Good Evening,
I thought id pop in and just leave some notes, based on the chats here and my own tinkerings…
A) Getting My Engine to work,
I installed the dot net thing from this place:
I also have microsoft visual studio 2022 community edition installed, unsure if it helps
Everything happens from inside: 2024-Sproutopia-2024.0.1’s root folder,
I created startengine.bat:
@echo off
cd Sproutopia
dotnet run Sproutopia.csproj
This launches the engine, When the Engine is open, it waits for the next binding
B) The Visualiser
I created a second bat file, called startvisualiser.bat
@echo off
cd Visualiser
dotnet run visualiser.csproj
This opens the visualiser, which seems to run the game in real time
C) Java Script Bot (Could work for any)
I already have node installed from last year, you might want to install it if required.
I created a new folder called JSBOT inside
Then I copied the content of starterbot → JSBot into this new folder,
I also moved the contents of SRC into root and deleted src itself (This might not be needed),
Then I generated the Node Dependencies using npm i directly in the bot’s root folder,
Leaving me with:
Back in
2024-Sproutopia-2024.0.1’s root folder
I created another bat file runbot.bat containing:
cd ./JSBOT/
node index.js
pause
Opening this while the engine is running queues a bot up,
I changed my appsettings to run 4 bots from the get go.
So I run this bat 4 times,
If everything went well you can then run a game by opening the engine, visualizer and number of bots, :
And it looks something like:
Thats 6 command windows, 1 for the engine, one for the visualiser and one for each bot.
D) JS Bot Broken initially + Fix
My starterBot did not work immediately, I got an error:
“Error connecting: Error: Failed to invoke ‘Register’ due to an error on the server. InvalidDataException: Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked.”
This has been an issue that I have had for the last 3 years, I have not looked at fixing it,
It could very well be environment.
But what I did do to resolve the issue is update the token generation from:
const token = process.env.Token ?? process.env.REGISTRATION_TOKEN;
to
const token = process.env[“REGISTRATION_TOKEN”] ?? createGuid();
and added a function:
function createGuid () {
return “xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx”.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c === “x” ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
That manually generates a Token, cause the original function fails for me,
Thats the issues I experienced, as well as the fix (That I have been carting along for the last 3 years.
Maybe this helps some people get started, or deal with that annoying JavaScript Bot Bug.
Thats my whole setup, From Here, Its AI time…