Game Engine RAM !!
keekee312
Member Posts: 91
Hi, I just created the beggining of my game a few hours ago, the project size is 1mb and the game engine already reaches 78mb in the GS viewer
I have ONE actor copied 100 times on my screen with random values from 1 to 9, set to unmovable and have many rules in it (lots of self.**** rules because each actor is "unique" and have a specified color)
Do you know how to decrease the game engine RAM usage because it's just the beginning of my game (the gameplay is done but I'll need more features in this actor so I guess it will increase again and again)
Thank you very much
PS : will it be solved in the next release ?
I have ONE actor copied 100 times on my screen with random values from 1 to 9, set to unmovable and have many rules in it (lots of self.**** rules because each actor is "unique" and have a specified color)
Do you know how to decrease the game engine RAM usage because it's just the beginning of my game (the gameplay is done but I'll need more features in this actor so I guess it will increase again and again)
Thank you very much
PS : will it be solved in the next release ?
Comments
Alternatively, wait for the update with memory and performance increase promised and wait and see how it works on that.
But 100 actors with lots of rules is asking for trouble!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
2) Or If I change color images instead of generating a random RGB color ?
3) If I set rules into an other actor instead of the main one, will it change something ?
Thanks I really need this game, i'll make a few test this evening and If nothing changes, I'll delete 2 dozens of my 100 actors
You are able to have that many actors, I have that many in some of my Scenes.
But you just generally can't have that many Rules.
Instead of having one Prototype, and all of the code in it to handle all of the different instances, perhaps you need to have all of the code in the instances themselves.
That way you don't have useless code in each Actor.
In a ideal world, you would have a nice, object-oriented system going. With all the code in the Prototypes, and all the Instances would derive from them.
But on these mobile devices, RAM is very limited.
You will usually have to sacrifice some ease of use to get things working.
So if your Instances are carrying any extra "weight" by accounting for other Instances, if they have code in them that will never get called, I suggest you strip it out and put the code in the Instances instead of the Prototypes.
My Game have up to 52 bubble, is run ok in iphone 2G.
If your game has actors with lots of rules then I'm afraid GS won't let you have lots on screen at once.
I'm not sure about how to deal with instances. I have to click on one of my actor on the screen, right ? But that means I have to manually choose their value anf it will always be the same no ? Because if I put the "value generator" in each actor instance, it will change nothing from my original try... I don't understand everything
Thanks, I really need this game
When touch pressed
+ value =1
Change self.color to grey (selected)
Change self.touched to 1 (means selected)
Change valueselected to ...+1
That's the idea. I have also a rule when it's selected and you retouch it to deselect it. You also have a rule which checks if the valueselected number is equal to game.result or not. Then when game result = valueselected then change result, destroy actor selected
Instead of destroying current actor and spawning new actor, I just change (using a rule) current actor's image and rules.
There is less actors, so game engine memory usage is lower.