grid

  1. Jenthura

    GML Having issues drawing a grid with arrays that start at 0

    Here's the code in my Draw event: var i_x=0; var i_y=0; grid_spacing=32; repeat(grid_width) { repeat (grid_height) { if i_x>=grid_width { i_x=0; } else {...
  2. Simon Gust

    Legacy GM Collision on a grid ((sub-pixel perfect), no overshooting)

    I’ve been wanting to create a collision system for objects moving on a grid that works the same like CardinalCoder’s object based collision. Turns out to be extremely complicated to get this to work. The reason is probably the addition of several quality-of-life aspects. - sub-pixel perfection...
  3. T

    Adding Versatility to Tilesets in GMS 2

    Hello, I'm one of the many people who switched over from GameMaker Studio (GMS) 1.4 to GMS 2. I've been slowly getting used to the changes and have come to enjoy the newest version. However, like many others, I miss some of the features from GMS 1.4. In particular, I want to start a...
  4. S

    GML ds_grid_resize did... nothing?

    Heya guys & gals, another thing I am struggling with today (yay), this time it's all about the resizing of grids. I am using a grid (called 'open') for saving some data. So far, it's only of size [ 2 x n ] . (To be exact, coordinates.) It is used as a "to do list" of points in another...
  5. D

    Invalid structure- Temporary solution

    Hey guys, the new required release have a bug where the ds grid always shows "invalid structure" in debug mode. The site shows the bug as fixed but even downloading again it continues, so maybe it will be fixed in the next release. For now I'm using this simple script I created grid=argument0...
  6. H

    GML Grid based movement

    I am creating a game that allows the player to move one grid space (32x32) and then the enemies each get a turn to move one grid space. I want the enemies to move one space towards the hero avoiding obstacles on the map. First Attempt: I created my own recursive functions to 'walk' around an...
  7. S

    Windows Auto-tiling problem

    Hi. I've been struggling with the auto-tile system. My game is based on a 16x16 pixel grid. As such, I want my tileset to be that as well. I've made this tileset, it is 4x5 of 16 tile pieces. I want to be able to place tiles that are that small with the autotile system. I've placed the...
  8. C

    Android Heyzap extension interfering with object trail effect

    Hey guys... I have the following problem: (for android) Heyzap extension(ad mediation) is interfering with the effect of some of my objects. Apparently when I include the heyzap extension, the trail effect of my enemy disappears. Funny enough, the player has the same animation effect, but is...
  9. T

    GMS 2 Grid-based pathfinding with tileset

    Good morning. The title already states it.. Is it possible to have grid-based pathfinding work with enemies collide with tiles? I got a tile layer where i set all my collision tiles. This works fine with my player though. But for my NPCs the function mp_grid_add_instances() needs to have an...
  10. H

    GML [SOLVED] Jumping animation from grid field to grid field

    Hi, I have a player moving from grid to grid by pressing the cursor keys. The player sprite is drawn using draw_sprite_ext in a draw event. Currently my player slides from grid to grid, but I would like to have him jump to simulate walking. I could do this with walking animations, but then I...
  11. U

    Perspective Hexagon Grid

    Hello all. I want to build a hexagon grid system that appears in perspective, like this: Every hexagon can be clicked and mouse-hovered (with highlight) and all those regular actions. I don't want to use real 3D perspective functions, because all the game will be in 2D. 2D-3D (and...
  12. S

    Spatial(?) Collision Grid

    I'd like to drastically cut down on collision checks by using what I believe is a spatial grid (I think?) Basically you'd split your room into different, equal sized cells, and every object is stored into one or more of these cells if they overlap them. Objects would only need to check for...
  13. H

    Legacy GM How to code a grid system in 3D

    Hello! I am trying to make a grid system in GM 3D (similar to Minecraft), but to no success. How would I go about making this? Do the ds_grid functions even work in a three-dimensional space? Any help would be much appreciated!
  14. Dreadusa

    Tips for smoother AI pathing?

    Currently I'm using a basic grid system to create a path for all of my enemies, they all use the same grid but it's a bit jittery. The path updates every frame to follow the player's X and Y coordinates, and the enemies move relatively fast to the player at a speed of 4 pixels per second while...
  15. Shadowblitz16

    GMS 2 grid collisions seem to vibrate a little bit on left and top sides

    can someone explain why this code.. /// @description entity_perform_solid_collision /// @param {Object} map /// @param {Vec3} velocity var _map = argument[0]; var _vel = argument[1]; if (_vel.y > 0) { var _break = true; } //Vertical Collisions y += _vel.y; if (_vel.y < 0) { var...
  16. M

    Legacy GM record x,y positions in grid?

    I've read up on the grids in the game maker manual but I'm only vaguely grasping it. How would I go about adding an objects position in a grid then removing it when that position in the room changes?
  17. B

    How to: Grid-Based Enemy-on-Enemy Collision?

    Hello, I've been following along with HeartBeast's random level generation tutorials, and completed all 7 of them. Afterwards, I adjusted the code to have grid-based movement, so my character moves in a 32 x 32 grid. I want to make a roguelike. The issue I'm running into is how enemies should...
  18. E

    Legacy GM RPG-Style Grid-Based Following?

    (Version 1.4.1772) I'm making an RPG game with the standard 4-person-party setup that uses the mp_grid. I want the party members to follow each other in a line, kinda like what you see in some parts of Pokemon games. However, I have no clue how to get this working in a way that the followers...
  19. D

    GML Drawing a grid with for loops

    Hi there, I'm drawing a grid in a room with size 1000x768, with every "tile" being 128x128. It draws alright but at some point the for loop seem to stop working, or something else that I couldn't pinpoint. I used show_debug_message to print the iterators from the loops, but I couldn't really...
  20. Didjynn

    [solved] Midpoint circle algorithm

    Hello, I'm trying to create an area around my player in circle that would grow with his levels. The thing is : I suck at mathematics. I made some research but I'm not able to understand what I read I tried on my side but it's too big for me. I don't even understand this wikipedia, I tried to...
Top