jess-hammer/dual-grid-tilemap-system-godot
Tentang
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!
Proyek lainnyaPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- +2
- dalam 15 hari
- +4
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
Asli✨👯 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:
- Godot 4.2: https://github.com/GlitchedinOrbit/dual-grid-tilemap-system-godot-gdscript
- Godot 4.4: https://github.com/pablogila/TileMapDual_godot_node <-- this one also supports isometric and hex tiles!
Otherwise, here's what mine looks like:
https://github.com/user-attachments/assets/a5532595-3278-49a7-a3a7-e9aa1f6fd15e
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 [email protected]
Jelajahi proyek terkait
Memuat…