-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 selection modes - "Select All" and "Select Low Priority" #15839
Conversation
17e1b28
to
76c39eb
Compare
76c39eb
to
0f25a7b
Compare
Rebased and updated. |
Would this need an upgrade rule for 3rd party mods and maps? |
This isn't changing any default behaviour, right? If so, then no. |
0f25a7b
to
caa8b3c
Compare
It's not changing the default behavior. It's just that the new feature won't be very usable without the YAML setup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Behaves well in game and code looks mostly fine. Just a couple of requests:
caa8b3c
to
3abf382
Compare
3abf382
to
8298ce9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested in RA, good job @dragunoff.
OpenRA.Game/Traits/Selectable.cs
Outdated
"Valid values are None (priority is not affected by modifiers)", | ||
"FlatPriority (priority is set to 10 when Ctrl pressed) and", | ||
"LowPriority (priority of actors without this value is set to 0 when Alt pressed).")] | ||
public readonly SelectionPriorityModes SelectionPriorityModes = SelectionPriorityModes.FlatPriority; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing something here, but doesn't FlatPriority change the default behavior compared to bleed? Shouldn't this be None instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either of the values here changes the default behavior when a modifier key (Ctrl or Alt) is pressed. Even if it's None
the priority would be set to 0
when Ctrl is pressed during a selection.
Perhaps the description here is not accurate. Actually I've been struggling to come up with good names and description for this feature. Because even though the modes are called "flat" and "low priority" they are not tied to the priority of an actor. They may as well be called "select ctrl" and "select alt"...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A value of None
probably makes more sense as a default. I didn't do it like that because most of the actors are included in the "flat" mode and I wanted to spare some YAML lines...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the difficulty in describing this probably reflects that this isn't exposed to the yaml in the best way.
What if we changed the behaviour such that None
, the default, keeps things as they are on bleed. Then expose usefully named templates that can be inherited, e.g. Inherits@SELECTIONPRIORITY: ^SupportActorSelectionPriority
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it's probably not the best way to expose it in YAML. I am open to suggestions. However I don't understand the template and inheritance idea -- could you provide an example or point me to a similar implementation of another feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ^AutoTarget*
templates that most actors implement.
What's the status here @dragunoff? |
@pchote I definitely want to finish this. But it turned out to be more complex than I thought. I think this warrants some more discussion. The problem for me is that the modes are not tied to the selection priority, so calling them "flat" and "low priority" doesn't make sense... I thought about just calling them "default", "mode 1", "mode 2", "mode 3" and then let actors have different priority for each mode (falling back to the default priority). We can even let mods define the names for these modes and if the want to even use them. That would make the feature very flexible.
I'm not sure about the YAML notation, just trying to explain the idea. |
How important is the "low priority" modifier? Can we get most of the gameplay benefits without the complexity by ignoring all the per-actor definitions and implementing this as a global "ignore priority" modifier during selection? |
Yes, ignoring priority is fine - that way we can keep the normal priority based selection and introduce modified selections that force raise/lower the priority. The naming problem remains though. |
What is there to name at this point? We wouldn't need to expose anything to the mod rules. |
How are we going to then define which actors should be included in which selection? 🤔 I may be misunderstanding your idea... |
My suggestion was to have it include all actors that are controllable by the player. If we really do need a distinction for buildings we could call have something like "ValidForFlattenedPriority: (true|false)". |
Ah, I see - you suggest dropping the "low priority" mode entirely. I'd really like to make it work though |
My motivation with exploring these other options is so that we can find a way to get this merged in time for the playtest branching. |
8298ce9
to
8c3a6ae
Compare
Okay, so I have simplified this a little bit. And I'm finally (mostly) satisfied with the result. I have dropped the selection modes names from the C# code and just named the flags after the actual modifier keys ( I've also dropped my original idea for the "Low Priority" mode (where selection priority was honored) - now modifiers simply raise the selection priority to |
8c3a6ae
to
6c4b372
Compare
Rebased on latest bleed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you missed engineers (and thumpers?) in D2k. Looks good to me otherwise.
It is intentional as they don't have a lower selection priority in D2k. This should be tackled as part of #16662 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested in all the mods and the code looks fine
This is a proposed implementation of the modifiers discussed in #14694. It adds two modes that alter the priority calculation. The modes are activated by holding down modifiers keys when selecting by mouse dragging.
Two new fields are added to theSelectable
trait:-IncludeInSelectAllMode = true
-IncludeInSelectLowPriorityMode = false
One new field is added to
Selectable
:PriorityModifiers
with valid valuesNone
(default),Ctrl
andAlt
Using the new field I have impleted two selection modes as YAML templates. This is how they work:
^FlatSelectionMode
. Buildings are not included but would still be selected if there are no higher priority actors.Example use case: Retreating all of your units (combat and non-combat).
Example use case: Moving together a mixed group of units (combat and non-combat).
^LowPrioritySelectionMode
. This is added to all non-combat units.Example use case: Retreating non-combat units (harvesters or engies for example).
Example use case: Selecting low priority units among blobs (engies, harvesters, MCV).
Remarks: