Bots
Computer players on the game's own engine, on the play page or from the command line: playing against one, writing one in JavaScript, bringing a BWAPI bot, bots for mods, and the reference.
A bot is a computer player somebody wrote. On the play page at
scmjs.dev/play, which runs StarCraft 1.16.1's own engine in
your browser, a bot takes a computer's seat against you. From a terminal,
scmjs bot plays bots on the same engine with no page open, against the
game's own computer players and against each other.
Two kinds of bot play here. One is written in JavaScript: a single file, with nothing to build. The other is a BWAPI bot in C++, the kind the StarCraft bot tournaments play, built from its source into one file.
| You want to | Start at |
|---|---|
| Play against a bot | Playing against a bot |
| Write a bot | A first bot: JavaScript, about fifty lines, playing within minutes |
| Play a BWAPI bot, yours or someone else's | Bringing a BWAPI bot |
| Make a bot for a mod | Bots for mods |
| Know what bots cannot do here yet | What is not there yet |
| Look something up | The short way and the interface underneath, the two references for JavaScript bots |
- Playing against a botOn the play page a bot is chosen where a computer player is: in a computer's row of the setup screen.
- A first botA bot in JavaScript is one ES module.
- Running a botA bot's file plays in two places: on the play page against you, and from a terminal against the game's computer and other bots.
- Bringing a BWAPI botBWAPI is the library the StarCraft bot tournaments are played with: a bot is C++ code that BWAPI calls every frame inside StarCraft 1.16.1.
- Bots for modsOn the play page and under scmjs bot run --mod, a bot plays a mod as it plays the game.
- How good the sample bots areVanta and Starter, two of the play page's own bots, played against the game's own computer as each race against each race, on Boxer, Challenger, Astral Balance, Lost Civilization and Fren…
- What is not there yetThese are the things a bot cannot do here yet, listed so that nobody plans around one.
- The short wayA module whose default export has onFrame and no create is written the short way.
- The interface underneathThe short way is built on this interface, and a bot may use it directly: a module whose default export has create is given the plain view and a list of orders, and keeps its own books.
- TrustA bot is a script.
- In the sourceFor developers.