2019-12-07 08:22 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0005149Spring engineAIpublic2016-03-09 16:38
Assigned ToKloot 
Product Version101.0 
Target VersionFixed in Version101.0+git 
DescriptionNo more EVENT_ENEMY_CREATED / EVENT_ENEMY_FINISHED events regardless of Cheats::SetEventsEnabled value.
Steps To ReproduceListen to EVENT_ENEMY_CREATED / EVENT_ENEMY_FINISHED events in CppTestAI.
Game should not matter (though tested with ZK).
Add 2 bots (team 1 and 2), and give los vision of the enemy (spam solars inside enemy):
/give 10 armsolar 0

There will be no EVENT_ENEMY_CREATED / EVENT_ENEMY_FINISHED events. Enabling cheats won't help either:
Cheats* cheats = callback->GetCheats();
delete cheats;
Additional InformationBroken between 100.0.1-502-ga2f3526 and 101.0

100.0.1-501-g262dff8 half-works.
With cheat-events enabled both events work.
Without cheats - only EVENT_ENEMY_FINISHED is sent.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files




Kloot (developer)

weird, I do not see anything obviously wrong with the code.

can you verify that https://github.com/spring/spring/blob/develop/rts/ExternalAI/AICheats.cpp#L63 is reached, and that the AI wrapper object ( https://github.com/spring/spring/blob/develop/rts/ExternalAI/SkirmishAIWrapper.h#L100 / https://github.com/spring/spring/blob/develop/rts/ExternalAI/EngineOutHandler.cpp#L243 ) has the proper state?


lamer (reporter)

Will do more testing and report back...
(i hope it's not gcc's 5.3.0 fault, sorry if so)


lamer (reporter)

lolish mistake: https://github.com/spring/spring/blob/101.0/rts/ExternalAI/EngineOutHandler.cpp#L222
DO_FOR_ENEMY_SKIRMISH_AIS doesn't have chance to be executed

But second issue remains:
"With cheat-events enabled both events work.
Without cheats - only EVENT_ENEMY_FINISHED is sent."
Seems that check supposed to workaround but kinda not works: https://github.com/spring/spring/blob/101.0/rts/ExternalAI/EngineOutHandler.cpp#L43
On unit created IsUnitInLosOrRadarOfAllyTeam returns false (even when base full of enemy solars)


Kloot (developer)

hmm thanks.

second issue is older, it takes one SlowUpdate before all allyteams know the unit's LOS state.


lamer (reporter)

Fixed by https://github.com/spring/spring/commit/5fba31ab499163bd01bb3e77a265ff4f8cff4342

Though fix is unsafe: some potential dev may fall into this issue. I'd remove "return" from macros (invert logic and moar {}'s).

Not having EVENT_ENEMY_CREATED without cheats is probly not a big deal as EVENT_ENEMY_ENTER_(LOS|RADAR) can take care of that unit.

Can be closed

-Issue History
Date Modified Username Field Change
2016-03-07 15:53 lamer New Issue
2016-03-07 16:14 Kloot Note Added: 0016004
2016-03-07 16:14 Kloot Status new => feedback
2016-03-07 16:33 lamer Note Added: 0016006
2016-03-07 16:33 lamer Status feedback => new
2016-03-07 19:36 lamer Note Added: 0016013
2016-03-07 20:02 Kloot Note Added: 0016015
2016-03-09 15:50 lamer Note Added: 0016029
2016-03-09 16:38 Kloot Status new => resolved
2016-03-09 16:38 Kloot Fixed in Version => 101.0+git
2016-03-09 16:38 Kloot Resolution open => fixed
2016-03-09 16:38 Kloot Assigned To => Kloot
+Issue History