#3086 closed defect (fixed)
[PATCH] Units stop attacking and errorspam for some formations
Reported by: | auron2401 | Owned by: | mimo |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 19 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | sanderd17 | Patch: |
Description (last modified by )
Reproduce steps: Have a formation (i reproduced using multiple groups of 50 in different formations - but works vs non such things as well) and press the stop button, units will stop attacking things, halt into a formation-looking shell, and stare the enemy into oblivion.
Symptoms: error spam, units stop attacking Affected formations: phalanx, skirmish, syntagma, testudo, wedge (see comment:7) Severity: recoverable Reproduce: See comment:6 Solution: Patch proposed in comment:7 and comment:9
Attachments (5)
Change History (25)
by , 9 years ago
Attachment: | commands.7z added |
---|
comment:1 by , 9 years ago
Also, I can reproduce locally. But the commands.txt above was done online. SBB was also getting errors.
comment:2 by , 9 years ago
This happened to me yesterday in a SVN 2v2 too. I sent 20 units and they were standing still and being slaughtered without attacking back.
by , 9 years ago
Attachment: | replay_log_auron.7z added |
---|
4MB or errors that occur when replaying auron's commands.txt
by , 9 years ago
Attachment: | commands.txt_replay_log_elexis.7z added |
---|
commands.txt & replay log of my match where I encountered the same bug
comment:3 by , 9 years ago
Moving units in formation, attacking, pressing stop button is not enough to reproduce this issue.
The error messages in the logs are not that useful (mostly UnitAI.order.data not found). This error appears on a timer call too. But I'm sure we can reproduce this issue soon. In my match I had some units with formation, some without.
comment:4 by , 9 years ago
In auron's logfile all errors appear in turn 2289-2302, in my logfile 1030-1072.
In my logfile I played as player 2 and the 19 units which probably caused the issue had the following entity numbers: 254,255,3865,3866,3867,3868,3869,3993,3994,3995,3996,3997,4069,4083,4255,4256,4257,4258,4259
comment:5 by , 9 years ago
In both logs, the errors appear when the 'Stop' command is issued (turn 2289 / 1030). Before that attack commands were issued for those entities.
comment:6 by , 9 years ago
Its the skirmish formation (available to ranged units only).
Steps to reproduce: -select ranged units -select skirmisher formation -attack unit or building (including to cause some damage) -hit H / Stop button -many errors appear
Notice that I didn't yet reproduce the issue of units not willing to fight in this situation!
Also: this error doesn't occur when I put diplomacy to neutral for both players.
comment:7 by , 9 years ago
Looking at the code (line 4306 of UnitAI.js), the problem should not be not specific to skirmish formations, but to all formations with CanAttackAsFormation=true. I've not looked at the formation code in UnitAI since quite some time, so I add sanderd17 in copy here, but the problem seems to come from the fact that the formation is still in the COMBAT.ATTACKING state while it has no more orders. Shouldn't a stop put the formation in IDLE state when no more orders ?
In addition, there is another potential problem in line 4199 of UnitAI.js, where the tested state should be "FORMATIONCONTROLLER.COMBAT.ATTACKING" and not ""FORMATIONCONTROLLER.ATTACKING"
comment:8 by , 9 years ago
Cc: | added |
---|
follow-up: 10 comment:9 by , 9 years ago
Stop should transition them into idle state and then the unit stance again should make them attack automatically (which doesn't seem to happen according to the bug description and i think in my match it happened too).
I tried multiple times but couldn't reproduce this issue with melee or other formation. With skirmisher formation it worked everytime.
comment:10 by , 9 years ago
Replying to elexis:
Stop should transition them into idle state and then the unit stance again should make them attack automatically (which doesn't seem to happen according to the bug description and i think in my match it happened too).
yes, but i'm not sure if it should be the IDLE state or the MEMBER state. But anyway, any state different from COMBAT.ATTACKING would solve the bug.
I tried multiple times but couldn't reproduce this issue with melee or other formation. With skirmisher formation it worked everytime.
have a look in simulation/templates:formations to see which one can attack as formation. It is only skirmish, wedge, phalanx, syntagma and testudo.
comment:11 by , 9 years ago
Unfortunately this bug can be used to jam the chat of all players until the affected units die.
comment:12 by , 9 years ago
Milestone: | Backlog → Alpha 19 |
---|
comment:13 by , 9 years ago
Summary: | Formations Error → Formations - Units shouldn't remain in ATTACKING state when having no orders |
---|
comment:14 by , 9 years ago
Milestone: | Alpha 19 → Alpha 20 |
---|
by , 9 years ago
Attachment: | commands.txt added |
---|
The bug still exists on r17091 and as mimo stated also occurs with other formations.
comment:15 by , 9 years ago
Component: | Core engine → UI & Simulation |
---|---|
Description: | modified (diff) |
Priority: | Should Have → Must Have |
Summary: | Formations - Units shouldn't remain in ATTACKING state when having no orders → Units stop attacking and errorspam for some formations |
(posted summary in the ticket description)
comment:17 by , 9 years ago
Keywords: | patch review added |
---|---|
Summary: | Units stop attacking and errorspam for some formations → [PATCH] Units stop attacking and errorspam for some formations |
Here is a patch which should fix the problems reported, but thorough tests would be welcomed. The units stopping the attack was (in my tests) due to the formation rearranging when one of their member dies which is not compatible with the attackAsFormation, so it is disabled in the patch when attackAsFormation.
by , 9 years ago
Attachment: | formationAttack.diff added |
---|
comment:18 by , 9 years ago
Your patch seems to work, although (without the previous commit and your patch) this error can be triggered without having anyone die.
comment:20 by , 9 years ago
Keywords: | review removed |
---|---|
Milestone: | Alpha 20 → Alpha 19 |
Commands.txt with error log.