I’ve just finished my first game and published it to the Play store but I’ve since noticed a performance dip that gradually gets worse the longer you play (not sure why I didn’t notice it before). The game is a simple little Zombie shooting gallery style game where you blast zombies with fireballs. I notice a dip in performance after killing 100 or so zombies. I’m looking for ideas on how to find the source of the problem.
Here’s a list of what I’ve tried so far:
-
- got rid of instantiate/destroy and
switched to object recycling/pooling
and enable/disable for zombies,
fireballs, most FX
- got rid of instantiate/destroy and
-
- disabled audio
-
- disabled spawn FX
-
- disabled death FX
-
- commented my debug statements
none of the above had any noticeable effect on performance
Before changing from instantiate/destroy to object recycling I disabled the script that makes the zombies move toward the player and allowed MANY to spawn, there was no noticeable performance hit until I destroyed several of them. Play store still has the version w/o object recycling for the zombies.
I don’t notice the performance hit when playing in the editor. Stats are as follows: 150+ fps on while playing in editor, Main Thread 902ms Renderer: 5.3ms, Draw Calls: 34, Tris: 782, Verts: 1.3k, Used Textures: 22-37.6MB, Render Textures: 6-6.8MB, VRAM Usage: 9.9 to 41MB, no shadows, animations.
As you may guess I’m pretty new to the whole programming/game dev thing but I’m doing my best to learn from my mistakes. Any input even and especially criticism is appreciated. If you have ideas on what else I could check to find the issue that would be great. I realise it’s a long shot w/o the code but I wouldn’t know what code to post at this point. If you like, here is a download link to the game:
https://play.google.com/store/apps/details?id=com.FunForgeGames.ZombieBlastInfinity