-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a Brush Spacing property to GridMap to control spacing between tiles when using paint/fill tools #9612
Comments
Adding brush spacing would certainly help with tiles that are not exactly one "cell" size - and it should be possible to define separate X and Z values (or whatever plane you are working on), potentially with some setting to do this automatically based on the bounding box of the tile you are working on as that can also help with non-square tiles too. That said, from the description i'm not sure how that'd help with modular tiles made out of floor/wall/column/etc pieces. With this feature gridmap would still only use tiles that cover "everything" per cell area, you wont be able to combine them anyway. And without this feature you can still use the pieces "manually" by creating multiple gridmaps: You could also put the 2x2 or 4x4 pieces in their own gridmap. As for the modular tiles, there are two approaches i can see for improving support without having multiple gridmaps (or at least reducing them):
Personally i'm in favor of the second one because i think it is both more flexible and support more use cases even if the first one could allow for a little better UX. I did a quick proof-of-concept for layer support in Gridmap to check this out: Godot.Gridmap.Layers.webmYou can try the functionality from this branch: https://github.com/badsectoracula/godot/tree/gridmap-layers I haven't done a PR because it needs more work, especially on the editor where i just added a spinbox to specify the working layer - and i'm not 100% sure if this approach would be something to add in the first place. |
Thank you for your feedback! To have layers could be very useful indeed, but I see it more for complex decorations (e.g. adding curtains or boards to some walls, adding a fountain in the middle of a room, etc). In terms of the modular asset workflow, you can achieve it using 1 layer/gridmap like this: To make it work you need to:
Below I drew another example, with the assets being 2 units wide and the grid's cell size being 1 unit. In this example, I show where the asset's origins are placed and how they snap to the grid: Using this setup, you don't need to switch between layers, and as contributors we can more easily implement a "clever fill tool" where the end user would select an area and Godot would fill it with floor, wall and corners. However, using this setup means that the paint tool brush needs to paint every 2 cells; which is why I want to implement this proposal. |
Ah i see, in my mind (and the assets i made in the shot/video above :-P) i had that grid, floor and wall origins are at the corner, not the center (only the column has the origin at the center). Yeah, now that i see how the walls are placed in relation to the floor i understand the setup. However (and this assuming i'm still not missing something) as this is purely about the editing side (i.e. how/where the editor would place stuff) i think the "Spacing" value should be controlled by the editor panel itself and not a property in GridMap - like next to the buttons where you control rotation. |
Very happy to hear that, as this is what I had in mind! (Note that this proposal was made before I implemented the bottom panel 😅) I should probably open a proposal for a tool settings panel as in the bottom right of this mockup: |
Describe the project you are working on
Top Down Twin Shooter:
See Github project here:
https://github.com/Nodragem/twin-stick-shooter-starter-kit
Describe the problem or limitation you are having in your project
Gridmap was designed to use "Classic" modular kits where we place 3D tiles of 1x1x1 unit on a grid of 1x1x1 unit (as seen in Bethesda's Skyrim's GDC presentation ).
Nowaday, we tend to use more granular modular kits: basically we separate the wall pieces from the floor pieces (as seen in Fallout 4's GDC presentation.
When using this new paradigm, the asset are made on a 2x2 grid units base, and the Gridmap is set at 1x1 unit. This allows to place a wall at the edge of a floor piece basically.
Based on this new paradigm, the Gridmap "brush" is not working very well. It will paint one 2x2 piece every 1 unit:
We would like the brush to place 1 piece every 2 units (as show on the lower row).
(Note that the kit used in this example are from KayKit Prototype Bits)
Describe the feature / enhancement and how it helps to overcome the problem or limitation
We would like to have a spacing parameter, so that the brush tool and the fill tool know that they need to place a floor/wall piece every X units (1, 2 or more).
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
In inspector, add a category "Brush" above "Cell", and an entry "spacing size".
Based on this value, we use a modulo when filling areas with an asset.
If this enhancement will not be used often, can it be worked around with a few lines of script?
It should be used often by 3D games with interiors and buildings.
Is there a reason why this should be core and not an add-on in the asset library?
It improves a tool (Gridmap) that is already core.
The text was updated successfully, but these errors were encountered: