godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.17k stars 98 forks source link

Extend the 2D TileMap autotiling feature to 3D GridMaps #114

Open viniciuscsg opened 5 years ago

viniciuscsg commented 5 years ago

Describe the project you are working on: A very simple 3d platformer with gridmap-based terrains and platforms.

Describe how this feature / enhancement will help your project: To construct a 3d level quickly by reusing walls, corners, wall edges etc, the most useful node available is clearly the Gridmap, similarly to what you would do with a 2d tilemap. However while there is autotiling functionality already implemented in 2d tilemaps to speed up level design, in 3d Gridmaps you have to select and place every tile individually, while also using non-intuitive keybinded commands to flip the tiles on screen, which is quite tiresome and time consuming.

As an practical example, to draw something as a simple cubic house or building measuring 3x3x3 cells, after setting up the resource and the grip map, one has to click the screen at least 39 times (including selecting the types of tiles needed, placing them, and changing the Gridmap's floor), plus using keybinded commands to flip the tiles a dozen times, without a tool-tip on screen.

If it was possible to extend the exact same functionality we already have for 2d tilemaps to make it work in the exact same way for a single floor of a grimap (as if it were a tilemap) the same building would me made with 6 clicks (3 to place, 3 to change floor) by choosing the 4-bit/2x2 option. With the 8bit-3x3 option, you would still click to paint every cell, but all the tile selection would still be automatic, and a great level of detail could be achieved quickly.

When one consider a rather large level, not having this feature can easily amount to hundreds (or thousands) of extra clicks and mouse movements, while drawing with autotiling is sure to speed up level design and be a great quality of life option, which hopefully could be achieved by reusing code already implemented in godot for another node (2d tilemaps).

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work: rlhyx0u5nez11 In this case, the 3x3 cliff above would produced by a single autotiled brush click.

Describe implementation detail for your proposal (in code), if possible: Adapt the tilemap autotile code, considering a floor in a gridmap as if it were a tilemap.

If this enhancement will not be used often, can it be worked around with a few lines of script?: This is an IDE usability enhancement, so I think implementing it with code by the average user would amount to creating your own level maker, which doesn't seem like a trivial task that could be done with a few lines of code. I believe that once implemented this enhancement will be used very often, given that painting levels with autotiling is widely considered much more efficiente than placing tiles one by one, and selecting the correct tile hundreds of times.

Is there a reason why this should be core and not an add-on in the asset library?: Yes, I believe this to be a general purpose functionality useful for any game with scenes composed of gridmaps, which is should be a preferred way of making grid based levels.

Lucaspec72 commented 5 years ago

YES, this should be implemented.

Alastor01 commented 5 years ago

Yes, this would be extremely useful. GridMap provides optimizations to rendering and physics processing, so it is a good practice to use it. Also it makes it very convenient to build levels (especially interior ones). However, like has already been said, it is very time consuming to use. In my case, I made a script which essentially converts specific floor tiles to multi-level wall tiles. But creating such script took a lot of time and is of course specific to my game. Not to mention, it has its own issues. A general purpose solution would be amazing.

HeadClot commented 4 years ago

This would be really nice to have for grid maps :)

jamisoncozart commented 4 years ago

Any update on this? Would be a super useful feature. Or if anyone has ways of automating this without this feature, let me know!

Calinou commented 4 years ago

@jamisoncozart As far as I know, nobody is currently working on this (either as a built-in feature or an add-on).

Valeryn4 commented 3 years ago

I have implemented a similar system, inside the project)

XLIVE99 commented 3 years ago

I have made plugin for this. It should work as TileMap's autotile system.

arturertel commented 3 years ago

Hello @XLIVE99 , thank you very much for your work! The demo works for me, but when I try to reconstruct it, unfortunately it does not work. Here is a screenshot, I would be very happy if you could help me. Unbenannt

XLIVE99 commented 3 years ago

Hello @arturertel , thanks for using my plugin. I will be happy if you open issue at the plugin's repository. Because this is the wrong repository. As for the error, AutoGrid seems trying to find MeshLibrary but it can't, make sure GridMap node has a MeshLibrary and after that, select another node then select the GridMap node again so the AutoGrid will check the GridMap node again. If it doesn't help, then please proceed to create issue at AutoGrid issue page.

Calinou commented 2 years ago

For an eventual GridMap autotiling implementation, note that it may be worth considering an entirely different approach compared to TileMaps (similar to the one in Source 2 Hammer, as demonstrated in this video). See also an explanation here: https://tfsource2.com/post/battleships-balancing-and-blockouts#Tilesets_-_What_are_they

Valeryn4 commented 2 years ago

For an eventual GridMap autotiling implementation, note that it may be worth considering an entirely different approach compared to TileMaps (similar to the one in Source 2 Hammer, as demonstrated in this video). See also an explanation here: https://tfsource2.com/post/battleships-balancing-and-blockouts#Tilesets_-_What_are_they

What if we want to make a game like "Dungeon Keeper" or "Evil Genius"?

MirceaKitsune commented 2 years ago

I would very much love to see this feature. 2D tilemaps let you define and automatically assign borders then easily draw your terrain, but 3D gridmaps don't have any automation for such a thing: You need to place all edges and corners manually which is far more difficult. It can be scripted which is what I was thinking of doing first, I'm likely going to just instance scenes instead as that has other benefits... would still be a very useful feature to have for level design though.

PierreSnell commented 7 months ago

Sorry to bump... But is there any news on this feature ?

Also, an API that we can call from code would be so much helpful in my case.

Thanks for the great engine that is Godot.

Calinou commented 7 months ago

But is there any news on this feature ?

To my knowledge, nobody has started implementing this feature yet.

stesproject commented 7 months ago

Can someone converts those autotile plugins to Godot 4? :(

XLIVE99 commented 5 months ago

@stesproject Hey, it is a little bit late but I upgraded AutoGrid to support Godot 4+ (Only tested on Godot 4.2.2). You can either download the source from releases or switch to "Godot-4.x" branch and download from there. Then you just have to copy paste "Addon" folder to your game project. It should work fine, if not, please open a bug report in the AutoGrid repo

XLIVE99 commented 5 months ago

Can you open an issue in AutoGrid issue page, this is not correct place to discuss this. And I can't see the image, the problem sounds like you choose wrong autotile mode, can you try with "Minimal 3x3"?