Game Engine broken

So I decided to add a script to kill bash after my game runner ran due to tasks still running after the match was over, it was a simple script.

Taskkill /f /IM bash.exe /t

I seem to now be getting the below error while running the game engine, what did I break here exactly.
Player action:1:287
[INFO] [Core.StartGame]: Game starting in 4
[INFO] [Core.StartGame]: Game starting in 3
[INFO] [Core.StartGame]: Game starting in 2
[DEBUG] [Core.ConnectionState]: Connected
[INFO] [RunLoop]: Game Tick Time: 7047 milliseconds
[DEBUG] [Engine.ConnectionState]: Connected
[INFO] [Engine]: Tick: 0, Player Count: 4
[ERROR] [Core]: Failed to run GameRunLoop with error: Sequence contains no matching element
[ERROR] [Shutdown]: Shutting down due to a critical error
[ERROR] [Shutdown]: Shutting down before a winner was found. Informing the runner.
[ERROR] [Connections]: Engine informed of Disconnect. Reason: Shutdown called before a winner was found.
Disconnecting all clients and stopping
[DEBUG] [CloudCallback]: Cloud Callback called with Failed
[DEBUG] [CloudCallback]: Cloud Callback No-opped, Status: failed
Disconnected
[INFO] [Core]: Disconnecting…
Disconnected:
Disconnected:
Disconnected:
[2021-04-02T14:01:52.620Z] Information: Connection disconnected.
[INFO] [Disconnected]: Runner Invoked Disconnect
[INFO] [Core]: Disconnected from SignalR.
[DEBUG] [Remove Connection]: Removing Connection ID: ec3b54cc-a680-4cbe-b1a3-197f91293d4c for Bot Guid: K8KOlDy7V44iOiLtLvdiUw
[DEBUG] [ActiveConnections]: Active Connections Entry Count: 4
[DEBUG] [ActiveConnections]: Active Connections Post Removal Entry Count: 3
[DEBUG] [Remove Connection]: Removing Connection ID: 62dccb14-6ecb-4bf2-b2b8-c9760f1b4d1e for Bot Guid: RdHOuepK4CbJn51mjBugmQ
[DEBUG] [ActiveConnections]: Active Connections Entry Count: 3
[DEBUG] [ActiveConnections]: Active Connections Post Removal Entry Count: 2
[DEBUG] [Remove Connection]: Removing Connection ID: a90e0b2a-2395-4b05-b044-68b733f1d637 for Bot Guid: AsxBBW1PONvFraULjJdtHQ
[DEBUG] [ActiveConnections]: Active Connections Entry Count: 2
[DEBUG] [ActiveConnections]: Active Connections Post Removal Entry Count: 1
[DEBUG] [Remove Connection]: Removing Connection ID: 7e591e53-1ef2-452a-b7a3-9a45e512a524 for Bot Guid: _i3Qp-NbejEOlzwxq5gJng
[DEBUG] [ActiveConnections]: Active Connections Entry Count: 1
[DEBUG] [ActiveConnections]: Active Connections Post Removal Entry Count: 0
info: Microsoft.Hosting.Lifetime[0]
Application is shutting down…
Stopping.
[ERROR] [GameLog]: Runner disconnected. Informing Runner of failed connection.
Stopping.
Stopping.
[INFO] [Shutdown]: Shutting down Logger
$

Ok, I take that back, seems like the Game Engine is broken, got the same error again after restarting my pc.

[INFO] [Core.StartGame]: Game starting in 4
$ [INFO] [Core.StartGame]: Game starting in 3
[INFO] [Core.StartGame]: Game starting in 2
[DEBUG] [Core.ConnectionState]: Connected
[INFO] [RunLoop]: Game Tick Time: 7049 milliseconds
[DEBUG] [Engine.ConnectionState]: Connected
[INFO] [Engine]: Tick: 0, Player Count: 4
[ERROR] [Core]: Failed to run GameRunLoop with error: Sequence contains no matching element
[ERROR] [Shutdown]: Shutting down due to a critical error
[ERROR] [Shutdown]: Shutting down before a winner was found. Informing the runner.
[ERROR] [Connections]: Engine informed of Disconnect. Reason: Shutdown called before a winner was found.
Disconnecting all clients and stopping
[DEBUG] [CloudCallback]: Cloud Callback called with Failed
[DEBUG] [CloudCallback]: Cloud Callback No-opped, Status: failed
Disconnected
Disconnected:
[2021-04-02T14:07:37.625Z] Information: Connection disconnected.
Disconnected:
[INFO] [Core]: Disconnecting…
[INFO] [Disconnected]: Runner Invoked Disconnect
[DEBUG] [Remove Connection]: Removing Connection ID: 33888b06-49ae-400b-a714-1926aea790ac for Bot Guid: ugf-ul04QXd5UZKtqgmu1A
[DEBUG] [Remove Connection]: Removing Connection ID: ed0355ec-7d59-4530-ac90-2fdd684cf7db for Bot Guid: 36vqIvJKYHb05DNebf4JGQ
[DEBUG] [ActiveConnections]: Active Connections Entry Count: 4
[DEBUG] [ActiveConnections]: Active Connections Entry Count: 4
[DEBUG] [ActiveConnections]: Active Connections Post Removal Entry Count: 3
[DEBUG] [ActiveConnections]: Active Connections Post Removal Entry Count: 3
[INFO] [Core]: Disconnected from SignalR.
Disconnected:
[DEBUG] [Remove Connection]: Removing Connection ID: a5088f68-0e05-4230-8b81-1bdcd363697d for Bot Guid: iwccJatBxsIKAAKVxaHEDw
[DEBUG] [ActiveConnections]: Active Connections Entry Count: 3
[DEBUG] [ActiveConnections]: Active Connections Post Removal Entry Count: 2
Stopping.
[DEBUG] [Remove Connection]: Removing Connection ID: b5cd5c6d-7d88-4108-8f53-539fba54f4fe for Bot Guid: MSkVyEuaiH25SC2CHsSaaw
[DEBUG] [ActiveConnections]: Active Connections Entry Count: 2
[DEBUG] [ActiveConnections]: Active Connections Post Removal Entry Count: 1
info: Microsoft.Hosting.Lifetime[0]
Application is shutting down…
Stopping.
Stopping.
[ERROR] [GameLog]: Runner disconnected. Informing Runner of failed connection.
[INFO] [Shutdown]: Shutting down Logger

There doesn’t seem to be an Exception Log to share either.

Hi @styphoiz, we are going to look into this and will get back to your shortly!

Hi @nadine.jack

I have a feeling my code might have broken the engine, I tried reversing some of my last changes however it still seems broken.
I have done a commit to git for this and it looks like it’s broken on the player portal, I have reported it there if you need to check why that could be the case.

Hi @styphoiz,

We will look into the error on our side as well. Can you confirm if you are using the latest version of the engine? New Starter Pack Release: 2021.1.3

1 Like

Confirmed that I am.
I tested this with using 4 of the reference bots which looked to have ran ok as well.

2 Likes

Hi @styphoiz,

Thanks a ton for all the investigation and getting this to us.

You tried with 4 reference bots - I’m a bit unclear on the last bit. On your machine, with 4 reference bots, the match completes successfully?

It is only when your bot is in the mix that things start to get funny?

We are currently looking into this and will have something concrete to tell you early this week.

So in the run.sh file, there is a reference to 3 bots, I copied that line and added in a 4th bot to see if it was my bot that caused the issue or not.
This scenario allows the engine to run.

With the existing 3 bots and my bot, the game engine then crashes.

Alright, thanks for the information. We’ll get back to you as soon as we have any further information

Hi @James.Reynolds

I figured out how I broke the engine, it seems like the commands doesn’t like variables.
I tested this by changing all occurrences of gameAction to 1 which the engine accepted.

Sample code :

let gameAction = 0;
gameAction = 4;
_playerAction = {
PlayerId: _bot.id,
Action: gameAction,
};

ok, maybe it’s this, I see my first action on the bot is as below, I’ll fix this in my code, maybe reject this in the game engine.
For now, I’ve initialized my variable to 1.

Send Action {
PlayerId: ‘a3be5195-9e03-4510-9b9c-8d9ba7152a8a’,
Action: 0,
Heading: 207
}

Hey @styphoiz, thanks for all your assistance!

What language are you using? Variable substitution shouldn’t be the issue.

I will investigate with that payload and let you know once a fix is pushed

Hi @James.Reynolds I’m using javascript

Thanks @styphoiz,

You won’t see the issues if you keep that action value your bot sends within the range of known commands (1-4)
We have updated the github repo so long with a change that addresses this.

We are in the process of finalising another starter pack release soon which will also include a fix to prevent the engine from crashing when it gets an known command

1 Like