spudde123/zig-sc2-template
Starter Starcraft 2 bot made in Zig to compete on the sc2ai ladder
Template for a Starcraft 2 bot for competing on sc2ai.net, written in Zig 0.14.1.
zig build run
. If you are using VS Code,
you can build and launch using the configs in the .vscode folder.
Debugging also works, for example with the VS Code configs or
with RemedyBG. Note that you need maps
placed in the correct folder inside your SC2 installation folder.
Make a folder called Maps
there if it doesn't exist, and download
some maps from
here.
To run a game on a specific map, you can write for example
zig build run -- --Map StargazersAIE
.zig build -Doptimize=ReleaseSafe
zig build -Dtarget=x86_64-linux -Doptimize=ReleaseSafe
. There is also a python script
that builds the executable and takes the files in the config
folder to the same zip
file, just in case you want to include some other files that your bot relies on.The examples folder includes some bots, one of which competes on the
sc2ai ladder. To quickly run for example the bot one_base_terran
you
can write zig build run -Dexample=one_base_terran
. zig build
builds your bot in src/main.zig
if you don't give it an example as a parameter.
Everything works on the SC2AI ladder without any customization, but locally you can change what the program does through command line parameters:
"C:/Program Files (x86)/StarCraft II"
for Windows,
"/Applications/StarCraft II"
for Mac and "~/StarCraftII"
for Linux.terran
, zerg
, protoss
, random
.very_easy
, easy
, medium
,
medium_hard
, hard
, harder
, very_hard
, cheat_vision
,
cheat_money
, cheat_insane
.random
, rush
, timing
, power
,
macro
, air
.Should have everything you need to start making a bot. Some things may still evolve but the data the user bot uses should remain stable. If you encounter some problems, you can join the SC2AI Discord and ask for help. Link is on the front page of sc2ai.net.