• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows Win32 function failed 0x8007000e (CreateBuffer at line 282 in \VertexBuilderM.cpp

S

Simplekat

Guest
Good afternoon,

I'm new to GMS and have only been using it for a couple of days. I am suddenling running into a crash and I have no idea what's causing it as the error it is throwing seems unique to results on Google or this forum.

When running the project, it displays the map but I am unable to interact with it (I'm currently at the mapping stage of the tutorial).

error_gms.png

The tutorial I am following introduces two scripts; src_save_game_data and src_load_game_data. Without these scripts, my game does not crash. However when they are introduced I am unable to run the project and the error immediately causes the crash. I have tried;

- Ensuring my GPU is allocated to GMS as opposed to onboard.
- Updating all drives (including checking for Windows updates).
- Uninstalling and reinstalling.

Any help that you could give would be very appreciated. Thank you!
 
S

Simplekat

Guest
Show us what is in src_save_game_data and src_load_game_data, as the error is likely in that code.
Thank you for your reply. The code is as follows;

scr_save_game_data
GML:
//This script will save the strings that the map holds

ini_open("battle_map_strings.ini");

for (var i = 0; i < ds_list_size(battle_map_list); i ++){
    ini_write_string("Data String", string(i), battle_map_list[| i]);
    
}

ini_write_real("Total Maps", "Value", ds_list_size(battle_map_list));

ini_close();

show_debug_message("scr_save_game_data finished");
scr_load_game_data
GML:
//This script will load the strings into the battle map list

ini_open("battle_map_strings.ini");

//How many maps were saved
total_maps = ini_read_real("Total Maps", "Value", total_maps);

for (var i = 0; i < total_maps; i ++){
    var str = ini_read_string("Data String", string(i), "");
    battle_map_list[| i] = str;
    
    show_debug_message(str);
}

ini_close();

//If a map exists in the first slot, load it

if (ds_list_size(battle_map_list) > 0){
    scr_load_map(0, ds_terrain_data, battle_map_list);
}
 
S

Simplekat

Guest
What is in scr_load_map? lol.
The way the tutorial is set out is that there are other seperare scripts for saving, loading, deleting and creating new maps. It's entirely possible that the problem is in here but I've compared it so many times to the video today and I'm still lost haha.

scr_load_map
GML:
/// @function scr_load_map(map_number, grid_to_copy_to, list_of_battle_maps)
/// @description Lave the map!
/// @param {real} map_number - the number of the map we are saving (battle map list entry)
/// @param {real} grid_to_copy_to - what's the name of the list that holds the strings

var map_number = argument0;
var grid_to_copy_to = argument1;
var list_of_battle_maps = argument2;

var grid_to_copy_from = ds_grid_create(1, 1);

if (list_of_battle_maps[| map_number] != undefined) && (list_of_battle_maps[| map_number] !=""){
    ds_grid_read(grid_to_copy_from, list_of_battle_maps[| map_number]);
    
    //Destroy all the lists in ds_terrain and then resize it - different sized maps
    for (var yy = 0; yy < ds_grid_height(grid_to_copy_to); yy ++){
        for (var xx = 0; xx < ds_grid_width(grid_to_copy_to); xx ++){
            var list = grid_to_copy_to[# xx, yy];
            ds_list_destroy(list);
        }
    }
    
    //Grab the width/height of the temp. grid
    var grid_width = ds_grid_width(grid_to_copy_from);
    var grid_height = ds_grid_height(grid_to_copy_from);
    
    //Resize ds_terrain_data
    ds_grid_resize(grid_to_copy_to, grid_width, grid_height);

    //Convert the strings into lists holding data and store that list in the relevent cell of grid_to_copy_to
    for (var yy = 0; yy < grid_height; yy ++){
        for (var xx = 0; xx < grid_width; xx ++){
            var list = ds_list_create();
            var list_str = grid_to_copy_from[# xx, yy];
            ds_list_read(list, list_str);
            
            grid_to_copy_to[# xx, yy] = list;
            show_debug_message(list)
        }
    }
    
    show_debug_message("Map " + string(map_number) + " loaded");
    ds_grid_destroy(grid_to_copy_from);
    
    return grid_to_copy_to;
    
}else{
    show_debug_message("Map failed to load");
    return grid_to_copy_to;
}
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
I don't think the issue is actually directly related to these scripts... the message you get makes me think that you are creating a vertex buffer or using the built in primitives and that is where the issue is. Possibly they are being built wrong and exceeding the permitted number of vertices, or memory or something. So, do you have ANY code or scripts in the game for creating vertex buffers or drawing primitives?
 
Yeah, the problem is very probably going to be somewhere in the code rather than in GM itself. Sometimes it's something very innocuous, I was just curious as to what was in those scripts because if I'm recalling correctly, I've usually had the error when I'm doing stuff with surfaces and I forget to reset the target or something silly like that. I wanted to see if they contained any graphic management of some sort.
 

Rob

Member
The code/scripts is from one of my tutorials. We don't use vertex buffers/primitives/surfaces. At this stage, the tutorial is about making your own room creator to make creating isometric maps easier using a grid for each map/level. Each cell in the grid holds a list. I use a double for loop to draw the sprites, based on the data each list holds for each grid.
 
Last edited:
S

Simplekat

Guest
I don't think the issue is actually directly related to these scripts... the message you get makes me think that you are creating a vertex buffer or using the built in primitives and that is where the issue is. Possibly they are being built wrong and exceeding the permitted number of vertices, or memory or something. So, do you have ANY code or scripts in the game for creating vertex buffers or drawing primitives?
There's nothing at all in the tutorials regarding the buffers or primitives.

Yeah, the problem is very probably going to be somewhere in the code rather than in GM itself. Sometimes it's something very innocuous, I was just curious as to what was in those scripts because if I'm recalling correctly, I've usually had the error when I'm doing stuff with surfaces and I forget to reset the target or something silly like that. I wanted to see if they contained any graphic management of some sort.
Yeah, no problem. I appreciate you taking a look.

It's strange because I have seen no results on Google regarding the "CreateBuffer".
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Okay, so it could be something related to the internal workings of GameMaker while it's drawing stuff. So, what are you drawing? And does it relate in any way to that load/save code you posted earlier?


EDIT: Okay, so, quick update... after checking some stuff, I've found that this error can occur when a surface is being created with the size (0,0). So please check that. Also, this error can occur when there is insufficient texture memory, so also check that by changing the texture page size in the Game Options. If it is 8192 then drop it down to 4096, and if it is 4096 drop it down to 2048.

EDIT EDIT: Have you tried clearing the compiler cache? Using the "broom" icon at the top. Sometimes you can get the weirdest of errors due to a stale cache, so this could also be the issue...
 
Last edited:
S

Simplekat

Guest
Okay, so it could be something related to the internal workings of GameMaker while it's drawing stuff. So, what are you drawing? And does it relate in any way to that load/save code you posted earlier?


EDIT: Okay, so, quick update... after checking some stuff, I've found that this error can occur when a surface is being created with the size (0,0). So please check that. Also, this error can occur when there is insufficient texture memory, so also check that by changing the texture page size in the Game Options. If it is 8192 then drop it down to 4096, and if it is 4096 drop it down to 2048.

EDIT EDIT: Have you tried clearing the compiler cache? Using the "broom" icon at the top. Sometimes you can get the weirdest of errors due to a stale cache, so this could also be the issue...
I was generally just painting with the tile sprites while following the part of the tutorial for making sure maps are loaded and saving. So not much at all, just random patterns.

The texture memory was set at 2048 when I went in to it. I lowered it down to 1024 and it's still crashing.

I've cleared the compiler cache a couple of times since it was recommended on a forum post but still no difference.

I've been speaking to Rob who has noticed that there is a huge memory spike in my project when hitting f5 (to save).
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Well, the code seems okay, so I'm really not sure what the issue could be.... A memory spike is to be expected, especially if the INI is large... although, that said, I really wouldn't use an INI file for this kind of thing, as the larger they are the more screwy they become. There used to be a memory limit on INI files (64kb, iirc) and some platforms still have odd behaviours when the INI file is over that size. Maybe try changing the code to use the file or JSON functions instead? Saying that, it's worth filing a bug with YYG about it and supplying them a link to the project so they can look at it. They'll be able to tell you with more clarity what the issue is/could be.
 
  • Like
Reactions: Rob
S

Sybok

Guest
Hey there,

That error code is a DirectX 11 return code for out of memory.

E_OUTOFMEMORY (0x8007000E)
It appears that your code is creating a vertex buffer somewhere and is larger than the size of what the GM internals (or graphics card capabilities) has allowed.
 
P

ph101

Guest
What graphics card do you have?

edit. removed my additional suggestion to google the error and search the forum as it was due to hardware, as it made Sybok think his post wasn't read/appreciated, but it certainly was.
 
Last edited by a moderator:
S

Sybok

Guest
Not sure if my posts have been marked invisible or something. LOL šŸ¤£





Key words being -
  • GR_D3D_Device - The DirectX 11 renderer
  • CreateBuffer - Buffer of some sort
  • VertexBuilderM.cpp - Buffer now identified as a vertex buffer
  • Error 0x8007000e - Return code for DirectX11 > Create Vertex Buffer
  • E_OUTOMEMORY - Microsoft's DirectX 11 API error code
  • Conclusion - Error creating a vertex buffer that is exceeding the allocated memory of what has been set aside in the GMS2 internals (or the capability of the GPU).
 
Last edited by a moderator:

REVOLTRE

Member
Hey not sure if you've fixed it but I had the EXACT same problem as you have. The whole game crashed due to memory spikes and that exact error message popped up on the screen. The error was fixed when I realised that I had a nested loop with the same 'i' variable with each iteration.

GML:
for (var i = 0; i < size; i++) {
    for (var i = 0; i < size; i++) {
        //PERFORM CODE
    }
}
Changing the initial condition to "j" in the inner loop fixed it for me.
GML:
for (var i = 0; i < size; i++) {
    for (var j = 0; j < size; j++) {
        //PERFORM CODE
    }
}
 
Top