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

GML [SOLVED] Can Path_Add cause slowdown?

Dr_Nomz

Member
I asked earlier about mp_grid slowdown, but now I'm wondering if this could cause slowdown if the path is "added", and then never deleted. (Or does it delete itself upon the instances destruction?)
 

FrostyCat

Redemption Seeker
Do you think they added this line to the Manual entry for path_add() just for fun, or is there a serious point to be made here?
The Manual entry for path_add() said:
Once you have finished using the path, or wish to create a new one and store its index in the same variable you should first delete the old path with path_delete to prevent memory leaks which can eventually crash your game.
 

Dr_Nomz

Member
Okay in that case, how about this?
Code:
if HP <= 0{
  with(planner){
  path_delete(path);
  instance_destroy();
  }
  instance_destroy()
}
The Planner being the object that the zombie follows, which creates the path in the first place.
 
Top