So I’m still pretty new, only two days into Unity, following tutorials and reading the manual.
I wrote this from scratch, just to test myself (not because I want to get sued by the makers of Pacman); when I run it in Unity, its fine, but when running on my iPhone 3G, it stutters a lot and is generally slow. At first I worried that it was just the limitations of the iPhone, but as I look at sample Unity games that I’ve downloaded, which seem much more complex than mine, they run smoothly, so I figure there must be something I’m missing out on, something I’m doing wrong.
Anyone willing to take a look and help me out?
Thanks,
Brian
I’ve not downloaded it, but I assume you have not checked the threads on general optimization on the iphone:
Drawcalls: you better have 30 or less drawcalls if you want a good performance. Use Combine Children + an empty game object to group same material objects into single objects
Animated objects should be 200-500 polygons
Use PVRTC textures where possible
Avoid GUI.xxx for ingame GUIs and if you use it, disable the layouting capabilities
You have way too many draw calls…combine the maze into one object, and combine the pills into one object. The pills would be trickier since they need to be removed dynamically, but that can be done with the mesh scripting interface. In particular you might want to look at the sprite manager posted here and use sprites for the pills instead of the capsule mesh, since right now you also have way too many polygons. I’d also recommend getting rid of all the box colliders for the maze and the capsule colliders for the pills and do the collisions through code using an array, since there’s no real reason to use physics for this sort of game, and that just slows it down even more. Using an array would also make it far easier to set up different playing boards instead of building the scene by hand. Also, don’t use dynamic lighting unless absolutely necessary.
In short, your scene may be conceptually simple, but it’s actually much more complex than the examples and you are in fact far exceeding the iPhone’s capabilities.
Thanks guys, I very much appreciate the help.
I’ll look into combine the objects.
I will also look into how to do collision through arrays. But just out of curiousity,
one thing I do notice immediately (and its why I left the maze as separate objects) is that as soon as I combine the maze into one object (in C4D), its collider no longer works. Is this maybe a modeling issue rather than a scripting issue? I’m still using a mesh collider on it.
Not really answer to your question, but if you want to improve performance it is better to use number of box colliders instead of mesh collider in your case.