Skip to content

Repository files navigation

✨👯 Dual-grid tilemap system in Godot 👯✨

This is a demo of how I implemented a simple dual-grid tilemap system in Godot 4.4.1 Mono using C#. It now supports multiple terrain types and can be refreshed while in the editor. Hope it helps!

⚠️ Important: consider these other (possibly better) dual-grid implementations

If you are looking for a GDScript version, here are some I recommend:

Otherwise, here's what mine looks like:

Demo.mp4

Long story short, it does NOT use terrain tiles but acts very similarly to them. It's just a custom Node2D that manages a "world" TileMapLayer and one or more "display" TileMapLayer! The logic to determine which tile to display is controlled by a set of 16 hard-coded rules.

The main reasons I love the dual-grid approach as opposed to regular terrain tiles/auto tiles is because:

  • it allows the tiles to have perfectly rounded corners
  • a maximum of only 16 tiles are required in the tileset (you could cut that number down to 6 if your tiles have symmetry)
  • the tiles align with the world grid

One could also argue it's more efficient, since each tile only checks 4 neighbours as opposed to 8. But I haven't done any performance testing so no promises.

I also made a version for Unity which you can find here

References

See Oskar Stålberg's original proposition of a dual-grid system: https://x.com/OskSta/status/1448248658865049605

Just like Oskar...I don't understand why the dual-grid method isn't more popular!

Regular tile cut:

On-the-dual tile cut:

Dual-grid system is also mentioned in ThinMatrix's video, which is what inspired me in the first place: https://youtu.be/buKQjkad2I0?si=9xot1uUw3PvNWvT9&t=234

If you have any questions or ideas for improvements feel free to contact me at jesscodesyt@gmail.com

About

No description, website, or topics provided.

Resources

Stars

609 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages