That is very strange indeed. I’ll see what I can find, but that was the full stack trace from the console and since the game engine crashed completely, I don’t have a state file that I can review.
Is there any chance that the current version of the starter pack doesn’t contain the latest code?
Edit: @Jordan - I did some digging.
Two things I found that might help:
1 .) The previous version of the starter pack works perfectly; it runs to completion with the exact same bot.
2.) I committed my latest bot so that I can run on the portal - it worked fine on there as well. Is that running the latest engine?
Edit #2:
My bot was still using Position to track territory. I updated that to use the Land class instead, and that seemed to fix the issue. I honestly have no idea why though. However, while the game engine now runs all the way to round 2500, it crashes right at the end and doesn’t write the game logs to disk. The error is as follows:
Bot: b6eb7e30-ae7e-4d25-9a24-2e2b420a58c9
Bot: b2e313b1-bdf0-417d-a329-5d103626125c
fail: Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher[8]
Failed to invoke hub method 'GameComplete'.
System.InvalidCastException: Unable to cast object of type 'System.Collections.Generic.List`1[Domain.Models.Occupants]' to type 'Domain.Models.Position'.
at Domain.Models.Position.Equals(Object obj) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Domain/Models/Position.cs:line 31
at System.Collections.Generic.ObjectEqualityComparer`1.IndexOf(T[] array, T value, Int32 startIndex, Int32 count)
at System.Array.IndexOf[T](T[] array, T value, Int32 startIndex, Int32 count)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CheckForCircularReference(JsonWriter writer, Object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)
at GameRunner.RunnerHub.GameComplete(GameCompletePayload gameCompletePayload) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/GameRunner/RunnerHub.cs:line 207
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.ExecuteMethod(ObjectMethodExecutor methodExecutor, Hub hub, Object[] arguments)
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.<Invoke>g__ExecuteInvocation|16_0(DefaultHubDispatcher`1 dispatcher, ObjectMethodExecutor methodExecutor, THub hub, Object[] arguments, AsyncServiceScope scope, IHubActivator`1 hubActivator, HubConnectionContext connection, HubMethodInvocationMessage hubMethodInvocationMessage, Boolean isStreamCall)
[ERROR] [Core]: Failed to run GameRunLoop with error: An unexpected error occurred invoking 'GameComplete' on the server. InvalidCastException: Unable to cast object of type 'System.Collections.Generic.List`1[Domain.Models.Occupants]' to type 'Domain.Models.Position'.
ConState: Connected
ConState: Connected
Bot: b8855f50-dbdf-42b9-89ac-2d652491606f
Bot: b6eb7e30-ae7e-4d25-9a24-2e2b420a58c9
ConState: Connected
Bot: b2e313b1-bdf0-417d-a329-5d103626125c
[DEBUG] [Core]: at Microsoft.AspNetCore.SignalR.Client.HubConnection.InvokeCoreAsyncCore(String methodName, Type returnType, Object[] args, CancellationToken cancellationToken)
at Microsoft.AspNetCore.SignalR.Client.HubConnection.InvokeCoreAsync(String methodName, Type returnType, Object[] args, CancellationToken cancellationToken)
at Engine.Services.EngineService.GameRunLoop() in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/EngineService.cs:line 183
at Engine.Services.SignalRService.<Startup>b__8_1(Task task) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/SignalRService.cs:line 122
[ERROR] [Shutdown]: Shutting down due to a critical error
[INFO] [Shutdown]: Shutdown called with critical error, but a winner was already found. Moving on.