You are here

Hellish Conditions

Still knee-deep in the blood of player conditions here, trying to reduce memory leaks.

Almost half the day was spent restructuring the way conditions are added and removed from creatures. The thrust of this change was to avoid instantiating new conditions where I didn't need to. Often, I only needed to see if a condition existed on a creature, and there was no need to make that creature generate the new condition just to check.

The good news is that the changes seem to be helping. Before the change, the game was generating 152 conditions that never got cleaned up when returning to the main menu. After the change: 46. And even those 46 would be re-used the next time a new game was started (basically, templates from which copies are made later in the game).

The bad news? Quite a lot of code changed. And that could mean stability issues down the line. But, since memory leaks also mean stability issues, it's a rock and a hard place scenario.

I'm still pretty confident in this approach. The wasted memory is down, and I'm putting out the relatively small fires resulting from the changes. Hopefully, it'll be stable enough to check back into the repository for Tiago to work with, and ultimately, we'll see enough of an improvement. (I.e. we'll have enough memory left to load things like music for the game)

Meanwhile, Tiago's still kicking butt sniping other bugs from the list, including a major crash bug resulting from iOS version losing focus (triggered by viewing iOS status bar, exiting app, buying in-app full version unlock, and other sort of important things :)