Open PranavSK opened 4 years ago
I've used both Tilemap and Gridmap a lot, and I came up against a few stumbling blocks, I don't know if we'd want to address these, but here's a list for discussion:
@Wavesonics It's probably better to create one proposal per requested feature (after searching for duplicates). This way, they can be discussed independently.
Describe the project you are working on: This proposal is for any game that would need a grid-based level editor.
Describe the problem or limitation you are having in your project: The current implementations of
TileMap
andGridMap
are a bit of a black box, although internally they use the same core concepts achievable via existing nodes. While it may seem to simplify things it actually loses a lot of the flexibility afforded by the node-based approach of Godot. This also affects the UX and how it is designed as it does not fully take advantage of Godot's best feature.Describe the feature/enhancement and how it helps to overcome the problem or limitation: To better understand what the issue is we can look at what
TileMap
andGridMap
try to provide:With this, we can also group some possible extensions a user might need:
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: Keeping the above in mind we can have the following:
Grid
. This would enable wrapping the custom grid using the cartesian coordinate system used internally by Godot. The core engine does not need to know actual conversions between the coordinate systems, Any custom grid types would extend and implement this theGrid
class.Brush
. This could be made available to runtime for supporting runtime level editors. These are dependent on theGrid
resource (A brush needs to store the grid type it can work on). There are two main functions in theBrush
resource - one to do instantiation/placement and another to resolve the asset to use.The idea here is that the brushes and the library depend on the grid, unlike the current approach where the library is more generic. This I believe makes more sense since the modular assets are generally created by keeping the grid in mind. With the ability to use custom grids, the library can still be used in different ways. Also by making the library global (per project) we can have a more unified place to organize them. This should also simplify the UX.
This approach would keep things intuitive in the Godot sense. It is also possible to make UX more unified with regards to level editing. We could also use this as a base for future editors (for eg. terrain editing). It is also easily customizable and a modular approach to level editing tools. Asset creators could provide grids or brushes and extend on other brushes easily. External editors that understand the Godot node-tree don't need to be retrofit to work in parallel with the level editor tools.
If this enhancement will not be used often, can it be worked around with a few lines of script?: Not really but, when implemented a lot of the custom level editor tool creation can be simplified.
Is there a reason why this should be core and not an add-on in the asset library?: It is a rethinking of existing implementation to provide for improved and customizable UX.