Release 2022.3.1 · EntelectChallenge/2022-Arctica

Thanks EC team for the new release! Looks like a ton of work went into it, looking forward to exploring the new game mechanics. The new territory claiming feature looks great.

Would it maybe be possible to extend the deadline from the 20th till the 22nd? Then we have an extra weekend to work on our bots (not sure how this impacts the EC team?)

1 Like

Hi @Jordan,

I just downloaded the latest engine and tried to run a match. I didn’t have any issues on the previous version, but the game engine is now crashing.

Any idea what could cause this? I haven’t had a chance to try and debug it in detail yet, but I figured it’s worth flagging so long.

[DEBUG] [Core]:    at Engine.Services.TerritoryService.CreateNewLand(BotObject bot, Position position) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/TerritoryService.cs:line 128
   at Engine.Services.TerritoryService.<>c__DisplayClass15_0.<AddBuildingTerritory>b__1(Position position) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/TerritoryService.cs:line 113
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at Engine.Services.TerritoryService.AddBuildingTerritory(BotObject bot, BuildingObject building) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/TerritoryService.cs:line 113
   at Engine.Services.TerritoryService.AddBuilding(BotObject bot, BuildingObject building) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/TerritoryService.cs:line 96
   at Engine.Handlers.Actions.BuildActionHandler.ProcessActionComplete(Node node, List`1 playerActions) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Handlers/Actions/BuildActionHandler.cs:line 93
   at Engine.Services.EngineService.SimulateTickForBots(IList`1 bots) in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/EngineService.cs:line 427
   at Engine.Services.EngineService.ProcessGameTick() in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/EngineService.cs:line 193
   at Engine.Services.EngineService.GameRunLoop() in /home/runner/work/2022-Arctica/2022-Arctica/game-engine/Engine/Services/EngineService.cs:line 83
   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
[ERROR] [Shutdown]: Shutting down before a winner was found. Informing the runner.

Hey there, @rfnel , thanks for flagging the issue.
I’ve had a look where it is breaking, TerritoryService.cs, line 128. What confuses me is that is a simple return statement… :joy:

Could you dig a bit deeper and try and find what type of exception is coming through? I’ll definitely need a bit more information to work with.

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.

1 Like

I’m experiencing the same. The engine crashes at that cast.

2 Likes

I think I’m making some progress on tracking the issue down, in CreateNewLand the call var containedNode = worldStateService.NodeByPosition(position) returns null just before it crashes on my side (even with a seemingly valid position). Not sure why the stacktrace only fails at the return (maybe some weird dotnet optimization?)

Got this error as well, going back to previous version to at least completed training.

Can the Entelect team also fix the ReadMe documentation, the documentation is not fully complete, like how to build (Kobus assisted me with this).
Where can roads be placed?
Where can Outposts be placed?

@rfnel I think I’ve sorted out the casting error, the json serializer was checking for circular references and the Position model’s equality method didn’t check if the passed object’s type was correct. Maybe some of you can test out the patch so long? The starter pack can be downloaded here (bottom of the page): Fix casting error when serializing bot objects · kobus-v-schoor/2022-Arctica@e395bf0 · GitHub

2 Likes

I think I’ve found a fix for the other issue as well. Like I mentioned in my previous post, the NodeByPosition call can return null which causes the crash. Turns out the node positions that are returning null are the positions of scout towers. Not sure why the scout tower positions are considered for the territory claims as well, but by checking if the node is null before continuing the crash is prevented.

@Jordan I’ve opened a PR with the fix (https://github.com/EntelectChallenge/2022-Arctica/pull/25) - for those that want to start developing so long with the fixes in place, you can download the fixed starter pack here: Release p3-crash-fix · kobus-v-schoor/2022-Arctica · GitHub - if you want to compare my code to the main engine you can use this link: Comparing EntelectChallenge:master...kobus-v-schoor:p3-crash-fix · EntelectChallenge/2022-Arctica · GitHub

2 Likes

I would even suggest the 27th.

I may be wrong with this perception, but the field feels smaller than it was a year ago. I worry announcing the final deadline a week before it happens, will put newcomers off entering again. Especially if they’ve sunk effort into their bots, and are now forced to ditch that or suddenly restructure their week.

The same is true for the rest of us, but at least we know this is unusual.

1 Like

I feel the 27th is good as well, this year does feel much different, awesome competition to enter however its does seem quite rushed this year with no proper plan of timelines, full rules or even match logs compared to previous years.

The 27th should give enough time to run the matches prior to acutal finals cut off which is 21st Septmeber.

2 Likes

@kobus-v-schoor @rfnel Thanks for the work guys! I’m having family lunch today so will be back this afternoon to have a good look at your suggested fixes. In the meantime, just some thoughts:

In my initial planning, scout towers weren’t meant to be part of claimable territory. It completely slipped my mind that the positions of the expanding territory would envelop the scout towers. Maybe there is a simple fix to exclude those parts of the map in the CreateNewLand method.

Regarding the Position.Equals method: I decided to have Land extend Position because I wanted to retain some of the Position based territory functionality as well as add on the more complex Land based stuff. I took out the Type comparison because I was having an issue where Position and Land were being compared and it was returning false even though they had the same positions. Maybe I just give the Land object a Position field instead of making it inherit the X and Y

2 Likes

I do not want to be that guy,

But my take is that the 22nd (Monday) is best

From experience the team hardly ever ran the challenge matches on the Sunday.
So giving us the whole weekend before playoffs will be good.

**As one can see we still have some bugs that might prevent matches being played.

For the sake of other contestants, I feel the 27th or even 29th could be a bit of a stretch.
Myself, I would prefer the 27th. Just incase I need the time.

I am fortunate that I can spend a bit of time on my entry this comming week and Im fairly happy with what I have already.
But territory could be a very big part of the match.

Anyways, my point is:
Playoffs will be on 24 September.
If we have the Event start on 27 August, Playoffs start on 29 August.
Playoffs will likely last 1 week,

That means we will likely know the other 6 contestants on 5 September

If its stretched too late people might have issues with transportation, accommodation and even Comic Con Tickets for their +1’s

Now if I already lives in Johannesburg, This would not be an issue. But Im not.
If i wasnt fortunate to get a Golden ticket,

The 5th could have been a issue for me.
Anyways,

Im just thinking aloud.

We have pressure from both sides:
On the One Side, Us contestants need to finalize our entries.
On the Other Side, Us Contestants need to make preparations.

Now if you have a Golden Ticket or already live close to the venue.
Then theres no issues at all.

But if you lived in say Capetown.
Then the whole dynamic changes.

So we have to keep this in mind.
And I am really in the group that will benefit most from more time to work on my entry.

But I cannot ignore the flip side either.

The question is: Will a week make a difference to arrangements?
And I cant really answer that question.

I agree.

Due to time-constraints I almost didn’t enter at all this time round.

If there are breaking changes, a week is just too little time (IMO) to fix up existing bots and to build in new functionality. Anyone who’s unable to work on their bots this week is going to be at a horrible disadvantage, even if they had a pretty solid bot a week ago. The weekend of the 27th seems fair.

2 Likes

Though, The entry deadline will definately be linked to how long Bugs linger.

Perhaps the 27th will be best regardless.

Theres just too large a chance that we find a gamebreaking bug today and its fixed on Tuesday.

But yeah, I just do not want to ignore both sides.
**Far more people would be affected by a short deadline for their entry than would be affected by an Arrangement deadline.

We know that the 2 Golden ticket Holders are good.
From the next 6 it depends on if they are already in Johannesburg / Pretoria and can drive through.
From that perspective it could be better to add an extra week to the entry deadline.

Rock and a hard place.
Anyways, Will catch up later,

I need to start finalizing my territory upgrades AND start looking at my implementation for the new territory changes.

The implementation is very easy…
Deciding deciding when and where is a much bigger problem. Endgame will be quite interesting…

Well, Enjoy and Goodluck all.

1 Like

Random Question.

The rules mentions that there’s some form of Resource protection in your own territory,

Was this implemented and what is the impact of it?

From my side I would prefer the 27th as well. I am swamped with work this week and would probably not even get to Artica which would be sad since I had a winner bot in the the 2nd phase and would probably drop out in the finals if I dont get a chance to implement some of the new mechanics that has been released.

Truth be told I dont want it to end already, I would love to get more time on this challenge to test some crazy strats and have some fun before the finals.

I know everyone has their own concerns and things to consider so this is just my vote for the 27th but if the tournament date stands for this weekend I would accept it as such.

I would appreciate a deadline of midnight on Sunday 21 August so that the 3rd round can run on 22 August and we should know the top 8 before end of the month.
I am in the group of people that need flight and accommodation bookings if I made the top 8.

There is a third possibility,

I believe another user briefly brought it up in another forum.

If we have two problems:
A) Time to build VS
B) Knowing the top 8

We could consider running the top 8, but then allowing another 2 weeks for finalists to refine their entries.

This would also raise the level of entries we have this year.
As if everyone knows their definitely going they might just push in deep.

Neither of the above cases has much impact on me.

But it is true that we essentially would only have 1 week to integrate Territory.
Which is fine.

BUT… If your week is swamped…
Considering theres still engine breaking bots,

There is a case where some contestants will only have a weekend to work on territory.

**I personally dont feel territory has enough weight to alter the top 8 players much.
My event 2 entry that placed 5th didnt even beat my event 1 entry.

But thats because I completely misunderstood how the status Modifiers worked.

Anyways.

I would say given the overall situation.
It could be viable to establish the top 8 early, Leave a window for refinements as well.

Im working on the condensed visualiser now.
It seems my version cannot handle a 4V4 in a serious matchup anymore.

So I have to work on the condensed logs.
My plans for today is to finalize that visualiser and add the 2 buildings for the last event.

I already know what I want to do for territory.
And it does not alter my existing strategy much, I just need to hook it into my Unit Allocations and things should be awesome.

Territory is a dangerous game / balance.

Anyways, just my thoughts.
If we have two contrasting issues.
Why not try and satisfy both sides.

3 Likes

At this point, im comfortable with either date, my concern is the issues with the engine, I’ve moved back to previous engine and still testing against that without making any changes to cater for the new engine.

My concerns currently:
Is the engine going to be ready to run tests on it locally?
Is the engine going to accept our bots that are running on the previous version of the engine, I have seen my bot doing poorly when uploading, i don’t know what version is on the portal currently?