Xcode GS Game memory/CPU crash issues

jhaasjhaas Member Posts: 233
edited November -1 in Tech Support
I assume this is something the Chefs are aware of(at least I hope it is). But now that I can monitor the performance of the final game as it plays on my device through the Apple SDK instruments software, I've noticed a couple areas of concern.

First - whenever I play either my simple, singe scene puzzle game or my larger 21 scene game - the average CPU usage grows over time. What starts out as decent performance begins to take noticeable hits after about 10 minutes of play. Even when the game is simply re-running the same code. The longer you play the more CPU it seems to take to keep it running. This may explain some of the slow downs, stutters and performance issues some of us have reported.

Next - the memory usage on multi scene games seems to increase with each new scene. This indicates that old scenes and their resources are not being cleaned up. I tried using the restart game option to see if that would help. It does not. I can play through my multi scene game about 1 and a half times before the memory grows from 12 meg to around 38 meg and then crashes. (It takes about a half hour to play through the game.)

I've repeated this twice to confirm. Even when the game starts over you would think re-running the same scenes would at least re use the objects already loaded. But memory usage creeps up with each new scene.

Again this is not a complaint - we are in beta after all.

I think for now I'll focus on simpler single scene games until some of this is ironed out. :)

Comments

  • jhaasjhaas Member Posts: 233
    Follow up - I've tried to add a destroy actor behavior to the main scene actor as the game goes from scene to scene to see if that would recapture any memory. Destroy actor had no effect on the situation. The game still crashes after one and a half plays.

    The only way I can see to work around this is not to have a reply option at all, and force people to restart the app completely.

    Ideas?

    :)
  • SDMGSDMG Member Posts: 280
    Hi jhaas ,

    unfortunatly my games takes 17-20+ secs to start on my ipod... this alone is reason enough for me to release my games with a later faster version of gamesalad... so to force people to restart the app completly with this slow starting times is a no go for me....

    i have had a look at all the apps i have bought so far and their startingtimes ranges from instant to 3-9 secs... the average was about 5 sec i think ... hmm its not fun to wait 17sec.... so when my gs-games would start this slow, i think the people could get a little impatient ... touching the screen etc... it looks like the ipod is hanging and not working anymore...

    the next problem in my games is that you see only a starting screen after 17sec at the beginning with a menue... pressing start lets you wait another 5-10 sec. where other games are starting instantly...

    So while the last problem maybee can be solved by putting all stuff in one scene ... (and hoping your fps are not crawling with all these actors ;) ... the slow starting times, the crashes, stutter... etc ... lets me wait for the next gs-version.

    ...oh and i have a lot to do with optimizing all games the games i have made;)

    and let me quote you here :

    this is not a complain - we are in beta !! ...and GS is still fun ;)

    so i think it will take a little time but our games can only get better ;))

    Cheers

    SDMG
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Hi SDMG,
    Throwing everything in the first scene actually slows down the loading of the game.

    Changing the Scene without Preserving it, should free up some memory, then use some for loading the new scene.

    Spawning actors uses up memory, increasing the amount dedicated for that scene depending on the number of spawned actors on the scene. Analogy: if you were getting orange juice for guests, you add more cups as you finish filling each cup. When they finish drinking the juice, they have empty cups which are not thrown out until the party is over.
  • SDMGSDMG Member Posts: 280
    Hey Codemonkey,

    strange party you have there ... where everybody is drinking orange juice ;))

    but thank you for your tips !!

    ;)
  • jhaasjhaas Member Posts: 233
    "Changing the Scene without Preserving it, should free up some memory, then use some for loading the new scene."

    Based on my above referenced tests - this doesn't seem to be the case. I do not have preserve scene set on any of my scenes - and the memory goes up - even if you destroy actors.

    We need GS to throw away those empty OJ cups :)
  • quantumsheepquantumsheep Member Posts: 8,188
    SDMG - I've found that once a level/scene has been loaded, it takes no time at all to load when you visit that scene again.

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Sign In or Register to comment.