Frequently asked questions
Getting started
- What is thebotslam?
thebotslam is a browser programming game: build robots from parts, code their brains, and win team games against other players' bots.
- Do I need to know how to code to play?
No coding experience is needed: the tutorial teaches you to write your first robot's brain in Python, and Blocks lets you code by dragging blocks.
- Is thebotslam free? What costs money?
Building, coding, test matches, ladder and friendly matches are free. Tournaments are $5 a team, and the winner takes 80% of the pot.
- Do I need an account, and how do I make one?
You need a free account to save designs and bots and to play other builders. Click Log in at the top right, then Create an account.
- Where are my designs, bots and code saved?
Designs, bots and teams are kept under your account on the server. Your code is saved as files on your own computer, never on thebotslam's server.
- Which browser should I use, and do I need to install anything?
thebotslam runs in your web browser with nothing to install. Chrome and Edge are best, because they can save your code straight to files on your computer.
- How does the tutorial work?
The Tutorial walks you through your first robot in about 20 minutes: build it in the Factory, code its brain in Python, and test it in the Test arena.
- Can I use feet and pounds instead of metres and kilograms?
Yes. Choose metric or imperial for how values are shown, and each program can say which units it's written in, so the game gives it feet or metres.
- What are the Factory, Brain code, Arena and League tabs for?
Build machines in the Factory, write and test their programs in Brain code, watch matches in the Arena, and play other builders in the League.
- How do I get my first bot into a match?
Build and save a design, build a bot, write and test its program, then submit it on the League's Ladder or enter a team in a tournament.
Building bots
- How do I build a bot in the Factory?
Put a chassis and parts on the Factory's build platform, save it as a design, then build a named bot from that design.
- What's the difference between a design, a bot and a team?
A design is a machine's parts, a bot is a named machine built from a design that runs your program, and a team is a set of your bots.
- Which chassis should I pick for which terrain?
Tracks, wheels, legs or flight: what each kind of chassis does on slopes, boulder fields, sand, mud and road, and how to compare them.
- How many parts can my bot carry?
Mounts decide how many sensors and tools fit on a chassis. Wheeled chassis and the hopper also have a weight limit, and every kilogram slows a bot.
- What do the sensors do?
What each sensor tells your bot: the scanner, rangefinder, GPS, radios, damage localizer, air radar and IR camera, plus the sensors every bot has built in.
- Which weapon should I start with?
Start with the WPN-1 pulse laser: instant, no ammunition and simple to aim. Move on to rockets, mortars and missiles once your bot finds targets reliably.
- Which engine and ROM should my bot have?
A bigger engine keeps a heavy bot quick but weighs more. A bigger ROM only gives your program more room. Here's how to choose both in the Factory.
- Can I change a bot after I've built it?
Yes. Change its design in the Factory and every bot built from it changes too. You can also rename a bot, load another program, or scrap it.
Languages and code
- Which programming languages can I write my bot's brain in?
Write your bot in Python, JavaScript, C++, Java, C#, Lua, BASIC, assembly or Scratch-style Blocks. Every one compiles to the same small bot CPU.
- Which language should I pick if I'm new to coding?
New to coding? Start with Python, the language the tutorial uses, or Blocks if you'd rather snap blocks together than type.
- Is it real Python? Which parts of Python can I use?
Bot Python is a subset of Python 3: real syntax and meaning, with numbers, fixed-size lists and functions, but no strings, classes, dicts or imports.
- Does my choice of language make my bot faster or slower?
Compiled languages get twice assembly's cycles and four times its memory, so a bot can do about as much in any league. Each language has its own ladder.
- What is the bot CPU, and why is there an assembly league?
Every bot runs on a small 32-bit CPU with eight registers and about 50 instructions, each with a fixed cycle cost. Assembly lets you program it directly.
- Can I use libraries, imports, strings or random numbers in my bot's code?
Your bot's code can only import the built-in bot module. There are no strings or random numbers: the bot CPU has no text, and matches are deterministic.
- How do the cycle, ROM and RAM limits on my bot's code work?
Each tick your bot gets a set number of CPU cycles, and its program must fit in ROM and RAM. Here's what happens when code runs long or grows too big.
- What happens when my bot's code has a compile error?
Brain code checks your program as you type and shows each error with its line number. A program that doesn't compile can't be entered on the League.
- Can I write my bot's code in my own editor or IDE?
Yes: download your language's API stubs from Brain code's API tab for autocomplete, docs and type checking in VS Code, PyCharm, IntelliJ and more.
Coding your bot
- How does my program talk to my bot's parts?
Each part sits on a numbered channel. Connect to it once at the top of your program, then set its commands and read its readings every tick.
- How do ticks, wait() and CPU cycles work in my bot's program?
A match runs in ticks, 20 a second. Each call to wait() ends your tick: commands go out and fresh readings come in. Each tick has a fixed cycle budget.
- Why does my bot just sit there and do nothing?
The usual causes: no wait() in the loop, a part on the wrong channel, a compile error, a command that's never set, or a crash that keeps restarting it.
- How do I make my bot turn to a heading and drive somewhere?
Set chassis.forward for throttle and chassis.turn for turn rate. Steer by the difference between where you want to face and chassis.heading.
- How do I find enemies with the scanner?
Point the scanner's 30° arc with scanner.sense, sweep it round, and read up to four contacts' bearings with scanner.ping(i) and scanner.bearing(i).
- How do I aim and fire my bot's laser?
Call laser.fire(bearing) when laser.ready is true. The turret turns to the bearing instantly, whichever way the chassis faces, and fires once.
- How do I keep my bot from driving into walls and obstacles?
Point a rangefinder ahead to see how far the nearest wall, block or bot is, and use a GPS to notice when you're stuck and back off.
- How does my bot know when it's been hit, and how much health it has left?
Read chassis.hull for your hull points and watch it drop to spot a hit. Add a damage localizer (DMG-1) to learn which side the hit came from.
- How do my bots share information with their teammates?
A radio (RAD-1) sends teammates up to four numbers and says where a teammate is. The team notepad is a shared text kept between matches.
- Does my code work in metres or feet?
Each program says its units in a line near its top. Metric programs get metres, imperial ones get feet. Angles, throttles and hull points never change.
Testing and debugging
- How do I test my bot before a real match?
Use the Test arena in Brain code: drag your bots onto a field, add terrain if you like, pick a game and click Run test to watch it play in the Arena.
- How do I see what my bot's program is doing?
Add log lines to your code and read them in Bot logs under the Arena, and check the compile status, Machine panel and Generated assembly in Brain code.
- What does "CPU fault, rebooting" mean, and how do I fix it?
Your bot's program crashed, for example by indexing outside an array. The CPU stalls a second and restarts it from the top. How to find the cause.
- How do I replay a match and step through it tick by tick?
Every match opens in the Arena: play, pause, drag the timeline, step one tick at a time, slow it down and jump to any hit from the Events list.
- Why did my bot lose, and how do I find out what went wrong?
Replay the match in the Arena: Events show each hit, Bot logs show what your bot thought and who hurt it. Then rebuild the moment in a test.
- What happens when my program runs out of cycles, and how do I make it faster?
Each tick gives your bot's CPU 256 cycles in assembly, 512 in other languages. Run out and the tick ends mid-code. How to measure and trim.
- How do I test my bot against other bots, like the house bots?
Put copies of your own bots, whole teams, or bots running a house bot's program into the Test arena, or challenge another player to a friendly match.
Teams and playing together
- How does a group of us build and code a bot team?
Your bots' code lives on your computer, so a group shares it with GitHub: everyone has a copy, pulls updates and pushes changes.
- How many bots can be on a team, and can I mix different machines?
A team is any set of your own bots, from any of your designs, each with its own program. Tournaments take up to 12 bots; total weight sets the class.
- Can I change my bots' code between matches?
On the ladder, submit a new version any time. A tournament entry keeps its programs: withdraw and re-enter before entries close to change them.
Matches, ladder and tournaments
- What are the game modes, and how do you win each one?
Last team standing, infiltrate and capture the flag: what wins each game, what happens at the time limit, and which games the League and tournaments use.
- How do I get my bot onto the League ladder?
Submit the bot open in Brain code from the League's Ladder, tick the games to enter, and the server plays rated series against bots in the same language.
- How are ratings calculated, and what does provisional mean?
Ladder bots and tournament teams are rated with Glicko-2: a rating plus a ± range. Provisional means the range is still wide, after few games or a change.
- How do tournaments work, and how do I win and get paid a prize?
Enter a team for $5 in a Novice, Intermediate or Open tournament, play a best-of-three bracket at Capture the flag, and the winner takes 80% of the fees.
- Can I watch matches live, and can I watch them again afterwards?
Watch ladder and friendly matches live with a 3-second delay, replay finished ones, and watch every tournament game with an account or an email link.
Can't find your question? Ask us.