Memory Bug Hunting, Dialogue Writing (Patreon)
Content
Since the release of v0.38.0 I've been busy with two major things: bug fixing and dialogue writing. The most recent version of LR2 introduced a new texting framework and display, but it's still in need of some solid content. I've been writing new text-specific flirt options to address that shortage, and this new content should make it into v0.38.1. I've also updated the texting system to use a list of Actions instead of being a hard-coded menu, which makes much more expandable by modders.
Of course no patron release would be complete without a host of bugs to track down and fix. One bug in particular has been haunting me for a few months, but was low on my priority list because it wasn't directly causing crashes or blocking progress. It was a memory bug, and it was causing some players to experience crashes during some scenes. A helpful patron dug into the code and tracked down the precise memory object that was ballooning in size, and with that information I was able to fix the problem.
The culprit ended up being tied to the animation system. When a character is drawn a secondary thread is created to prepare a Render object, which is the most time consuming part of the drawing procedure. This Render was placed into a temporary list and grabbed when the main thread was available to draw to the screen. These Render objects were never actually being removed from the temporary list though, only overwritten when the same character was drawn a second time.
The result is a ballooning memory footprint, proportional to the number of people that had been drawn that day. A catch-all memory clear at the end of the day would fix the problem, but large companies could reach an absurd level of memory use. How absurd? My test scenario created and displayed 10 characters and then did a memory profile. The result was a full 1.5 gigs of allocated memory for the Render objects, vs 0.3 gigs of actual cached images! Glad to have that problem take care of once and for all!
Now I need to finish up some personality specific dialogue for v0.38.1, which is just a couple short days away! Back to work with me!