View Issue Details

IDProjectCategoryView StatusLast Update
0006065Spring engineGeneralpublic2018-11-16 18:34
ReporterGoogle_Frog Assigned ToKloot  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version104.0 +git 
Summary0006065: 104.0.1-869-g204d265 maintenance Formation move regression
DescriptionThe removal of SET_WANTED_MAX_SPEED appears to have an associated regression regarding queuing multiple different wanted speeds. A proper removal of SET_WANTED_MAX_SPEED may involve adding a parameter to most commands which sets the wanted speed of the unit. This solution seems worse than the original cludgyness of SET_WANTED_MAX_SPEED.
Steps To Reproduce * Spawn a fast unit and a slow unit (cloakraid and dyntrainer_support_base in this example).
 * Issue a Fight command with Ctrl (the move in formation and at the same speed modifier).
 * Issue a Fight command with Shift (the queue modifier).

The expected behaviour is for the units to move in formation and at the same speed to the first waypoint, then move at their maximum speed to the second. The observed behaviour is that the fast unit starts to move at its maximum speed, while executing the first command, when the second command is queued.
TagsNo tags attached.
Attached Files
screen00021.jpg (Attachment missing)
Checked infolog.txt for Errors

Activities

Kloot

2018-11-08 19:05

developer   ~0019498

fyi I don't see myself doing any of the potential solutions for a (long) while so you may have to reintroduce CMD_SWMS as a custom Lua command if formation speed mechanics matter in ZK.

Google_Frog

2018-11-09 01:17

reporter   ~0019503

Then can we (temporarily) have SET_WANTED_MAX_SPEED back? A custom command is likely to be even more terrible than the engine implementation of SET_WANTED_MAX_SPEED.

Alternately, I request a way for LuaUI to set the wanted max speed of a unit. Something happens when units are issued a Fight+Ctrl order which (looking at the changelog) I see no way for luaUI to emulate.

Google_Frog

2018-11-09 02:57

reporter   ~0019504

Another factor to take into account is that the removal of SET_WANTED_MAX_SPEED seems to have broken CircuitAI. See https://github.com/rlcevg/CircuitAI/issues/91

Kloot

2018-11-09 13:53

developer   ~0019505

For formation orders specifically you can detect when a move/fight command has the control-bit (options.ctrl) and handle speed control in a gadget, though this might require a small engine change to allow overriding the default group-move regulator.

AI's can also send control-bit orders so repairing Circuit shouldn't be a major obstacle.

Google_Frog

2018-11-11 11:05

reporter   ~0019510

Well, here is a gadget which implements the engines current behaviour for Fight: https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaRules/Gadgets/unit_wanted_speed.lua

All commands cause the gadget to re-sets maxWantedSpeed because almost all commands seem to cause the engine to un-set maxWantedSpeed. Could commands registered as CMDTYPE.ICON_MODE be made to not affect maxWantedSpeed? Another solution would be to let lua determine which commands affect maxWantedSpeed.

Kloot

2018-11-11 22:39

developer   ~0019521

I'll probably just make the engine system opt-out with a blanket switch.

Kloot

2018-11-16 18:32

developer   ~0019551

Fix 39d5e927a0de3029968460de82d801491e5ff7f4 committed to develop branch: fix 0006065
MoveCtrl.Set*MoveTypeData(..., "useWantedSpeed[0]", false) disables engine wanted-speed changes for individual orders
MoveCtrl.Set*MoveTypeData(..., "useWantedSpeed[1]", false) disables engine wanted-speed changes for formation orders, repo: spring changeset id: 11140

Kloot

2018-11-16 18:34

developer   ~0019553

Fix f2746effb4a091054aa2f1797376f37ff3451bcc committed to maintenance branch: fix 0006065
MoveCtrl.Set*MoveTypeData(..., "useWantedSpeed[0]", false) disables engine wanted-speed changes for individual orders
MoveCtrl.Set*MoveTypeData(..., "useWantedSpeed[1]", false) disables engine wanted-speed changes for formation orders, repo: spring changeset id: 11142

Issue History

Date Modified Username Field Change
2018-11-08 01:33 Google_Frog New Issue
2018-11-08 01:33 Google_Frog File Added: screen00021.jpg
2018-11-08 19:05 Kloot Note Added: 0019498
2018-11-09 01:17 Google_Frog Note Added: 0019503
2018-11-09 02:57 Google_Frog Note Added: 0019504
2018-11-09 13:53 Kloot Note Added: 0019505
2018-11-11 11:05 Google_Frog Note Added: 0019510
2018-11-11 22:39 Kloot Note Added: 0019521
2018-11-16 18:32 Kloot Changeset attached => spring develop 39d5e927
2018-11-16 18:32 Kloot Note Added: 0019551
2018-11-16 18:32 Kloot Assigned To => Kloot
2018-11-16 18:32 Kloot Status new => resolved
2018-11-16 18:32 Kloot Resolution open => fixed
2018-11-16 18:34 Kloot Changeset attached => spring maintenance f2746eff
2018-11-16 18:34 Kloot Note Added: 0019553