How a developer simulated a real-time bot opponent on shared hosting without background processes
A developer building a head-to-head word-guessing game on shared hosting faced a core constraint: no persistent processes, daemons, or WebSocket servers allowed. To avoid an empty matchmaking queue killing user retention, they needed a bot opponent — but conventional bots require background processes that shared hosting forbids. The solution was to treat the bot as a pure deterministic function, computing what it 'would have done' at the moment a player polls for game status, using the battle ID as a stable random seed. Separate seeds control guess timing, word choices, and chat messages, ensuring any two clients observing the same battle see a perfectly consistent opponent. The bot's final outcome is also predetermined at battle creation, making difficulty tunable by adjusting probability distributions rather than building or handicapping an actual AI solver.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in