Opened 9 years ago

Closed 6 years ago

Last modified 6 years ago

#3239 closed defect (fixed)

[Formations] Testudo / Syntagma not working

Reported by: elexis Owned by: temple
Priority: Must Have Milestone: Alpha 23
Component: UI & Simulation Keywords:
Cc: Patch:

Description (last modified by elexis)

On an a18 match, the following error appeared:

First this warning on turn 7742

WARNING: JavaScript warning: simulation/components/Formation.js line 219
reference to undefined property this.memberPositions[entity]

with the following error on the same turn, every turn in 7742-7754 (except 7752 and 7753) and on turn 11854:

ERROR: JavaScript error: simulation/components/Formation.js line 219
TypeError: this.memberPositions[entity] is undefined
  Formation.prototype.GetFormationAnimation@simulation/components/Formation.js:219:6
  UnitAI.prototype.UnitFsmSpec.INDIVIDUAL.IDLE.enter@simulation/components/UnitAI.js:1405:7
  FSM.prototype.SwitchToNextState@simulation/helpers/FSM.js:376:1
  FSM.prototype.ProcessMessage@simulation/helpers/FSM.js:284:4
  UnitAI.prototype.OnMotionChanged@simulation/components/UnitAI.js:3803:63
ERROR: Script message handler OnMotionChanged failed

The other warnings and errors are known: On turn 615: #3187 On turn 12594: #3149

The error is reproducible by replaying the attached commands.txt

Attachments (3)

commands.txt_replaylog.7z (380.1 KB ) - added by elexis 9 years ago.
t3239_cc_1_commands.txt_map_and_log.7z (51.2 KB ) - added by elexis 9 years ago.
Use r16780 to replay.
grugnas_a21_formation_errors.jpg (221.6 KB ) - added by elexis 7 years ago.

Download all attachments as: .zip

Change History (13)

by elexis, 9 years ago

Attachment: commands.txt_replaylog.7z added

comment:1 by elexis, 9 years ago

This one attachment:t3154_commands.txt_replaylog_alternative2.7z:ticket:3154 also has this error in it on turn 5591.

This time the entity wanted to enter the WALKING state, not IDLE.

Turn 5591 (500)... WARNING: JavaScript warning: simulation/components/Formation.js line 219
reference to undefined property this.memberPositions[entity]
ERROR: Error in timer on entity 8338, IID 86, function TimerHandler: TypeError: this.memberPositions[entity] is undefined
  Formation.prototype.GetFormationAnimation@simulation/components/Formation.js:219:6
  UnitAI.prototype.UnitFsmSpec.FORMATIONMEMBER.WALKING.enter@simulation/components/UnitAI.js:1287:6
  FSM.prototype.SwitchToNextState@simulation/helpers/FSM.js:376:1
  FSM.prototype.ProcessMessage@simulation/helpers/FSM.js:284:4
  UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3473:39
  UnitAI.prototype.UnitFsmSpec.INDIVIDUAL.COMBAT.ATTACKING.Timer@simulation/components/UnitAI.js:1877:1
  FSM.prototype.ProcessMessage@simulation/helpers/FSM.js:274:29
  UnitAI.prototype.TimerHandler@simulation/components/UnitAI.js:3761:68
  Timer.prototype.OnUpdate@simulation/components/Timer.js:100:4

On turn 1155 #3154 happened, maybe that's relevant to this bug.

comment:2 by elexis, 9 years ago

This error is still occuring on r16780. cc_1 was kind enough to send a replay file and his custom map on which that error appeared.

Put the map into binaries/data/mods/public/maps/scenarios and replay the commands.txt file visually or non-visually.

The error is identical to the one above:

Executing turn 1253 of 2352
WARNING: JavaScript warning: simulation/components/Formation.js line 219
reference to undefined property this.memberPositions[entity]
ERROR: Error in timer on entity 500, IID 88, function TimerHandler: TypeError: this.memberPositions[entity] is undefined
  Formation.prototype.GetFormationAnimation@simulation/components/Formation.js:219:6
  UnitAI.prototype.UnitFsmSpec.INDIVIDUAL.IDLE.enter@simulation/components/UnitAI.js:1407:7
  FSM.prototype.SwitchToNextState@simulation/helpers/FSM.js:376:1
  FSM.prototype.ProcessMessage@simulation/helpers/FSM.js:284:4
  UnitAI.prototype.TimerHandler@simulation/components/UnitAI.js:3783:68
  Timer.prototype.OnUpdate@simulation/components/Timer.js:100:4

by elexis, 9 years ago

Use r16780 to replay.

comment:3 by elexis, 9 years ago

Priority: Should HaveMust Have
Summary: Formations - memberPositions[entity] is undefined when calling GetFormationAnimation for entity switching into idle stateFormations - Testudo / Syntagma not working

After analyzing the log of cc_1, I found a way to reproduce this error.

Reproduce (on current svn with disabled formations):

  1. Start a match with macedonian (roman) civ
  2. Enter the "i am too busy" cheat
  3. Produce 10 melee units at the CC
  4. Put them on syntagma (testudo) formation
  5. Move them somewhere (notice they actually are not information)
  6. Wait until they arrive or press H to stop them
  7. That error

On a18 I couldn't reproduce the error for now, since the units actually get into formation and stop properly.

comment:4 by Stan, 9 years ago

Summary: Formations - Testudo / Syntagma not working[Formations] Testudo / Syntagma not working

comment:5 by elexis, 9 years ago

Milestone: BacklogAlpha 19
Resolution: fixed
Status: newclosed

Fixed by r17028.

Next time formations are disabled temporarily, we need to make sure these formations are disabled too.

comment:6 by elexis, 7 years ago

Description: modified (diff)
Milestone: Alpha 19Backlog

In the attached Alpha 21 replay provided by Grugnas, we can see this exact stack

by elexis, 7 years ago

comment:7 by elexis, 7 years ago

Resolution: fixed
Status: closedreopened

comment:8 by temple, 6 years ago

Patch at Phab:D998.

comment:9 by temple, 6 years ago

Owner: set to temple
Resolution: fixed
Status: reopenedclosed

In 20956:

Fix formation animation warning

Differential Revision: https://code.wildfiregames.com/D998
Reviewed by: wraitii
Fixes: #3239

comment:10 by temple, 6 years ago

Milestone: BacklogAlpha 23
Note: See TracTickets for help on using tickets.