godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.34k stars 21.06k forks source link

Node Concepts for Module: Grid2D, Grid3D, HexGrid2D, HexGrid3D #10005

Closed willnationsdev closed 4 years ago

willnationsdev commented 7 years ago

Not necessarily for Godot 3.0, but what do the core devs think about incorporating into Godot modules extremely generic renditions of Grid and HexGrid nodes for 2D/3D environments? I already know there are TileMap (2D) and GridMap (3D), but those are more for defining static environments and not for providing organization and auto-positioning for dynamic, multi-layered content. Like, for any given layer, defining a script base type that is allowed to exist on that layer and allowing the user to use the Grid node purely to facilitate movement, positioning, visibility, etc. of the objects they are putting into the game world. Something where my get_cell method returns an Object derived from the given script rather than just Int pointing to some texture/mesh in a static/baked file.

Clint Fleetwood already has a basic Hex module derived from incorporating stuff from RedBlobGames' documentation on hex math and the like: https://github.com/cefleet/HexModule

It would need a lot of work to refactor to meet the Godot coding conventions and generalize into a much more flexible object orientation. I was discussing it with him, and I just wanted to know whether something like this would ever even be considered for core engine integration as a module or if something like this would just be rejected / relegated to a plugin only.

Seeing as how there are already TileMap, GridMap, and GridContainer built into the engine, it seems there is precedent for having organizational nodes built-in (without plugins), and there currently appears to be a vacant slot for any nodes that help to organize non-environmental, non-UI objects within a 2D/3D space and according to some defined algorithm. That is likely the base type that would be planned, and then the Grid2D, Grid3D, HexGrid2D, and HexGrid3D node types would be derived from that type.

aaronfranke commented 5 years ago

For facilitating movement and positions etc, what's stopping users from simply rounding and/or scaling some value to fit on a grid?

For multiple layers, couldn't you just use multiple GridMap nodes?

akien-mga commented 4 years ago

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!