Skip to content
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

Improve GridMap and 3D level design workflow #10992

Open
3 of 32 tasks
Nodragem opened this issue Oct 18, 2024 · 2 comments
Open
3 of 32 tasks

Improve GridMap and 3D level design workflow #10992

Nodragem opened this issue Oct 18, 2024 · 2 comments

Comments

@Nodragem
Copy link

Nodragem commented Oct 18, 2024

Describe the project you are working on

I have been working on a Top-down Action/Adventure starter kit. It inspired all the ideas I've got to improve the level design workflow in Godot. It is open source and available here: https://github.com/Nodragem/top-down-action-adventure-starter-kit

Describe the problem or limitation you are having in your project

There are many little things that can be done to make the on-grid level design experience (e.g. gridmap) greater and I will be listing them here, as a working plan for future contributions.

I am very happy to get feedback and help in shaping this plan for better on-grid level design tools and implementing it!

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

Outside Gridmap

  • change default drag-and-drop behaviour of 3D asset to add as sibling Make "add as sibling" the default when drag-and-dropping an asset into 3D View #9682
  • preview/thumbnail of packedscene containing a node3d/mesh
  • absolute snapping
  • snapping relative to a Gridmap
  • hide big gizmo in selection mode (to easily select small objects in levels)
  • easier to understand grid properties in Editor Setting (e.g. Grid Division Level Max?)

Gridmap Small Improvements (but impactful)

Mesh Library and Gridmap Palette

  • add "delete from mesh library" in the palette
  • multi selection in palette (which will allow for random paint/fill)
  • add tags or categories with tabs
  • possiblity to work with multiple mesh libraries?

Brush improvements

Gridmap Bigger Improvements:

  • improve selection tool:
    • allow complex selections. At the moment we can only select cubes!
    • allow to add, remove from selection
  • improve paint/selection tool:
    • allow Point, Line, Rectangle, Cube selection
    • select on xy, yz, xz plane
    • while having nice keyboard shorcut which do not conflict!
  • clever fill tool: like terrain but needs to work with 3D modular assets rather than 2D tiles worflow.
  • merge two gridmaps
  • copy-paste between gridmaps

Navigation Mesh:

  • discuss the possibly to sunset the current navigation system by tiles? and replace it by navigation region.

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

This proposal will be divided into smaller proposal and PR. It is here to give a big picture.

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

No.

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

Gridmap is already core.

@Hiiamwilliam
Copy link

I'd like to share my thoughts. I've spent a good time working on a 3.X plugin (not published yet) to fix some issues and add some functionalities. However, I did some quick tests, and will consider the 4.4.dev3 version as reference for this comment.

Before thinking about future improvements, I'd prefer if some current limitations/bugs were taken care of - I'll list them with a bunch of other unorganized thoughts at the end. Meanwhile:

absolute snapping + snapping relative to a Gridmap

Snapping what to what? Nodes to the GridMap's cells?

easier to understand grid properties in Editor Setting

Seems unrelated to GridMap, how would this help?

fixing moving/duplicating a set of tiles in Gridmap

I think you linked the wrong url.

fix: selection rotation when working centerX, centerY, centerZ are True

This seems to happen only if Paste Selects is True.

allow to rotate selected cells

Do you mean "rotate Selected cells around themselves, without rotating the Selection"?

add flip/mirror horizontal/vertical

I think it would be better to add the ability to create and add flipped versions into the current MeshLibrary. The linked pull request suggests changing the cell's ...constructor(?). However, this would affect all cells, and not all cells need to be flipped. Performance impacts must be measured.

show colliders

Seems useful, but at the same time, not really? When is this information important within GridMap? Not all items have collision.

paint on top of used cells

I thought about this in my plugin. How would you do this? Check which cell is under the cursor, then paint on the cell's coordinate + Vector3.UP? What if there's a different cell on top of the cursor? What about painting a cell below or at the sides?

add tile blocks (or group of tiles)

Seems like a good idea. But I wonder, if you end up using a few cells to build several groups, workflow may not improve that much: you'll still need to select from several choices then paint blocks individually. Also, you may have to constantly switch between two different menus to pick what you want.


Thoughts about improvements:

  • Reminder: currently GridMap has no dedicated contributor. This likely means that only trivial changes will end up being merged in a timely manner - bigger changes may be pushed to the future to not break compatibility. It is what it is.
    So, if you feel like making pull requests, set your expectations accordingly.
  • MeshLibrary limitations:
  • GridMap limitations:
    • Make changing floors accept echo Input events. Currently, if you press and hold Q or E, it will apply only one floor change.
      Alternatively, add a functionality that centers all three plane levels to the cursor for quick changes.

    • improve paint/selection tool: select on xy, yz, xz plane

      Something changed between Godot 3 and 4. In 3, you can modify the extents of the Selection after creating it using Shift + Q/E. You can change the currently edited Plane and make the Selection grow/shrink in different directions. It's kinda weird, but it's something. If this is what you meant, then it's a matter of restoring/updating old behavior.

    • By far, the smallest change with biggest impact that GridMap can have is a signal or callback to get last edited cells.
      You mentioned several ideas that could be done via user-provided script if this information was available: paint on top of used cells, add tile blocks, add random tile fill/paint, clever fill tool, work with multiple MeshLibraries (by using a GridMap "manager" that signals to other GridMaps which cells should be modified), and possibly act as brush size and shape.
      It would also help with auto-tiling. Even this plugin mentions that the lack of information about last edited cells is a limitation. Note: that plugin doesn't work with Selections - so even plugins have trouble.

  • Other changes:
    • Either make GridMap use the name of items instead of ID or provide a proper way to handle MeshLibrary refactoring.
    • About "show mesh origins": I can imagine it leading to either visual pollution if the proposed radius is too large or unhelpful pointers if it's too small. Also, I assume most items fit in one cell - you would add a whole new visualization mode just to check for a few big items.
      I think proper solutions to this require knowing the "actual occupied volume" of an item. I imagine this could be done if there were Collision Mask + Layer per MeshLibrary item instead of per GridMap AND the GridMap Editor could check for overlap before Painting/Erasing. Then, Erasing any cell of the bigger items would correctly erase them.
      Now, this wouldn't fix trying to erase a cell whose mesh has gaps by clicking on the coordinates of the gap... You would have to somehow define which neighboring coordinates around the origin are part of this cell, then make the Editor understand that.
    • About brush spacing: seems good but it's dependent on GridMap's cell Size and/or Scale. They can be changed in such a way that even if the spacing is respected, the meshes would still overlap. A more robust solution is to combine the mesh's AABB + cursor rotation to check for overlap. Works fine for Fill Selection, but has problems when Painting in self-intersecting manner.
    • A handy information that could also be made available along last edited cells is coordinates in the Selection. You could for instance write a plugin with custom actions to "Paint cells A and B with random rotation", or "replace items A with B" etc.

@Nodragem
Copy link
Author

Thank you for this fantastic feedback!

I will try to digest your suggestions and edit my list of improvements accordingly later this week.

For some of my ideas, like "adding tile blocks" I will be making related proposals with pictures, so that it is easier to understand them.

Yes I intend to make PRs ! I am rather optimistic that a lot of trivial or uncontroversial changes can be made in combination to make the user experience better. Let's see how it goes.

@Calinou Calinou changed the title Improving Gridmap and Level Design Workflow Improve GridMap and 3D level design workflow Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants