Opened 3 years ago

Closed 3 years ago

#6263 closed defect (fixed)

UnitAI formationcotroller is undefined

Reported by: Silier Owned by: Silier
Priority: Release Blocker Milestone: Alpha 25
Component: Simulation Keywords:
Cc: Patch: Phab:D4206

Description (last modified by Silier)

https://wildfiregames.com/forum/topic/41264-alpha-25-pre-releaserelease-candidate-build-testing/?do=findComment&comment=444687

ERROR: JavaScript error: simulation/components/UnitAI.js line 258 cmpControllerAI is null Order.FormationWalk@simulation/components/UnitAI.js:258:8

From replay by Freagarach:

ERROR: JavaScript error: simulation/components/UnitAI.js line 258 cmpControllerAI is null

Order.FormationWalk@simulation/components/UnitAI.js:258:8
FSM.prototype.ProcessMessage@globalscripts/FSM.js:265:17
UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3824:26
Order.Attack@simulation/components/UnitAI.js:402:16
FSM.prototype.ProcessMessage@globalscripts/FSM.js:265:17
UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3824:26
Order.Attack@simulation/components/UnitAI.js:402:16
FSM.prototype.ProcessMessage@globalscripts/FSM.js:265:17
UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3824:26
Order.Attack@simulation/components/UnitAI.js:402:16
FSM.prototype.ProcessMessage@globalscripts/FSM.js:265:17
UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3824:26
Order.Attack@simulation/components/UnitAI.js:402:16
FSM.prototype.ProcessMessage@globalscripts/FSM.js:265:17
UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3824:26
Order.Attack@simulation/components/UnitAI.js:402:16
FSM.prototype.ProcessMessage@globalscripts/FSM.js:265:17
UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3824:26
Order.Attack@simulation/components/UnitAI.js:402:16
FSM.prototype.ProcessMessage@globalscripts/FSM.js:265:17
UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3824:26
Order.Attack@simulation/components/UnitAI.js:402:16
FSM.prototype.ProcessMessage@globalscripts/FSM.js:265:17
UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3824:26
Order.Attack@simulation/components/UnitAI.js:402:16
FSM.prototype.ProcessMessage@globalscripts/FSM.js:265:17
UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3824:26
Order.Attack@simulation/components/UnitAI.js:402:16
FSM.prototype.ProcessMessage@globalscripts/FSM.js:265:17 UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3824:26
Order.Attack@simulation/components/UnitAI.js:402:1
FSM.prototype.ProcessMessage@globalscripts/FSM.js:265:17
UnitAI.prototype.FinishOrder@simulation/components/UnitAI.js:3824:26
enter@simulation/components/UnitAI.js:2196:15
FSM.prototype.SwitchToNextState@globalscripts/FSM.js:366:14
FSM.prototype.ProcessMessage@globalscripts/FSM.js:274:8
UnitAI.prototype.ProcessMessage@simulation/components/UnitAI.js:4277:15
Attack.prototype.StopAttacking@simulation/components/Attack.js:526:14
Resistance.prototype.OnOwnershipChanged@simulation/components/Resistance.js:181:62

ERROR: Script message handler OnOwnershipChanged failed

Attachments (1)

commands.txt (26.8 KB ) - added by Silier 3 years ago.
by Freagarach

Download all attachments as: .zip

Change History (5)

by Silier, 3 years ago

Attachment: commands.txt added

by Freagarach

comment:1 by Silier, 3 years ago

Description: modified (diff)

comment:2 by Silier, 3 years ago

looks like attack was pushed several times before formationwalk and by the time it got back to the order formation was not more existing

comment:3 by Silier, 3 years ago

Owner: set to Silier
Patch: Phab:D4206

comment:4 by Silier, 3 years ago

Resolution: fixed
Status: newclosed

In 25845:

Reject FormationWalk if entity is not part of formation anymore

Attack orders can be and looks like are pushed in front of formationwalk order.
That is generally also logic in single entity behaviour.

In case formation gets destroyed and then target dies, attacker is supposed to stop attacking target immediately.
That essentially leads to getting to old formationwalk command, what was not issue for packable units until rP24895, that introduced formationcompoennt into the order.

Hovewer abandoning this order without being in formation makes more sense. Probably this one and FormationLeave should be FORMATIONMEMBER specific commands and error out in INDIVIDUAL state, but thats too much refactoring and potential rabbit hole.

Differential revision: D4206
Reviewed by: @wraitii
Accepted by: @asterix
Fixes: #6263

Note: See TracTickets for help on using tickets.