progressive slowdown of game...

Hi, all,

My game is getting very close to completion, and uses the standard progression model suggested in Unity games:

Level 1 → Loader Scene → Level 2 → Loader Scene → Level n

The problem is that as I play further into the game, the frame-rate drops, even though all the scenes are based on the same “core” scene.

This doesn’t appear to be due to a memory leak (I have code to check the components in memory during the loading scene, and it’s not progressively rising), it’s not use of static variables (I have none), it’s not due to instantiating objects (I use object pools), it’s not due to loaded resources (everything that is loaded is unloaded in the “OnDestroy” functions.

At first, I thought it was something to do with the geometry on the level in question, but it turns out that if I do a clean run of the game, access the levels where I see slowdown first, the slowdown does not occur

I’m pretty sure this isn’t a memory issue either - this problem is principally seen on iPod Touch 3rd Gen, but the game never uses more than 70mb (at a spike), and usually runs within 65mb.

Recently, I’ve tried looking for other potential issues, like problems with pre-caching textures, so set up “Cache cameras” at the start of each stage, but this hasn’t affected anything.

Anyone have any ideas?

Cheers,

SB

How about using Unity’s profiler to determine the problem?

The profiler doesn’t seem to add anything to the equation, unfortunately. The key thing I’d be looking for to attempt to find memory leaks is an increase of in memory objects in the Loading scene - this doesn’t happen. The number is pretty solid - does have variation, but not consistently creeping upward…

I’d like to look at the game in the Allocations Instrument from XCode, but unfortunately this seems to stop recording whenever the game changes scenes, and there doesn’t appear to be a way to restart it…