• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

grid

  1. P

    GML Path not stopping- and i have no clue why

    Hey, so im changing my movement system from buttons to click to move and ive run into an issue. Im using a 32x32 mp_grid system. Right now, from idle state clicking an enemy changes my state to movement, and movement state creates a path to targetId coords and starts the path. Clicking an empty...
  2. D

    GameMaker QTable update dosen't work

    Im trying to make a simple Q-learning AI, but im horrible messing with grinds and aways get the same problem when i try to update the qTable. project is simple, the AI can go to all directions and need to touch the "obj_goal" while avoid the "obj_obstacles" Create event: QTableWidth = 100...
  3. Jason Coggins

    SOLVED Issues with a black grid showing up on a sprite that has no grid

    I am using an image for the background instead of a solid color and I have the room grid turned off and the Interpolate Colours Between Pixels unchecked (turned off) but for some reason the background is drawn with a black grid on it. The original image imported into GMS does not have a grid on...
  4. M

    Smoother Pathfinding?

    I have this code for pathfinding: enemy: path_delete(path) path = path_add(); targetx = obj_jugador.x; targety = obj_jugador.y; mp_grid_path(obj_pathfinding.grid, path, x, y, targetx, targety, true); path_start(path, spd, path_action_stop, true); alarm_set(0, random_range(30, 120))...
  5. M

    SOLVED How to make auto movement, but strictly by cells

    Greetings! May someone please help/guide me? I want to make a movement like in a snake, when the character moves in the direction given by the key, but strictly along the grid My idea, so far, was to make it continue to move to the middle of the next cell after calling a perpendicular direction...
  6. dmx0987654321

    SOLVED Can't use player.x = newX to set location of player (this sounds like an incredibly basic problem but I've tried everything)

    Hi, I just want to preface this by saying this is my first time using GMS2 (latest release), and my code is probably a clusterf**k of stitched-together tutorial code and my own inefficient creations, but it works (or at least it did until now). That said, I have consulted the manual and this...
  7. M

    SOLVED Datastructure problem

    So I was making a farming rpg where you needed to plant plants(duh). I made a data structure where the height is the room height div by cellsize (32) and same for the width (width div cellsize) and the coordinates of the mouse div by the cellsize is in which cell you are. I also made it so that...
  8. W

    GML What is the best way to perform binary math operations between 2 grids?

    I have two 14x14 ds_grids that I'm trying to use as a bitboard. How can I perform a logical_or operation between the two grids to produce a new grid of values like I can with matrices in NumPy? For example if I had two 3x3 grids like the following... [ [0,0,1], [0,0,1], [0,1,0], ]...
  9. JeanSwamp

    Instance count based on room size/available space

    Hello, I am trying to come up with a way to dynamically modify the amount of enemies, objects, and other instances I create in procgen rooms, which are grid based. Ideally I'd want to have a minimum amount of those objects to be spawned, and be increased if there's more available space. Here's...
  10. 1Howl_Red

    SOLVED Grids not working properly past a certain size of a room.

    So I've ran into a peculiar problem easy to recreate. Here I've made a test project with nothing but a wall object and a simple mp_grid code made so that the path created will avoid the walls. These walls are the 150x150 as I'm in a project using tiles that large (sprites are fairly large as...
  11. flyinian

    GameMaker Help with path finding/sprite alignments on grid

    What can I do to prevent the npc from clipping through the walls? The 32 * 32 grid was originally done so that the npcs can have enough space to traverse without clipping into walls but, I'd like to downsize the grid to a 8 * 8 grid so the walls are thinner without having to downsize the...
  12. D

    SOLVED Translate position in room to position on gui?

    I have a room that is pretty big in size. So naturally I'm using a camera and view. I can pan around, zoom in, zoom out, and resize the window. I've got all that working pretty good. I'm only using view[0] and its default camera. What I'm trying to achieve: This game is grid based and it is...
  13. R

    SOLVED controlling a grid

    hello guys, I'm coming here to ask for another help. I recently started to get into a new project, and in it I want to practice GML programming. A mechanism that I want to implement in my project is a grid system, where I can manipulate each cell to make checks or even make an automatic...
  14. L

    (HELP) Grid Based Enemy Movement

    Looking for some help here. I have an object called ObjEnemy and I'm trying to figure out how to make it so that it moves randomly on it's own and when it gets to a certain distance of the player, it will move to said player. But I want the enemy to move in between these grid spaces and be in...
  15. D

    SOLVED Saving files (i need to save a grid)

    hey so i have leaderboards in my game and i surly sucks if you get a good time close the game and then you open it again the leaderboards are blank. so i wanted to save the grid i store everything in i watched a bit around and so but i dont think i understand it. i found this saveStruct = {...
  16. D

    How do i address a grid inside a grid ?

    i want to make a leaderboard for each of my levels so i made a grid stat stores leader boards ``` global.grid_levels = ds_grid_create(100,2); for(i=0;i<ds_grid_width(global.grid_levels);i++;) { ds_grid_set(global.grid_levels,i,0,ds_grid_create(4,11)); //how to address 2nd...
  17. A

    Windows/Android grid creation problem

    Hi I am gonna trying making a simple grid on my 2560 x 1600 screen using this draw_gui command var w = 1; draw_set_color(c_orange) for (var i = 0; i < room_height; i += 64) { draw_line_width(0,i,room_width,i,w); } for (var i = 100; i < room_width; i += 64) {...
  18. bodilliam

    GML Grid Code

    Hi guys I am somewhat new to GM, and was wondering if there was a easy way to make a snap to grid. There is on Construct 3 and I was just interested in knowing. Thanks!
  19. A

    ds_grid_read() seems to always consume memory

    My game currently has a memory leak and will slowly crash. The following code is causing the leak, I've stiped down the code as much as possible to simplify the problem. I realize the code block below serves no functional purpose. I just want to understand it and why its consuming so much...
  20. Storm1208

    [Solved] Grid Generation Code Not Printing All Lines

    Hey all! I've been working on some grid creation code and I ran into an issue with it last night. I've been trying to fix it for the past day but I haven't had any luck. The code is supposed to generate a 5x8 size grid within the screen (not based on the room's height and width, but within a...
Top