Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hello I downloaded the source game file but whenever I boot up the game by running it in Game Maker Studio Pro. I receive this error when I press start on the main menu.

___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_wall_sandstone_block64:

Fatal Error: Can not create vertex buffer of size 147456 bytes
6386 vertex buffers allocated with total size of 919104 KB
 at gml_Object_obj_wall_sandstone_block64_DrawEvent_1 (line 5) - d3d_draw_wall(x  ,y  ,zbottom+0.01,x + sprite_width,y     ,ztop-0.01,my_wex,image_xscale,1)
############################################################################################

Any solutions? I would really like to play around with the engine after paying for it.

This is the second time I've seen this thing appear, so I did a bit of research. Found this GMC topic that suggests that you should call d3d_set_identity() every 10,000 draws, when you're using an integrated graphics card you have less VRAM and that puts a hard-cap on how much 3D drawing you can do. (And I use a dedicated graphics card, so I never ran into this issue myself while developing the engine)

One way to see if it works is to just add a d3d_transform_set_identity() to the first line of the drawing code of the terrain blocks (e.g. the obj_wall_sandstone_block64 and perhaps a couple of its relatives) so that it flushes the vertex buffers occasionally... it's going to be overkill to do it before you draw EVERY piece of terrain, and it could have a performance impact, but it should solve the problem. If it solves the problem, you're pretty much good to go, and what you'd do is something like this (to reduce the performance impact):

  • Add a script called "flush_the_vertex_buffer" and set up a global counter variable
  • Reset it to 0 every step in the controller object
  • add the flush_the_vertex_buffer script to every terrain block's draw event
  • The script should increment the global counter, and if it's above a certain value (e.g. 10,000), set it to 0 and call d3d_transform_set_identity().

If you can confirm adding in some d3d_transform_set_identity() calls solves the problem for you, I'll get a fix for this into the source file ASAP.