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

Implement more GridMap editor keyboard shortcuts (similar to Trackmania) #11173

Open
geowarin opened this issue Nov 16, 2024 · 7 comments
Open

Comments

@geowarin
Copy link

geowarin commented Nov 16, 2024

Describe the project you are working on

A 3d game

Describe the problem or limitation you are having in your project

GridMap editing requires a lot of back and forth between keyboard and mouse because some actions are only available with the mouse (like placing blocks)

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

This idea was first suggested by @Calinou (#10992 (comment))

Trackmania shortcuts are described here: https://wiki.trackmania.io/en/content-creation/map-editor

image

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

Allow user to move the cursors using the keyboard

Using arrow keys to move the selected mesh on the grid

Place the current mesh with the space bar

Since Trackmania is geared toward making a circuit, the cursor then auto-advances to the next voxel on the grid (using the circuit direction).

Since Godot's gridmap is more flexible, we could choose not to move forward at all, or use the current camera direction to move the cursor after placing a mesh.

This would allow users to make walls by holding the space bar.

Allow selection of meshes with the number keys

In the Trackmania editor, all the pieces are numbered.

It is possible to directly select pieces with keys 1-9.
To select a piece with a number greater than 9, users can input the number 0 first.

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

No, gridmap is a core feature.

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

Making an extension would require re-coding a lot of gridmap features in gdscript

@Calinou Calinou changed the title Keyboard driven GridMap Editing (Trackmania like) Implement more GridMap editor keyboard shortcuts (similar to Trackmania) Nov 16, 2024
@Nodragem
Copy link

The 0-9 shortcuts would be great. The arrow keys + space may require more thinking though.

I would say that the priority is to polish the pointer+keyboard workflow atm. To sacrifice the space key is a big decision; and if we can use the space key to improve the pointer+keyboard interaction, it should be prioritised.

What I mean is that there are still many features that needs to be added/improved in the Gridmap (e.g. ability to select a cube, a square, a line; ability to select along XY, XZ, YZ), and we should keep the spacebar free for when designing these tools.

Other than that it should be easy to implement, as basically the spacebar would be read as a click. I wonder if another key could be used??

@Hiiamwilliam
Copy link

  • Allow user to move the cursors using the keyboard

If you were able to move the cursor via keyboard, it would be ideal if the 3D Viewport Camera followed it. Else, you could move the cursor out of view, which would require using the mouse again to force the cursor back into view.
A good solution would be to ensure that at least the currently focused Viewport's Camera moves with the cursor so that it is always centered. This would need to apply to changing floors as well.
I hope the GridMap Editor doesn't need to mess with the Viewport Editor to do this, as I think this is generally not accepted.

Also, I wonder how nicely keyboard navigation will work with a combination of rotated Camera + rotated GridMap. If you press "left", should it go global left, local left, or left according to the Camera? What about using different planes other than the default XZ? Things can get weird.

  • Place the current mesh with the space bar

Spacebar could be used as "Apply action of current Mode". So in Paint Mode, if you have selected an item, pressing spacebar paints in the cursor position. If it's Erase Mode, it erases, etc.
This way, even if future updates bring new Modes/functionalities, spacebar could still be recognized as "apply" key.

we should keep the spacebar free for when designing these tools

I think spacebar is too handy for the left hand to be made exclusive to future Selection-related tools. It's also a reliable key for different keyboard types and operational systems.
Having said that, a possible non-spacebar usage of keys is pressing the Mode shortcuts to apply the action. So the same key is responsible for both changing to the Mode if not already there, and if it is, applying that action.

  • Allow selection of meshes with the number keys

If I understand the new bottom panel update correctly, the top row numbers 1 and 3 are used, so directly pressing numbers to pick cell ID isn't possible. Seemingly 2 isn't bound, so maybe it could be chosen for a "quick select" functionality. So you would press 2, then numbers of the cell ID, then spacebar or Enter to select.

Alternatively, we could use a new key (maybe F) to trigger the Filter functionality. Relying on numbers to quick select meshes could make things difficult to remember: I think it's easier to Filter "door_wood" than quick selecting "23".

@Nodragem
Copy link

@Hiiamwilliam I personally see the Gridmap Editor as work-in-progress. I basically just changed all the shortcuts with the PR that moves the Gridmap to the bottom panel, so it is a good opportunity to double-check if the shortcuts are future proof. For example, we may want to free 1 and 3 now, so that we can implement the 1-9 quick selection feature later. I am also thinking to move the action tools to the ASDF row.

Especially before we reach the 4.4 release, I would say we can experiment with different shortcuts, as no users will have learnt them yet 😅

@smix8 Generally speaking, can we mark the Gridmap Editor's shorcuts as experimental for the 4.4 release? so that we can continue to tweak them while we better understand where the Gridmap Editor is going in terms of features.

@Calinou
Copy link
Member

Calinou commented Nov 21, 2024

Generally speaking, can we mark the Gridmap Editor's shorcuts as experimental for the 4.4 release?

Properties and methods can be marked as experimental, but there is no dedicated system to mark editor features as experimental. That said, I would be wary about marking a new editor system as experimental if it replaces an existing system.

@Hiiamwilliam
Copy link

I think it would be better to decide exactly which functionalities should be added, perhaps with a dedicated proposal, before worrying about which keys should do what. We can't future proof if we have no idea what to consider.

But, if the intention is to add more actions (and thus shortcuts) and still be able to have a flexible layout, Editor Shortcuts should be implemented for GridMap.

@Nodragem
Copy link

Yes definitely!

What do you mean by editor shortcuts?

@Hiiamwilliam
Copy link

The shortcuts at Editor > Editor Settings > Shortcuts. I suggested they should be implemented because I'm still using Godot 3 and they don't exist there, but such shortcuts exist in Godot 4. Whoops.
And well, since they're implemented, then there shouldn't be much worry about what keys will do what, as long as all important actions can have their shortcut changed.

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