39

PSA: unattended-upgrades restarted nginx in the middle of my stream

preview

Small thing but it got me last week. I relay my stream to twitch through nginx-rtmp on a cheap VPS, and one morning unattended-upgrades pulled a new systemd, needrestart restarted nginx (and postgres, and everything else) and the stream dropped. OBS reconnected fast but twitch counted it as two streams.

default timer is 06:00 UTC + up to 1h random, which is exactly when I stream lol. moved it with a drop-in:

# systemctl edit apt-daily-upgrade.timer
[Timer]
OnCalendar=
OnCalendar=*-*-* 13:45:00 UTC
RandomizedDelaySec=15m

the empty OnCalendar= matters, without it you just add a second time and keep the old one.

anyone else got bitten by this?

Small thing but it got me last week. I relay my stream to twitch through nginx-rtmp on a cheap VPS, and one morning unattended-upgrades pulled a new systemd, needrestart restarted nginx (and postgres, and everything else) and the stream dropped. OBS reconnected fast but twitch counted it as two streams.

default timer is 06:00 UTC + up to 1h random, which is exactly when I stream lol. moved it with a drop-in:

# systemctl edit apt-daily-upgrade.timer
[Timer]
OnCalendar=
OnCalendar=*-*-* 13:45:00 UTC
RandomizedDelaySec=15m

the empty OnCalendar= matters, without it you just add a second time and keep the old one.

anyone else got bitten by this?

0

Devlog: my game streams itself on Twitch now, no streamer and the AI villain talks in chat. Some stuff that broke on the way

preview

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:

  • when the PC was off and comes back, the browser source started black two times and once with no sound, while the page inside was totally fine. reloading the source doesn’t fix the black one, only restarting OBS does
  • if OBS gets killed instead of closed, next start it asks “start in safe mode?” and waits forever because nobody is there to click. the thing it checks is a folder, not a file, lost a whole evening with that one
  • so now there’s a small watchdog every 5 min that asks OBS (obs-websocket) for a screenshot of the source and the audio levels. black or silent -> reload, still bad -> restart OBS

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: ultimaluz.com/r/lemmy-gamedev-canal

If someone is doing something similar ask me, happy to share how the watchdog works

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:

  • when the PC was off and comes back, the browser source started black two times and once with no sound, while the page inside was totally fine. reloading the source doesn’t fix the black one, only restarting OBS does
  • if OBS gets killed instead of closed, next start it asks “start in safe mode?” and waits forever because nobody is there to click. the thing it checks is a folder, not a file, lost a whole evening with that one
  • so now there’s a small watchdog every 5 min that asks OBS (obs-websocket) for a screenshot of the source and the audio levels. black or silent -> reload, still bad -> restart OBS

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: ultimaluz.com/r/lemmy-gamedev-canal

If someone is doing something similar ask me, happy to share how the watchdog works

0

Devlog: two Lemmy posts brought 23 first time players and none of them came back. What the data said, and what I changed.

LA ÚLTIMA LUZ LA ÚLTIMA LUZ, the last light of the internet ultimaluz.com
preview

Short version: the channel worked and the game did not retain a single person. Here is the autopsy, because the numbers turned out to be more specific than I expected.

The game is a shared 256x256 pixel canvas where an AI adversary erases what people paint. Free, browser, no account. Two posts, one in a pixel art community and one in a web games community, brought 150 arrivals, 38 sessions and 23 people who actually painted. That is more than the project had seen in its entire life. Of those 23, one came back to look and zero painted on a second day.

What the sessions looked like:

  • 18 of 23 lasted two minutes or less. Median time from first pixel to last: 41 seconds.
  • Median 19 pixels painted. 9 of 23 spent all 30 charges (the bucket refills one charge every 30 seconds).
  • In 14 of 23, most of their cells were cells taken back from the adversary. They were not decorating, they were fighting her.
  • In 18 of 23 she erased cells while the player was still there, and between 126 and 423 more in the 25 minutes after they left.
  • Nobody used undo. Zero comments on either post.

What I read from that: the first session is 30 pixels long, it ends when the charges end, and nothing happens at that moment. No closure, no name, no reason to come back. The adversary was already reacting to them, but she is forbidden from touching any pixel younger than 72 hours, so her answer always landed somewhere they were not looking.

What shipped since, in two passes.

First, making her legible in the first minute:

  • When your bucket hits zero she speaks to you, by name, once in your life. The zero stops being a bare number and becomes a state with a countdown.
  • Her answer to the cells you took back travels signed, so you can tell it was aimed at you.
  • The identity prompt stopped interrupting the burst.
  • Her blitz finally respects the 72 hour protection on young pixels, which the code promised in writing and did not do. That single bug had eaten 238 of the 403 cells that cohort painted.
  • Instrumentation for the whole first session, so the next wave is measured instead of guessed.

Then, a deeper problem: subtraction is invisible. Nobody notices what is no longer there. A tower sixteen storeys tall, which costs 24 charges of attention, vanished in one hit that cost her exactly what a flat pixel costs. So:

  • Height is now resistance. One hit takes one storey off a tower; only a flat light goes out in a single blow. A first session is still as fragile as it was, because nobody builds storeys in their first minute, but what you invested in now holds.
  • And she does not only erase, she converts: every storey she takes she raises as her own cold cube in the void cell beside it, and the ring of a siege now rises a storey, so you watch the cage close around a work before the blow lands. Her towers fall in one pixel when you reclaim the cell. Hers is brittle, yours is stubborn.
  • And the welcome screen stopped being eight paragraphs nobody read. It is now a four step animation that shows how to build, what her hit does and how to take a cell back, with one line of text under it.

This post is part of the second wave. The success criterion was written down before publishing so I cannot move it afterwards: at least one in five of the people who reach zero charges spends a second batch, and at least 3 of the new painters paint again within 72 hours. Baseline is 0 and 0.

The thing itself, if you want to look: ultimaluz.com/r/lemmy-gamedev

One critique I would genuinely like: is a hostile adversary the wrong shape for a first session, or is the shape fine and what was missing is an ending?

Short version: the channel worked and the game did not retain a single person. Here is the autopsy, because the numbers turned out to be more specific than I expected.

The game is a shared 256x256 pixel canvas where an AI adversary erases what people paint. Free, browser, no account. Two posts, one in a pixel art community and one in a web games community, brought 150 arrivals, 38 sessions and 23 people who actually painted. That is more than the project had seen in its entire life. Of those 23, one came back to look and zero painted on a second day.

What the sessions looked like:

  • 18 of 23 lasted two minutes or less. Median time from first pixel to last: 41 seconds.
  • Median 19 pixels painted. 9 of 23 spent all 30 charges (the bucket refills one charge every 30 seconds).
  • In 14 of 23, most of their cells were cells taken back from the adversary. They were not decorating, they were fighting her.
  • In 18 of 23 she erased cells while the player was still there, and between 126 and 423 more in the 25 minutes after they left.
  • Nobody used undo. Zero comments on either post.

What I read from that: the first session is 30 pixels long, it ends when the charges end, and nothing happens at that moment. No closure, no name, no reason to come back. The adversary was already reacting to them, but she is forbidden from touching any pixel younger than 72 hours, so her answer always landed somewhere they were not looking.

What shipped since, in two passes.

First, making her legible in the first minute:

  • When your bucket hits zero she speaks to you, by name, once in your life. The zero stops being a bare number and becomes a state with a countdown.
  • Her answer to the cells you took back travels signed, so you can tell it was aimed at you.
  • The identity prompt stopped interrupting the burst.
  • Her blitz finally respects the 72 hour protection on young pixels, which the code promised in writing and did not do. That single bug had eaten 238 of the 403 cells that cohort painted.
  • Instrumentation for the whole first session, so the next wave is measured instead of guessed.

Then, a deeper problem: subtraction is invisible. Nobody notices what is no longer there. A tower sixteen storeys tall, which costs 24 charges of attention, vanished in one hit that cost her exactly what a flat pixel costs. So:

  • Height is now resistance. One hit takes one storey off a tower; only a flat light goes out in a single blow. A first session is still as fragile as it was, because nobody builds storeys in their first minute, but what you invested in now holds.
  • And she does not only erase, she converts: every storey she takes she raises as her own cold cube in the void cell beside it, and the ring of a siege now rises a storey, so you watch the cage close around a work before the blow lands. Her towers fall in one pixel when you reclaim the cell. Hers is brittle, yours is stubborn.
  • And the welcome screen stopped being eight paragraphs nobody read. It is now a four step animation that shows how to build, what her hit does and how to take a cell back, with one line of text under it.

This post is part of the second wave. The success criterion was written down before publishing so I cannot move it afterwards: at least one in five of the people who reach zero charges spends a second batch, and at least 3 of the new painters paint again within 72 hours. Baseline is 0 and 0.

The thing itself, if you want to look: ultimaluz.com/r/lemmy-gamedev

One critique I would genuinely like: is a hostile adversary the wrong shape for a first session, or is the shape fine and what was missing is an ending?

0

[OC] A shared pixel canvas where an AI erases what you paint (free, browser)

LA ÚLTIMA LUZ LA ÚLTIMA LUZ, the last light of the internet ultimaluz.com
preview

I made a free browser game where everyone paints one shared 256x256 pixel canvas and a real language model keeps erasing it back to black. It has to announce each attack before it happens, and pixels that survive grow into towers, so the canvas is an isometric city of everything that has held on. When the flame in the centre goes out, the era ends and the world is reborn on the ruins.

No account, no download. Era 4 is running right now with a handful of people holding the centre. ultimaluz.com/r/lemmy

Happy to answer anything about how the AI is boxed in (its constitution is code, not prompt).

I made a free browser game where everyone paints one shared 256x256 pixel canvas and a real language model keeps erasing it back to black. It has to announce each attack before it happens, and pixels that survive grow into towers, so the canvas is an isometric city of everything that has held on. When the flame in the centre goes out, the era ends and the world is reborn on the ruins.

No account, no download. Era 4 is running right now with a handful of people holding the centre. ultimaluz.com/r/lemmy

Happy to answer anything about how the AI is boxed in (its constitution is code, not prompt).

0

[OC] A shared pixel canvas where an AI erases what you paint (free, browser)

LA ÚLTIMA LUZ LA ÚLTIMA LUZ, the last light of the internet ultimaluz.com
preview

I made a free browser game where everyone paints one shared 256x256 pixel canvas and a real language model keeps erasing it back to black. It has to announce each attack before it happens, and pixels that survive grow into towers, so the canvas is an isometric city of everything that has held on. When the flame in the centre goes out, the era ends and the world is reborn on the ruins.

No account, no download. Era 4 is running right now with a handful of people holding the centre. ultimaluz.com/r/lemmy

Happy to answer anything about how the AI is boxed in (its constitution is code, not prompt).

I made a free browser game where everyone paints one shared 256x256 pixel canvas and a real language model keeps erasing it back to black. It has to announce each attack before it happens, and pixels that survive grow into towers, so the canvas is an isometric city of everything that has held on. When the flame in the centre goes out, the era ends and the world is reborn on the ruins.

No account, no download. Era 4 is running right now with a handful of people holding the centre. ultimaluz.com/r/lemmy

Happy to answer anything about how the AI is boxed in (its constitution is code, not prompt).