Closed kobus-v-schoor closed 2 years ago
Actually, now that I look at it looks like just replacing the return
with a continue
should do the trick, since if the actions are not added to independentPlayerActions
or groupedPlayerActions
they don't get executed, but the action will still get removed in the loop foreach (var playerAction in actionsToComplete)
- I'll update my existing PR with the fix
Hi, I see this issue is still present in the latest release - just a heads up to fix it.
In the following loop there is a return statement that, when triggered, causes the engine to altogether stop processing commands from all bots. This can be triggered when a bot sends two units to build on the same node, but when the second unit starts building the node is no longer available, causing
worldStateService.GetNode
to return null. Thereturn
on line 315 then triggers, and the rest of the actions don't get processed, leading to units never being returned to the available pool of units and eventual widespread deaths.https://github.com/EntelectChallenge/2022-Arctica/blob/25308962439f385c02e04489d3607fff34c54a62/game-engine/Engine/Services/EngineService.cs#L298-L316
The action must first be partially processed (even if invalid) so that the units get returned to the available pool, and then removed.