Week 59: Autotiling with dynamic quadrant selection

An animated GIF of a screen recording showing some tiles being drawn in the Godot scene-editor.
My dynamic tilemap cell-quadrant rendering is still a work-in-progress!


tl;dr: I'm still working on autotiling; I now have a nested tilemap that dynamically renders each quadrant separately for a given cell, but I have more debugging to do to fix my quadrant-selection logic.


What happened last week?

Highlights

  • I got most of the system working for dynamically rendering each quadrant separately for a given tilemap cell.
    • But I still have some debugging to do to fix my quadrant-selection logic.

Laundry list

  • Continue implementing my new corner-type-annotation-image tileset system.
    • Add support for matching any corner-type that at least has the correct depth, if neither the target corner-type nor any fallback-corner-type is available in any quadrant.
    • Encode fallback-corner-type mappings.
    • Implement the nested tilemap pattern.
      • The level-author draws tiles onto the outer tilemap.
      • Then the outer tilemap decides which four quadrants should be drawn for each subtile, and delegates to an inner tilemap to draw each individual quadrant.
    • Start trying to run things and debug problems.
    • Fix my quadrant-matching logic so that a mapping without inbound corners will rank higher than a mapping with the wrong inbound corners.
    • Combine inner-tile-set state into the outer-tile-set and just use one instance, so that the dynamically calculated inner state is saved to the external tile-set file.
    • Update autotiling to clear cells instead of assigning empty subtiles.
    • Fix a type-mismatch that was preventing quadrant shape vertices from being constructed correctly.
    • Fix quadrant-shape x/y flipping for some 45-degree cases.
    • Update quadrant-corner-types-to-position-mapping to keep the first matching position rather than the last matching position.
    • Fix quadrant-shape calculations to also clip 45-corners for opposite-corners when the quadrant is the inner corner of a 45-degree floor or ceiling subtile.
    • Add a couple more corner-types, as I discover more cases I need to disambiguate for complex 45-degree joins.
    • Replace corner-types that reference “45-floor” or “45-ceiling” with v-flip-agnostic alternatives, such as h-side and v-side.
      • This is an important simplification, since I was needing to swap types when considering a bottom quadrant vs a top quadrant, which was too error-prone.
    • Add some more missing corner-types.
    • Planned a new small refactor to my corner-type annotation system:
      • Instead of implicitly associating a quadrant with h-opp/v-opp adjacent quadrants of specific corner-types, make the association explicit with additional quadrant-connection annotations.
      • Then, it can be clear when a quadrant depends on adjacent corners of a certain type, or whether the type doesn’t matter.
    • Draw the new quadrant-connection annotations.
    • Implement most of the logic updates to handle the new quadrant-connection annotations.
    • Update custom inbound corner-type annotations to be at a slight offset, so that they don’t overlap with the space needed for the new simple quadrant-connection annotation.
    • Update corner-type fallbacks to specifically match either the horizontal-opposite or vertical-opposite quadrant.
    • Encode many more valid fallbacks.

What's next?

  • Continue creating my custom autotiling system.
    • I should have the complete system working in the next couple days for 90° and 45° cases.
    • Then I'll add 27° cases.
    • There will be a lot of new cases to add for this, but adding them shouldn't take too much time, relatively, since the rest of the system is implemented now!


🎉 Cheers!


This is a simple icon representing my sabbatical.

Comments