stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

6h 33m 21s logged

Reactor Devlog 1! :jamegam-yay:

Wait…. So what is Reactor?

Reactor is a tool to test bots made for Defector without having to publish your bot to the website and go through all that hassle.

What I’ve done in the first 6 hours

  • Installed mini_racer for python and wrote a basic function to take a .js script and run the bot function inside it.
  • Fixed a but with mini_racer lacking array.at() due to mini_racer using an outdated version of js by just defining it myself :)
  • Learned the basics of Textual for making TUIs in python
  • Made a cool TUI that allows you to start the reactor and then shows the statistics of the sim in a table. (see attached image)
  • fixed some misc bugs

Ok, now how does it actually work?

So basically, whenever I want to to play two bots against each other, I define a new mini_racer context with a modified version of their src (changed the export default with export default", "globalThis.botFunc = because otherwise mini_racer wouldnt be able to see it, and added a polyfill to the front of the script to define table.prototype.at()) and then evaluate the bot () function for both bots and simulate a match between them! I then just made a function to loop through each possible robot matchup and run the game of 100-150 rounds, and then delegated the whole thing to a thread so the UI could still render while it runs.

So What’s next?

  • Add the ability to get the bots on the leaderboard and play against them
  • Make some more simple bots
  • add misc features like better UI and the ability to select extra bots to add instead of just ones in the cache folder

See Ya Later!

- Elio :3

0
66

Comments 0

No comments yet. Be the first!