godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add a dual-grid tilemap system, for square and isometric autotiles #10567

Open pablogila opened 2 weeks ago

pablogila commented 2 weeks ago

Describe the project you are working on

I am working in a regular game with a tile set. I want to draw the least number of tiles. For this it is more efficient to use a 2x2 bitmap than a 3x3 one (15 tiles against 47).

Describe the problem or limitation you are having in your project

Using a 2x2 bitmap means that the tileset is not aligned with the world grid. Also, each tile is twice the size of a normal tile.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

A dual-grid tile implementation, allowing for both square and isometric tilesets with a 2x2 bitmap. Further explanation of this system can be found at:

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

A C# implementation of the proposed dual-grid system can be found at:

A dual-grid custom node implemented in GDScript to easily achieve this is available at:

If this enhancement will not be used often, can it be worked around with a few lines of script?

Thanks to this implementation, devs will only need tilemaps with 15 tiles, instead of 47 tiles for 3x3 bitmaps. So this feature will definitely be used often.

Is there a reason why this should be core and not an add-on in the asset library?

This would expand the current tileset options in Godot.

groud commented 2 weeks ago

I was linked the technique, I think it looks very good. It's however not super easy to integrate within the current system, as there's no way to "paint" terrains on a TileMap now, besides using placeholder as shown in the example project. I might have a solution, but it's a bit complex. I'll open a proposal.