itch.io is community of indie game creators and players

Devlogs

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

Untitled Fighting Game
A downloadable game

Howdy! 👋

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

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
Download Untitled Fighting Game
Leave a comment