Page 1 of 1

[boskid][1.1.80] Crash shortly after loading save (Commandable::findDistraction)

Posted: Mon Apr 17, 2023 8:36 am
by UberKitten
I've been having this crash happen consistently within ~60 minutes of gameplay. With my recent auto-save the crash is consistent with no user input in about 5 seconds after the save is loaded.

Relevant lines from exception stack trace:

Code: Select all

c:\tmp\factorio-build-1kjbgw\src\ai\commandable.cpp (282): Commandable::findDistraction
c:\tmp\factorio-build-1kjbgw\src\ai\commandable.cpp (199): Commandable::runBehavior
c:\tmp\factorio-build-1kjbgw\src\ai\unitgroup.cpp (286): UnitGroup::update
c:\tmp\factorio-build-1kjbgw\src\ai\commander.cpp (243): Commander::update

Re: [boskid][1.1.80] Crash shortly after loading save (Commandable::findDistraction)

Posted: Mon Apr 17, 2023 2:11 pm
by boskid
Thanks for the save file, by being able to consistently reproduce the issue i was able to narrow down what the issue is. There are layers of moving pieces involved, the core of the issue is that mod Rampant is setting composite command with a Flee+Group command making a unit not yet member of a unit group, but later when the unit group becomes dead, the unit joins a dead unit group causing various consistency issues, the main one was that unit group had no command set and the Commandable::findDistraction was trying to use the command causing a crash. The way the unit group was becoming dead is also really tricky stuff because the group was dying as the attack_area command was being set because that command requires AttackBehavior and GotoBehavior but when GotoBehavior was querying the AI pathfinder it was rejected causing the GotoBehavior to immediately fail causing the group to be destroyed. For 1.1.81 i made a fix that when a Group command activates in the composite command, it verifies that the unit group is still alive before spawning a GroupBehavior.

Re: [boskid][1.1.80] Crash shortly after loading save (Commandable::findDistraction)

Posted: Mon Apr 17, 2023 5:46 pm
by UberKitten
Thanks for the write-up! I was (un)lucky to get the reproducible crash, glad it helped pinpoint the issue.