Python bot getting error with latest starter packl

Hi

I can’t tell if this is my code or the engine, I didn’t get this in the previous engine.
Can someone from the Entelect team please advise?

[ERROR] [Core]: Failed to run GameRunLoop with error: Collection was modified; enumeration operation may not execute.
[DEBUG] [Core]: at System.Collections.Generic.HashSet1.Enumerator.MoveNext() at System.Linq.Enumerable.All[TSource](IEnumerable1 source, Func2 predicate) at Engine.Services.WorldStateService.GenerateRandomPosition(Int32 lowerX, Int32 upperX, Int32 lowerY, Int32 upperY, ISet1 proximityPositions, Int32 minDistance, Boolean baseZone, Boolean nonBaseZone) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/WorldStateService.cs:line 391
at Engine.Services.WorldStateService.GenerateValidPosition(Int32 regionX, Int32 regionY, ResourceConfig config, ISet`1 proximityPositions) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/WorldStateService.cs:line 453
at Engine.Services.WorldStateService.GenerateMap() in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/WorldStateService.cs:line 617
at Engine.Services.WorldStateService.GenerateStartingWorld() in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/WorldStateService.cs:line 348
at Engine.Services.WorldStateService.Initialize() in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/WorldStateService.cs:line 442
at Engine.Services.EngineService.GameRunLoop() in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/EngineService.cs:line 50
at Engine.Services.SignalRService.b__7_1(Task task) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/SignalRService.cs:line 119
[ERROR] [Shutdown]: Shutting down due to a critical error

Good morning Styphoiz,

The team are looking into this.

I might just scrap my python bot and move back to JS, not really getting much joy from it :confused: even though it has some features I’m looking for, will try the python bot again next year or if i have some before the final event.

I’m getting this same error with my c# bot.

Assumed it was something weird on my side, but if other people are seeing it too it might be a bug in the runner…

I thought it was just me as well so ran my bot again against the previous starter pack and it ran fine, ran the JS version also against the new pack and that ran fine, thought I’d raise it anyway.

I think I’ve found the issue, in https://github.com/EntelectChallenge/2022-Arctica/blob/25308962439f385c02e04489d3607fff34c54a62/game-engine/Engine/Services/WorldStateService.cs#L398 positionsInUse was for some reason being modified while it was being iterated over, so I just made it so that is copied before iterating. I’m unable to replicate the issue on my side, could you possibly test the build that I made here? copy positionsInUse to prevent a modification while iteration · kobus-v-schoor/2022-Arctica@857308f · GitHub - downloadable at the bottom of the page. PS if you want to make sure I didn’t put in extra funnies here is the comparison between my branch and the main repo: Comparing EntelectChallenge:master...kobus-v-schoor:develop · EntelectChallenge/2022-Arctica · GitHub

@kobus-v-schoor spot on, that patch eliminates the issue for me. :tada:

Strange how not everyone is getting it, perhaps it is a timing thing and has something to do with when bots connect to the runner? :man_shrugging:

Ok great, I’ll open a PR - the piece of code that is causing the issue does have a random component to it, so that might have something to do with it not always triggering.

@Jako @Jenique I opened a PR few days ago to fix this bug (https://github.com/EntelectChallenge/2022-Arctica/pull/22), just want to make sure you guys don’t miss it

Thank you very much Kobus,
The team will get on it as soon as possible.

1 Like