This is my problem: My brother and I have developed the following game: http://www.hobbygames.co (it is still in an early stage), we want to make this game available for all the possible platforms, pc, mac, linux, iphone, android, etc, and even when we are not close to that we are trying to export this game for mobile devices, however, our game wont run properly on any of them. I have already read a lot of tutorials, tips, blogs, etc, about performance tips and stuff, however I cant get to any solid conclusion of what could be wrong. I managed to read something about "too many events", and "too many sprites", however, I have seen a couple of games that seem to me they use lots of sprites (I know a little bit about composition so I know that even when they look like they use lots of sprites they are actually been smartly composed and build and not using as many sprites as one could think).
To resume a little bit, I will make a summary of possible things that could be critical for my performance problem:
Number of events: 163
Approx download: 11.7
Memory use: 69.5
Max number of objects on screen: 658
Number of for each loops: 2 (this one could be a mayor issue since it iterates over all the zombies on screen)
Number of sprites: I have not counted them but they go far beyond 20 sprites
Number of particles used: there is only one particle being used when gandma makes a shotgun shot.
This is all the information I have for all of you, I am desparate and I need all the help I can get from you guys, please help me understand my problem, any advice would be greatly appreciated.
For starters, get rid of the big music loop. Mobiles don't have a lot of memory, and you're already stuffing it full of graphics.
Second lay off the graphics... You probably have to many frames x number of different objects animations for each angle.
Third, check the collision polygons, I couldn't hit those sheep if I had a shot gun.
The big music loop will be erased. lay off?, any suggestion?, as you have seen, to give the impression of semi-cenital perspective I have no choice but to create multiple frames per each angle, I tried to avoid this while keeping the cenital perspective but I couldnt figure it out. About the polygons... the bullet is the one checking for collions against the zombies, so if you have a sheep pretty close to you, you will have to get away and shoot since the bullet is far away from the sheep and the collision event wont trigger.
Well you don't have to use collisions. You can pick the closest object within her angle(granny.x,granny.y,zombie.x,zombie.y).
With that many objects running at you you shouldn't have to worry about accuracy.
All people want to see is something blow up.
Also try to scale down the physical size to the nearest power of two size. You can then up-scale the images in game.
A lot of games do this, and yes some of them look like crap.
ok that could solve that problem, thank you. . Any ideas of why there is such a poor performance on mobile devices? (I have seen games like age of zombies and I think they are doing the same thing we are doing about angles and multiple frames for the the position of granny and the cenital perspective). Should I lower the types of rocks, bushes, etc (though I think that would be kind of restrictive :S)
Hard to say. Could be anything from how she's being pushed around, to how often you are doing the "for each"s.
No physics, right?
Develop games in your browser. Powerful, performant & highly capable.
No, no physics. I think that the weird pushing granny behaviour is because all zombies are container-based, they are composed of a sprite object, a "mover" (a mover is conceptual object that has a bullet behaviour with bounce on and a solid behaviour (solid behaviour, not physics), it is separate from the sprite so I can correctly handle the perspective frame animation in each direction of the zombie) and an indicator. Granny, by the other hand, is also container-based, it is also composed of a sprite, a mover and nothing more.