v0.6.5 (in which I reveal my versioning system isn't semantic, but a general vibe)


Howdy! ๐Ÿ‘‹

I was experimenting with music and sound effects when I left the game running in the background. Suddenly, the game crashed!

Image

Very cool. Turns out, I've been cramming so much into the history for each character, that eventually something had to give. Observing memory usage increase over time was pretty shocking.

I bitched and moaned reached out on Twitter, and some helpful folks schooled my dumb ass on memory optimization! Because of an eventual replay feature (and if Playdate ever gets netplay, rollback netcode support!), I was putting a lot of state information in each history frame: Position, velocity, health, direction, etc. I was even storing a "buttonChecks" object, because, at the time, I thought it'd be pretty convenient to have a bunch of baked in button checks. All of this added up, memory-wise.

After the thorough browbeating, I set to work stripping out everything that wasn't the button state for each frame. Most of it was pretty simple, though I did uncover an intermittent bug that I was previously unable to pin down! Serendipitous! Trimming all that fat really helped. Because the memory usage over time isn't as dramatic, it stutters less as a result, too! There's still a technique called https://en.wikipedia.org/wiki/Run-length_encoding that could help me reduce memory usage even further, by storing only the changes in the button state! I plan on implementing that in the future, but I'm pretty happy with its current performance.

Huge thanks to Hunter Bridges, Matt Septhon, and James (who does not have an itch.io profile, so here's their GitHub instead!) for setting me on the right path!

Files

untitled-playdate-game-playdate.zip 18 MB
Version 0.6.5 59 days ago

Get Untitled Fighting Game

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.