My game does not respond for several seconds, if the game has been left on for quite some time
Hi,
This has plagued me for months.
If I start my game, go into the level (a sort of infinite runner), it all works great.
BUT, if I leave the game going for a long time, playing levels, turning the device off, turning it back on, resuming, going to menu, going back to a level...
Then when I play, the framerate is still fine, BUT, for the first few seconds the game runs smoothly, BUT I cannot do any input.
I press the JUMP button and nothing happens.
At first this last for a few seconds, then a bit longer, then a bit longer, and ultimately, the player is non-responsive for the full 5 or 6 seconds it takes to hit the first obstacles. He doesn't respond.
It's running smoothly, but he doesn't respond.
It's been happening for several revisions of Game Salad (since about January 2012, at the least, and I assume before that as well - that's just when I first noticed the problem).
Now, I've only actually played this Ad Hoc build a handful of times tonight, and it's got to the point where the character dies before I can get the player to jump. He moves along for a full 6 seconds, and dies, before the game takes any input.
Has anyone else had this problem? Found a fix? And suggestions?
If I quit the game, and start again, it's fine again...
It happens in Ad Hoc, but also just on the viewer, if I play it for quite a while.
It seems to be worsened by turning the device on and off, rather than just playing lots of levels in one session.
I've been working on this game for 6 months, and hoping to submit tonight. But this bug in Game Salad is likely to give me some nasty reviews.
Would really love any suggestions!
- Murray
This has plagued me for months.
If I start my game, go into the level (a sort of infinite runner), it all works great.
BUT, if I leave the game going for a long time, playing levels, turning the device off, turning it back on, resuming, going to menu, going back to a level...
Then when I play, the framerate is still fine, BUT, for the first few seconds the game runs smoothly, BUT I cannot do any input.
I press the JUMP button and nothing happens.
At first this last for a few seconds, then a bit longer, then a bit longer, and ultimately, the player is non-responsive for the full 5 or 6 seconds it takes to hit the first obstacles. He doesn't respond.
It's running smoothly, but he doesn't respond.
It's been happening for several revisions of Game Salad (since about January 2012, at the least, and I assume before that as well - that's just when I first noticed the problem).
Now, I've only actually played this Ad Hoc build a handful of times tonight, and it's got to the point where the character dies before I can get the player to jump. He moves along for a full 6 seconds, and dies, before the game takes any input.
Has anyone else had this problem? Found a fix? And suggestions?
If I quit the game, and start again, it's fine again...
It happens in Ad Hoc, but also just on the viewer, if I play it for quite a while.
It seems to be worsened by turning the device on and off, rather than just playing lots of levels in one session.
I've been working on this game for 6 months, and hoping to submit tonight. But this bug in Game Salad is likely to give me some nasty reviews.
Would really love any suggestions!
- Murray
Answers
Check the memory setting when testing with the viewer, maybe you are hitting a limit. Also check for possible loops in the code.
Also, did you optimize your code?
1. Don't have unnecessary movable actors
2. Limit use of constrains
3. No constrains in loops
4. Reduce the amount of parallel sounds with 'play to completion'
There are more optimization suggestions on the forum.
I've definitely optimised it a lot over the past month, making all the enemies recycled, instead of Spawning and Destroying, and minimising Timers and Constrains.
I'll try testing with the Memory Setting, although in the viewer, I can't test "closing and opening the game" or "powering off and on the device", but I'll see what I can find out.
What do you mean by "loops"? What would you define as a loop? Cheers!
- Murray
Would you be able to make anything of these figures? I'm not sure whether they indicate a specific threshhold or not. They seem like OK amounts to me. I'm submitting my game as ARM7 only.
The game is experiencing the "unresponsive start of the level" syndrome when the stats are reading...
Images: 22.9 mb
Sounds: 3.6 mb
Game Engine: 33.0 mb
Other: 44.9 mb
Total: 104.4 mb
Have I hit an evil number somewhere there?
When it becomes responsive again, it reads...
Images: 22.9 mb
Sounds: 3.6 mb
Game Engine: 33.9 mb
Other: 44.1 mb
Total: 104.5 mb
My games seems to peak at a total of about 114mb when I go into the Pause Menu, then poke around some other menus as well. I guess that's when the maximum amount of stuff is loaded, with the game still loaded in the background, too.
I have a looping skateboard rolling sound going whenever the player is on the ground.
And quite a few sound fx triggering off as you play, but no other looping ones. Just the music track, which is about 3.5 minutes long.
Do these numbers look safe overall? Or are there any obvious boundaries I'm smashing?
Any advice would be much appreciated.
- Murray
It seems to just sit on that the whole time?
Could this relate to the problem? I don't really see how it would, but...?
I haven't been able to solve this problem.
You asked, "Not sure why you assume it is a GS bug and not an issue in your code."
My reasoning behind it is that, I do a CHANGE SCENE, to reload my game level, and the game is unresponsive for a long time, if I keep reloading that scene.
But when I reload the scene, shouldn't Game Salad clean everything up, and reload the scene, as if it were being loaded for the first time?
Shouldn't it be just as responsive the 50th time, as it is the 1st time?
I don't have any further control over cleaning up and reloading the scene, do I? Or is there some way to ensure that when I call Change Scene, that it does so entirely neatly?
Thanks.
- Murray
As for the code, you need to look for things that change over time, maybe you have a value that triggers a loop once it goes to high or to low. The reason I'm saying that it is likely a code issue is because a problem of this scale should had been seen by now with other games. You might still be hitting a bug, but if that is the case, it shouldn't be just you.
Maybe post a video of the issue?
Opening a bug with GS is also an option.