Week 23: Slimming-down file sizes and giving-back to Godot!

A screenshot from Squirrel Away, showing the platform-graph inspector rendering jump trajectories as well as all jump/land position pairs that were considered for possible jumps between a pair of surfaces.
The platform-graph inspector has always been able to display jump trajectories as well as all jump/land position pairs that were considered for possible jumps between a pair of surfaces.

These trajectories and these jump/land positions don't need to be saved, and are now re-calculated as-needed when using the inspector.


tl;dr: I reduced platform-graph file sizes to improve performance, and I made some contributions to Godot.


What happened last week?

Highlights

  • I reduced platform graph file sizes.
    • These files were pretty massive before, and were making the HTML builds run very poorly.
    • They are much smaller now, and things are zipping along!
  • I made some contributions to Godot.
    • Identified some problems with how binary serialization works.
    • Created some pull requests to make documentation better.
    • My two submissions to the Godot Asset Library were reviewed.
      • Nearly done!
  • I participated in the GMTK 2021 game jam!

Laundry list

  • Refactor platform-graph storage in various ways, in order to reduce file sizes:
    • Implement an alternative, more-efficient approach to path-finding, which doesn’t save trajectory state, and instead re-calculates trajectory state on-the-fly.
    • Add support for omitting various debug-only state from platform-graph save files (info on failed-edge calculations and a complete list of all jump-land-position-velocity pairs considered).
    • Remove trailing zeros after decimals in JSON encodings.
    • Move JSON-parsing logic into a separate file.
    • Go back and leave a trailing . when removing trailing zeros after the decimal.
      • For some reason, removing the trailing . breaks something when I try to parse the graph afterward.
      • I have no ideas why this breakage is happening, and I should probably look into it.
      • But, leaving the trailing . doesn’t increase the file size by too much, and I don’t want to spend the extra time looking into this for now.
    • File-size metrics:
      • Before: 4838 KB
      • After removing trajectory state: 2220 KB
      • After removing debug-only state: 624 KB
      • After removing trailing zeros: 584 KB
      • After adding back in a trailing ".": 591 KB
  • Refactored some inspector logic, which relates closely to the data I'm trying to remove from save files.
    • Add logic to dynamically populate edge-trajectory state as-needed within the inspector.
    • Fix a bug in the inspector that was somehow causing the first item in the tree to get squashed into the root.
    • Refactor some platform-graph edges-from-surface logic to make it easier to dynamically re-calculate later from the inspector.
    • Update inspector to dynamically re-calculate all possible jump-land-positions and failed-edge state from a given origin.
      • This lets me discard all this extra state from my platform graphs and save files.
      • This lets me still debug these things as needed.
    • Update the graph to never hold onto debug-only state.
  • Experiment with `File.store_var` and `File.get_var`.
    • This API should be both _much_ more convenient and _much_ more space-efficient for storing my platform-graph data than my current approach of using JSON.
    • But this API seems to be completely broken?
    • I filed a bug:
    • Received some feedback on how Godot’s object serialization should work.
  • Learned about Godot's contribution model, and opened a few pull-requests.
  • Created a secret README for my GitHub profile.
  • Clean up MovementParams flag names and doc comments.
  • Increase preselection-update throttle periods and move them to SurfacerConfig.
  • My Godot Asset Library submissions were approved:
  • Send an Analytics event when platform-graph load ends, and include how long the load took.
  • Adjust new-nav-pulse-duration to be longer and less dependent on the length of the path.
  • Add a dynamic surface-exclusion-list to platform graphs.
    • This can be used to simulate adding/removing surfaces at runtime.
  • Fix some issues with overly strict trajectory re-calculation checks.
  • Create a new godot-bootstrap project that only includes the bare minimum for a fully-working usage of Scaffolder+Surfacer.
    • This served as a general-purpose starting-off point for my GMTK project.

What's next?

  • I have a small list of fixes I'd like to make to my game jam game.
    • These changes won't count for the game jam judging, but they will be nice for anyone who finds my game in the future.
    • These are mostly fixes that are needed in the underlying Scaffolder and Surfacer frameworks anyway.
  • Rate other GMTK games.
  • Finish updating and merging my Godot documentation pull requests.
  • A few more small fixes to my Surfacer framework.
  • Then I think it'll finally be time to start making a handful of small games with Surfacer!
    • I suspect I won't actually get this far until next week.


🎉 Cheers!


This is a simple icon representing my sabbatical.

Comments