View Issue Details

IDProjectCategoryLast Update
0025477AI War 2Crash/ExceptionAug 5, 2021 12:01 pm
ReporterDaniexpert Assigned ToChris_McElligottPark  
Severityminor 
Status resolvedResolutionfixed 
Product VersionBeta 3.503 Multiplayer Sound 
Fixed in VersionBeta 3.504 Multiplayer Achievements 
Summary0025477: Hit exception in RelentlessWaveLogic
DescriptionSee attachment
TagsNo tags attached.

Activities

Daniexpert

Aug 5, 2021 9:32 am

manager  

exceptionRelentlessWaveLogic.txt (1,410 bytes)   
8/5/2021 3:29:40 PM 3.503 SINGLEP DELAYED3: Hit exception in RelentlessWaveLogic LRP. debugCode 120 System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at Arcen.Universal.ArcenSparseLookup`2[K,T].SetItemForKey (K Key, T Item) [0x0001d] in <e6c263c3478540379b40cbd8b3af8103>:0 
  at Arcen.Universal.ArcenSparseLookup`2[K,T].set_Item (K key, T value) [0x00001] in <e6c263c3478540379b40cbd8b3af8103>:0 
  at Arcen.AIW2.External.SpecialFaction_RelentlessWaveLogic+<>c__DisplayClass13_1.<DoLongRangePlanning_OnBackgroundNonSimThread_Subclass>b__0 (Arcen.AIW2.Core.GameEntity_Squad entity) [0x00302] in <fbc92d115f3d40dc9fcb12b8381cd65c>:0 
  at Arcen.AIW2.Core.EntityCollection.DoForEntities (Arcen.AIW2.Core.GameEntity_Squad+ProcessorDelegate Processor) [0x0004d] in <da12c8ad86e4427c9c029187bdba6942>:0 
  at Arcen.AIW2.Core.Faction.DoForEntities (Arcen.AIW2.Core.GameEntity_Squad+ProcessorDelegate Processor) [0x00033] in <da12c8ad86e4427c9c029187bdba6942>:0 
  at Arcen.AIW2.External.SpecialFaction_RelentlessWaveLogic.DoLongRangePlanning_OnBackgroundNonSimThread_Subclass (Arcen.AIW2.Core.Faction faction, Arcen.AIW2.External.ArcenLongTermIntermittentPlanningContext Context) [0x000b5] in <fbc92d115f3d40dc9fcb12b8381cd65c>:0 

BadgerBadger

Aug 5, 2021 10:42 am

manager   ~0062609

Do you have dlc3 enabled?

Daniexpert

Aug 5, 2021 10:46 am

manager   ~0062611

Last edited: Aug 5, 2021 10:47 am

Yes, it's the same game of the other reports.

Chris_McElligottPark

Aug 5, 2021 11:20 am

administrator   ~0062613

Fixed the end issue, but I think there is also a more core issue. Going to look at that.

* Making assignments into ArcenSparseLookups is now notably more efficient, and also no longer carries the risk of an exception in SetItemForKey().
** That said, anyone who got an exception in SetItemForKey() probably had a threading issue as well, so it's not an exception that was hit frequently.

Chris_McElligottPark

Aug 5, 2021 11:22 am

administrator   ~0062614

Yep, okay, I see the problem. There are two factions with the same type of class on them. Border aggression and relentless waves. It's running the same logic at the same time on two different threads because of that, and this is what led to the error in question. There are several possible solutions, but the first one is to make sure that this either throws an error or works properly. This is something a modder or similar could run into easily.

Chris_McElligottPark

Aug 5, 2021 12:01 pm

administrator   ~0062615

Okay, here's the real solution:

* Previously, if two factions had the same SpecialFactionType, then they would not run their long-range-planning at the same time. This has been sufficient until now, but was an accidental programmer trap at the same time.
** If there were two different SpecialFactionTypes that used the same external code implementation (there are many valid reasons to do this), then they WOULD run at the same time, on two threads, and wreak a ton of problems.
** Now this is based around the type of the externa code implementation rather than the SpecialFactionType, since that is more exclusive and solves the issue.

Badger, this is something where those two factions were clashing, and the exception he got was a cross-threading type one. I have verified that the threads no longer run at the same time in a save that was having the same issue. This was a time bomb, and if you had any strange behaviors from your new stuff, this is why. But it's all set now.

Issue History

Date Modified Username Field Change
Aug 5, 2021 9:32 am Daniexpert New Issue
Aug 5, 2021 9:32 am Daniexpert File Added: exceptionRelentlessWaveLogic.txt
Aug 5, 2021 10:42 am BadgerBadger Note Added: 0062609
Aug 5, 2021 10:46 am Daniexpert Note Added: 0062611
Aug 5, 2021 10:47 am Daniexpert Note Edited: 0062611
Aug 5, 2021 11:20 am Chris_McElligottPark Note Added: 0062613
Aug 5, 2021 11:22 am Chris_McElligottPark Note Added: 0062614
Aug 5, 2021 12:01 pm Chris_McElligottPark Assigned To => Chris_McElligottPark
Aug 5, 2021 12:01 pm Chris_McElligottPark Status new => resolved
Aug 5, 2021 12:01 pm Chris_McElligottPark Resolution open => fixed
Aug 5, 2021 12:01 pm Chris_McElligottPark Fixed in Version => Beta 3.504 Multiplayer Achievements
Aug 5, 2021 12:01 pm Chris_McElligottPark Note Added: 0062615