• Atom Reaction
  • How to play
  • Strategy
  • Videos
  • Shorts
  • Tdm
  • Drills
  • Chess
  • About me
  • Projects
  • Social Medias
    • Instagram
    • YouTube
    • Twitter
  • Games
    • Dice Chess
    • Ultimate Tic Tac Toe
    • Atom Reaction

    • About the games
  • Coding
    • Resume
    • LeetCode
    • Codechef
    • CodingNinjas
โ–S๐’Š๐’๐’†๐’๐’•ใ€…๐’Œ๐’Š๐’๐’๐’†๐’“เฟ

Atom Reaction rules, strategy guides and free browser games, plus gameplay videos and projects by Swapnil Shah.

Connect with me
  • Instagram
  • YouTube
  • Twitter
  • Contact Me

    silentkillerop123@protonmail.com

    How to playStrategyGamesProjectsAboutContactPrivacy PolicyTerms
    ยฉ 2026 Copyright: silentkillerop.me

    Behind the game ยท by Swapnil Shah ยท 23 November 2026

    How the Atom Reaction bots were built

    The computer players in Atom Reaction were one of the most interesting parts to build, mostly because the results kept surprising me. Here is how they work and what I learned from measuring them.

    The basic idea

    The bots use a classic game-search technique called alpha-beta search. The bot tries each move, imagines the opponent's best reply, then its own, and so on to a fixed depth, scoring the resulting boards. It picks the move that leads to the best score and skips branches that cannot be better, which makes the search much faster.

    Four levels

    Easy searches two moves deep and picks randomly among its top choices, so it plays sensibly but not perfectly. Medium searches two moves and always takes its best. Hard searches four moves deep with a time limit of about a second and a half. Nightmare also searches four moves, with two seconds and a stronger way of scoring the board.

    Running in a web worker

    A deep search can take a second or more. On the main thread that would freeze the screen. So the search runs in a web worker, a background thread in the browser, and the interface stays smooth while the bot thinks. There is a fallback to the main thread, and a minimum delay so the bot does not respond so quickly that it feels robotic.

    Surprise 1: deeper was not stronger

    I assumed searching six moves deep would give a stronger bot than four. In tests with swapped sides and random openings, depth six and odd depths like three and five were actually weaker than four. I checked the search against a brute-force version to prove it was correct, so the cause was the way the board is scored, not a bug.

    Surprise 2: pruning moves hurt

    I tried to speed things up by considering only the best few replies, a technique called beam search. A depth-four bot with this shortcut lost to a plain depth-two bot. Cutting the moves it considered removed exactly the surprising replies that a strong player finds.

    How I measured

    Each level was tested against the next with random openings and the sides swapped, over many games, split across all CPU cores. I learned not to use fixed random seeds, because identical seeds replay the same game over and over and make results look more certain than they are.

    In the end I chose the strongest setup I could actually measure, even though I had planned a deeper search for Nightmare. A bot you can prove is stronger is better than one you merely hope is.

    Put it into practice โ†’

    More Atom Reaction guides

    • How to play: The complete rules, critical mass numbers and a worked example of a chain reaction.
    • Strategy guide: Ten practical tips for the opening, middle game, endgame and Battle Royale.
    • Game modes: Online rooms, bots, pass and play, daily puzzle and Battle Royale explained.
    • FAQ: Quick answers about players, bots, accounts and installing the game.
    • Opening moves: Where to place your first orbs and what to avoid in the first five turns.
    • Corner strategy in Atom Reaction: Why corners are the strongest cells and how to build chains out of them.
    • Common Atom Reaction mistakes: Seven mistakes that cost new players games, with a fix for each.
    • Beating the Atom Reaction bots: How each bot level thinks and the habits that beat them.
    • Multiplayer tactics for Atom Reaction: Target selection, kingmaking and surviving a crowded board.
    • Battle Royale survival guide: How the shrinking board works and how to be the last one standing.
    • Two player strategy for Atom Reaction: Tempo, forcing exchanges and corner control in head-to-head games.
    • Reading the board in Atom Reaction: A simple scan routine to spot threats and chains before they happen.
    • Trap patterns in Atom Reaction: The decoy corner, the delayed fuse and the forced capture.
    • Endgame guide: Count orbs, keep reserve moves and finish the last opponent.
    • Choosing the right board size: How the grid size changes pace, tactics and player count.
    • Reviewing your games to improve: Using replay and post-game review to find the move that lost the game.
    • Hosting a game night: Rooms, invite links, spectators, chat and keeping everyone engaged.
    • Playing on your phone: Install it, switch on lite mode and get turn alerts on any phone.
    • How the Atom Reaction backend was built: FastAPI, WebSockets, in-memory rooms and a chain-resolving game engine.
    • Backend challenges we faced and how we fixed them: Endless chains, room floods, rate limits and server hardening.
    • Frontend challenge: why phones got hot and how we fixed it: Cached sprites, frame pacing and lite mode to cool down phones.
    • Making multiplayer reliable: reconnects and dropped connections: Automatic reconnect, seat recovery and bots that cover for dropped players.
    • Saving games to a database without slowing play: A sleeping PostgreSQL database, background queues and privacy purges.