#37
Death to all lag!
Posted by Craig Stern
Hey guys, I have some exciting news! I finally figured out the big thing that was causing slowdown during Telepath Tactics's longer battles: it turns out, it was caused by weird behavior by the third-party particle system that I use in the game.
I was able to narrow it down to the particle system during testing by creating a custom battle, spawning loads and loads of particles during dialogue at the very start of that battle, and then sitting around and doing nothing at all during my turn. I recorded processor usage with a profiler tool during this whole process. The results: even while absolutely nothing was happening, the processor was still working overtime to keep up with updating particle emitters that had long since ceased to actually emit particles!
This is a picture of the profiler about 45 to 50 seconds into the battle, after I'd finished generating all of those particle emitters and was just sitting there doing nothing at all:
![[IMG]](https://ksr-ugc.imgix.net/assets/004/069/997/2bfde8f6637d5f12e769a50bcb1a66fc_original.png?v=1435675901&w=700&fit=max&auto=format&lossless=true&s=1a8a723c999cd08c036c284ade75e8f0)
Just look at this thing.
So now I finally knew what was responsible for all of that progressive slowdown: particle emitters sticking around the battlefield, silent and invisible, sucking up processor cycles! While it was a relief to finally know the cause of the problem, I was briefly afraid that I was going to have to attempt a fix of someone else's particle system--or worse, to code a brand new one myself from scratch. Luckily, this proved unnecessary, as I was able to hack together a quick and relatively inelegant (but nonetheless highly effective) fix as part of yesterday's version 1.038 patch.
The bottom line: game slowdown should now be all but eliminated in version 1.038. If you haven't updated recently, I'd recommend doing so!
Going forward, I'm planning to finish implementing a new save file system that's easily readable (and editable!), make some much-needed fixes to the map editor, and tackle any remaining weirdness with the game's inventory system. I also have a couple of new secret projects in the works that I'm excited about, but I'm not ready to announce those just yet. Stay tuned!
Click to expand...