Page 1 of 1

Map : reset after hyperspace and additional keyboard bindings

Posted: Wed Sep 25, 2024 2:10 pm
by micha
Hi, I'm new, and just hacked around on something which was bugging me with the current release; namely the maps.

1. Reset selected system after hyperspace jump

After a hyperspace jump, very typically I want to open the current system map (either to check info, or set a target, etc). The current game does not reset the "selected system" after a jump which, to me at least, is somewhat confusing. My code now does.

As a bonus, it now signals as per a comment in Player::OnEnterSystem() - Game now emits an "onSystemEntered" signal, which the SectorView connects to. TBH I'm not entirely sure what the benefit of this is as the signal "handlers" appear to be getting called from within "emit" and not asynchronously. Is this just a design paradigm to decouple the classes?

2. Additional keyboard bindings

I'm also thinking about adding more keyboard binds to the Sector Map - moving the selection around between systems on a route, as well as being able to use the keyboard to set the jump destination or calculate a route. One challenge for setting the destination with the keyboard are multi-star systems.

----

1 is done; Adding more keybinds for 2 is fairly trivial based on some experimentation, a question is what we want to be able to control by keyboard (ideally everything as jumping between mouse and keyboard is cumbersome, but that would require some non-trivial rethinking of the UI as a whole).

Thoughts?

Re: Map : reset after hyperspace and additional keyboard bindings

Posted: Wed Sep 25, 2024 4:32 pm
by zonkmachine
micha wrote: Wed Sep 25, 2024 2:10 pm 1. Reset selected system after hyperspace jump

After a hyperspace jump, very typically I want to open the current system map (either to check info, or set a target, etc). The current game does not reset the "selected system" after a jump which, to me at least, is somewhat confusing. My code now does.
I believe this is discussed here: https://github.com/pioneerspacesim/pioneer/issues/5691

Re: Map : reset after hyperspace and additional keyboard bindings

Posted: Thu Sep 26, 2024 1:37 am
by micha
Thank you; I did search through the issues list but didn't find that one, then I figured it was probably better to discuss here first before raising a new issue. I'll continue discussion there.

Re: Map : reset after hyperspace and additional keyboard bindings

Posted: Thu Oct 10, 2024 7:07 am
by sturnclaw
micha wrote: Wed Sep 25, 2024 2:10 pm I'm also thinking about adding more keyboard binds to the Sector Map - moving the selection around between systems on a route, as well as being able to use the keyboard to set the jump destination or calculate a route. One challenge for setting the destination with the keyboard are multi-star systems.

----

1 is done; Adding more keybinds for 2 is fairly trivial based on some experimentation, a question is what we want to be able to control by keyboard (ideally everything as jumping between mouse and keyboard is cumbersome, but that would require some non-trivial rethinking of the UI as a whole).
I'm quite tardy in replying here (haven't checked the forums in a long while) - more keyboard/gamepad/joystick interactivity would definitely be nice! There are a few hurdles to that direction as we haven't quite fully meshed ImGui and the game's input systems together, leading to the delightful user-found features like "hold W, drag the low-thrust slider, release W while dragging, the game thinks W is still held down". Keyboard shortcuts defined on the Lua side using ui.isButtonPressed() are non-remappable, and InputActions can only be registered from C++ and are disabled when the user is actively interacting with the UI layer.

If that isn't a daunting hurdle for you, feel free to add keyboard binds to any actions within the Sector Map that you want! Focus next/previous system in route would be nice, and anything else you can think of that might be useful for users on a controller rather than mouse/keyboard (or perhaps a handheld like the Steam Deck). Handling selection for multi-star systems could be implemented (from a user-facing perspective) with a "Select next/previous star in system" bind, though that one might be best implemented in Lua.

One option you might consider is adding an additional radial menu with common actions that is triggered on the selected system? (i.e. add/remove from route list, auto-route, open in system view, etc.)

If the latter two suggestions are something you would want to work on in the short term, I can take some time to (finally!) properly expose the InputAction/Axis functionality to Lua - I've been dragging my heels on it due to its implications on mod support especially when combined with our long-range plans to have a separate Lua "execution environment" for the main menu compared to the game.

Re: Map : reset after hyperspace and additional keyboard bindings

Posted: Thu Oct 10, 2024 1:50 pm
by micha
I currently have "PgUp/PgDn" for moving between systems in a route, and "Home/End" for jumping to the start and end. The only tricky part was that the current system is not part of the route. It was useful while working on this feature.

It would also be nice to unify the controls between the various maps. For example, there's no way (that I've discovered) to translate the Sector Map using the mouse..

Using a radial pop-up is a nifty idea - less key-combinations to try to remember. OTOH, more fiddly to use and can't be used in macros.


Probably should go through the entire game though and think about all the controls and unify what can be unified.. from my perspective I think it would be nice to be able to fully keyboard/joystick control the entire game instead of needing to switch between mouse and keyboard.

Re: Map : reset after hyperspace and additional keyboard bindings

Posted: Thu Oct 10, 2024 5:00 pm
by bszlrd
The ability to pan the sector map would be a welcome change.

Not sure if everything could be put onto joystick, but that would be useful too. On the other hand, the mouse and keyboard controls shouldn't be dumbed down in order to do that in my opinion. The bane of a lot of console ports.

Re: Map : reset after hyperspace and additional keyboard bindings

Posted: Thu Oct 10, 2024 10:05 pm
by micha
> Not sure if everything could be put onto joystick, but that would be useful too. On the other hand, the mouse and keyboard controls shouldn't be dumbed down in order to do that in my opinion. The bane of a lot of console ports.

I 100% agree. The consolification of "Elite: Dangerous" was a crime, especially now they've dropped the port but haven't reverted the dumbing down! As is the dropping of VR as a first-class citizen in the game, which is the main reason why I never bothered to buy Oddyssey expansion. That and the fact I have zero interest in an FPS shoe-horned in to the game. But it was what people wanted.. *shrug* Lol, sorry, getting a bit off-topic in my rambling rant!

Back on-topic, if everything is on keyboard, then a decent joystick should be able to map everything to it. I was not meaning full support for gamepads or similarly limited devices, I was meaning something like an X-56 HOTAS which has a significant number of mappable buttons. As long as the game can switch input-focus to different parts of the screen and re-use keys instead of needing a separate set of keys for every part we can keep the number of required buttons to a sane limit. For example, in the Sector View, it might be possible to switch focus to the side-bar to interact with any elements in there, and then back into the map instead of needing a separate set of keys.