View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0005149 | Spring engine | AI | public | 2016-03-07 15:53 | 2016-03-09 16:38 | ||||
Reporter | lamer | ||||||||
Assigned To | Kloot | ||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | 101.0 | ||||||||
Target Version | Fixed in Version | 101.0+git | |||||||
Summary | 0005149: EVENT_ENEMY_CREATED / EVENT_ENEMY_FINISHED never sent | ||||||||
Description | No more EVENT_ENEMY_CREATED / EVENT_ENEMY_FINISHED events regardless of Cheats::SetEventsEnabled value. | ||||||||
Steps To Reproduce | Listen 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): /cheats /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(); cheats->SetEnabled(true); cheats->SetEventsEnabled(true); delete cheats; | ||||||||
Additional Information | Broken 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. | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
![]() |
|
Kloot (developer) 2016-03-07 16:14 |
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) 2016-03-07 16:33 |
Will do more testing and report back... (i hope it's not gcc's 5.3.0 fault, sorry if so) |
lamer (reporter) 2016-03-07 19:36 |
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) 2016-03-07 20:02 |
hmm thanks. second issue is older, it takes one SlowUpdate before all allyteams know the unit's LOS state. |
lamer (reporter) 2016-03-09 15:50 |
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 |
![]() |
|||
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 |