• 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!

Mp_grid_draw vertex buffer crash

M

Monster25

Guest
Hey! Trying to draw my grid using mp_grid_draw, but I keep getting the vertex buffer crash as if I try and draw something that exceeds the room. Would anyone know why that is?
 
M

Monster25

Guest
Heres the Grid object:

Room Size: 3456x3456

NEW ROOM EVENT
///New Grid when any room starts
cell_width = 64; //Cell Width of grid
cell_height = 64; //Cell Height of grid

hcells = room_width/cell_width; //Number of horizontalcells
vcells = room_height/cell_height; //Number of verticalcells

global.grid = mp_grid_create(0,0,hcells,vcells,cell_width,cell_height); //Create the Grid

mp_grid_add_instances(global.grid, obj_solid, false) //Add instances to grid

DRAW EVENT:
draw_set_alpha(0.1);

mp_grid_draw(global.grid)

for (var i=0; i< room_width ; i+=64)
{
draw_line(i,0,i,room_height);
}
for (i = 0; i< room_height;i+=64)
draw_line(0,i,room_width,i);

draw_set_alpha(1);
 
M

Monster25

Guest
Is the room too big for the draw event to cover all of it or am I doing something wrong?
 
M

Monster25

Guest
Still, the same problem, even with drawing it onto a surface

Fatal Error: Can not create vertex buffer of size 98304 bytes
11551 vertex buffers allocated with total size of 1950176 KB
at gml_Object_obj_grid_DrawEvent_1 (line 4) - mp_grid_draw(global.grid)
 

Bingdom

Googledom
If you're only drawing the mp_grid once to a surface, then drawing the surface to see the debug info, and that problem is still occurring, reduce your room size. There's not much you can do.
 
Top