Godot version:
master / dad47d8876de45132226985dbbd079e060f6facc
OS/device including version:
_Manjaro Linux 17.1_
Issue description: (_This issue is a feature request_)
Currently, it seems that the gridmap requires all its containing elements to be of the same size. However, it's not always ideal because in such a scenario as an interior kit, it needs to have elements of different sizes, like columns, walls, roofs, and so on.
It might be more useful, if it treats the cell size as a 'unit dimension' so that the items in an associated mesh library can be of a size which is a multiple of that unit.
For instance, if the cell size is (2, 2, 2), then it can contain such items with sizes like (2, 4, 2), (4, 4, 2), but not (1, 2, 3).
And it'd be nice if we can stack items in the same position, so that it can be possible to put columns on a floor, for example.
I'm not very confident if it even makes sense. But I thought something like that might be helpful from my experience of using Skyrim's Creation Kit, in which you can quickly build a level with building blocks of different sizes.
Stacking items is usually done by stacking gridmaps, just like you would do with tilemaps.
Tilemaps also allow you to define tiles that span more than one cell (but still are occupying one in data), which I used for walls and plants in a game. That would be useful in gridmaps too (if not already possible?)
You can do this already. You just need to create a new GridMap node for each set. So, one set can be 2, 2, 2, another 1, 1, 1, etc. Also, when you use a different GridMap set, you can place objects at the same location. So, for example, you could create a GridMap called "Floors" and have various 3D floor tiles in it. Then you could create a GridMap called "Furniture" and have chairs, tables, etc., in there. Then you could place your floors, switch to "Furniture" and place your chairs, etc., and the chairs will be on the floor tiles.
One thing to keep in mind is you have to design all your 3D elements to work together. So, if your floor tiles are a certain height, then you must ensure your chair's legs would rest on the floor, else they would either float above the floor or be sunk into the floor. You would set this correctly in your 3D modeling app. The simple way is to build your chair on top of your floor and then export the chair.
Thanks for the suggestion. I'm glad to know that there's already a way to make it work in Godot, but I have to say it feels more like a workaround than a real solution.
Probably, it wouldn't be too much of a problem if I need to use multiple gridmaps to stack items like floor tiles or furnitures, but if I have to make a gridmap per each block of every dimension and orientation, then I'd probably try to find another solution.
Imagine you have a 1x3 sofa and you'd like to place two of them, one horizontally and the other vertically. You'd need two different gridmaps just to layout the same sofa in a different direction, and the number would grow as you continue to layout walls, floors, or other furnitures.
I hope we wouldn't require our users to create so many gridmaps just to circumvent a limitation like that, especially if tilemaps already support such a feature.
Imagine you have a 1x3 sofa and you'd like to place two of them, one horizontally and the other vertically. You'd need two different gridmaps just to layout the same sofa in different direction, and the number would grow as you continue to layout walls, floors, or other furnitures.
This is possible with tilemaps, I just wonder if gridmaps can do it too. Just keep in mind it will always occupy one "anchor" data cell, even though the resulting mesh spans more than a cell. Perhaps it needs properly setup pivot points? What happens if you just throw a 1x3 sofa into a gridmap and try it?
Or you could just use GridMaps to place your grid items, like floors, walls, etc., and then use normal geometry (i.e. not in a GridMap) to place your couches. As long as you have grid snapping turned on, it's not too much different. And you normally don't need to "brush in" a bunch of couches like you would floors and walls.
@Zylann @SilverSurfer1221 Ah, you are right that GridMap already supports pivoting, so my previous example with 1x3 sofa was an invalid one.
Not sure about items with different dimensions (i.e. 1x3 and 2x2) but now I feel I need to try an actual scene to see if such a feature is really needed. Thanks for the input!
You can rotate the GridMap item via pressing "S", but you are still limited to placing one GridMap item at a particular spot from the same GridMap. So, if you have a GridMap called "Furniture" and drag a couch from it you could not place another couch, even rotated, on the same GridSquare unless you had a second GridMap that also had a couch in it.
I believe this is intentional so you won't place multiple instances of the exact same geometry in the same spot. It wouldn't be good to accidentally place three floor tiles in the same exact spot.
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!
Most helpful comment
You can rotate the GridMap item via pressing "S", but you are still limited to placing one GridMap item at a particular spot from the same GridMap. So, if you have a GridMap called "Furniture" and drag a couch from it you could not place another couch, even rotated, on the same GridSquare unless you had a second GridMap that also had a couch in it.
I believe this is intentional so you won't place multiple instances of the exact same geometry in the same spot. It wouldn't be good to accidentally place three floor tiles in the same exact spot.