Some context first. The game is a shared 256x256 pixel canvas, people paint it by hand from the browser and an AI called La Maquina spends the day erasing it. Free, no account. Problem is it has basically no players and I'm not going to stream it myself every day, so I tried to let the canvas stream itself.
I already had a 3D spectator view (three.js) with a "stream mode", the camera goes on autopilot and jumps to whoever just painted a pixel and shows their name, and her lines go as captions. So the plan was just put that page in OBS as a browser source and leave it running. It runs on a PC at home that isn't free all day (4060 Ti, NVENC, 1080p30, around 6 Mbps up), that's why the schedule is a bit weird.
At first I wanted a cheap VPS for this but measured before paying. Without a GPU chromium falls back to software WebGL and the scene was doing 0 or 1 fps, with the GPU it's around 100. So no VPS.
Things that broke:
For the chat there's a little bot reading the same live events the game uses and posting her lines. Only lines from the bank the game already has, I don't want anything generated going out without me reading it first. When the channel is offline she shuts up, !play and !era work always. And since this week the chat can paint too, !near lights a pixel next to the last one and !more east or !more north keeps drawing from yours, one pixel per message with the same charges as on the web (you have to follow the channel, mostly to keep throwaway accounts out).
Since yesterday it also goes to Kick at the same time, and since today to YouTube too. The PC sends the stream once to a tiny nginx-rtmp relay on the game's VPS and that copies it to all three, so the upload at home stays the same. Kick only takes RTMPS and nginx-rtmp doesn't do TLS, so that one goes through stunnel.
First night without telling anyone: 9 hours, 10 unique viewers (I guess people browsing the Art category) and zero of them went to the game lol. So this post is kind of the real launch.
Live on Twitch, Kick and YouTube weekdays 03:00-12:30 UTC and weekends 01:30-07:00 UTC. The game works anytime: https://ultimaluz.com/r/lemmy-gamedev-canal
If someone is doing something similar ask me, happy to share how the watchdog works
both, kind of. the part that actually erases stuff is plain game AI, rules and a budget: it finds groups of 25+ connected pixels, announces a siege on one, closes a ring around it, and if people don't keep the ring lit it eats the work. all deterministic code. on top of that, every 15 min a small LLM (gemini flash lite through openrouter) gets the state of the board and picks which of the legal moves to make, which work to siege and when, and the code clamps whatever it answers, it can't break the rules. it also writes a one line reason that goes in a war log on the site, that's the only generated text players see. everything she says in the game and on the stream comes from a bank of lines I wrote by hand, and nothing on the canvas is generated, it's all people painting. if the LLM is off, a fixed set of rules plays instead
@programming.dev
Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.
go to feed...
@programming.dev
Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.
go to feed...
By "AI villain" do you mean an LLM or a more traditional game AI?
save