Spawn actor or change image
IsabelleK
Member, Sous Chef Posts: 2,807
Hello,
In my game I had many actors with rules:
When touch is pressed, destroy this actor and spawn actor XXX.
To decrease game engine RAM usage I changed these actors to one actor with rules:
When touch is pressed, change attribute game.NextFrame to (game.NextFrame+1)%10
When game.NextFrame=1, change image to X.
When game.NextFrame=2, change image to X2.
etc.
Game engine RAM usage was lower, but I noticed that images RAM usage increased. Is that normal?
Changing image takes more RAM than spawning other actor with that image?
Thank you.
In my game I had many actors with rules:
When touch is pressed, destroy this actor and spawn actor XXX.
To decrease game engine RAM usage I changed these actors to one actor with rules:
When touch is pressed, change attribute game.NextFrame to (game.NextFrame+1)%10
When game.NextFrame=1, change image to X.
When game.NextFrame=2, change image to X2.
etc.
Game engine RAM usage was lower, but I noticed that images RAM usage increased. Is that normal?
Changing image takes more RAM than spawning other actor with that image?
Thank you.
Comments
If you destroy an actor, it will be deleted from the memory too.
I think, I don't have to explain further :-)