113 points · by dddanmar · 9y ago · 41 comments
twitch-plays-doom is a Python Twitch IRC->restful-doom proxy to control doomguy with a staggering 8 second delay.
The project was Saturday night's 'I wonder if I can make this work' session. Since it's been live there has been a team of four successfully make it to half way through E01M01.
I've since added godmode to the chat (you can guess the command).
This was fun, hope others get some enjoyment out of it.
Twitch Stream/Chat https://www.twitch.tv/dddanmar/
twitch-plays-doom https://github.com/dddanmar/twitch-plays-doom/
restful-doom https://github.com/jeff-1amstudios/restful-doom/
chocolate-doom https://github.com/chocolate-doom/chocolate-doom/
Edit: I'm getting downvotes for this? It's in the posted source code: https://github.com/dddanmar/twitch-plays-doom/blob/master/tw...
It's a battle of trying to keep the marine alive versus killing him. Every-time someone types iddqd, god mode is toggled.
God mode makes the character invincible, without god mode on the marine dies in a few seconds.
Factions are normal and I would expect them to coalesce, polarize and get more extreme over time.
Doom is simply too interactive. You need to be able to control it in realtime.
I recommend three things:
- Slow the delay right down, and possibly make it adjustable via chat commands. A 500ms-1s delay is honestly going to be the best possible thing here. Yes, some players will lag too much and won't be able to play at those latencies - which is why you make it adjustable.
- Show, inside the video stream, the command that is currently executing, and the username executing from. This will create a unique tuple that will allow players to figure out the sync for themselves.
- A consensus system that tallies up the next key to press, TpP-style, might be a good idea. Right now everyone's fighting to cooperate because it's concatenating everyone's actions together.
Twitch uses RTMPE for the most part, it's always going to be a little delayed. It's a decent box, compression is on, connected to fibre internet.
If anyone has any ideas of reducing latency I'd love to hear it!
Or you could execute the command for a second, then pause the game execution. Make it closer to turn-based Doom.
I am unfortunately completely ignorant of how you actually send data to Twitch, but can you use H264? It has an "ultra-low latency" mode.
Edit: Hmm, you're on OBS. Maybe you could stream using some uncompressed low-latency option from OBS to ffserver, then reencode on ffserver to low-latency H264. Alternatively, you could use ffmpeg with its X11 capture option, pointed at eg Xvfb.
Worked well for showing off the platform, since there was really a low latency. Since it uses it's own interactive input, and not relying on IRC for interaction, so it's UX is considerably more user friendly... if you want to sign up for a Microsoft Xbox live account to use it
My part took all of four hours to write, setup, deploy and post.
At this point I'm going to pull the stream down, been going 5 days now with a few crashes in Doom that are getting a little frustrating to debug.
Thanks again! This was great fun!!
:O I can't fire fast enough!
f - f - f - f