godotengine / godot-proposals

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

Make Gridmap consist of scenes, rather than meshes #4849

Open njalooo opened 2 years ago

njalooo commented 2 years ago

Describe the project you are working on

I'm working on a topdown 3D pixel art game, because i want a perspective camera, and felt too limited by the 2D space.

Describe the problem or limitation you are having in your project

I want to have a Tile/ Gridblock with a 2D Sprite on top (Sprite3D node). Currently i can only ad the block in the Meshlibrary, and have to add the 2DSprites individually for every block.

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

If the Mesh library would be a more of a Scene library, it would turn it into a very powerfull and timesaving tool for game devs to express their creativity. Because then one could add all sorts of nodes into one package, including animations and Sprites for example. Also it would make working with the Meshlibrary easier, since there are a few caveats as described in a similar issue. Also i'm not the first to come up with this idea, i found this old issue, which got closed when the main Godot issue pages was turned into a bug only page.

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

When creating a Mesh/Scene Library over Scene > Convert to > Mesh/Scene Library, all direct child nodes of the root node should get turned into their own entry in the Library, with all their respective children beeing included. Later, one should be able to instance said scene, and set it's transformation coordinates via the Grid Map.

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

I think it would be used often, and in order to do the same anyways one would have to have a good understanding of the enigne, for example one could check every filled block of the grid map, check if it's a certain block, and add a scene at that position.

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

This would be an improvement to an already existing Feature, and enhance the Game Engine functionallity a lot.

Calinou commented 2 years ago

Related to https://github.com/godotengine/godot-proposals/issues/3518 and https://github.com/godotengine/godot-proposals/issues/1453.

GridMap uses MultiMesh behind the scenes for optimization reasons, and using actual scenes as tiles would prevent that.

DarkKilauea commented 2 years ago

I have an addon that addresses some of these concerns: https://github.com/DarkKilauea/godot-scene-map

Although I haven't had the time to achieve all of my goals with the project, perhaps it will satisfy your current needs.

loteque commented 1 year ago

Does this issue also prevent having a mesh library of Animated Meshes? Would it be helpful if I made a new issue addressing this?

Zireael07 commented 1 year ago

Yes and no

Wanchai commented 1 year ago

I realise it must be complicated but support for the AnimationPlayer could be awesome!

Nodragem commented 1 month ago

Maybe we could have a SceneLibrary that lives alongside the MeshLibrary, maybe both inheriting from a Library class... đŸ¤”