Week 46: Tile-sets, toast-notifications, and surface-parsing efficiency

A screenshot of the Godot level editor showing the kinds of shapes that I can make with my new tile-set.
I expanded my tile-set system to support even more shapes!


tl;dr: New tile-set shapes, new toast-notifications, and more efficient surface parsing.


What happened last week?

Highlights

  • I created a new tileset system that supports even more angles and shapes.
  • I created a new toast-notification system.
  • I refactored my surface-parsing logic to use a more efficient tile-set-focused strategy.

Laundry list

  • Create a toast notification system.
    • This system is pretty configurable, uses my pre-existing styling system, and should be a good starting point for creating a dialog system later on.
    • Notification size and placement can be configured.
    • Notifications can be configured to close with a short delay, a long delay, manually with an X button, manually with a tap anywhere on the screen, or via code.

A screenshot showing the new toast notification.
My new toast notification.

A screenshot showing the new toast notification.
My new toast notification—now closable with an X button.

A screenshot showing the new toast notification.
My new toast notification—now larger.

A screenshot showing the new toast notification.
My new toast notification—now full-width.

A screenshot showing the new toast notification.
My new toast notification—now full-screen.

  • Refactor surface-parsing to use a more-efficient tile-set-focused strategy.
    • Add more collidable tile shape validation tests.
      • Tiles must not have duplicated vertices.
      • Tiles must not have collinear vertices.
      • Tile vertices must align with whole-pixel coordinates.
      • Tile vertices should only be oddly-shaped if the corresponding flag is configured in the app manifest.
      • Tile vertices must be convex.
      • Tile vertices must not exceed the cell-size of the corresponding tile-map.
    • Add more collidable tile-map validation tests.
      • Tile-maps must use the same cell size.
    • Add support for removing only partially-internal surfaces.
      • For example, when there’s a half-block against a full-block, only the surfaces along the portion that overlaps should be removed.
    • I used to repeatedly iterate across all cells in the tile-map in an outer and an inner loop, which is extremely inefficient.
      • I now map cell indices to tile shape data, and only look-up the relevant neighbor-cell data for a given cell.
    • In particular, this makes the following steps more efficient:
      • Cell-to-surfaces-along-each-side parsing
      • Internal-surface removal
      • Continuous-surface merging
  • Create a more complete tileset system.
    • Includes slopes at 90°, 45°, and 26.6° (one up, two over).
    • I created a new image template.
    • I created a single TileSet resource with a handful of separate Autotile "tiles".

A tile-set template with many different angles.
My new tile-set template. The colors are temporary, but the general shapes should be pretty re-usable.

A screenshot of the Godot editor showing a level that demonstrates the kinds of shapes that can be created with the new tile set.
Here's a quick demo level showing the kinds of shapes I can make with the new tile-set.

  • Miscellaneous:
    • Add a function for testing whether a polygon is convex.
    • Show a notification about reduced frame rates when toggling-on annotations.
    • Fix a regression in HUD-key-value-box and inspector-panel styling.
    • Fix an issue with how my old tile-set-parsing logic had assumed all tiles would be what Godot calls a “Single tile” instead of “Autotile” or “Atlas”.
      • I needed to map cells by their coordinates as well as their “tile ID”.
    • Start debugging recent surface-parser changes.
    • Fix a bug with key-value box resizing.
    • Fix an issue with global styleboxes sometimes getting destroyed when their local duplicates should instead be destroyed.

What's next?

  • 🦃 Another short week!
  • Finish debugging some lingering issues from my recent surface-parser refactor.
  • Create new and improved Squirrel Away tile art.
  • Finish some remaining work with oddly-shaped surface-parsing.


🎉 Cheers!


This is a simple icon representing my sabbatical.

Comments