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

Legacy GM Out of Memory Error

G

Girelle44

Guest
Hello, Game Developers!
After new update I faced pretty tricky problem. Out of Memory Errors are common for new developers, as I've found out. But mine is special. I'm a beginner developer, most of my skills are from Shaun's Spadling videos.
So my problem is here:
1) Game works perfectly in all cases, but when player dies (global.lifes < 0) The out of memory error occures
Global.lifes is a variable, stated in control object to the maximum of three.

[/IMG]
2) I use Save ini files in this project. If player restarts game with r-button command or fall out of screed loadgame script works normally. If player dies because of enemy bullets due to following script:
Code:
if global.lifes < 0
{
    scr_continue();
}
Game crashes. This script is a part of obj_player script tree.
3) I used lighting surface system in my game
Code:
surface_set_target(surf);

draw_clear(c_black);

with(obj_light)
{
    draw_set_blend_mode(bm_src_color);
    draw_sprite_ext(spr_light,0,x*other.surfscale,y*other.surfscale,lightsize*other.surfscale,lightsize*other.surfscale,0,c_white,lightstrength);
    draw_set_blend_mode(bm_normal);
}

with(obj_light_man)
{
    draw_set_blend_mode(bm_src_color);
    draw_sprite_ext(spr_light,0,x*other.surfscale,y*other.surfscale,lightsize*other.surfscale,lightsize*other.surfscale,0,c_white,lightstrength);
    draw_set_blend_mode(bm_normal);
}

surface_reset_target();
draw_surface_ext(surf,0,0,1/surfscale,1/surfscale,0,c_white,0.77);
4) Only one big sprite is used (1024*768)
5) Lotta step events are taking place
[/IMG]. For each object that mooves. (More than 30).
6) Compiling information:
Code:
Run_Start
StartGame()
StartGame() - DONE
Total memory used = 116636006(0x00499649) bytes
**********************************.
Entering main loop.
**********************************.
Out of Memory allocating 28382711564247072 bytes
7) I've already fully uninstalled Gamemaker and downloaded new version in Steam. It didn't work out.

So, to sum up, game crushes only if room restarts due to players death (global.lifes < 0)
Looking forward for your help, ready to answer all your addition questions. Thank you in advance.
 
Last edited by a moderator:
Top