Loading...
  OR  Zero-K Name:    Password:   

New U.I. Suggestion: Hot Select for units

15 posts, 1986 views
Post comment
Filter:    Player:  
sort

6 years ago
I'm a long time Planetary Annihilation: Titans player and have just recently jumped on the Zero-K zeitgeist following the Steam release. One of the main draws for both of these games is the level of customization for User Interface. PA even allows for modding of UI, which allows players to assemble their UI through modular additions. Of these UI Mods for PA, probably the most popular is HotBuild2. Hotbuild2 for PA contains a feature that I relied on heavily to control my army in that game, and so far this feature is not represented in Zero-K.

I suggest having the ability to select or de-select a unit type by using Hotkeys. Lets call it Hot Select. Ideally it should be the same hotkey that is used to create the unit at a factory, for consistency.

For example: in PA I would select my bombers by first pressing "Select All Air Units" and then pressing R to narrow my selection to ONLY bombers. Likewise, I could select my Fighter jets by pressing "Select All Air Units" and then press E. This made it extremely easy to micro my airforce as I could very quickly move my bombers and fighters independently to avoid AA or engage the enemy bombers. I could also deselect a unit type after pressing "Select All Air Units" by using the CTRL modifier. This is far more efficient than using CTRL groups or ALT CTRL groups. Hot select allows your micro to play out like this: Draw a box around your army, press a key to select artillery, then click to position your artillery. Draw another box, Press a key to select stealth units, then click to send them to a specific target. This provides a LOT of fine control over your army with very few key presses or having to reconfigure your CTRL groups mid-battle.

If you are having trouble visualizing it, here's a Youtube video introducing HotBuild2 to Plannetary Annihilation. Jump to around 2:45 to see the settings screen where units can be assigned to keys.



So, as a new player to this game, what would it take to implement this feature for Zero-K? Could we use the Windows Key as a new modifier for Hot Selecting units? Let me know if you would also be interested in this UI feature. I would appreciate if someone who knows the game better could describe the benefits or drawbacks of what I'm describing and how difficult it would be to implement. Thanks!

+4 / -0

6 years ago
I bet theres some way to set this up. This game started off being crazy customizable with lots of widgets and personalized keybinds/selection keys. I think somewhere along the line they decided to make it more uniform and harder to personalize because too confusing and lot of bugs etc.

If you look in your Zero-K folder there is LuaUI > Configs > ZKKeys.lua - you can open this with text editor and youll see lines like

"AllMap+_Not_Builder_Not_Building_Not_Transport_Aircraft_Radar+_ClearSelection_SelectAll+", "ctrl+s"}, "

Which is some really specific way of setting up selection keybinds. You might be able to edit this document if you get someone to explain what sort of keybinds you want setting up and how to do it.
+3 / -0


6 years ago
I like the sound of it. Spring games in general have pretty complex and deep unit selection tools, but I haven't seen anything quite like this. I'm not as familiar as I'd like to be with the ingame widgets and gadgets, but I can't imagine it would be that hard to do. ALT CTRL groups are nice, but it would be nice to hotkey selection/deselection from an existing selection.
+0 / -0
Made a ticket for the selection suggestion https://github.com/ZeroK-RTS/Zero-K/issues/3008

The buiding suggestion already exists but requires editing the keybinds file manually (since if you bind a few things to the same key through the ingame UI it clears the others).
+0 / -0
Read this section: https://springrts.com/wiki/Uikeys.txt#selections

Do not implement the selection keys verbatim, as the hotkey system presented on the Spring wiki is outdated. Instead, open LuaUI/Config/zk_keys.lua and add lines. There are already some selection keys in the hotkeys file around line 150. See how far you get, although I think this system may be somewhat limited in the categories that it can access. We could possibly add some nicer categories or it may be easier to write a widget. https://zero-k.info/mediawiki/index.php?title=Mod_Creation#Widgets

We could likely make unit selection keys configurable through the hotkeys menu. This would require some hax similar to the grid hotkey settings in order to make the same key select multiple unit types simultaneously. Alternately, each action could select all units with a hotkey identical to that action.
+1 / -0

6 years ago
Alt-number causes all new units of the same type that are in your selection to be auto-added to that number group.
Ctrl-Z selects all the units of the same type that you have selected.

So, one way to implement (kind of) what you wanted:

-assign different unit types to different numbers, or several to one (for example fighters and bombers to Alt-5).
Now you can press 5 to select all of these aircraft, click the bomber in the selection box at the bottom of the screen, and press ctrl-z to select all bombers.

+0 / -0


6 years ago
You can also shift-click in the unit list window to select all of this type within current selection.
+0 / -0

6 years ago
EErankAdminAnarchid Cool, I didn't know that! right-clicking deselects a unit. Can I shift-right-click to deselect a type?
+0 / -0


6 years ago
No idea, try it? :P
+0 / -0

6 years ago
Tried, Works!
So if you have a selection, you can shift-rightclick a unit picture in the unit selection box at the bottom of the screen to remove that unit type from the selection, or shift-leftclick to select only that unit type.
+0 / -0

6 years ago
Yes, you can currently click into the unit list window to select/deselect units. However, having to manually mouse over to click buttons in the UI is very inefficient. Also, it means that you can not build a muscle memory and teach yourself the hand movements to select the units you want to command. I'm always striving to have a control scheme that I don't have to consciously think about while I play, and for that I need Hotkeys for my unit selection. Since making this thread, I've also been considering the amount of control that the combination of ALT CTRL Groups and Hotkey Selections would give you when used in tandem. It seems very powerful to select any unit on the field within 2 button presses. Until that is possible I'll have to settle for shift clicking into the unit list window. Thanks for the work around though!
+0 / -0
Resurrecting this post because I'm looking deeper into how to implement these changes and I've had time to cement more precisely how it should function.

I'll be using some of the images here to clarify what I'm trying to do.
https://imgur.com/a/vCbIRSo

There is a Simplified version of what I'm trying to do and then an Ideal version.

I'll tackle the Simplified version first (accessing all units in global selection settings):

The simple version of "Hot Select" is assigning Global Selection to all units based on their default grid construction letter. The spacebar is currently criminally under used for taking up so much keyboard real-estate. Glaive is built with "W", so holding spacebar and pressing W should select all of your glaives. Likewise for pressing Spacebar+E to select all of your Ronin. This is mostly consistent across all factories so Space+W would always globally select Raiders, Space+D would always select your anti-air, etc. If you have 2+ factories then Spacebar+W should select all raiders from all factories, but this could be edited to user preference.

Under [Settings> Hotkeys> Selection] is a section for "Global Selection", but only a handful of units are listed here (see reference image 1). If I could add every unit to Global Selection, I could do the entire simplified version of "Hot Select". Currently I would need to dive into config files to make this happen, and I'm struggling to understand the config files and how I would need to manipulate them as I don't have a background in coding.

A lot of the infrastructure already exists. All of the Settings UI that could be used to make this work already exists to add hotkeys for specific unit INFO Panels, but not to select them globally (see reference image 2). How can I repurpose all of this great work that's already been done to add a full list of Global Select hotkeys?

Then the Ideal version (creating a better default for everyone):

Ideally all of these Global Hot Selects should have their own section in the Hotkey Settings Tab to be configured.

  • Defaults for all units sharing their lettering with the factory construction letter

  • Default for Spacebar as the "Global Hot Selection" button

  • Spacebar does not activate "Global Hot Selection" while construction queue or factory queue is active

  • Spacebar+Shift+Key = add units to current selection

  • Spacebar+Ctrl+Key = subtract units from current selection

  • When nothing is selected, Spacebar+Key uses global selection. When units are selected, Spacebar+key filters only among the currently selected units.

  • Strider Hub units and missiles exempted by default

  • Air and sea units should probably not overlap as they don't share unit roles with ground factories.

  • S F G & H tend to be less uniform in their role and may need some special tuning to be more useful defaults when more than 1 factory is in play

  • There are plenty of free keys left to modify with Spacebar to give a unique key to air units, sea, striders, bombs, lobsters, transports, etc.

As the spacebar isn't currently used outside of queue order commands, if these were defaults it shouldn't affect any new players experience. Players could choose to never interact with the system, or minimally decide to use it only for quickly grabbing their forgotten Anti-air units with spacebar+D without setting any Control Groups or Auto Groups.

Zero-K has the reputation of having the best User Interface of any Real Time Strategy game and I think this system would be an amazing addition in terms of putting decision power into the hands of the player with as little resistance as possible. It also frees up your Control Groups to set actual battle squads in the #1-#5 slots instead of spending those on Auto Groups.

Any comments appreciated as I try to determine if there's enough interest in this to work on implementing it to be useable for everyone or if this is something I'll just be working out for my own personal config files. I don't know how to do it yet (reading the documentation currently) so any advice or guidance would be cool.

Thanks!
+1 / -0


2 days ago
You'll want to write a widget that creates a bunch of button options in the hotkeys menu. Like this https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaUI/Widgets/gui_spectate_selected_team.lua#L25-L31

Add a button for each type of selection button you want. The button will be automatically hotkeyable. The OnChange action of the button will involve doing Spring.GetTeamUnits and Spring.GetSelected units, then doing some sort of Spring.ApplyANewSelection (look up the name, idk it off the top of my head). You'll probably also want to filter for selection rank.
+1 / -0
So far I'm looking at using what's been done inside this widget as a starting point: https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaUI/Widgets/gui_selectkeys.lua

This is the widget that currently handles all the options for

  • options_path = 'Hotkeys/Selection'

Looks like it was created in 2010 which is why it's such a piecemeal collection of global options instead of holistic.

It would probably be best to implement the simplified version first by expanding the options inside this widget to simply include every unit.
+0 / -0
A lot of progress has been made. I've adapted gui_selectkeys widget into a full menu with buttons to set a global selection hotkey for any factory-made unit.




The simplified version is almost fully realized except that hotkeys can't be shared across multiple buttons for unit selection. If you're reading this and you have a solution for selecting every unit that has a hotkey assigned to it, let me know!

The workaround is, in addition to the global selection menu, to create custom unit group lists with a single key that represents a unit role. This is sometimes very straightfoward and other times a judgement call as to which unit should belong in which category. The good things is that a lot of different groups can be made to suite a diversity of preference.

The intention is to be using spacebar as the modifier key for unit selection since it's unused by default.

I'll be excluding Air and Naval units as these should get their own specific hotkey groups (working on it).

The first idea I had is to simply use the grid layout from factory production.



And a lot of that works without a hitch for Constructor (Q), Skirmisher (E), Riot (R), Assault (T), Artillery (Y), and Anti-Air (D). This is great because players can develop a muscle memory to select these roles globally regardless of what factory they plop first, and it frees up your valuable Control Groups and Auto Groups to be used situationally while overcoming the biggest barrier to hot key useage: memorization.

But some unit roles are messier and sometimes the unit role doesn't cleanly fit.

Scouts (S), Raiders (W), and Heavy Raiders (using (A) since it's free on the grid). While I'm tempted to throw everything that sits on W in the factory grid into a single grouping, I think it's actually more practical to split it up in this case. Here's what I've come up with, anything in italics has been moved off of it's factory production grid letter.

  • Raiders (W): glaive, bandit, duck, scorcher, pyro, *bolas, *venom, *kodachi

  • Scouts (S): dirtbag, puppy, dart, *flea, *dagger,

  • Heavy Raider (A): *Blitz, *Archer

I understand that Flea and Dagger were put into their first spot in the factory to communicate their greater viability to players. Flipping the positions in the grid of flea/venom and dagger/bolas would correct this inconsistency in the grid layout.

I'm sure there will diversity of opinion on exactly what the category groupings should be.

That just leaves a few categories:

  • Signature Units (F): phantom, crab, felon, jugglenaut, impaler, cyclops, grizzly

  • Bombs (G): Imp, snitch, skuttle, limpet

  • Utility (H): Iris, aspis, djinn

  • Weirdos: Widow, scythe, dominatrix, tremor, lobster, claymore, striders

I think these lettered groupings are all useful, even if less useful than the prior groups. Players are not likely to often have multiple signature units from different factories in a game so it's helpful to have a button that will select your Grizzlies when playing Amphbot and your Phantoms when playing Cloakbot.

The weirdos are the units that are more suited to having specific hotkeys or being put into Auto Groups.

Once all these special groups have been added I'll be posting the widget for people to try out. Let me know if there's a specific grouping you think would be good and I'll try to prioritize the ones that have the most popularity. All feedback or discussion appreciated.

Now that I've got the basic idea working and I'm testing it, it feels GREAT to be hot selecting my anti-air with Space+D or retreating my Recluse Ball with Space+E without having to think about it.
+2 / -0