Guide: Getting the runner to work and adding your own bot

Hey all,

Know this is probably common knowledge to most but I’m feeling the guy I was when I first took this challenge might not have pushed through here.

I do not consider the setup as part of the AI development, so I feel guides of this nature is great.
I installed this on a completely new Windows 10 device.

There’s essentially 2 parts to this (Developing and Publishing)

Lets install the Requirements

Step 1: Install Git
https://git-scm.com/downloads
Role: Allows you to execute the scripts (sh files) as well as publish your bot

Step 2: Install .Net SDK 3.1.407


Role: Dependency of the Starter Pack Itself (I needed this specific version)

Also Install .Net SDK 5.0


Role: Dependency of the Starter Pack

Starterpack
I downloaded the starterpack release from here:

Extracted it and ran the “starter-pack/run.sh” file

If all goes well you should see a waiting for bots to connect,
You should see a “Connected Clients: 3, Target: 4”

This means you are good, the runner is just configured to use 4 bots and only 3 are linked up.
To get a match running, you can edit your run.sh file

You should see 3 lines:
cd ./reference-bot-publish/ && sleep 3 && dotnet ReferenceBot.dll &

You should add a 4th to get the bot running.

You also need to include the correct command for your own bot, Example:

Python should be something like:
cd ./my-python-bot/ && sleep 3 && python PythonStarterBot.py &

Have not tested but it looks right.

Small Note: in the “starter-pack/runner-publish” as well as “engine-publish” folders there is a file called appsettings.json where you find botCount. This is where you choose how many bots you wish to have in your match and this count should be equal to the amount of bots added to the “starter-pack/run.sh” file
You could also set an Environmental value (See James.Reynolds’ responce below)

With that done you can develop and run your bot.
We should have a visualizer soon.

Running matches leaves a GameStateLog log with the date of the match inside “starter-pack/logger-publish” , pretty hard to piece together.

Once complete you need to take the bot you built and publish it to Github.

I feel the Entelect Guide covers everything in that regard.

Once complete with the above I did install Github Desktop (https://desktop.github.com/), and I could commit and publish there with little issues (Basically Publishing to github is the equivalent of Submitting your bot)

I actually submitted by bot before I could get the Game Engine to run.

*I do not do this kind of development often.
But thought maybe this helps others out.

I remember the first year I partook It took me 2 weeks to get the starterpack to run (Space Invaders).
So wanted to get this as easy as possible for beginners and students who have no idea where to start.

The setup probably took me longer than I’m comfortable to admit but we all have strengths and weaknesses.

5 Likes

@WillieTheron Thanks for the great guide!

A couple things, please update the dependency in your post to Net 5 rather than Net Core 3.1.

Also, to update your bot count, you need to update that appsettings.json file in both “runner-publish” and “engine-publish” folders, OR set an environment variable on your machine BOT_COUNT=4, changing 4 to the number of bots you want in your match.

Just an upfront note: You can set as many bots as you like, but past about 20 bots, the logfiles start to get pretty large.

EDIT: Yes, the visualizer will be here soon!

Are you sure we need .net 5.0 though?

I installed .net 3.1 only on my device and it worked (Actually the starterpack asked for that version specifically)
It could be that windows 10 has .net 5.0 natively. But I dont think I installed that. I will add to probably install that as well,.

I made the other edits as well. Just know between docker and a few other Github readmes I went too deep down the rabbit hole…

Well, if it worked for 3.1 then great!

After digging a little deeper, you are right that 3.1 will work. It is just the build process that requires it, and that is already done in the starter pack.

2 Likes

I copied the line launching the reference bot in run.sh to get the fourth bot and got the following:

Issue seems to be with actually simulating to localhost:5000
Im uncertain if theres another requirement, or even a firewall on your end.

I also get that from time to time. Restarting the runner fixes it for me.
Depending on where you extracted those files, you could try running as administrator as well.

Hi @Feanor, thank you for posting and welcome to the Entelect Challenge.

When you see this again please try to open the runner url in a browser to ensure it is still running, as the message suggests the runner could have stopped during the registration process. Also please ensure that both the Game Engine and Game Logger are running before trying to connect with your bot.

Please let us know if this helps.

I think the issue has to do with Newtonsoft.Json.
In the docker for runner I get the following error:
Could not load file or assembly ‘Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’. The located assembly’s manifest definition does not match the assembly reference. (0x80131040)

I have it working now. Missed an install

2 Likes

Hi @Feanor, happy to hear you got it working! Thanks for the info regarding a solution.

I would just like to thank Willie, this is helpful, and would like to suggest to Entelect to add something similar to their top level readme.md file.

2 Likes