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!
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
Get Untitled Fighting Game
Untitled Fighting Game
Status | In development |
Author | robobeau |
Genre | Fighting |
Tags | Playdate, tiled |
More posts
- v0.6.0 (or It's Never Too Early To Polish)Jan 15, 2024
- v0.5.2 (or Framerate Walk with Me)Sep 05, 2023
- v0.5.0 (or A Million Little Refactors)Jul 08, 2023
- Learning how to code QCB/F inputsApr 21, 2023
- v0.4.0!!!11!1Apr 09, 2023
- Been a while!Mar 09, 2023
- Got Butler set up, so here's v0.3.2!Jan 29, 2023
- Pre-alpha!Jan 22, 2023
- The Right Tool for the Job (or How I Learned to Stop Worrying and Love Tiled)Oct 02, 2022
Leave a comment
Log in with itch.io to leave a comment.