View Issue Details

IDProjectCategoryLast Update
0025637AI War 2Crash/ExceptionOct 15, 2021 9:57 am
ReporterBadgerBadger Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product VersionBeta 3.709 Upgrades And Serialization Fix 
Fixed in VersionBeta 3.710 Hotfixes Serialization and Performance 
Summary0025637: Exception in speed groups
DescriptionI had started a new game to test and saw a number of exceptions like this:
10/14/2021 8:07:03 PM 3.709 SINGLEP DELAYED149: Error in thread for execution context 'executionContext'
InvalidCastException
Specified cast is not valid.
===STACK FRAMES (with file info)===
FILE METHOD IL_OFFSET NATIVE_OFFSET LINE_NUMBER COLUMN_NUMBER
/home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/GameEntity/SpeedGroup.cs CheckForDestruction_HostOnly 62 184 1590
/home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/Faction/Faction.cs DoSpeedGroupLogic_HostOnly 57 115 40140
    <>m__3 56 135 0 0
/home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/World_AIW2.cs DoForFactions 21 61 3817 0
    DoWorldSecondLogic_FromSimBGThread 173 835 0 0
    DoWorld_Second_PerSecondLogic 102 307 0 0
    DoWorldStepLogic_ClientOrHost_FromSimBGThread 165 315 0 0
    Execute 224 488 0 0
===RAW STACK TRACE===
  at Arcen.AIW2.Core.SpeedGroup.CheckForDestruction_HostOnly () [0x0003e] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/GameEntity/SpeedGroup.cs:159
  at Arcen.AIW2.Core.Faction.DoSpeedGroupLogic_HostOnly () [0x00039] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/Faction/Faction.cs:4014
  at Arcen.AIW2.External.EntitySimLogicImplementation_BaseInfo+<DoWorldSecondLogic_FromSimBGThread>c__AnonStorey1C.<>m__3 (Arcen.AIW2.Core.Faction faction) [0x00038] in <700d1fdeb34641e089b71f554f869920>:0
  at Arcen.AIW2.Core.World_AIW2.DoForFactions (Arcen.AIW2.Core.Faction+ProcessorDelegate Processor) [0x00015] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/World_AIW2.cs:3817
  at Arcen.AIW2.External.EntitySimLogicImplementation_BaseInfo.DoWorldSecondLogic_FromSimBGThread (Arcen.AIW2.Core.ArcenClientOrHostSimContextCore Context) [0x000ad] in <700d1fdeb34641e089b71f554f869920>:0
  at Arcen.AIW2.External.EntitySimLogicImplementation_BaseInfo.DoWorld_Second_PerSecondLogic (Arcen.AIW2.Core.ArcenClientOrHostSimContextCore Context) [0x00066] in <700d1fdeb34641e089b71f554f869920>:0
  at Arcen.AIW2.External.EntitySimLogicImplementation_BaseInfo.DoWorldStepLogic_ClientOrHost_FromSimBGThread (Arcen.AIW2.Core.ArcenClientOrHostSimContextCore Context) [0x000a5] in <700d1fdeb34641e089b71f554f869920>:0
  at Arcen.AIW2.External.SimExecution.Execute () [0x000e0] in <700d1fdeb34641e089b71f554f869920>:0
  at System.Environment.get_StackTrace () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at Arcen.Universal.ArcenDebugging.ArcenDebugLog (System.String Message, Arcen.Universal.Verbosity Verbosity) [0x00012] in /home/arcengames_aiw-ultra/CodeCrossProject/ArcenUniversal/src/UtilityLibraries/ArcenDebugging.cs:258
  at Arcen.Universal.ArcenDebugging.LogException (System.Exception e, System.String message, Arcen.Universal.Verbosity verbosity) [0x001fe] in /home/arcengames_aiw-ultra/CodeCrossProject/ArcenUniversal/src/UtilityLibraries/ArcenDebugging.cs:565
  at Arcen.AIW2.External.SimExecution.Execute () [0x00000] in <700d1fdeb34641e089b71f554f869920>:0
  at Arcen.AIW2.External.ArcenClientOrHostSimPlanningContext.InnerRun () [0x00000] in <700d1fdeb34641e089b71f554f869920>:0
  at Arcen.AIW2.External.ArcenExecutionContext.InnerRun () [0x00000] in <700d1fdeb34641e089b71f554f869920>:0
  at Arcen.AIW2.External.ArcenThread.InternalActualThreadFunction () [0x00000] in <700d1fdeb34641e089b71f554f869920>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.Threading.ThreadHelper.ThreadStart () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
TagsNo tags attached.

Activities

BadgerBadger

Oct 14, 2021 10:11 pm

manager   ~0062936

And a seemingly related error:

10/14/2021 8:11:24 PM 3.709 SINGLEP Execute error in 'SaveGame': System.InvalidCastException: Specified cast is not valid.
  at Arcen.AIW2.Core.SpeedGroup.CheckForDestruction_HostOnly () [0x0003e] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/GameEntity/SpeedGroup.cs:159
  at Arcen.AIW2.Core.SpeedGroup.SerializeTo (Arcen.Universal.ArcenSerializationBuffer Buffer) [0x00015] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/GameEntity/SpeedGroup.cs:113
  at Arcen.AIW2.Core.Faction.SerializeFactionTo (Arcen.Universal.ArcenSerializationBuffer Buffer, Arcen.Universal.SerializationCommandType SerializationCmdType) [0x004f6] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/Faction/Faction.cs:738
  at Arcen.AIW2.Core.World_AIW2.SerializeWorldTo (Arcen.Universal.ArcenSerializationBuffer Buffer, Arcen.Universal.SpecialSerializationType SpecialSerialization, Arcen.Universal.SerializationCommandType SerializationType) [0x00463] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/GameState/World_AIW2.cs:1004
  at Arcen.Universal.World.SerializeTo (Arcen.Universal.ArcenSerializationBuffer Buffer, Arcen.Universal.SpecialSerializationType SpecialSerialization, Arcen.Universal.SerializationCommandType SerializationType) [0x0039d] in /home/arcengames_aiw-ultra/CodeCrossProject/ArcenUniversal/src/Logic/GameState/World.cs:440
  at Arcen.Universal.World.SaveWorldToDisk (System.String SaveName, Arcen.Universal.List`1[T] SavegameMetadata) [0x000ef] in /home/arcengames_aiw-ultra/CodeCrossProject/ArcenUniversal/src/Logic/GameState/World.cs:978
  at Arcen.AIW2.External.GameCommand_SaveGame.Execute (Arcen.AIW2.Core.GameCommand command, Arcen.AIW2.Core.ArcenClientOrHostSimContextCore context) [0x0002d] in <700d1fdeb34641e089b71f554f869920>:0
  at Arcen.AIW2.Core.GameCommand.Execute (Arcen.AIW2.Core.ArcenClientOrHostSimContextCore Context) [0x00061] in /home/arcengames_aiw-ultra/CodeMain/ArcenAIW2Core/src/Logic/Networking/GameCommand.cs:408
  at System.Environment.get_StackTrace () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at Arcen.Universal.ArcenDebugging.ArcenLog_InnerOnMainThreadOnly (System.String Message, Arcen.Universal.DebugLogDestination Destination, System.Boolean IncludeStackTrace, Arcen.Universal.Verbosity Verbosity, System.DateTime Timestamp) [0x00197] in /home/arcengames_aiw-ultra/CodeCrossProject/ArcenUniversal/src/UtilityLibraries/ArcenDebugging.cs:398
  at Arcen.Universal.ArcenDebugging.ArcenDebugLog (System.String Message, Arcen.Universal.Verbosity Verbosity) [0x00038] in /home/arcengames_aiw-ultra/CodeCrossProject/ArcenUniversal/src/UtilityLibraries/ArcenDebugging.cs:262

BadgerBadger

Oct 14, 2021 10:28 pm

manager   ~0062938

Last edited: Oct 14, 2021 10:29 pm

The problem seems to be this code:

in SpeedGroup.cs we have
        public Dictionary<int, LazyLoadSquadWrapper> EntityDict = new Dictionary<int, LazyLoadSquadWrapper>( 400 );

but in CheckForDestruction we say
            foreach ( KeyValuePair<int, GameEntity_Squad> kv in this.EntityDict )

mismatch of data types

Chris_McElligottPark

Oct 15, 2021 9:57 am

administrator   ~0062943

Thanks!

* Fixed a number of invalid cast exceptions and similar relating to the changes to SpeedGroup in the prior game. Essentially this made it so that you could not save, or really play all that long. Facepalm.

Issue History

Date Modified Username Field Change
Oct 14, 2021 10:08 pm BadgerBadger New Issue
Oct 14, 2021 10:08 pm BadgerBadger Status new => assigned
Oct 14, 2021 10:08 pm BadgerBadger Assigned To => Chris_McElligottPark
Oct 14, 2021 10:11 pm BadgerBadger Note Added: 0062936
Oct 14, 2021 10:28 pm BadgerBadger Note Added: 0062938
Oct 14, 2021 10:29 pm BadgerBadger Note Edited: 0062938
Oct 15, 2021 9:57 am Chris_McElligottPark Status assigned => resolved
Oct 15, 2021 9:57 am Chris_McElligottPark Resolution open => fixed
Oct 15, 2021 9:57 am Chris_McElligottPark Fixed in Version => Beta 3.710 Hotfixes Serialization and Performance
Oct 15, 2021 9:57 am Chris_McElligottPark Note Added: 0062943