rlcevg / CircuitAI

Spring RTS local native AI
GNU General Public License v2.0
18 stars 19 forks source link

Circuit crash #53

Closed GoogleFrog closed 7 years ago

GoogleFrog commented 7 years ago

https://github.com/ZeroK-RTS/CrashReports/issues/1495

rlcevg commented 7 years ago

[f=0013959] [GlobalLosActionExecutor] global LOS toggled for all allyteams

It was a bad idea to poke and pry AI's busyness.

(gdb) info line *0x6288158a
Line 75 of "C:/bob/devel/spring/spring/AI/Skirmish/CircuitAI/src/AIExport.cpp" starts at address 0x6288156b <handleEvent@12+123> and ends at 0x6288159b <handleEvent@12+171>.
(gdb) info line *0x62889917
Line 392 of "C:/bob/devel/spring/spring/AI/Skirmish/CircuitAI/src/circuit/CircuitAI.cpp" starts at address 0x628898f0 <circuit::CCircuitAI::HandleGameEvent(int, void const*)+416>
   and ends at 0x6288991a <circuit::CCircuitAI::HandleGameEvent(int, void const*)+458>.
(gdb) info line *0x62886969
Line 1154 of "C:/bob/devel/spring/spring/AI/Skirmish/CircuitAI/src/circuit/CircuitAI.cpp" starts at address 0x62886969 <circuit::CCircuitAI::RegisterEnemyUnit(int, bool)+713>
   and ends at 0x62886971 <circuit::CCircuitAI::RegisterEnemyUnit(int, bool)+721>.
rlcevg commented 7 years ago

Could be engine's bug.

rlcevg commented 7 years ago

AI API calls doesn't check globalLOS status, but engine sent enemy's event by globalLOS (like EnemyCreated that is not in real los). Either 1) AI should act like globalLOS doesn't exist (checking Unit::GetPos vs ZeroVector should work), or 2) engine's AICallback should learn about globalLOS. (2) looks better.

rlcevg commented 7 years ago

https://github.com/rlcevg/CircuitAI/commit/257c056b9b7bc88d9aab1e9a0169576c31b476b9 Fix: ignore EnemyCreeated event if AI can't get UnitDef.