💾 Archived View for tilde.team › ~easeout › glog › 2020-07-26-mosh-and-quake.gmi captured on 2022-06-11 at 21:54:08. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2020-09-24)
-=-=-=-=-=-=-
Previous: tilde.team Learning Curve
26 July 2020
This morning I engaged in chat a bit and learned about an upcoming glog reply thread indexing feature of GUS. To support it I've moved these posts to each have their own page instead of all appearing at the glog folder level, which is better for meaningful URLs.
One thing that I didn't love about this pubnix is that when you SSH to a remote terminal, you get echo delay as you type according to your connection latency. I hadn't expected that, but it's obvious in hindsight. The teletype infrastructure of early Unix is still here, and that's how it works.
Then on IRC today I heard about mosh, a remote shell tool like SSH that's well-adapted to inconsistent connections, and to clients that change networks or sleep and wake. The killer feature for me is that it tracks whether typed characters have been echoed lately, and if so, will echo locally as a prediction. That means typing is as responsive as in your home shell.
There are weak spots in prediction: You can backspace over your prompt, and then the server corrects the misprediction. In vim, when you type at the end of a line it's smooth, but when you type in the middle of a line, there's no prediction that the text to the right will be pushed. So mosh's prediction effort is limited within reason, and great when it works.
What this experience reminds me of is Quake. Back in 1996, Quake was the first action game I found that you could play over TCP/IP across the internet, and of course I was on 14.4Kbps dialup at the time. I vaguely remember a DOS text-mode server browser. My usual ping time was half a second. It went about as well as you'd expect; you'd press forward or click the mouse and your character would take action after a delay that made it unplayable without a better connection.
As I understand it, the team at id reconsidered the problem and offered a new executable called QuakeWorld that you could download and use with the base game's content. The headline feature of QuakeWorld was prediction: Given the way all the players were moving, it would draw them you where your ping time suggested they would be by now. If it guessed wrong, they'd bounce back to where they really were as soon as your client found out. That's still in games; it's called rubber-banding. The other piece of the puzzle is that when you pressed forward and clicked the fire button, your camera would move and your gun model would animate, assuming that the server was just going to echo that back to you. That could be wrong, too; you could have been knocked around by someone else and then your camera would jump. We complained about lag all game long. Lower ping times continued to confer advantages. But most of the time it was smooth and fun. That prediction took the game from unplayable to playable, and set a precedent that games still follow.