@coyot: It could in theory, but all the timings and everything are deeply intertwined with the animation system. So, that’s some non-trivial surgery. Besides, there’s already code in there to deal with performance drops in various ways:
- Flixel itself ratchets down the framerate to maintain a fixed amount of updates per second, before it resorts to slowdown
- Before we implemented manual particle settings, there was already code for AOE attacks that makes particles themselves appear less often in proportion to fps
- You can now manually set particles, of course
The real thing is just that the animation system itself isn’t the bottleneck, since changing animation frames is just more processing - the framebuffer still needs to be redrawn continuously. Of course, it is happening twice, but there’s not a lot of obvious gains to be had without the risk of substantial new bugs. I’ll post the latest benchmarks just to be sure, but the real bottleneck is still just “drawing a bunch of things to the screen over and over again.” Flixel can only do so much here, so although I can optimize and tweak here and there, there’s no real silver bullet until I move the whole engine to something that gives me real honest-to-God hardware acceleration. I’ve been looking into HaXe a lot lately, and I think that’s probably our ticket for any future development - HaXe devs tell me that it shouldn’t be too hard to port over, and then we can target C++ for the download version with hardware accelerated graphics.
That of course, won’t happen until/unless we do a sequel, but if/when we do a sequel, I’ll try to maintain compatibility with the original game’s dataset and features (this would also be a boon to porting it to consoles, iOS, etc, if/when that opportunity ever presents itself).
I’ll be interested to see if the latest memory leak fix in 1.0.27 does anything to mitigate the 4x slowdown problems.