Game freezing & crashing (iPhone)

notionrnotionr Member, PRO Posts: 4
edited November -1 in Tech Support
The AdHoc build will work fine for some period and then freeze or crash. It can be after 5 minutes of playing or after 60 minutes, and it has happened on various iPhones and iPads. I have been able to cause a crash in the viewer by pushing the buttons very fast for several minutes, but the crash occurs when users are not necessarily pushing buttons fast. In the game, buttons cause roughly 30 small images to change position and size on the screen.

Details:

- one-scene like Darren's templates with camera origin changes
- no spawning
- no physics (no movable)
- 85 actors
- 137 attributes
- <2mb total of images and sounds (113 images mostly at 4k each, 5 sounds)
- fair number of calculations
- not many timers ("after 0.1" on the buttons, one overall session timer)

Viewer Performance Stats at start:
FPS: 60.7
Images: 10.4MB
Sounds: 187KB
Engine: 26.2MB
Other: 13.4MB
Total: 50.1MB

Viewer Performance at time of crash:
FPS: 34.73
Images: 10.4MB
Sounds: 187KB
Engine: 32.5MB
Other: 13.6MB
Total: 56.7MB

Any ideas?

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Are you on a 3g? 50 MB is really to much for a second gen device so pushing over 50 is almost certainly gonna crash it. 3Gs doesn't do much better but it should at least handle 50 Also your image dimensions are what determines the memory usage for your images not the file size. a 4k 512x512 image will use the same memory as a 2 Mb 512x512 image

    Edit: also 85 actors in a scene will be hard on performance.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    In my experience, older devices will start crashing (they run out of RAM) at about ~40MB

    The older devices have pitiful amounts of RAM.

    It is not an exact number, and Apple will not disclose the number, of when the device will crash. It seems to be based on a percentage, and varies per device.

    If you want your game to work on old devices (ones older than an iPhone4 or a Touch 4th gen) then I would make sure the RAM usage never gets above 40MB.

    The biggest culprit in your stats above seems to be the Engine usage, which I believe is tied to the number of Actors you have in the Scene. To be honest, 85 is pushing it.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    you should be fine iphone 4, but anything olders gonna crash. THe 85 actors is probably doing it. Once the memorys hits around 45 on the older devices its crashing

    edit: too slow joe beat me hehe
  • notionrnotionr Member, PRO Posts: 4
    Thanks tenrdrmer. I didn't know that about the images, or about the overall memory usage.

    Is there something that describes what impacts "Engine" and "Other" memory usage? How do I get those down?
  • notionrnotionr Member, PRO Posts: 4
    notionr said:
    Thanks tenrdrmer. I didn't know that about the images, or about the overall memory usage.

    Is there something that describes what impacts "Engine" and "Other" memory usage? How do I get those down?

    Edit: Ah, just saw firemaplegames reply on actors - thanks! I'll look into that. Is there anything else that impacts "Engine" usage? What about "Other"?
  • notionrnotionr Member, PRO Posts: 4
    On the actors, let's say you have 5 buttons. Is it the same memory usage whether you have 1 actor and 5 instances with different logic on each or 5 actors with 1 instance each? Is one approach preferable?
Sign In or Register to comment.