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

RAM usage while using DRAW sprites QUESTION

S

SeMike

Guest
Hello I wanted to ask just one (for some maybe) simple question.
Is RAM usage higher if I am using DRAW cycles on drawing sprites like
Code:
for (j=0; j<=x_grid_size; j+=1)
{
for (k=0; k<=y_grid_size; k+=1)
{
doc = ds_grid_get(room_grid,j,k)
draw_sprite(string(doc),0,j*cell_size,k*cell_size);
}
}
(lets say grid size is 32 so its a 32x32 grid) than if I would use normal room and objects with sprites?
Thank you^^
 

FrostyCat

Redemption Seeker
You can easily see why the answer to your question is "no" once you consider the added baggage that comes with object instances.

Also, instead of obsessing over trivial reductions in RAM usage, pay better attention to correctness. In your code I can easily see an off-by-one error, improperly scoped iteration variables and an invalid sprite argument to draw_sprite(). Don't micro-optimize at the cost of being correct.
 
S

SeMike

Guest
I noticed that in GMS, you are talking about the
k<=y_grid_size which is supposted to be
k<y_grid_size right? already fixed that^^ but thank you very much for your fast and informative answer! :)
 
Top