Opened 9 years ago
Last modified 3 years ago
#3210 new enhancement
[PATCH] Change unit stance without waiting another turn
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Backlog |
Component: | UI – In-game | Keywords: | patch, simple |
Cc: | Patch: |
Description
One should be able to change the unit stance (violent / aggressive / defensive ...) without waiting another turn. The icon in the HUD should be updated in the same turn (even before the message has made it into the simulation state). Even if the game is not laggy one can notice that the responsiveness could be improved. You never know for sure if the setting was saved until the next turn is reached. Consequently you wait instead of issuing more commands to other units.
Attachments (3)
Change History (11)
comment:1 by , 9 years ago
Summary: | Change unit stance before waiting another turn → Change unit stance without waiting another turn |
---|
by , 8 years ago
Attachment: | cacheHighlight.patch added |
---|
comment:2 by , 8 years ago
by , 8 years ago
Attachment: | cacheHighlight2.patch added |
---|
by , 8 years ago
Attachment: | cacheHighlight3.patch added |
---|
comment:3 by , 8 years ago
Sorry for all the bad patches !
This one (3) does work as far as i can tell. Although not very efficient.
comment:4 by , 8 years ago
Keywords: | patch added |
---|---|
Milestone: | Backlog → Alpha 21 |
Summary: | Change unit stance without waiting another turn → [PATCH] Change unit stance without waiting another turn |
Ticket: Since network lag won't disappear, it is nice to improve the responsiveness and update the GUI immediately instead of waiting if we know that the command will be executed as ordered. Besides the linked tickets, this is also the case for rallypoints, which are updated visually immediately instead of waiting for the simulation.
If the GUI doesn't respond immediately, players will suspect that the GUI didn't accept the command and click on it multiple times, just to be sure that it does what was ordered. That adds to frustration when experiencing lag.
The downside is that the simulation might reject the command and thus the GUI update had shown the wrong value. That's why these kinds of GUI responsiveness improvements should only be done when it is (typically) certain that the command will be executed if ordered.
Review:
Logic:
- The code doesn't save the formation / stance state on a per entity basis but only for the current selection. Once the selection is changed, the result is lost.
Coding style:
- L43 missing semicolon, use www.jshint.com to check for blatant syntax error like that
- abide the wiki:Coding_Conventions and f.e. use quotes for object properties (L39 and following)
if(
->if (
{
on a separate line- Not stated in the convention yet, but we prefer
let
instead ofvar
in function scope, as that is more strict with regards to scope issues. - unneeded variable
showHighlight
, inline that - Don't introduce trailing whitespace (including space in emptylines)
- L955, L969 unneeded emptyline
{
}
not needed if it only contains one statement- Don't add
TODO
s, we have tickets for that. - In
selection.js
you can likely just replace with an empty object{}
. - In my opinion it is nicer to compare with
==
instead of===
when possible.
Add yourself to programmers.json
and add the review
keyword to the ticket if you want the patch to be committed, see wiki:SubmittingPatches.
comment:5 by , 8 years ago
Milestone: | Alpha 21 → Backlog |
---|
comment:6 by , 5 years ago
Component: | UI & Simulation → In-game UI |
---|
Move tickets to In-game UI
as UI & Simulation
got some sub components.
comment:7 by , 3 years ago
Keywords: | simple removed |
---|---|
severity: | → simple |
comment:8 by , 3 years ago
Keywords: | simple added |
---|
Whoops. Didn't realize that the references wouldn't be the same. Ignore first patch