Designing Made in Chat: a mafia game that lives in Twitch chat
Why the game is always on, why chat is only the input, and how crews of different sizes stay fair.
Made in Chat is a mafia game played entirely through Twitch chat. Viewers start as a Lurker, type commands to commit crimes and earn money, and work their way up to Head of the Table. Later they form crews and fight other crews for turf on a city map.
Before writing much code I had to settle a few decisions. These are the ones that shaped everything else.
Chat is the input, not the output
The obvious way to build a chat game is to have the bot reply to every command. That falls apart fast: a busy chat turns into a wall of bot messages, and Twitch rate limits kick in.
So chat is only the input. The rich output goes to an OBS overlay on stream and to a website, and the bot only speaks when it really needs to. That keeps chat readable and keeps the bot well inside its limits.
Always on, with live bonuses
My first plan was live-only: the game runs while I'm streaming. But the goal was something casual, a command or two and then come back later, and that doesn't work if the game stops when the stream does.
So the game is always on. Crimes, banking, crews and turf work at any time. Going live adds bonuses, events and ceremonies on top, driven by Twitch's stream online/offline events. Passive income is the live bonus.
Keeping turf fair when nobody's online
Always-on raises an obvious problem: if a crew's members are asleep, can someone just walk in and take their turf?
No. Held turf has a standing garrison, so it's never free to take, and it's locked down for 30 minutes after every fight so a crew can't be ground down in one go.
Big crews vs small crews
Without limits, the biggest crew wins everything. A few rules stop that:
- Crews cap at 8 members and 4 districts.
- Only the 5 strongest fighters count in a fight.
- The smaller crew gets an underdog bonus.
- Attack and garrison strength weaken as a crew holds more turf.
- Fights are decided by odds, not a straight comparison, so upsets happen.
All of these numbers live in one economy file, so I can tune balance without touching code.
Content is data
Crimes, ranks, items and events are all data rather than code. Adding a new crime or event is an addition, not a rewrite, which matters for a game I want to keep growing.
Where it's at
The alpha covers commands, the economy, crimes, ranks, the overlay and saved progress. Crews, turf, heists and events are the next phase. It's self-hosted on my Windows Server VPS behind a Cloudflare tunnel at made.tomdev.xyz.
Comments
Sign in with Discord to react or comment.