2019-08-20 01:25 CEST

View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0006065Spring engineGeneralpublic2018-11-16 18:34
ReporterGoogle_Frog 
Assigned ToKloot 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version104.0 +git 
Target VersionFixed in Version 
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.
Checked infolog.txt for lua Errors
Attached Files

-Relationships
+Relationships

-Notes

~0019498

Kloot (developer)

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.

~0019503

Google_Frog (reporter)

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.

~0019504

Google_Frog (reporter)

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

~0019505

Kloot (developer)

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.

~0019510

Google_Frog (reporter)

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.

~0019521

Kloot (developer)

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

~0019551

Kloot (developer)

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

~0019553

Kloot (developer)

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
+Notes

-Related Changesets
spring: develop 39d5e927
Timestamp: 2018-11-16 18:26:06
Author: Kloot
Details ] Diff ]
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
mod - rts/Game/SelectedUnitsAI.cpp Diff ] File ]
mod - rts/Sim/MoveTypes/HoverAirMoveType.cpp Diff ] File ]
mod - rts/Sim/MoveTypes/MoveType.cpp Diff ] File ]
mod - rts/Sim/MoveTypes/MoveType.h Diff ] File ]
mod - rts/Sim/MoveTypes/StaticMoveType.h Diff ] File ]
mod - rts/Sim/Units/CommandAI/CommandAI.cpp Diff ] File ]
mod - rts/Sim/Units/CommandAI/CommandAI.h Diff ] File ]
mod - rts/Sim/Units/CommandAI/MobileCAI.h Diff ] File ]
spring: maintenance f2746eff
Timestamp: 2018-11-16 18:26:06
Author: Kloot
Details ] Diff ]
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
mod - rts/Game/SelectedUnitsAI.cpp Diff ] File ]
mod - rts/Sim/MoveTypes/HoverAirMoveType.cpp Diff ] File ]
mod - rts/Sim/MoveTypes/MoveType.cpp Diff ] File ]
mod - rts/Sim/MoveTypes/MoveType.h Diff ] File ]
mod - rts/Sim/MoveTypes/StaticMoveType.h Diff ] File ]
mod - rts/Sim/Units/CommandAI/CommandAI.cpp Diff ] File ]
mod - rts/Sim/Units/CommandAI/CommandAI.h Diff ] File ]
mod - rts/Sim/Units/CommandAI/MobileCAI.h Diff ] File ]

+Related Changesets

-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
+Issue History