Some Bits: Nelson's log

73 posts about games

Steam Machine first impressions

On an impulse I bought a Steam Machine, a 512GB unit with controller. It’s very good! I signed up to order Sep 4 and it arrived Oct 8.

I’ve been fooling around with Linux gaming for awhile now, including Bazzite on a mini-PC for my TV. I’ve been very impressed but Linux has some rough edges. Was curious if the commercial supported product would be better. It is!

The overall product experience is quite good. Nice packaging, it works right out of the box, it’s simple to set up (login is just a click in the mobile app). There was one hiccup (some tutorial messages suggesting keyboard controls I don’t have access to) but overall very solid.

Game behavior seems much nicer. HDR works out of the box, as does switching resolutions and changing windowed / fullscreen in various newer games. I’ve had a lot of trouble with that in my own Linux gaming setups. I think the Steam Machine is just committed to running everything in gamescope always? It seems to work. They’re using MangoHUD for a performance overlay with good defaults, too.

Big improvement: the system wakes from sleep when I press the Steam controller button. Trying to get this working with Linux and other controllers is a huge PITA, I’ve never managed it.

It has a giant fan on the back and seems to be very quiet.

I haven’t seen much bullshit about shader compiling / update downloads. Both Enshrouded and Borderlands 4 give my desktop Linux box fits with that, lots of rebuilds, hangs, downloads. Steam Machine just seemed to work. Enshrouded recompiled shaders once in-game, a couple minutes’ wait, but then it just works.

Borderlands 4 has also been tricky on Linux because the game has its own in-game updater. On my desktop system it ends with a DOS window open saying something about the update and expecting me to type exit or close it. That didn’t happen on the Steam Machine. I saw the window and then it closed it itself somehow.

In general performance on the Steam Machine is good. I’m not equipped to really evaluate so I can say it’s significantly better than the Radeon 680M mini-pc it replaces. And obviously not as good as the Nvidia 5060 on my desktop. The Steam Machine comes preconfigured to limit at 1080p. But lower spec games work fine at 1440p or 2160p. HDR 10 works everywhere. 120Hz, too! First time I’ve ever seen that and not sure I can tell the difference.

I don’t love the Steam Controller. I didn’t like the old Steam Link one either. Really I’m happy with a classic Xbox controller with one extra set of buttons to replace the awkward stick-click input. They’re trying to make a controller work as mouse with a touchpad and enough remappable buttons to substitute as a keyboard too. This thing has a crazy number of capacitive sensors (two touchpads, two touch sensors on the joysticks, two touch sensors on the back) and they don’t seem useful for much. The mouse mode is too jiggly. The extra paddle buttons on the back are awkwardly placed. I’ll note all this other stuff on the controller is turned off in most games by default, even games that would benefit from it. Steam has a nice controller mapper to add in extra buttons but it’s an awful lot of work to set it up.

All in all I’m excited about this machine. It’s a shame it came after the components parts shortage and is priced at $1100. Even $800 would be a stretch for the market, I think. The pricing is fair given current market conditions, I’m sure you can’t build something of similar quality for much cheaper. But it feels awfully expensive for a toy.

Linux gaming: GPU overview

I’ve been installing Linux on whatever hardware I happen to have. It’s worked OK on various video cards. But there’s big differences. Most of this post is from the point of view of gaming (Windows games with Proton) but some AI stuff too. No deep expertise here, but I’ve had to learn this all recently and am sharing here.

AMD

AMD GPUs are the best supported in Linux. In general they just work. There’s a reasonable kernel driver built right into the kernel, fringe side features are better supported, and the Mesa user space stuff all does its job well in providing graphics APIs like Vulkan. Valve has invested an enormous amount into supporting AMD cards well in Linux and it shows. Next time I buy a video card, it will be AMD.

The one caveat is AI. Inference does work on AMD, ROCm is a real thing that really works. But there’s a sense the performance isn’t quite as good as with NVidia. I haven’t really tested it carefully.

Intel Arc

These are rumored to work reasonably well for gaming on Linux but they are still rare cards. I have no experience with them. The kernel drivers are part of the regular Linux kernel. Not sure about AI performance.

Nvidia

Oof. This is what I’m saddled with for the high performance cards I have. And the situation is not great. It does all work, and works reasonably well, but it’s such a kludge. I’m grateful to distros like Bazzite or Nobara or CachyOS that take the difficulty out of getting the drivers working. Arch’s docs are helpful info.

The problem is that historically Nvidia’s drivers have been closed source. But they have to run in the kernel. Now they have a more open source driver but only the kernel parts are open source, there’s still a lot of closed user space stuff providing higher level APIs (instead of using Mesa).

So even now there’s some insane thing where you are compiling drivers from source code you get from Nvidia when you install a new Linux kernel. And the kernel has to be signed to boot in Secure Boot, which just makes it more complex. It’s a mess.

There’s at least four flavors of Nvidia GPU driver.

The good ones come from Nvidia. They’re proprietary, but they have good performance. And they do work.

  • The “open” Nvidia drivers. This is the best option and works on cards starting with the 16xx cards and newer (ie: around 2018, Turing architecture and beyond). This driver is under active development by Nvidia, the latest 610 release recently came out. The kernel code is real open source but is only useful in pairing with a bunch of closed user space code.
  • The legacy proprietary Nvidia drivers. These are slowly on the way out but are the only thing that supports older cards like my 1080. I believe these drivers are still supported and getting updates but only limited ones. I think 580 is the last version that will be released?

The bad ones are fully open source and from third parties. They’re not really bad, it’s amazing work, but it’s a lot of reverse engineering and extra effort and their performance is not up to the closed ones.

  • Nouveau with NVK is the main open source driver. Linux systems will install this because it’s easier and license-friendly. But the performance is not great.
  • Nova is a new project to provide a new Nvidia driver in Rust. It’s very new and I think not ready for regular use.

AI inference works great on Nvidia, they pioneered most of the work and are still the leaders in Linux AI.

Linux gaming: switching video and sound

I use my Linux box with a long cable to play games on my TV. When I plug in the TV I want to change resolutions and change sound output devices for the TV. (The display is mirrored from my desktop). This is the kind of thing I’d only do manually in Windows but in Linux it’s reasonable to automate it. Particularly with an AI doing the hard work.

The switch script

Switching boils down to using kscreen-doctor to set the video mode and pactl to change the audio device. I’m using this script manually and it works great.

#!/bin/bash
# Description: Toggle display resolution and audio output between Desktop and TV modes.
# Safe to run multiple times consecutively.

# ================================
# Configuration Variables
# ================================
DISPLAY_NAME="DP-3"

# Desktop Settings
DESKTOP_RES="6016x3384@60"
DESKTOP_CARD="alsa_card.pci-0000_0b_00.4"
DESKTOP_PROFILE="output:analog-stereo"
DESKTOP_SINK="alsa_output.pci-0000_0b_00.4.analog-stereo"

# TV Settings
TV_RES="3840x2160@60"
TV_CARD="alsa_card.pci-0000_09_00.1"
TV_PROFILE="output:hdmi-surround-extra1"
TV_SINK="alsa_output.pci-0000_09_00.1.hdmi-surround-extra1"

# ================================
# Helper Functions
# ================================
switch_audio() {
    local card="$1"
    local profile="$2"
    local sink="$3"

    # 1. Set Card Profile
    pactl set-card-profile "$card" "$profile" 2>/dev/null

    # 2. Set Default Sink
    pactl set-default-sink "$sink" 2>/dev/null

    # 3. Move active audio streams safely
    pactl list short sink-inputs | awk '{print $1}' | while read -r stream; do
        if [ -n "$stream" ]; then
            pactl move-sink-input "$stream" "$sink" 2>/dev/null
        fi
    done
}

# ================================
# Main Execution
# ================================
MODE="${1:-desktop}"

if [ "$MODE" = "tv" ]; then
    echo "📺 Switching to TV Mode..."
    
    # Switch Display to 2160p
    kscreen-doctor "output.${DISPLAY_NAME}.mode.${TV_RES}"
    
    # Switch Audio to NVIDIA 5.1 Surround
    switch_audio "$TV_CARD" "$TV_PROFILE" "$TV_SINK"

else
    echo "🖥️  Switching to Desktop Mode..."
    
    # Switch Display to 6K
    kscreen-doctor "output.${DISPLAY_NAME}.mode.${DESKTOP_RES}"
    
    # Switch Audio to Starship/Matisse Stereo
    switch_audio "$DESKTOP_CARD" "$DESKTOP_PROFILE" "$DESKTOP_SINK"

fi

echo "Done!"

Switching automatically

I haven’t tried this yet, but Gemini has a reasonable plan for making this happen automatically when I plug in the cable. It boils down to running a user systemd service to run udevadm monitor to get notified when the cable is plugged in.

#!/bin/bash
# Description: Auto-detects HDMI hotplug events and calls switch_mode.sh

# Path to your switch script (adjust if located elsewhere)
SWITCH_SCRIPT="$HOME/bin/switch_mode.sh"

# Automatically find the first HDMI connector status path
HDMI_STATUS_FILE=$(ls /sys/class/drm/card*-HDMI-*/status 2>/dev/null | head -n 1)

if [ -z "$HDMI_STATUS_FILE" ]; then
    echo "Error: No HDMI port found in /sys/class/drm/"
    exit 1
fi

echo "Monitoring HDMI port: $HDMI_STATUS_FILE"

check_and_switch() {
    STATUS=$(cat "$HDMI_STATUS_FILE" 2>/dev/null)
    if [ "$STATUS" = "connected" ]; then
        echo "HDMI Connected -> Switching to TV"
        "$SWITCH_SCRIPT" tv
    else
        echo "HDMI Disconnected -> Switching to Desktop"
        "$SWITCH_SCRIPT" desktop
    fi
}

# 1. Run check immediately when the script starts
check_and_switch

# 2. Listen for DRM kernel display events in real time (no root required)
udevadm monitor --subsystem-match=drm | while read -r line; do
    if echo "$line" | grep -q "change"; then
        # Brief pause to let the hardware settle
        sleep 1
        check_and_switch
    fi
done
[Unit]
Description=HDMI Hotplug Display and Audio Switcher
After=graphical-session.target

[Service]
Type=simple
ExecStart=%h/bin/tv_auto_switch.sh
Restart=always
RestartSec=3

[Install]
WantedBy=graphical-session.target

More switching

I didn’t actually set it up but I’m pretty sure udevadm monitor will work as a way to know when an HDMI cable is plugged in to activate the switch. But I realized I’d rather leave the thing plugged in all the time and only switch modes on my Linux box when the TV receiver switches to its video input. I tried for awhile and couldn’t make it work. An AMD video card might.

Some TVs make it look like you basically disconnected the cable when you switch away from that input. They turn off the HDMI hot plug signal and stop sending EDID. My TV does not do this, on the Linux side it looks like it’s always on.

The TV should be sending HDMI-CEC commands down the wire to notify the device when it’s selected as input. In Linux those should be available on /dev/cec0 or the like. Unfortunately the NVidia graphics drivers just don’t support this. Intel and AMD supposedly do. Yet another way NVidia’s Linux support falls short.

I finally just put a button to invoke my script on the KDE taskbar so it’s very easy to switch modes.

Yay for AI

I have the skills to figure scripts out like this myself. It would take me ~2 hours to research and write and debug this script. Or it takes me 10 minutes with an AI. I never would have bothered without. My expertise is still important: I’m asking the questions of the AI the right way and I can review the suggestions to see if they make sense. But the AI is definitely great at this kind of one-off hack.

Linux desktop gaming: ways to run

I’m deep in the weeds of tinkering with how Steam launches games. In Linux you have a bunch of options. Here’s some experiments I did running Borderlands 4 (Unreal Engine 5) on a mini PC with an AMD Ryzen 7 PRO 8845HS and a Radeon 780M graphics chip, trying to run the game at 1080p on my 6016 x 3384 screen.

Note this machine is woefully underpowered to run this game well, I’m on full Low settings. And Borderlands 4 is considered poorly optimized. I’m mostly concerned about the different display options: resolutions, HDR, upscaling. Those choices should apply on better hardware too but there’s less need to squeeze out more pixels with clever choices.

In all cases I’m changing launch options by right clicking the game in Steam, choosing General / Launch Options, and then pasting in command strings.

I’m using GE-Proton11-1 as the compatibility tool. This is a very recent version.

A useful reference: Proton Variants. This documents all the various fiddly environment variables the different compatibility tools use.

First, two digressions on other options

Frame generation

I am not ever enabling “frame generation” (DLSS or FSR) in the game. This is a gimmick where the GPU will generate whole frames by time-interpolating other frames. But it doesn’t look very good and it adds latency and seems always bad to use.

Gamemoderun

A wildcard: you can preface any program you run with gamemoderun. That enables game mode, a set of Linux kernel tweaks that lowers latency. This seems entirely orthogonal to different display options and offers only a tiny improvement, at least on a quiet system. I mostly use it but will not worry about testing it separately, I just use it everywhere.

Simply running it directly

gamemoderun %command%.

Just launch the game directly without tweaks. This works pretty well in Borderlands and arguably is the best way to run the game. The game will try to run at full desktop resolution but Borderlands detects other resolutions and lets you apply them. You can pick your upscaling algorithm, I’m using AMD’s FSR. TSR looks better but is a little slower.

The one drawback with this is there’s no HDR.

Running it directly with HDR

PROTON_ENABLE_WAYLAND=1 PROTON_ENABLE_HDR=1 DXVK_HDR=1 ENABLE_HDR_WSI=1 gamemoderun %command%

This is a variant of simply running it: Borderlands will talk directly to the display compositor the desktop is using. However there’s a whole raft of flags there to enable HDR. Why three flags for HDR? I don’t know honestly, I’m copying what the AI tells me to do. It’s possible these aren’t all necessary, particularly with GE-Proton, but they are harmless if not used.

The other flag here is PROTON_ENABLE_WAYLAND=1. That’s arguably the most important one. Without it, Proton runs games under XWayland, so that Proton is using X11 graphics and the XWayland X server is translating those to Wayland. With that Proton uses a native Wayland driver. That’s better but I guess that native driver isn’t entirely stable yet, so it’s not the default.

Running with Gamescope

gamemoderun gamescope -W 2560 -H 1440 -f -F fsr -- %command%

Gamescope is an intermediate compositor that smooths over a bunch of issues with gaming on Linux. It basically creates a virtual display that the game draws too, then blits that image to the real display. It’s pretty low latency and has solved a lot of problems for me, particularly older games that don’t seem to understand the Linux display very well. It doesn’t seem necessary for Borderlands 4 but we’ll try it anyway. (One drawback: Gamescope breaks the Steam overlay. There’s an experimental flag to enable it again but it doesn’t seem to work.)

-f just tells gamescope itself to be fullscreen, not a window.

-W 2560 -H 1440 -F fsr tells gamescope to run its virtual display at 1440p and use FSR if needed to scale things. The game will think it is running on a 1440p monitor. Borderlands lets me choose my own resolution inside the game, and I choose 1080p. So now Borderlands is drawing at 1080p.

Borderlands is well behaved and lets me set the resolution. Another way to set the resolution is to add -w 1920 -h 1080 to the gamescope options. That tells gamescope to tell the game it’s a 1080p screen but to automatically upscale to 1440p itself. I’m acomplishing the same thing by using the Borderlands menu to pick 1080p.

An added complication here is Borderlands itself may do some spatial upscaling depending on the graphics settings. I’m a little fuzzy on this but an AI tells me on “Performance” mode it renders the game at 50% (540p). So there’s several scaling steps here.

  1. 540p: the actual game geometry rendering
  2. 540p → 1080p. Borderlands upscaling with FSR 3.0
  3. 1080p → 1440p. Gamescope upscaling with FSR 1.0
  4. 1440p → 3384p. Linux graphics (KDE’s compositor?) upscaling with a crummy linear filter.
  5. 3384p → monitor. Linux is handing a full 3384p signal so the monitor doesn’t need to use its hardware upscaler. In other circumstances the monitor might upscale.

Writing all this out, step 3 seems bogus and it’d be better to eliminate it. Have gamescope just work at the same resolution you want the game to work at. The flipside is the FSR 1.0 in step 3 is probably better than whatever upscaling is in steps 4 and 5, so it might still be preferable to do the extra work in gamescope.

The other option that seems appealing is to run gamescope -W 6016 -h 3384 and have it fully upscale things with FSR 1.0. I think that’s how gamescope is intended to be used. But that’s a lot of pixels and this little video card is kinda limited, so the AI is advising me 1440p is better. FWIW I tried it at 3384p and it seemed to run just the same as with gamescope at 1080p.

Gamescope with HDR

ENABLE_HDR_WSI=1 DXVK_HDR=1 gamemoderun gamescope -W 2560 -H 1440 -f -F fsr --hdr-enabled -- %command%

Gamescope by default doesn’t do HDR. You have to add these flags to enable HDR both in the game (the environment variables) and in gamescope (--hdr-enabled).

Putting it all together

For Borderlands, I don’t want to use gamescope. I mean I could, and maybe the FSR 1.0 upscaling is better than the linear upscaling the Linux desktop would do. But it doesn’t look much better and gamescope certainly adds complexity and a little latency.

Without Gamescope I get about 39 fps in one little test I ran with this command:

PROTON_ENABLE_WAYLAND=1 PROTON_ENABLE_HDR=1 DXVK_HDR=1 ENABLE_HDR_WSI=1 gamemoderun %command%

If I did want to use gamescope, I’d run it at 1080p like this. I tried this and it might look a tiny bit better and runs at 38 fps instead of 39.

ENABLE_HDR_WSI=1 DXVK_HDR=1 gamemoderun gamescope -w 1920 -h 1080 -W 1920 -H 1080 -f -r 60 --hdr-enabled -- %command%

Closing thoughts

Hilarious thing: all these various options don’t really look that different to me. It seems less blurry when I do the more “optimal” things. And maybe I get 10% more framerate depending on how I tweak it. But honestly with this particular heavy game and this particular underpowered hardware, it’s not a big thing.

Linux gaming is easy!

Seriously, all this tinkering is ridiculous. One nice thing about Bazzite is you can ignore most of it: if you use Game Mode, it just handles Gamescope in the background and stuff works. Desktop Steam should get there eventually, but this transition where options like native Wayland rendering don’t work reliably yet is awkward.

Linux remote game streaming

One thing I miss from my Windows machine was it was easy to stream games to my TV. I installed a Steam Link client on the Android TV and it connected to my Windows box running Steam. Game streaming works surprisingly well on a LAN.

Steam streaming from Linux server

In theory I should be able to do the exact same thing from Steam running on Linux. In practice I found it didn’t just work when I tried it. I should try again, particularly now that I understand better how to use gamescope and deck mode to make the Linux box run Steam games better.

Sunshine / Moonlight

The other option for remote streaming is the Sunshine server running on the Moonlight client. This is an open source evolution of NVidia’s game streaming systems. It’s well loved because it’s very low latency, like 3ms on a LAN.

I’ve made it work but it’s very unreliable. The Sunshine server on Linux is quite janky and the way it captures audio and video seems delicate. It does work sometimes! But not regularly for me. Also I have to remember to manually set my desktop to 1080p before launching Sunshine. I think the Sunshine server can do that too but again I had trouble making that work.

Headless?

What I really want is a headless system. Something where the game is running on a virtual / offscreen display and doesn’t affect my desktop at all. In practice this also seems very difficult, in particular to get the GPU to render with hardware acceleration.

One solution is a dummy HDMI plug that looks like a fake monitor. I bought one and plugged it in and it sort of works. But now I have a new display in my desktop and I couldn’t get KDE Plasma to not use it for anything, it kept causing problems.

A second solution is a virtual display with a spoofed virtual EDID pretending to be a monitor. Apparently you can hack Linux to do this. The result is similar to the dummy HDMI plug but without the stupid hardware dongle. I have not tried this.

A third solution is truly headless. Most solutions for this use the Sway compositor which has both good support for running headless and also a remote video capture system wlr-screencopy that Sunshine can work well with. This all sounds good but very complicated to set up and too bleeding edge for me. Some links on that:

Linux desktop gaming notes (Gamescope)

I’m finally understanding how Linux gaming works. Particularly the problem of setting display resolution and driver features. See also this CachyOS guide.

Compatibility tool

The most important Linux-specific thing is what Windows emulator Steam uses to launch your game. They call this a “compatibility tool”. I believe Proton 10 is the default these days. Valve ships other Proton versions: there’s Proton 11, Experimental, Hotfix. You can select which one Steam uses. Proton-GE is a popular third party one, by the same GloriousEggroll who puts together Nobara.

Gamescope and resolutions

The other tricky thing with Linux is the display resolution compatibility is not great. If I launch something from my normal Linux desktop most games are fixed to some bizarro resolution like 7400x4000. There’s also issues with X11 vs Wayland vs XWayland.

The solution to a lot of this is Gamescope, a graphics compositor Valve built for the SteamDeck. It makes it very easy to launch a game with a specific resolution independent of what the underlying hardware and drivers are doing. For instance you can easily launch games in 1920x1080@60 fps. They will run well and gamescope will make sure it looks good on your screen.

You can run games directly in Linux without gamescope, but the quality of that experience is highly variable. Gamescope simplifies things so that games run more reliably.

Also related: MangoHud, the overlay for monitoring FPS in games and other things. I find it annoying and intrusive but it is the preferred tool if you want to test how well a game is running. Steam also has its overlay but it can be unreliable in Linux.

Steamdeck game mode

Bazzite and Nobara both have a thing they call “deck mode”. You log in to a special SteamDeck-like session instead of a normal KDE desktop session that is for nothing but running Steam in Big Picture mode. Behind the scenes that game mode is a GUI wrapping several tools.

Games are run with gamemoderun which tweaks Linux to run an app for better game performance. It does things like change the CPU governor and kernel scheduler to make the game run smoothly. It seems to actually help.

Game mode also launches games under Gamescope. And it has a GUI built into Steam that lets you configure the resolution, etc that Gamescope presents. It’s quite nice!

ProtonPlus

ProtonPlus is a standalone GUI for downloading compatibility tools like Proton-GE. That’s its main use and is under the “Tools” tab.

But the “Games” tab has a very handy feature: a sane editor for Gamescope configurations. All this is doing is modifying Steam’s config files to set launch options; you can do the exact same thing by setting custom command lines with the Steam properties editor. But there you are typing command lines by hand, with Proton Plus you can edit them with a GUI. Just remember to exit Steam first so that it doesn’t clobber the configs that ProtonPlus sets.

I am using this all the time to enable HDR and to set a specific resolution I want the game to run at. It’s a kludge but gamescope works around some limitations of Linux gaming.

Note ProtonPlus doesn’t really help you use gamemoderun. There’s a way to enable it but no simple checkbox for it.

Other configs

gamescope for resolutions is the main thing I’ve used so far. There’s a variety of environment variables that are popular for further tweaking how things run, stuff like PROTON_ENABLE_WAYLAND=1 and PROTON_ENABLE_NVAPI=1. I don’t know much about them. ProtonPlus sets some of them if you enable Advanced mode.

Gaming on desktop

Putting it all together... the easy thing is to use the Steam Deck mode that Bazzite or Nobara offers. If all you’re doing is gaming on the computer, it’s a great choice. But me I’m mostly working on this thing and then occasionally playing a game. So I use ProtonPlus to configure Steam to launch games with the resolution and options I need.

Linux gaming and resolution scaling

Deep into tinkering with gaming on Linux using Bazzite 44. The problem I’m wrestling with is that fullscreen games are guessing a different resolution than they should. my screen is 6016x3384 natively but instead the game is trying to run at 6863x3860 or some other wrong value. This doesn’t happen for all games.

These tests are for the game Rhythm Storm, a fairly simple but graphically intense game. I’m playing on a ProArt display that’s 6016x3384 natively, with a NVidia 5060 and the 595.71 Linux open drivers installed. Bazzite is pretty much an all-Wayland system, with just a bit of X11 compatibility. I am running the display at 225% scaling. This Gemini chat is all the research I’ve done so far.

First, a useful tool: xrandr. That shows a set of resolution that X11 apps think are valid. On my system with 225% scaling it shows 6863x3860, the mode the game is picking. If I change scaling this number changes in some mathematically way I can’t quite understand. Anyway this must be what the Steam game is picking up.

One tool to fix this scaling problem is gamescope. That’s some sort of Steam graphics shim that sits between the game and the Linux display software. It can be told to enforce a specific resolution and you can impose it for a particular game by altering the Steam game launch options. That works! Unfortunately it also hides the Steam overlay. There’s supposed to be a -e or --steam option to work around that, but when I try that the game never launches at all.

I’ve been surprised at how well games work on Steam / Linux in general. Proton is a marvel! But this kind of problem is exactly the sort of infuriating bullshit that makes Linux seem unacceptable as a desktop OS. Right now I’m still cheerful about trying to figure problems like this out, so I’ll stick with it. Wonder how long that will last.

Remote game streaming

Some things I’ve learned about playing games by running them on a big computer and using my TV as a client. Basically this is an optimized form of desktop screen sharing.

The client TV is a 2160p Sony Bravia. That runs Android and seems the best of the smart TV platforms. The server running the games is a desktop gaming PC, I’ve tried both Bazzite Linux and Windows. Both devices are wired on the same LAN. (This stuff works on the Internet too and is surprisingly responsive.)

Steam Remote Play

Valve has had a remote gaming product for some 10 years. I still have working Steam Link client hardware! But these days it’s easier to run a Steam client on the TV.

It works pretty well but is surprisingly flaky. The biggest problem is resolution switching. Steam should change the desktop resolution to the TV’s resolution, or down to 1080p if I tell it to. That only works one time out of three so mostly I have to change the resolution on the PC myself. (The TV can display anything, but 3440x1440 looks terrible on a 2160p display.)

The other knock on Steam Remote Play is that it’s not very optimized. Folks report 20-40ms latency, or maybe 2 frames of a 60fps game. I haven’t really noticed that but I’m not super sensitive to it.

Sunshine / Moonlight

The alternative fancy gamers recommend is the Sunshine streaming game server and the Moonlight client. These have been around quite awhile, started as an open source reimplementation of the NVidia Game Shield protocol. The big advantage folks quote over Steam is latency: it delivers 4ms on my LAN, or well under one game frame.

The server works well on Windows. It seems reliable. It has some nice stuff about launching things when a client connects, like invoking Steam Big Picture. I’m still having to set the Windows desktop resolution manually although I think Sunshine can do that for me.

The server does not work for me on Bazzite Linux. It sort of does. But the NVidia drivers on my old 1080 card aren’t correctly detecting display modes so I’m stuck streaming 3440x1440.

Alternate resolutions

One dumb thing about all these solutions is that they’re displaying what’s on the PC’s screen, at the PC’s resolution. But basically I have a remote screen on the cliente TV: why should I care what’s plugged in on the server?

One solution is a dummy HDMI plug. This does the EDID handshake to make the computer thing you have a monitor plugged in so you can configure the OS to use it as a primary or secondary screen. These are particularly popular for headless machines: with no monitors plugged in some GPUs refuse to operate at all.

The dummy plug seemed to work as a second screen on Linux. But caused all sorts of problems. First, the desktop GUI wants to use that screen! But it’s invisible, so stuff gets placed there you can’t see. Second, I couldn’t reliably get all the gaming stuff to happen on that fake screen while leaving my desktop alone for normal stuff. The software is just not designed to do it.

I went down a rabbit hole of trying to fix the resolution-switching problems on Linux with my 1080. Total disaster. There’s some hack with kernel keyword arguments with display mode lines, yuck! There’s also a hack where you load fake EDID data from a file to trick the graphics card. I couldn’t make any of that work. Honestly why doesn’t the NVidia driver just detect the modes that are there?

The other solution is a virtual display. Basically have a device driver fake a viritual screen disconnected from actual hardware. This feels like the right solution and reminds me of the ancient X11 virtual desktop hacks. Ironically, virtual displays are reportedly unreliable to impossible on Linux.

On a Windows server folks recommend Apollo, a Sunshine fork, which has virtual displays as a headline feature. I’ve tried this server and it works, but I haven’t tried the virtual display feature yet.

8BitDo Ultimate 2C variants and upgrades

I bought an 8BitDo Ultimate 2C Wireless Controller for Windows PC and Android from Amazon. It can connect either via Bluetooth or a proprietary 2.4GHz USB dongle. It’s mostly worked fine with the 2.4GHz on my PC. I’m not able to pair it with my onn Android TV via Bluetooth, not sure yet what’s wrong. It seems to start pairing, the controller vibrates, then the TV says it can’t pair.

There is also a 8BitDo Ultimate 2C Bluetooth Controller for Switch and Switch 2 (on Amazon). This is a similar controller but is Bluetooth only, no 2.4GHz. And it only advertises Switch compatibility, nothing else.

I’m not sure why this is so complicated. PC gaming has been plagued for decades with XInput vs DInput, a lot of controllers have a physical switch to select between the two. Switch apparently has its own Bluetooth HID profile that’s different again. 8BitDo is doing customers no favors by making two incompatible products with very similar names.

To make matters more confusing, 8BitDo has a firmware updater. But while version 2.50 supports a bunch of controller types it does not support the Windows Ultimate 2C. It does support “Ultimate 2C Bluetooth” though, by which they apparently mean the Switch version. When I run the software and plug my Windows controller in via USB it starts vibrating in a little pattern but there are no update options that work.

The trick is to use a different program, the 8BitDo Ultimate Software V2. It’s unsigned so Windows gives a scary warning but it runs and updates my controller fine. This software has a bunch of advanced features like macros and button remapping but I’m not sure any work on my 2C.

8BitDo make excellent hardware, their controllers are great and cheap. But the software situation is not good. I also am frustrated by all these controller modes and incompatibilities but that may not be entirely 8BitDo’s fault.

BTW, the firmware upgrade didn’t fix my pairing problem with the onn streaming device. The same controller pairs fine with my Pixel phone, so I’m guessing it’s a problem with the onn. The onn does work with the controller with the 2.4GHz USB dongle. Steam Link works great on it!

MuOS on Anbernic

I’m still tinkering with my Anbernic RG35XX, a remarkable cheap retro gaming handheld. This time around I’m looking at muOS, the most popular third party firmware. It’s a Linux distribution with emulators bundled up and a decent simple UI. It has pretty good hardware compatibility with the console, stuff like Bluetooth is said to work.

The installer takes a long time but when it finishes you’re left with a tidy system. Here’s what’s on the SD card after install

Number  Start (sector)    End (sector)  Size       Code  Name
   1           73728           90111   8.0 MiB     EF00  spare
   2           90112          155647   32.0 MiB    EF00  boot-resource
   3          155648          188415   16.0 MiB    EF00  env
   4          188416          319487   64.0 MiB    EF00  boot
   5          319488         8708095   4.0 GiB     EF00  rootfs
   6         8708096       124735484   55.3 GiB    0700  roms

More or less like the Anbernic stock OS with a bewildering array of tiny partitions related to system booting. Sensibly they put the roms on the last partition where it can be resized easily. One nice thing about muOS: when you install it, it resizes that partition to use up the rest of your SD card. The popular tiny-best-set-go collection of ROMs is about 8GB, so you can fit a full capable retrogaming system with ROMs in a 16GB SDcard.

Surprisingly that ROMS partition isn’t empty after installing the stock muOS distribution. But I don’t think it has any copyrighted games in it. It’s got 3.7GB of stuff in it though. Not sure what all is there, it looks like stuff RetroARCH needs like emulation libraries, music files, shaders, some cheats.

The root filesystem is 1.3GB. The core system seems to be based on busybox. I don’t see any evidence of apk though, so maybe not Alpine. Something custom? No systemd either, no surprise. /opt has openssh, java (?!), and a big directory for openssh with bloated things like tailscaled, syncthing, and rclone in it. Useful software but not quite in keeping with the tiny core. Odd hybrid, I wonder if it’s documented.

It seems to work to unpack the Tiny Best Set into the ROMS directory on muOS and have a bunch of playable games. No need to use the second SD slot.

Anbernic firmware options

Still tinkering with this retrogaming handheld, an Anbernic RG35XX-H. Curious now about firmware options. Sources include here (out of date) and here and here and this AI answer.

  • Stock Anbernic firmware. Mostly running RetroArch, presumably does a good job with hardware drivers. My specific model is downloadable here. Latest seems to be dated 2024-10-18. I think the version that shipped with my device is 2024-01-12. (I updated and it seems nicer, more consistent UI.) One thing I’m clear about is whether there are 64 bit versions. The version that shipped is 32 bit.
  • MOD4, the stock firmware modified with things like an FTP server, NTP to set the clock, etc.
  • cbepx-me mods, another modified stock firmware.
  • Knulli, a fork of Batocera, an OS popular with the RPi crowd. The FAQ says it’s forked because of a license issue with closed source kernels. I couldn’t even find a Batocera download for the RG35XX. Koriki is another Batocera fork you see mentioned sometimes, made to be smaller / lighter.
  • muOS. Another full featured custom system, not sure what distinguishes it from the others. It looks like a pretty solid product though and folks on Reddit like it. Said to boot fast.
  • GarlicOS, so called to remind people of OnionOS, a firmware for a different retrogaming device. More info here. It’s.. medium sized, if I can say that? 250MB for the rootfs. Comes in 32 and 64 bit versions. The install instructions make it sound like you put it on top of the stock firmware, huh.
  • MinUI with an emphasis on being minimal. Quite small, 60MB for the whole thing (with extras) compared to 2GB for some others. Somewhat limited set of emulators for consoles. It installs on top of the Anbernic firmware.

Broadly speaking the firmware is doing two things.

  1. Booting and device drivers and basic system stuff. Also enhancements like network support, customizability of the UI, etc.
  2. A series of emulators. RetroArch is king here but there’s others.

I can imagine a lot of room for experimentation with usability, convenience features like networking, etc. Seems like a fun and vital area of hackery.

Update: a little poll on Reddit has MuOS as the popular choice by far.

Anbernic default OS

I got an Anbernic RG35XX H, a remarkable inexpensive retrogaming handheld computer. Apparently it’s an Android device at its core but it ships with an OS and GUI that is entirely about launching game emulators. And it’s really a Linux system. I hope to customize or at least upgrade the software, maybe starting with this guide.

The device was shipped to me with a 64 GB MicroSD Card that booted. Mostly it runs RetroArch and it had a wide variety of ROMS preloaded. Here’s what’s on it.

The card has six partitions:

Number  Start (sector)    End (sector)  Size       Code  Name
   1           73728        96542719   46.0 GiB    0700  Roms
   2        96542720        96608255   32.0 MiB    0700  boot-resource
   3        96608256        96641023   16.0 MiB    0700  env
   4        96641024        96772095   64.0 MiB    0700  boot
   5        96772096       113549311   8.0 GiB     0700  rootfs
   6       113549312       121063423   3.6 GiB     0700  UDISK

Partition 1, Roms, is a FAT filesystem. With a bunch of presumably unlicensed ROMs on it, naughty naughty. There’s 45 different systems here! There’s 700 ROMs for Atari 2600, for instance, although they stop at the letter H. 466 for GBA but the whole alphabet is represented. So a sort of demo collection but not carefully curated. Other big directories under Roms include bios, anbernic/bezels, and save. That save directory includes save games created by emulated ROMs I had run.

Partition 2, boot-resource, is a FAT filesystem. It contains a few images in BMP format for battery state, a boot logo, etc.

Partition 3, env is a mystery. File just says it is “data”. The first few bytes include what looks like Linux kernel command line parameters. Probably part of the boot chain.

Partition 4, the Boot, looks like a “Android bootimg”. It doesn’t have a filesystem I can boot. Maybe these tools would help.

Partition 5, the RootFS, is an ext4fs that has an ARM32 Ubuntu 18 (!) system. Presumably this is the OS for Anbernic. The directory /mnt/vendor seems to have all the interesting game related stuff in it.

  • vendor/deep/retro is the biggest software package, it’s RetroArch.
  • vendor/deep also contains PPSSPP (PSP), openBOR (side-scrollers), and drastic (Nintendo DS)
  • vendor/bin/game has what look like a bunch of emulators in it, 32 bit ARM executables.
  • vendor/ctrl looks like shell scripts for the Anbernic system, things like mounting SD cards or configuring CPU parameters.
  • vendor/oem/version.ini is handy, it tells me 20240112.

Partition 6, the UDISK, is an ext4 filesystem. It’s basically empty but has stuff called dmenu and save in it.

Booting Windows 11 23H2 to Steam Big Picture

I want my new TV gaming PC to boot all the way in to Steam Big Picture with no keyboard required. This is remarkably difficult and all the docs you find are outdated because Win 11 23H2 changed some things. Microsoft really doesn’t want you do this. Partly for good reason (it removes local system security) and partly because they are trying to force you into their monopoly experience.

This worked for me:

1. Log in locally, not with Microsoft account

Settings > Accounts > Your info has a “Sign in with a local account instead”. Turn that on.

Documented here, at least until Microsoft hides the docs again. When I did this I got warned I needed to back up my Bitlocker encryption key first, I guess because ordinarily that’s stored in your Microsoft key. I just removed Bitlocker entirely instead.

2. Re-enable the “no password” UI option

Go in RegEdit to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device and set the value DevicePasswordLessBuildVersion to 0. (Mine was 2).

This is a new thing in 23H2, documented here. If you don’t, the next step won’t work.

3. Enable passwordless login

Run the program netplwiz. Uncheck the checkbox at the top for “Users must enter a user name and password to use this computer”.

Documented here. This doesn’t work in 23H2 if you don’t do step 2 to re-enable it. Why the stupid program name? It started life as the “Add Network Places Wizard”, terminology from Windows 95.

4. Get Steam to start at boot in Big Picture mode

Go to Steam Settings > Interface. Enable “Run Steam when my computer starts” and “Start Steam in Big Picture Mode”.

Documented here. The web has all sorts of complicated docs with registry edits, batch files, replacing the Windows shell, etc... None of that is necessary.

Windows gaming PC

On a whim I bought a MinisForum UM690 Pro (Venus), a small form factor PC to use for light gaming on my TV. It’s fairly beefy for a small box, AMD 6900HX processor, Radeon 680M graphics, 32G of RAM. All for $430 on Amazon. More than double what I paid for the N100 server I bought last year but this was the cheapest I could get for what I wanted. My metric here was something with a real GPU, not just integrated. Then I kept bumping up the price a bit to hit the sweet spot of price / performance / newness. I also picked a dual LAN model in case I want to repurpose it as a router.

Hardware

The hardware seems pretty good. My only complaint is that the fan comes on pretty quickly and is not as quiet as I’d like. It’s nothing terrible, not like the vacuum cleaners of old, but it’s definitely not silent. The BIOS makes it look like there’s two fans maybe?

The GPU is OK but not amazing, benchmarks and specs put it at ⅓rd of a Radeon 1080 or 2x a Steam Deck.

At full synthetic load the system pulls about 90W. CPU is at 80°, GPU is at 60°. Fan is noisy but not awful. During normal light use it’s about 30W and the fan is a very quiet hum. 60W playing DRG: Survivor, a light 3d game. Idle is 10W and full sleep mode is 1.5W. It’s not great thermal engineering but it seems to do the job.

Update: the fan is annoying, it seems to come on in short loud bursts instead of a slow steady growth, even under constant load. Unfortunately there’s apparently no way to read or control the fan speed in software. Over on Reddit there are folks complaining and talking about replacing the hardware’s fan with something connected to USB they can control. See here for instance.

I have a beloved Logitech K830 wireless keyboard/mouse that I’m using with it now. Curious about weirdo keyboards like this one: obviously no good for regular typing but enough for pressing a few buttons to log in or launch something. Update: I ordered a Fosmon Mini Bluetooth keyboard.

For games I’m using an old Xbox controller with the unobtainium USB dongle. The pairing is flaky and won’t wake the system from sleep. I gather Xbox controllers are still the best choice for PCs. 8BitDo also makes good controllers for cheaper, I’ve pre-ordered the Ultimate 2C. Note there’s a feeling you’d rather have proprietary wireless because Bluetooth has high variable latency.

Windows 11

Windows 11 sure does not spark joy. There’s so many upsells and manipulations from Microsoft I feel like I’m fighting a war. OFGB is a help with that. I was originally going to reinstall Windows because I wasn’t sure I trusted whatever MinisForum installed but it seems fine. No bloatware at all. It does come with a Windows 11 Home license so that’s a bit of a nuisance, I’d really like Pro so I had remote desktop access. I may yet buy a cheap license key to upgrade.

I had a brief moment of excitement when I flashed the BIOS and it rebooted demanding my BitLocker key. I guess the drive is encrypted? I had no idea what the key might be. Fortunately Microsoft has a thoughtful recovery system, the BIOS displayed a URL to visit and I found my key there in my Microsoft account. All this stuff requires networks and logins of course but these days I just accept that’s the thing.

MinisForum has a nice driver distribution in the support page. Nothing too exotic, mostly it’s just AMD drivers. The only problem I’ve fun into is nothing seems to be able to read the fan speed. Hardly a big deal.

Software

I’m resisting the urge to install too much on this machine. Keep telling myself it’s for games, not a real working machine.

Steam, of course, for games. Its Big Picture mode is really nice. I haven’t yet figured out how to get the computer to boot into this mode, it may not be possible since Windows really wants you to type some sort of login PIN or something when the computer starts. That also means I need to keep a keyboard around, ugh. (“Local only account” I think is the solution for the PIN but I haven’t tried it.) Update: I set up autologin, notes here.

Playnite is an interesting alternative cross-platform game launcher. I gave it a quick try and I think I’ll stick with Steam. Playnite is interesting if you are playing a lot of games from other sources. The UI is pretty databasey though and it lacks Steam’s great “show only controller games” filter. Also doesn’t seem to fully support controller itself although it does in full screen. I do like how it uses IGDB though.

I’ve also installed UltraVNC for remote access. It’s clumsy software but does seem to work. The remote access world has gotten real weird, there’s a zillion different products out there that all seem a bit sketchy. VNC is still alive and well, TightVNC is the other one that comes recommended. RustDesk also looked interesting to me for something new.

Update: RustDesk seems to perform much better over LAN. All of them have bugs, like you can’t reliably resize windows on the remote desktop. (Alt-Space > Size helps with this.)

I installed Controller Companion. It’s a $3 Steam app that lets you use a game controller as a keyboard and mouse replacement. The mouse is great but the on-screen keyboard is clumsy. But it does kind of work and seems useful. It’s nearly abandonware: the last real work was in 2017 and the last update at all was 2020. JoyXOff is a free alternative that had an update in the last year. Steam also can do this itself if you enable Steam Input in desktop (in the controller settings.)

I’m having problems swapping between a running game and other stuff. Big Picture is 2160p and the game is 1080p fullscreen and when I Alt-Tab out of the game, Big Picture is in a window covering the top ¼ only. I think it’s supposed to be full screen though, maybe I didn’t tab to it on top?

I had a maddening problem where games would only run at 1080p 30Hz with vsync turned on. Without vsync they’d run at 120fps, so it wasn’t the GPU not keeping up. Finally figured out Windows had for some reason decided to run the display adapter at 2160p 30Hz, despite all the cables and monitor working fine at 60Hz. Took awhile to figure out: the Very Fancy AMD Adrenaline software that claims to optimize everything never noticed. Neither did Windows, nor Steam.

PS5 controllers vs Anker USB chargers

For years I’ve been annoyed that Sony Playstation controllers won’t charge when plugged into my high quality Anker USB chargers. They charge fine on the PS5 itself but not an external charger. Turns out this is sort of Anker’s fault, at least according to an informed-sounding reddit post.

It’s a screw up on both sides, Sony and Anker.

The reason the Anker charger won’t charge the PS5 controller is because the Anker does not correctly follow the rules of the USB Type-C specification, which forbids proprietary charging modes, and requires that USB-C chargers present as a USB BC 1.2 DCP (ie, a short between the D+ and D- lines.

The Anker charger presents Apple, Qualcomm, and other proprietary charging modes on D+ and D-. This is Anker’s “PowerIQ” technology, which tries to present a grab bag of random proprietary fast charging modes in an attempt to make the other side happy no matter what.

The Sony controller *requires* BC 1.2 DCP in order to start charging from a charger. This is technically also not spec compliant, as it should start charging from any 5V 1.5A or 5V 3A charger signaled via USB-C...

But yeah... in this case, the PS5 controller doesn’t charge because both sides aren’t following the USB-C spec in their own ways.

So the key protocol here is USB Battery Charging 1.2 Dedicated Charging Port. This spec dates to 2010 and works with old USB A devices. It predates the USB Power Delivery protocol from 2012 that I think is the hallmark of good USB C charging.

For USB BC, the charger simply connects the otherwise unused data D+ and D- lines with a 200Ω resistor and that’s a signal to the device it’s connected to a dedicated charging port. Unfortunately a bunch of other common proprietary devices (Apple, Qualcomm, etc) used D+ and D- in different ways to control charging. Anker supports those under the name “Power IQ” but then that doesn’t do USB BC.

It may be impossible to build a device that reliably supports all these old different weird ways of signaling charging. I’m sympathetic to the argument that in 2024, chargers should no longer be doing out-of-spec stuff for 10+ year old devices. But that’s a product choice that’s not clear. Also Anker is very proud of PowerIQ, back in 2014 or whenever it seemed like quite an innovation.

Sony could sure help by updating to USB PD.

Some more reading here, here, here, here.

Vaguely related; the PS5 DualSense battery is 1560mAh. There’s third party replacements that are 2650 mAh. Details here. My Pixel 8 has a 4575 mAh battery. Anker’s power packs are 5,000 to 40,000 mAh.

8bitdo SN30 Pro controller vs Steam

I have an 8BitDo Sn30 Pro game controller, a nice little portable Bluetooth / USB game controller that works in various modes. I had some initial flakiness but now it’s working well. The best discussion I’ve found is this Steam forum thread; if you read past all the rude people flaming each other there’s some useful info.

Working with a USB wired connection is easy. Working with Bluetooth seems to work reliably for me, at least right now. But I had to remove and re-add the device in Windows Bluetooth settings at least once, for awhile it was acting flaky.

The first insight is that the 8bitdo controller works in several modes that you can switch between depending on how you turn it on / use it.

  • Start+Y: Nintendo Switch mode.
    Windows sees this as “Pro Controller”, Steam sees this as “Nintendo Switch Pro Controller”. It seems to work pretty well for PC games although Steam may have to remap some inputs for you because few PC games support this directly.
  • Start+B: “Android mode”, which I think is the older DirectInput API.
    Windows says “8Bitdo SN30 Pro”, Steam says “Bluetooth Wireless Controller”.
    Steam made me set up the button mappings, pressing each button in turn. All of them worked except the last share button.
  • Start+X: “Windows mode”, which I think is the newer XInput API.
    Windows says “8Bitdo SN30 Pro”, but gives it a different listing in the Bluetooth devices from the Android mode entry. Steam says “XInput Controller”. Works well but no share button.
  • Start+A: “macOS mode”.
    Windows calls it a “Wireless Controller”, Steam calls it a “PS4 Controller”. The buttons all seem to work as expected.

The second insight is that these modes look like completely different Bluetooth controller entries in Windows. It’s like you own four separate devices depending on which way you turn the controller on. You have to configure each one individually in Windows. (Or pick the one you want and stick with it). I think one time it got confused and that’s why removing the Bluetooth device and re-adding it helped.

I think XInput mode is probably the best choice for most PC games.

There’s a small Star button in lower left on the 8bitdo. This works as a regular button in Nintendo Switch mode. But in XInput mode (and DInput?) this is a Turbo button, if you hold it down with a different button it toggles that input rapidly. In that mode the button itself doesn’t seem visible to the PC. Not a big loss but it means you won’t have a Share button.

One extra quirk: I bought the Switch edition of the SN30 Pro which has Nintendo’s bizarro button layout painted on the controller. So the button at the bottom of the cross on the right says “B”, not “A”. Steam has you identify buttons more by position than the labels so it’s not too big a deal to adapt.

PS: a big raspberry to Sony whose PS5 controllers are prone to stick drift. I used Steam to see the numeric outputs from the device. The stick gives reading from -32767 to 32767 with ideally 0 when at rest, or at least close to 0. My stick regularly jumps between -20000 and 0 with no input at all. I can’t even set a deadzone easily, Steam’s max is 18000. (And mapping 2/3 of the range to 0 is not a great experience anyway.) This flaw is common among PS5 owners. They aren’t cheap at $70.

Installing a Valheim server

Now that I have Proxmox I can easily spin up VMs or containers for things I would ordinarily be suspicious of running on my real server. I’ve been enjoying the game Valheim recently so I ran a server there following these instructions. In detail.

First, I took a detour through Game Server Managers that ended up being a dead end. These are special OS installs optimized for installing game servers, often Linux-based. I was hoping for something with a button to press that said “install Valheim”. I didn’t find anything Proxmox specific. I liked the look of AMP but it’s proprietary. I installed this TurnKey GameServer and tried to get it working but ran into a lot of problems. I finally decided using a manager was adding unnecessary complexity, particularly since I have Proxmox as a VM manager already.

So I installed Debian 12.4 in a VM on Proxmox. Then I followed these instructions for installing Valheim which more or less worked although read the comments on the gist for some updates since the instructions were written. It’s all pretty straightforward except for the use of steamcmd, a new-to-me tool. That’s a command line version of Steam for running servers and the management of authentication, etc is a little opaque. Since these instructions were written Steam has added an anonymous mode for game servers that might be easier.

It all basically just worked. Last thing I had to do was forward port 2456 on my router so I could connect from elsewhere.

Proxmox makes this kind of tinkering a pleasure. I like how I can snapshot a guest OS and try something with a chance of recovery. I also like the full isolation of a VM. I should set up some sort of subnet so that I can install things like this that can’t access my main home LAN. Only it still has to be able to talk to the Internet through the router. That’s tricky but I think Proxmox has some help for doing that.

I’m trying to use Debian instead of Ubuntu for this kind of project. It’s surprisingly different, like it doesn’t use netplan for network config by default. Here’s a list of packages I installed that I’ll probably want in any Debian system:

sudo joe chrony curl screen net-tools avahi-daemon

Game streaming with GeForce Now

A couple of weeks ago I tried streaming a game to my Chromebook via GeForce Now. It worked surprisingly well in some ways but the video quality was bad enough it wasn’t much fun.

The main goal was playing Satisfactory (a first person game but slow, not twitchy) on my Chromebook. I paid for the Priority service, which gives you 1080p @60fps and a powerful enough server. It all worked OK and the experience was nearly seamless. But the video quality was awful. It’d constantly drop down to really blurry graphics. If I sat still and didn’t move the camera it’d look OK but the moment I moved it was awful.

I think it may have been the WiFi I was using. It was good WiFi and speed tests showed 50Mbps or more with low latency. But even good WiFi has some packet loss and that’s the enemy of quality. FWIW performance was better on my Windows machine wired to a fast gigabit fiber. Also pretty good for ethernet + Starlink. But good heavens if a streaming game service can’t work on good WiFi what’s the point?

I was able to improve things on the WiFi a bit by disabling “adjust for poor network conditions”. Before I did that the stream would regularly drop from 1080p as far down as 480p for a couple of seconds. It seemed to run much better locked to 1080p.

I don’t think it was the Chromebook; it looks bad on my gaming PC too. It’s possible paying $20 for the Ultimate service would help things. I’m fine with just 1080p@60 but maybe paying for a better server results in a better quality video stream?

Even on the fast ethernet networks the video compression quality is really weird. Here’s some screenshots comparing the same scene in three scenarios. (Click to enlarge, they are all lossless PNGs). 1080p on the native game (ie, perfect). Then the best picture I could get out of GeForce Now streaming. And finally the worst picture from GeForce Now. Captured by spinning the camera and snapping a photo. The game is not doing motion blurring, it should look sharp. These were all generated on my Windows gaming PC, GeForce Now running in Chrome.

That right image from GeForce Now is just unacceptable to me. And that’s what you see most of the time, when the camera is in motion. The middle one where GeForce Now is doing its best is also not great. I can only think that compressing a video stream at 60 fps with very low latency is hard and their streaming platform isn’t up to it.

FWIW the streaming client seems to use up to 30Mbps for the 1080p stream which suggests it’s very fast compression. There’s options for limiting the bitrate and I tinkered with those but mostly have left them unlimited.

Good things.. The latency is great, even with a 50ms+ lag from Starlink it feels very responsive. I didn’t try a twitchy shooter or anything but it felt like I was playing locally. The user experience is also very simple. It all runs in a browser and you can easily use your existing Steam library (including Steam Sync for save games). The free level is good enough you can see how it works but you definitely want to pay for the $10/mo premium for higher quality. (Not sure the $20/mo is worth the improvement, I didn’t try it.)

BTW there’s precious few docs. Press Ctrl-N for streaming performance stats and Ctrl-G for the GeForce Now settings.

I dunno, it’s remarkable this technology works at all. Game streaming has worked for over 12 years now! But somehow it’s never quite caught on. GeForce Now solves a lot of problems: easy to use, simple business model without some weird game subscription required. But the video quality was just not good enough, particularly on WiFi.

Nintendo Switch image downloads

The Switch has a screenshot function that saves images to an “album” in system storage. There’s a bunch of ways to download those images; plug the Switch in to a PC via USB, transfer with an SD Card, upload them to a social media service.. Or the slickest way, ad-hoc WiFi.

The process is described well in this article. Briefly the steps are:

  1. Select photos to download and say you want to share to your phone.
  2. Connect to a Switch ad hoc WiFi network. You do this by scanning the QR Code the Switch displays. It contains a WiFi Card string which has the SSID and password. The phone connects automatically to the network when you scan the image.
  3. Connect to a web server the Switch is hosting at 192.168.0.1. You do this by scanning a second QR Code that contains an URL. Your phone opens a web browser with the images in it.
  4. Save the images from the web page however your phone lets you.

It’s pretty slick. Also remarkably complex from a technology point of view, but using it is fairly simple.

Awakened PoE trade, AI complexity

I am playing the game Path of Exile again and continue to be amazed at the complexity of the third party tools gamers have created for it. The game doesn’t really support addons or anything, it’s all hacked on. A few years ago I looked at how PoB Item Tester worked; this time around it’s Awakened PoE Trade (APoET).

There’s a feature where APoET will take a screenshot of the screen, OCR the text on the caption of an item, then tell you whether it is valuable. It’s a little flaky but when it works it’s a huge convenience over alt-tabbing out and doing a web lookup.

The tech it uses is remarkably complex. APoET itself is an Electron app written in 8500 lines of TypeScript and 6800 lines of Vue. It’s a strange UI, built to run as popups on hotkeys while playing the game; not at all like a typical Electron windowed app.

The OCR code is just 326 lines of TypeScript. To use it you install a binary blob. In that is Tesseract, a nearly 40 year old OCR library that has gotten a bunch of updates over time. The modern version is based on OpenCV (itself 20 years old) and some machine learning model boiled down into 4MB of weights. The code for these libraries are a further 5.5MB of WASM binaries. It’s called “tesseract-core-simd”; news to me that WASM could take advantage of SIMD instructions, I guess that’s a few years old.

Anyway it’s a tower of complex software building what is ultimately a pretty simple and kludgey product. I love that this is all possible and accessible even to folks hacking a tool for a game they play.

(while I’m here, the real standout tool for PoE is Path of Building, a complete theorycrafting game simulator. With 50,000 lines of hand-written Lua and another 2M lines of game data as Lua code.)

Installing Oculus on a PC: “Not Enough Space”

The Oculus Windows app installer has a bug; you can’t install it on an NTFS dynamic partition. If you try it reports there’s not enough space, despite there being plenty. Dynamic partitions are extremely common on Windows machines.

The workaround I used was to run OculusSetup.exe /drive=D. I happened to have a D drive that was a basic partition and while there’s no GUI option for choosing the install drive, there is this command line switch. If you’re not so lucky, there’s a lot of advice online suggesting making a 20GB virtual disk and installing there.

This bug is six years old. I always wonder how bugs like this happen; do the developers just not give a shit? Sometimes I think it’s incompetence but Oculus is a very impressive piece of tech in general. The linked Reddit discussion suggests this is some ham-handed attempt to avoid installing to removable media, so maybe it’s deliberate. Maybe it’s a DRM thing? What a stupid decision if so.

Gaming: Starlink vs Path of Exile

I’ve been using Starlink since March. I’m also a gamer. While Starlink has gotten a lot better for gaming it’s still not perfect. See this lag graph for an example. Basically every few minutes the game freezes for a second or so and I’m 95% sure it’s Starlink packet loss. It doesn’t make the game unplayable but it is annoying.

https://i.imgur.com/6Xi4Xk8.png

Path of Exile is unusual in that the default network mode is lockstep. It only draws a frame if it receives a network packet from the TCP stream, so any packet loss and retransmit delays is immediately visible. Most games compensate for network flakiness by guessing at what probably should have happened and then catching up once the network resumes again. PoE has the option to do that too, but by default they show you exactly what’s coming in on the network. No packets, no updates.

So it’s a nice example of how Starlink’s momentary outages can cause problems. You won’t notice it streaming a video or loading web pages. You’ll see occasional hiccups in a live videoconference. In PoE you see little lag spikes.

I have more proper monitoring for similar loss: see my latency graph based on sending 5 pings at once every 5 seconds. Each red dot is packet loss. It’s really quite good but you see some latency spikes and a few lost packets here and there.

https://i.imgur.com/fNh1BVP.png

(I also posted this to Reddit.)

No Man’s Sky biomes

I still play the amazing generative graphics game No Man’s Sky. One nice thing is the game has 11 different kinds of planets with different biomes. Each biome has a list of different names the game might use to describe them. It’s not always obvious what biome a name describes. So here’s a list of them all for easy searching. See also here and here for other sources, or my data as a spreadsheet.

This data is current as of September 2021 including the Frontiers update of NMS (3.6).

[REDACTED]Exotic - Glitch
[REDACTED]Mega Exotic
AbandonedBarren
AbandonedDead
AcidicToxic
AcridToxic
AirlessDead
ArcticFrozen
AridScorched
Ash-ShroudedVolcanic
AshenVolcanic
AzureMega Exotic
BarrenBarren
BasaltVolcanic
BladedExotic - Irri Shells
BleakBarren
BlightedToxic
BloodMega Exotic
BoggyMarsh
BoilingScorched
BountifulLush
BreachedExotic - Beams
BreachedExotic - Glitch
BubblingExotic - Bubble
CabledExotic - Contour
CalcifiedExotic - M Structure
CappedExotic - Hydro Garden
CausticToxic
CeruleanMega Exotic
CharredScorched
Chromatic FogMega Exotic
CloudyMarsh
ColumnedExotic - Shards
ContaminatedIrradiated
ContouredExotic - Contour
CorrosiveToxic
CorruptedExotic - Glitch
CrimsonExotic - Glitch
CrimsonMega Exotic
DampMarsh
DeadDead
Deathly Green AnomalyMega Exotic
Decaying NuclearIrradiated
DesertBarren
DesolateBarren
DesolateDead
DoomedExotic - Glitch
Doomed JadeMega Exotic
DustyBarren
EmptyDead
Endless MorassMarsh
ErasedExotic - Glitch
EruptingVolcanic
FieryScorched
FinnedExotic - Irri Shells
FissuredExotic - Beams
Flame-RupturedVolcanic
FlourishingLush
FoamingExotic - Bubble
FoggyMarsh
ForsakenDead
FracturedExotic - Wire Cell
FragmentedExotic - Wire Cell
FreezingFrozen
FrostboundFrozen
FrothingExotic - Bubble
FrozenFrozen
Frozen AnomalyMega Exotic
FungalExotic - Hydro Garden
Gamma-IntensiveIrradiated
GlacialFrozen
GlassyExotic - Glitch
GrassyLush
Harsh Blue GlobeMega Exotic
Haunted EmerilMega Exotic
HazyMarsh
HexagonalExotic - Hexagon
HiemalFrozen
High EnergyIrradiated
High Radio SourceIrradiated
High TemperatureScorched
HotScorched
HumidLush
HyperboreanFrozen
IceboundFrozen
IcyFrozen
Imminent Core DetonationVolcanic
IncandescentScorched
InfectedExotic - Glitch
IrradiatedIrradiated
IsotopicIrradiated
LavaVolcanic
Life-IncompatibleDead
LifelessDead
Lost BlueMega Exotic
Lost GreenMega Exotic
Lost RedMega Exotic
Low AtmosphereDead
MagmaVolcanic
MalfunctioningExotic - Glitch
MarshyMarsh
MechanicalExotic - Fract Cube
MetallicExotic - Fract Cube
MetallurgicExotic - Fract Cube
MiasmaticToxic
MistyMarsh
MoltenVolcanic
MurkyMarsh
NoxiousToxic
NuclearIrradiated
Obsidian BeadVolcanic
of LightExotic - Beams
OssifiedExotic - M Structure
OvergrownLush
ParadiseLush
ParchedBarren
PetrifiedExotic - M Structure
PillaredExotic - Shards
Planetary AnomalyExotic - Glitch
Planetary AnomalyMega Exotic
PlatedExotic - Hexagon
PoisonousToxic
QuagmireMarsh
RadioactiveIrradiated
RainyLush
RattlingExotic - Bone Spire
ReekingMarsh
RockyBarren
RottingToxic
ScaldingScorched
ScalyExotic - Hexagon
ScarletMega Exotic
ScorchedScorched
ShardedExotic - Shards
ShatteredExotic - Wire Cell
Shell-StrewnExotic - Irri Shells
SkeletalExotic - Bone Spire
SpinedExotic - Bone Spire
SporalExotic - Hydro Garden
Stellar Corruption DetectedMega Exotic
Sub-zeroFrozen
SupercriticalIrradiated
SwampMarsh
TectonicVolcanic
TemperateLush
TemporaryExotic - Glitch
Terraforming CatastropheDead
ThirstyExotic - Glitch
TorridScorched
ToxicToxic
Toxic AnomalyMega Exotic
TropicalLush
TropicalMarsh
UltramarineMega Exotic
UnstableVolcanic
VapourMarsh
VerdantLush
Vermillion GlobeMega Exotic
Vile AnomalyMega Exotic
ViolentVolcanic
ViridescentLush
VolcanicVolcanic
WebbedExotic - Contour
Wind-sweptBarren
Wine DarkMega Exotic

Dyson Sphere Program

I just finished a first playthrough of a really great early access game, Dyson Sphere Program. I don’t normally talk about games here but this game is so much like programming it seems relevant. Also it’s pretty and it’s fun.

DSP is a Factorio clone. Or to be more fair, a “factory automation game” since it’s now kind of a genre. But DSP is a lot like Factorio and it’s quite apparent when you play.

The big innovation is that it’s a lot more beautiful, as the screenshot above demonstrates. Full 3d graphics. And it’s not just a gimmick; not only does it look great but it performs well. And you even play in 3d a bit, the conveyor belts can be woven at different altitudes letting you make some nice bus designs. Also planets are actually spheres which has some implications.

The other big change is that it’s a multi-planet game. You start out building a factory on a single planet but there’s resources you’ll need to go to another planet in your system for and later on, you’ll bring in rare resources from other stars. Honestly this doesn’t add a lot of complexity but it does add some beauty and variety. (There’s a good Factorio mod called SpaceX that creates something similar.)

And the third big change is there’s a grand goal, swallowing the sun in a Dyson Sphere to generate power. You can see my nearly completed sphere rising over the planet in the picture above. The Sphere gives a purpose to all the construction that’s a bit more tangible than Factorio’s “build a rocket”. Also it’s real pretty and makes a useful power resource when it’s complete.

One nice improvement in DSP is a lot of quality of life stuff, UI improvements that make building things easier. OTOH the game is still in early access - the blueprint system only was released a week ago and has some rough edges. One of my favorite features is the devops dashboard, er, the production monitoring graphs. Here’s some details of the growth of my empire over the 65 hours it took me to win.

The game is really impressively implemented. It’s simulating a lot of individual components. And rendering them in 3d. It runs smooth on my fairly high end PC with a 1080Ti GPU. I read somewhere the Dyson sphere components themselves, tens of thousands, are being simulated with GPU code. Makes sense. Folks complain that this part greatly slows their PC but I didn’t have any trouble at all; maybe an artifact of how beefy a GPU they have.

The game is still early access and is missing some things I’d like to see. Some UI for monitoring and controlling the logistics network would be nice, it plays a bigger role in DSP than Factorio. It’d also be nice to have more game systems to design; there’s no analog to fluids or trains, for instance. Also the DSP folks have promised to add some defense / military aspect of the game. I’m fine with a peaceful builder but it could be interesting to have the challenge. Finally there’s no multiplayer, not even one promised, that seems like a mistake to me.

There’s a small but active mod scene for the game. No official mod support yet but the game is in Unity which is fairly amenable to hacking. There’s a few resources for writing your own mods. One point of confusion; there’s a global scoreboard called the Milky Way and various rumors that some mods keep you out of it. I asked on the Discord and was told there’s no whitelist or anything. Instead the game has its own cheat protection, it inspects its own data structures and if something modified them (say, a mod) then you are disqualified. That means info-only mods are OK and it’s determined by behavior. Unfortunately there’s no published list or info on which mods are allowed or not, you have to guess.

It’s a good game!

GoodReads for games

I love GoodReads. It’s terrific having a giant list of books I’ve read and my thoughts about them. Also it’s got a nice community, a low key social network. There’s a lot of reasons to complain post-Amazon-acquisition, particularly about how little development the site gets, but it’s still good.

I’ve never managed to get into Letterboxd, the equivalent popular site for movies. I’ve started using it again recently and am doing a little better but I sure wish I had notes on the 500+ movies I’ve watched in my life, particularly back when I was watching 3 movies a week.

So what about video games? I went looking and found various options. See also this list. “Reviews” refers to folks who at least entered a rating for the game. I’m using three games to compare user populations: Ratchet & Clank Rift Apart (2021), No Man’s Sky (2016), and Majora’s Mask (2000).

Grouvee

No Man’s Sky: 3005 users, 1026 reviews
Rift Apart: 274 users, 116 reviews.
Majora’s Mask: 5404 users, 2754 reviews

Steam import implemented
Export implemented

GG

No Man’s Sky: 350 users, 44 reviews.
Rift Apart: 337 users, 129 reviews
Majora’s Mask: 60 users, 51 reviews

Steam import on roadmap
Export not mentioned?

Backloggd (numbers approximate)

No Man’s Sky: 1500 users, 900 reviews.
Rift Apart: 446 users, 380 reviews
Majora’s Mask: 4200 users, 2500 reviews

Steam import on roadmap
Export on roadmap

HowLongToBeat (backlogs + beat)

No Man’s Sky: 2700 users, 256 reviews
Rift Apart: 1000 users, 285 reviews
Majora’s Mask: 2500 users, 516 reviews

Steam import implemented
Export implemented

Main conclusion from that is GG is a much smaller userbase. Anecdotally, Backloggd shows up in recent discussions on ResetEra, etc. Grouvee and HowLongToBeat have been around longer. I also think it looks like Backloggd is as popular as Grouvee now but missed out a few years ago when No Man’s Sky came out. I like how many folks on these platforms rate Majora’s Mask, that’s a classic and sophisticated game for folks to know.

I like that Grouvee and HowLongToBeat already has the import and export features I want.

PS5 vs TCL 6: dark HDR

I’ve got my Playstation 5 plugged directly into my TCL 6 Series TV. That makes for what should be a great picture: 2160p resolution, HDR10 color. It looks great! When it works.

The setup started developing a problem where sometimes when I turned it on everything was way too dark. Like the whole picture was scrunched down to 0-50% brightness. It happened randomly and maybe dependent on the order I turned things on. But it got worse and worse until I just couldn’t use HDR anymore.

The fix is to reboot the TCL TV. No, seriously. TVs no longer turn off when they’re off, they keep running their computer in the background. So you need a full reboot via system menus (or power cord).

If you search you find lots of people online are having this problem, plenty of Reddit discussions. There’s also a bunch of other “HDR dark?” articles that talk about a different problem, which is the default picture settings for HDR are way darker than standard color. But this problem is a real bug and no amount of boosting brightness, etc will fix it.

Update: no, turns out reboots don’t always fix it. I’ve started from a soft reboot of both the PS5 and the TCL TV and gotten into the dim HDR mode. I haven’t tried a full hard / cold reboot (ie: unplug the damn thing).

I may have found another fix though, which is to go into a debug menu and select the “update dimming firmware” option. I don’t think the firmware update itself does anything, or rather maybe there’s no firmware to update. But it seems to cause the TV to reboot the HDR connection and twice now it’s come back at the right brightness. The magic sequence is HOME BUTTON (5X) - RW - PAUSE - FF - PAUSE - RW. This brings up the so called “platform menu”; there’s lots of hidden menus in Roku documented here and here.

Half a new gaming PC

I got most of a new gaming PC. ASUS X570-Pro motherboard, Ryzen 3700X CPU, 32 GB of DDR4-3200 RAM. Reusing all my old parts, including the GeForce 1080. $680 from NewEgg.

My old gaming PC gave up the ghost; wouldn’t turn on. After sitting in an 85F house for a few days and also maybe some messy power fed to it (albeit turned off). Looks like the motherboard died. I looked at just replacing the motherboard but new ones cost double what they did originally, used ones were sketchy, and there was one plausible looking new X270 motherboard for cheaper but it was a different brand and eh, good money after bad.

So asking friends for advice and a trip through LogicalIncrements I laneded on the Ryzen 3700X with the X570 chipset. Right in the sweet spot of very powerful but not absurdly expensive. Honestly picking a machine from parts these days is very simple if you’re not overclocking.

Motherboard selection is so confusing. You want to pick the right size (ATX for the old school giant computers) and chipset (X570 for the Ryzen 3700X). But beyond that.. I finally figured out ASUS made 2 “normal” motherboards and like 8 gamer boards, the main distinguishing factor of which is a variety of colored flashing lights. So I went for the fancy normal board. I could have saved $100 getting an ASUS X570-P, the barebones motherboard, but I figured it was worth paying extra for a better sound chip, ethernet adapter, and more I/O slots, etc. Probably money wasted but eh.

RAM selection is not so easy either. At some point I realized I wanted to buy the Corsair CMK32GX4M2Z3200C16 RAM, not CMK32GX4M2B3200C16 RAM. WTF? Who knows, but the first one is on the approved RAM list and the second one isn’t. It’d probably work fine, but why mess with that?

I reused my old case (Fractal Design Define R5), CPU cooler (Noctua NH-D15S), and power supply (Corsair RM750X). Props to Noctua for a cheap/free updated mounting bracket for the new CPU. All these parts turn out to be really nicely engineered and I’m glad I can reuse them. It runs so quiet! Also reused my existing SSD drives, Samsung 960 Evo and 970 Evo.

The big upgrade I didn’t do is the graphics card. This NVidia GeForce 1080 was top of the line when I bought it and it’s still able to push games pretty well. This week’s announcement of the new NVidia 3070 and Ampere friends is super impressive, so maybe in a few months I’ll upgrade.

I paid a local Grass Valley computer company to do the assembly because honestly I don’t have the patience. Particularly to remount a heatsink and get all the cables routed just right. They did nice work.

Still trying to figure out if the RAM is running right. I’m using CPU-Z and it makes me think the Memory is running slower than it could be. I need to check in the BIOS to be sure I guess.

Sometime recently Open Hardware Monitor got very good. Finally a no bullshit, standard UI temperature / fan speed monitor. Nice for keeping an eye that the thing is running smoothly.

Making Amiibo for Animal Crossing

Nintendo has this system called Amiibo where you buy little figurines for a game and then scan them on your Switch console to do various in-game things. Breath of the Wild Amiibo unlock outfits, for instance. And Animal Crossing New Horizons Amiibo unlock new villagers to come live with you.

But Amiibo are expensive! New they are in the vicinity of $20 on Amazon. And there’s some collector / scarcity thing going on too so some of the rare ones are like $100. I’m not a big fan of paying real money just to unlock digital content. I mean sure I’ll pay for a major DLC, but I have no ethical problem creating my own unlock for a character.

Anyway, it turns out that Amiibo are just NFC 215 tags. And those are easy to write with pretty much any NFC-capable mobile phone, or with a $30 bit of NFC hardware. (Surprise! Your phone can write tags as well as read them!) And of course you can easily find the tag data online.

I ended up following this guide on Reddit. The FAQ is helpful too. In short:

  • Buy some blank NFC 215 tags on Amazon. They cost anywhere from $0.25 to $1.00 each depending on volume and shipping speed.
  • Get an NFC writer. I used TagMo on my Android Pixel 3 phone. It’s an unauthorized app, so you’re taking a small security risk installing it.
  • Get the special unfixed-info.bin and locked-secret.bin files installed on the tag writer. They’re only 80 bytes each. See the Reddit guides for where to find these.
  • Get the Animal Crossing tag data. This requires downloading files of dubious licensing status. A site called NFC Bank is a popular source.
  • Burn the tag. You can then scan it again to test it.
  • In game go to Isabelle and choose the Amiibo option for inviting visitors. Scan your new tag with the game controller.

The one small bummer is the cheap tags aren’t reusable. There’s alternate hardware which will spoof NFC tags for you. I think also some more expensive writable tags are re-writable.

Another option if this all seems too hard is you can apparently buy pirated Amiibo tags on Etsy, eBay, etc. Folks put a lot of effort into making nice cards or buttons for them too so they look good.

Epic Launcher: running copied games

The Epic Launcher on Windows stores its games in C:\Program Files\Epic Games. However if you copy a game from one computer to another, the Epic Launcher on the new computer won’t recognize it or let you play it. Super annoying if you want to avoid re-downloading 60GB of stuff you already have a copy of. (Steam does not have this nuisance.)

The workaround for this is to first start installing the game on the new computer using the Epic Launcher. Let it download for a few seconds, then abort the install (don’t just pause it) from the launcher. Then go in to the folder and delete the game directory on the new computer. And then copy the files from the old computer to the new. Finally in the Epic Launcher click “Resume” and it will verify the files rather than re-download and let you play the game.

This solution is described in How to Move Fortnite to Another Folder, Drive, or PC. The problem is also discussed in EpicGamesLauncher - Recognising already installed files which includes some hints about a C:\ProgramData directory that may contain the hidden state that’s missing if you just copy the program files. I didn’t pursue that avenue for making things work but it’s a good idea.

How PoB Item Tester works

I’ve been obsessed with the Diablo-like game Path of Exile for the past few months. Great game. For the code nerd in me, I’ve been fascinated by how the community has created a bunch of addons and tools to run with the game, despite the game having no support for them. The kludges are thick and woolly and fascinating.

The primary way most of these addons work is via AutoHotKey, a Windows-specific scripting system that occupies a role a little like AppleScript does on MacOS. AHK has been around forever; its main feature is that it’s very good at capturing global keyboard events and doing odd things in the background that don’t fit the usual GUI paradigm. I use it to remap CapsLock to search Google, for instance.

PoB Item Tester is the most complex addon I know. You hover over an item in the game, press Ctrl-C to copy its description to the clipboard, then press Ctrl-Win-C to have a window popup that shows what the item would do if you used it. Behind the scenes it’s using Path of Building to do calculations that simulate game behavor. PoB is a standalone Windows program that itself is a tour-de-force of reverse engineering. It is a full GUI program written in Lua (!).

Functionality aside, it’s the integration that I’m interested in. Here’s what the AutoHotKey script does:

  1. Hook Control-Win-C with AHK to get the item from the Windows clipboard and pass it to TestItemFromClipboard
  2. Write the item to a file on disk
  3. Invoke a Lua script from AHK
  4. Pop up a window based on some GUI setup done previously.
  5. Get the file created by the Lua script and display the contents

So the other half of the integration is in Lua. It has a whole Mock Lua UI system to allow PoB to run headless. Some details on what the Lua script run from AHK is doing:

  1. Set up the Mock GUI. Buried in there is the part that launches Path of Building’s Lua code.
  2. Tell PoB to load the build to test against
  3. Create an Item object based on the file written by AHK (from the clipboard). These seems to do the actual simulation calculations.
  4. Capture the item’s tooltip as HTML and write it to a file for AHK to display.

So there you have it. The game sure wasn’t designed to be scripted, but clever use of the clipboard and keyboard hooks lets people write scripts that feel like they’re running in-game. Path of Building wasn’t written to be scripted either, but someone figured out how to hack the Lua to get it to run headless and do calculations for them. That’s a lot of very motivated hackery, I’m impressed.

PC gamepads: DirectInput vs XInput

I bought a crappy cheap game controller to use for a few weeks and ran into the total compatibility nightmare which is Windows game controllers.

Long story short, there’s two completely separate APIs. DirectInput and XInput. Old controllers (like my cheap PS3 knockoff) used DirectInput. Starting ~2005 Microsoft introduced XInput as a new API with better support for advanced controllers. It had drawbacks and some game controllers were slow to adopt it. Around 2011 Microsoft deprecated DirectInput, so everyone’s supposed to use XInput now. Despite that you can still buy new controllers that do DirectInput. Some controllers have a hardware switch to toggle modes.

What’s dumb is not all games still support DirectInput. (Looking at you, Dead Souls). Worse, Microsoft’s drivers don’t support some compatibility shims so a DirectInput device can be used via the XInput API. So you have to do something third party if you have an old DirectInput controller and want it to work with XInput. There’s three options I found:

x360ce is a thing that emulates an X360 controller and looks like an XInput driver but takes its input from DirectInput devices. I’m not sure it really is a driver, the hack includes its own XInput.dll you have to drop in to some games’ folders to fake it out. I didn’t try this, but it’s the usual old school gamer recommendation for solving this problem. It seems very flexible and hacker friendly. There’s newer binary builds on the GitHub page.

ScpToolkit is similar to x360ce, but emulates a Playstation controller. I did actually install this and found it didn’t work and uninstalling was spooky. I ended up using Windows’ rollback to remove it.

Steam Big Picture mode also includes an XInput emulator that seems to work well. I can’t find official docs for it and its confusing, but the Internet is full of badly written guides and videos on how to use it. This is what I ended up using. Setup is a bit fiddly; for awhile I was telling it to be “Generic” and it was sort of working but what I really wanted was “Playstation”. I’m still not clear if that means it’s emulating a Playstation controller, or if it is using this cheap controller I bought thinking it is a Playstation controller. Or both. Whatever, it seems to work.

Logs of Lag outage

Oh boy did I screw up. Back on September 1 I pushed a tiny change to Logs of Lag, an old service I still run for League of Legends players. It was such a simple change, just adding an HTML link, so I didn’t test it carefully. Turns out I made that change on top of the master branch which had some other changes I’d committed but never tested or deployed back in 2015, and that new-but-old code didn’t work. The site’s been broken for 7 weeks now and I only found out when a user wrote me.

I love this commit comment past-me wrote:

Potentially breaking change: webapp use new stats. This change has not been tested manually, hence the warning in deploy.sh

I did read the commit log before pushing again, but apparently I didn’t read back far enough. Also I didn’t use my deploy script to deploy the server. Talk about shooting yourself in the foot. I even have a tiny bit of monitoring on the service but it didn’t show this kind of error, not that I pay attention to the monitor anyway.

The real problem is that I’ve abandoned this project; I haven’t done real development on it in 4 years. It’s kinda broken now too as the file format the code parsers has changed over time and I haven’t kept up. I’m now 100% fed up with League of Legends and Riot Games, given how sexist and awful that company is. So I have no motivation to do more. But the tool is still useful so I’ve tried to keep it online. (Past me did one thing right: the site is mostly just running static files, so it’s not hard to keep running.)

The site doesn’t get a lot of usage, my estimate last year was 50-100 unique users a day with about ~450 uses of the tool a day. Here’s a graph of the rate of usage; you can see an organic falloff over the whole year, then it falls sharply Sep 1 when I broke the site. I wonder if it will recover.

logsoflag2-year.png

PS4 6.02: more external storage woes

As I wrote in an earlier post, on a PS4 there’s no way to make a copy of a game’s download files to an external drive. You can move the files to a drive but they are then deleted from the source. Which is a huge PITA when the game requires a 90 GB download.

But it gets better. If you plug an external drive with a copy of a game into a PS4 that already has a copy of that game, the software freaks out. It insists you delete one of the two copies before you can use the external drive. There’s no way to tell it to ignore the duplicate to, say, let you get at some other game on the external drive. You must delete first.

So not only can you not create copies of games, but if you screw up you’ll be forced to delete a copy you downloaded. Argh!

(I reiterate; none of this is about copy protection; the PS4 online DRM will prevent you from playing the game if your login doesn’t have a license for it, whether you have a copy on the drive or not.)

PS: the external drive copying is awfully slow. a 50GB game image is taking 18 minutes, or about 50 MB/s. That’s just about USB 2.0 speeds. The drive, cable, and the PS4 itself are all supposed to support USB 3.0. Maybe it’s the spinning drive speed limiting things.

PS4 5.50+ USB hard drive, copying games

A tale of failures. I wanted to copy a PS4 game I have off the internal hard drive onto a USB drive, so I could copy it onto a second console instead of redownloading 60GB+ worth of stuff. This turns out to be impossible.

Since version 5.50 the PS4 has gotten a lot friendlier about supporting USB drives. Among other things you can relatively easily plug in a USB drive and copy user data (like game saves) to and from it. The PS4 will do this with any exFAT or FAT32 disc, like your garden variety flash drive.

You can also move a game from the internal hard drive to a USB. Key point there: move, not copy. Copy is explicitly not allowed. You can only move a game to disc if the disc is formatted as “extended storage” for the PS4. I thought I’d be clever and move the game to an external drive, make a clone, then move it back. But you can’t do that easily. The extended storage volume doesn’t even have a meaningful partition table, no filesystem I can mount. I suppose I could make a block level clone of the disk but that’s too much trouble. (It’s probably just some slightly bent version of a standard FreeBSD or Windows filesystem, but I’m not going to waste time researching that.)

One last option PS4 supports is to back up your whole console to an external disc, then restore it to a different console. You can also clone one PS4 to another directly over a LAN. However in both cases the destination PS4 gets entirely wiped and reconfigured, it’s not suitable for making a copy of a game.

The stupid thing about all this is Sony probably still thinks it’s doing some useful copy protection. It’s not, the copy protection is entirely keyed now to your online account. They’re just making it awkward for power users to do reasonable things.

 

Sony Playstation: how to fail at cloud sync

First world problems; I got a second Playstation console, the sweet God of War edition. Yay for me, no more carrying a PS4 back and forth between houses! Only now I have to worry about moving my save game data around because the cloud sync on Playstation is so awful.

Sony added auto-upload back in 2015 as part of your paid subscription. However they never added auto-download. So even when everything is working perfectly you still have to manually download save game data every time you switch devices.

Only auto-upload doesn’t work very well. It seems to only upload when you put the device in rest mode. If you go straight from playing a game to shutting down, the files aren’t auto-uploaded. So you can’t trust it and have to manually upload. But manually uploading is also a hassle, you have to shut the game down entirely to upload. (Which raises the question of how it’s uploading in rest mode when the game is still in memory, albeit suspended.)

Even with fully manual management there’s problems. There’s some confusion about file origin; both of my PS4s are complaining that the file didn’t originate on their system when I try to download. Also you can’t be logged in to Playstation on the same account on two consoles at the same time. And there’s also some confusing thing about which console is your “primary” for your account, which seems to have to do with licensing rights. Only maybe a secondary console also doesn’t auto-upload?

Real two-way automatic sync is a little tricky; if the user modifies files on both systems simultaneously and then syncs both, you have a conflict. No gamer wants to have to “git merge” two timelines. But 99% of the time a file is only modified in one place so “always sync the latest version” is fine as long as you detect conflicts. Hell, do a little light locking and warn the user if they’re trying to play while another session is active. To be safe a good sync system should have a bit of history for the files too and some way to recover an older version. Sony of course doesn’t, treating storage space as some enormous premium. (It was a big deal when they moved from 1GB of storage to 10GB for users who are paying $10/month.)

I gather Xbox Live’s version of cloud syncing works better. Steam’s SteamSync mostly works just great too, although I did have it bug out on me once.

 

Two unrelated PS4 gripes

Sony’s online store site requires a login. The login requires third party cookies; logging in to  store.playstation.com requires setting using a cookie at auth.api.sonyentertainmentnetwork.com, so it won’t work if you have third party cookies disabled. This breaks the Brave Browser, which disables third party cookies by default. It also breaks in Chrome if you disable the cookies. I thought Safari prevented third party cookies by default, I wonder if they have a workaround? The error displayed is

{“error”:”invalid_client”,”error_description”:”Bad client credentials”,”error_code”:4102,”parameters”:[]}

The PS4 operating system, or the apps, have a bug where if a game is put in the background the fan gets really loud. Ie, if you open the system menus. I assume instead of suspending processing entirely the game starts spinning consuming lots of CPU or GPU, generating heat, which makes the fan run. It’s dumb. A fan theory is that the games have no framerate cap and so they effectively render at 1000 FPS or whatever, but I think the problem may be broader than that.

 

Upgrading a PS4 hard drive

I just upgraded the hard drive in my Playstation. It was remarkably easy following these very thorough directions. Sony designed the system to be easily upgraded, quite a surprise.

The hardware is super simple; slide off the cover, remove a single branded screw, and slide out the drive tray. Swap in the new drive (4 screws) and slide it back in, done. I replaced it with a 2TB hybrid drive. A full SSD would be faster but costs 5x as much. These Seagate SSHD drives have a 64GB SSD caching the 2TB platter and seem like a reasonable compromise.

The software is also surprisingly simple. Back up the PS4 to a spare external  USB drive, swap in the blank new drive, then boot to recovery mode. You can then reinstall the firmware from a download Sony provides, restore your backup, and you’re done. It took all of 30 minutes of my time, plus 5 hours waiting for the backup and restores to copy.

My main reason for the upgrade was more space. The old units shipped with a 500GB drive which after overhead, etc allowed for about 6 games to be installed at once. Significant nuisance; I don’t want to download 30GB a second time for something I want to revisit.

 

New Windows gaming PC

After five years of running Macs I’m going to try Windows again. I only use the computer in front of me as a fancy terminal, web browsers and SSH sessions mostly. And gaming. But I’m not really using the OS as a real computer, so I can suffer with Windows. Also I’m fed up with a bunch of stuff related to Macs. MacOS is not a very good Unix, I went back to doing all my real work on Ubuntu last year. Mac gaming is just awful. And Apple has apparently abandoned the idea of updating iMac hardware.

Anyway, I ordered a PC. I went full max spec with brand new Kaby Lake parts because I intend to use this machine for 4+ years. Top end CPU, top end GPU, 16GB RAM, 500GB SSD, and some fancier cooling / quiet components. Here’s the parts list.

  • Motherboard:  Asus Z270-P
  • CPU: Intel Core i7-7700K 4.2GHz
  • GPU: EVGA 08G-P4-6286-KR NVIDIA Geforce GTX 1080 FTW
  • RAM: C769-V16B Corsair CMK16GX4M2B2800C14 16GB (2x8GB)
  • Drive: Samsung 960 EVO 500GB PCIe NVMe M.2 SSD
  • Power supply: Corsair CP-9020092-NA RMx RM750X 750W
  • Case: Fractal Design Define R5
  • CPU cooler: Noctua NH-D15S
  • Monitor: Asus ROG PG348Q 3440x1440

So far so good! The motherboard was a compromise, it doesn’t support SLI. The CPU and GPU are too far up on the price vs. performance curve but I was feeling spendy. The case is nice, it has sound baffling. The CPU cooler is absurdly huge; I don’t intend to overclock, but large = quiet.

Shopping for the monitor really made me appreciate what Apple has done with the iMac displays. It’s very hard to find something that quality for PC parts. I decided not to go with the 4k/5k/Retina high density displays, too expensive and no GPU can fill that many pixels in a game.

There’s some neat new things in PC hardware. The M.2 form factor for SSDs dispenses entirely with the history of hard drives, the SSD looks something like a RAM module. (Which begs the question; why are PC cases still so giant? Cooling.) And GPUs have a nice new feature called G-Sync or Freesync. For 20+ years we run the screen at 60Hz and hope the GPU can keep up with 60fps vsync interrupts. Now the GPU just renders frames as fast as it can and the LCD only updates when there’s a new frame to draw.

I had Central Computers build it for me, a local screwdriver shop. They did a great job on the quote and build process for $80 labor plus maybe a 10% markup on parts. The computer priced out about $2150, the monitor $1100. Expensive! But I use this literally all day every day, and like I said I don’t intend to upgrade for a long while.

 

League of Legends server IPs

Just writing this down so I don’t lose it. I haven’t verified these. But most of the old lists I’ve seen are no longer valid since Riot started doing its own peering.

  • NA - ping 104.160.131.3
  • EUW - ping 104.160.141.3
  • EUNE - ping 104.160.142.3
  • OCE - ping 104.160.156.1
  • LAN - ping 104.160.136.3

Source is this Reddit discussion about yet another ping checker. I wish Riot would build a small network diagnostic into the client, before a game starts. Many of these third party tools don’t measure round trip time correctly and none that I’ve seen measure packet loss.

Also I was curious so I just did an mtr to the NA address. Average response to the end is 92ms, which is about the same number the league reports as ping. Standard deviation is 12ms, best/worst is 73/140. That’s with ICMP probes, I don’t get responses from UDP probes.

Overwatch netcode

I’ve been playing a lot of Overwatch, on PS4. It’s fun! Also it feels super responsive and reliable on the network, I almost never perceive lag. Blizzard is uniquely good at building games like this so it’s no surprise, but what are they doing to make an Internet game feel like real time?

This video from Blizzard developers is good info (but outdated; keep reading). It goes into detail into server prediction, client prediction, and perceived lag. I think they’re mostly doing what other games have in the past, but there’s a lot of choices and tradeoffs they make. One choice they say is new is they make the assumption that most clients have reliable, fast networking. That means they don’t need to buffer nearly as much. Specifically they say that with most games you may be buffered 4 ticks (or 80ms), but if they think your network is good they’ll buffer you just 1 tick (20ms), so it feels even more real time.

The server runs the simulation at 62.5Hz. When that video was posted, clients got network updates at 20.8Hz. In August they pushed an update so PC clients get updates at 62.5Hz. PS4 and XBone also got the faster tick rate on September 13. The rate is adaptive, so your client will drop down if you have low bandwidth.

The game is a UDP protocol. I’m not sure about bandwidth usage. Back in the 20.8Hz days this post claimed it’s about 60-100Kbps in both directions. So maybe triple that? Bandwidth consumption was the reason Blizzard originally went with the lower tick rate.

I’m really curious why it’s 62.5Hz and not the obvious 60Hz. Maybe you want the network updates to be just a bit faster than the screen updates for smoothness?

For comparison, League of Legends runs at 30 Hz on the server. I’m not sure about the network / client update rate, it may be the same. CS:GO is 64Hz (or even 128Hz).

League of Legends rank distribution over time

Just finished a small longitudinal data project. Not real happy with how it turned out, but figured I should document it anyway. Frustrated it doesn’t look better, also that it didn’t get more attention.

Here’s the deliverable: a Reddit post. It’s a visualization of rank inflation in League of Legends over the course of the last year, Season 6. I collected the data by hand out of curiosity. The resulting visualization more or less confirms what people who pay attention already knew; there is inflation. Only 15 upvotes which is crappy engagement for something I spent several hours on.

7mmsnc2

I tinkered with the visualization for awhile. The colors are meaningful, they represent Bronze / Silver / Gold / Platinum to folks who play the game. (There’s also White for Diamond+). There’s 5 divisions within each tier, that’s the black lines. And then some ugly caption text because I wanted to condense the whole thing down to a single shareable image.

I produced it using iPython, Pandas, and matplotlib. I really like Pandas’ abstraction of a DataFrame, it’s a very powerful tool for working for a matrix of numbers. Even so I have a lot of data massaging code to get from my original spreadsheet to a clean list of numbers. Deleting extra rows, transposing rows/columns, converting “93%” to 0.93, etc etc.

I really don’t like matplotlib. I’ll paste my graph generation code below, it’s super ugly. There’s like seven ways to set options. Flags passed to the Pandas plot() function, functions called on the global matplotlib object, functions called on the global pyplot object, functions called on the axis objects, two different ways to modify RC parameters, etc etc. Just a mess. Maybe this is my ignorance though and there’s a way to simplify / rationalize it all.

# Plot
plt.style.use('seaborn-whitegrid')
matplotlib.rc('axes', grid=True)
matplotlib.rc('grid', color='w')
matplotlib.rcParams['font.family'] = ['Liberation Sans']

# Filled area for the tiers
ax = tdf.plot(
    kind='area', stacked=False,
    figsize=(10, 6),
    legend=False,
    linewidth=0,
    alpha=1.0,
    color=('#ffffff', '#87fffd', '#ffdb57', '#dce2f2', '#b2a07e'))
ax.set_yticks(numpy.arange(25,100.01,25))
ax.yaxis.set_major_formatter(matplotlib.ticker.FormatStrFormatter('%.0f%%'))

# Lines for every division
df.plot(ax = ax, legend=False, color='k', linewidth=0.5)

# Configure the chart a bit more
ax.set_axisbelow(False)
plt.title('Season 6 distribution of ranks in NA')
plt.text(0, -35, '''There is a general trend of rank inflation...''',
        linespacing=1.4, size=12)

Documenting obscure bugs helps!

Had a real pleasure today; someone found a description of a League of Legends networking problem I wrote up a year ago and it gave him the clue to fix a problem he was having. (Long story short; specific actions in the game cause bursts of high network traffic, which can trigger lag or disconnects.)

I spend a lot of time writing up details of bugs and software problems. I do this partly for clarity, writing it up is a way to make sure I really understand the problem. I also do it so I can find my notes later in case I have a similar problem. And finally I put those descriptions online in case they help other people. And about once a year, they do!

 

League of Legends stats: some findings

I’ve been noodling with some League of Legends data as an excuse to learn more data analysis tech. I’ve blogged about the software, here’s the actual results I found.

League of Legends is a huge game, some 100M a month playing 1M+ games a day. And the data for those games is readily available. I took a look at third party summaries of game statistics from champion.gg and na.op.gg and tried to divine some meaning. The dataset mostly is for ranked games by Platinum+ skilled players in North America for patch 6.17. But I also looked at players of different skill and trends across game patches.

The most interesting conclusion I found was that some champions win much more in the hands of skilled players. Nidalee, for instance, has a 45% win rate in Silver but a 54% win rate in Diamond. That’s not exactly a surprise, she’s known to have a high skill cap, but it’s good to see hard data. And there are surprises; I would not have guessed Pantheon also was highly improved or that Dr. Mundo suffered at higher skill levels.

Despite looking, mostly I didn’t find any unusual trends or big shifts in the game over patches. To me that’s a testament to the quality of the game, in particular Riot’s game balance team.

Below find some analysis and graphs. I’ve put my notebook output online for viewing here:

Basic stats for patch 6.17

The first thing I did was look at the basic champion.gg stats for patch 6.17. Each row in my dataset is one summary line for all players of a champion in a role. For instance Nami / Support. Note there’s a bit of bias here; champion.gg omits rare cases like Nami / Jungle.

There’s relatively little diversity in ADC and Support champions. Simple result: there are only 17 regularly played ADC champions and 25 Supports. There’s ~50 champions played Top/Middle/Jungle. This fact skews a lot of my later statistics, particularly with the ADC pool where a single champion (Lucian) dominates with a 32% play percentage. The top mid, by contrast, is Ahri with only 13%.

download (1).png

Players generally don’t pick champions with higher win rates. This surprised me a bit; I thought there’d be a clear bias towards the OP champs. There isn’t.

download.png

Players do tend to win more on champions they have more experience with. No big surprise here, but more games = more wins. The stat “experience” here is average games played on that champion. (It’s in the champion.gg dataset, but not displayed on the website.) The correlation coefficient is +0.24 with a p value of 0.0005, which seems likely to be significant to me. The causation is less clear. For example Galio-Top players have an average of 107 games on the champ and a 55% win rate. Do people win on Galio because they play him a lot, or do they play him a lot because they win? (Or in the specific case of Galio; do relatively few people play him but the ones who do are really good?)

download.png

Stats for players of different skills from na.op.gg

I was curious how these statistics varied by tier, so I went to na.op.gg and downloaded stats for players at all skill levels. I mostly focussed on Silver through Diamond, since those are the most “normal” player populations. This data is for the month of Aug 15 – Sep 15 2016 and spans patch 6.17 and 6.18.

Some champions have much higher win rates at higher tiers. This result is the most interesting I’ve found. I feel like each player at the extremes has a story. I’m not surprised that Nidalee’s win rate goes up 9.37% from Silver to Diamond; she’s hard to play well and so presumably does better in the hands of a skilled player. Aurelion Sol goes up 5.8%, maybe because he depends on skilled teammates? But why does Pantheon go up 7.5%? He seems so simple! I’m guessing Aatrox and Garen do worse in higher tiers because players know how to exploit their weaknesses. And Amumu’s 4.1% drop may be as simple as Diamond players being less vulnerable to Amumu cheese. But there’s more to say here and I’d like to develop this data further. Here’s the 10 most improved and 10 who suffer the most.

Screen Shot 2016-09-21 at 4.32.54 PM.png

Some champs are significantly more popular at higher tiers. The companion result to win rates; what about pick rates by tier? Janna is the most more frequently picked, she goes from 0.8% to 2.9%. (As a frequent Janna player my theory is she is much more rewarding to play when your team is more skilled.) Leona drops from 1.6% to 0.6%. The ADC champion pool attenuates at higher tiers too; Lucian dominates and Jinx drops off, for instance.

Screen Shot 2016-09-21 at 4.37.11 PM.png

Silver-to-Diamond win rate is correlated with Silver-to-Diamond pick rate. In the previous section I reported that for Platinum players, win rate is not correlated with pick rate. However the champs that have the most improvement rate from Silver-to-Diamond also tend to have higher pick rates from Silver-to-Diamond. This suggests that higher tier players are picking champions that have more impact at their skill level. Well maybe; I have a suspicion this effect is pretty small.

download (2).png

 

Trends across patches

Finally I was curious how stable the game statistics were over patches. I collected historical data from champion.gg’s GitHub going back to patch 5.10, over a year ago. These are all ranked Platinum games.

Stats are pretty stable between patches. In general there’s not a lot of change in the game since 5.10. For instance, players averaged a 2.55 KDA in 5.10 and a 2.48 KDA now in 6.17. There is a general trend up in some of the cumulative stats like “goldEarned” or “totalDamageTaken”. That could easily be a symptom of games just taking longer over time; unfortunately I don’t have stats on game length to normalize with. Two highlights though. Experience has a big drop at the beginning of Season 6. I take this to be new accounts and/or people changing up how they play. Also totalHeal had a big bump up around patch 5.22. That could be the same general cumulative stat effect, but I think it may also indicate the addition of more healing abilities and the rise of healing supports like Soraka and Nami.

download (2).png

Champion diversity is pretty stable between patches. Up above I showed the distribution of playPercent across 5 roles for patch 6.17; here’s an animation of that distribution across patches. It’s pretty stable. So are the distributions for all the metrics I’m most interested in; goldEarned, KDA, winPercent, in general the distribution across champs looks the same between patches. I find that a bit surprising because I think of LoL game balance being pretty dynamic with a constantly changing meta. But it’s not really reflected in the stats.

 

Factory Idle

I’ve been hooked on Factory Idle, a well made little puzzle / idle game that runs in the browser. You lay out factories from modular components. It’s basically a casual version of Factorio, with deliberate periods of idleness built in where you let it run in the background and do its thing. Designing factories feels a lot like programming.

Below is a screenshot of my current research factory. I’m at tier 3 of factory research, where I have metal labs and oil&gas labs (left and bottom) both generating reports and feeding them to analytics labs when then deliver them to the research centers on the right. It’s not at all space efficient, as managing flows gets more complicated I’ve been deliberately leaving space to make it easier to design and refactor. The complex piping in the center room is particularly subtle, a system to mix awkward rates like the 11/20 output of the blue metal labs feeding the 32/40 orange inputs of the analytics labs.

(Note this layout has a bug; one of the gas labs in lower left is missing its gas input.)

Screen Shot 2016-06-02 at 12.54.44 PM.png

champion.gg and BSON data

A potential League of Legends nerdy project; analyze stats from games to determine which items are winning the most. champion.gg is an excellent site for stats like this, but it’s reports are focussed on champions. Which champion wins the most? What items do they build?

I want to know what items win the most. There’s a theory that Iceborn Gauntlet and Sunfire Cape are both overpowered right now, for instance. Has the win rates for people who buy those items gone up in the past month? I think that’s a well defined question.

Unfortunately champion.gg doesn’t answer it. But the website is open source, and the author even kindly publishes analyzed data blobs. Still not sure it has quite everything I need to do my item analysis, but it has potential

The data is in bson format. Here’s a quick and dirty way to extract, say, the data that is presented on this page

bsondump webchampionpages.bson | \
jq '. | select(.key=="Janna")' | less

Somebits Games

Mostly putting this here so I don’t forget. I made a new Twitter account, @SomebitsGames, for uploading game screenshots and video clips. The PS4 has some very nice sharing features built in but I didn’t want to share them to my main Twitter account.

(Fallout 4 is awesome, y’all.)

Cheating at League of Legends

A lot of people cheat while playing League of Legends. My impression is it’s not so bad that it ruins the game, but it sure is annoying.

Network invalidation

The simple and dumb cheats are denial of service attacks and drophacking. (See this discussion.) DoS attacks are directed against an enemy player in your game. Somehow you already know their IP address, and then you pay a couple of bucks to a bot farm to knock them offline. This happens a lot to high Elo players, particularly streamers. Poor Rivington (a Riot employee) basically couldn’t stream for a whole week because he’d be knocked offline every time he tried to play. Riot can’t stop DoS attacks directly, but they could definitely make it less appealing by having some sort of game invalidation if players are disconnected through most of the game. For some reason they’ve never wanted to implement that. DotA 2 has a good system.

Drophacking is a similar network denial attack, only in this case when you’re losing you crash the game server so it invalidates the whole game. This attack seems less common but not unknown and there’ve been a couple of severe instances at specific times, I assume once someone finds an exploit. Riot seems to be pretty quick about stopping drophacking, which is certainly expected given they control the server code.

Scripting

The other half of cheating is scripting, code running on the player’s computer to help them play better. I’ve seen a couple of what look like scripters to me in game. Specifically someone playing Sivir, where she’d cast her spell shield with inhuman swiftness to block my attempts to hook her as Thresh. I mean maybe she was just very good, but there was the time I cast the hook from inside a bush and she had at best 100ms to press E and yet there she is, pressing E. Or having a script press it for her.

Mostly this seems to be done via DLLs injected into the LoL process itself. The DLL allows Lua scripts to run, alter the UI, and perform player actions automatically. Two popular scripting tools are L# and Bot of Legends. Bot of Legends costs $10/month. Here’s a video of what it looks like to play with BoL.

There’s a huge variety of community-supplied scripts. See BoL Script Status for a gallery of scripts. Unfortunately most of the links go to paywalled forum posts. But scripts seem to be shared on GitHub. Here’s a couple of users I found: BoLFantastik, DraconisBoL.

Here’s an example code snippet that casts Ignite if it will guarantee a kill.

function AutoIgnite(enemy)
        iDmg = ((IREADY and getDmg("IGNITE", enemy, myHero)) or 0)
        if enemy.health <= iDmg and GetDistance(enemy) <= 600 and ignite ~= nil
                then
                        if IREADY then CastSpell(ignite, enemy) end
        end
end

Augmented intelligence

People who cheat at games baffle me, and make me angry when I play against them. But I do find the idea of augmented intelligence interesting, machine tools assisting people in doing things they intend. Like the Zed video I linked above has a short bit for “Jungle clear”, where you tell it “I want to kill this monster” and it combos your skills efficiently for max damage. The Insec video is another good example, scripting the ward / hop / kick combo that is a famously high skill play. Or not anymore, just press the button.

One challenge is UI for augmented intelligence, how do you present these higher level actions to the user? From the few videos I’ve seen there’s nothing impressive. That Insec video just shows a minimal line you draw, which way the enemy will go when you do it. Spare, but functional. Some of the other videos I’ve shown overload the player with information, drawing overlapping circles over everything. Maybe useful for debugging but not anything else.

The other question I have for scripting is how much it really helps the player. I have no doubt that spell-shielding Sivir was getting boosted by a tool that prevented me from hooking her. But there’s still a person in control of the character, it’s not a full bot, and she’s still having to make choices about where to go on the map and what to attack and when to go in or flee. I don’t think these scripts help with that. My gut feeling is the scripts probably cover about 40% of what a good player needs to do, the other 60% is up to them to do themselves. What’s funny is I’m in the bottom 25% of players. So if I see a scripter, they must be truly terrible if they have a 40% boost.

Ubiquiti: less LoL lag

One nice change from with the new network, less lag playing League of Legends.

With my old hacky setup with triple nat and routers acting as a bridge, I had a lag pattern like thishacky lag

Now with the Ubiquiti gear I have a lag pattern like this:

Lag after

Note the lack of spikes! I have no idea what those were, something was getting buffered or something weird before.

I don’t think median latency or packet loss really changed, but I’m glad not to see those ping spikes. Although TBH they didn’t affect my gameplay much.

LoL dotmap

Fresh off my heatmap attempt I made a second map of a single LoL game using a dot map. One dot per player recorded position (28,000 in all), colored by team.

Screen Shot 2015-08-17 at 6.04.56 PM

I think this treatment works better; the team color is really important information. But I miss the emphasis of dwell times that the heatmap accumulation algorithm gives. I’ve tried to fake it by using dots with 20% opacity but that’s pretty bogus. (Also easy to fudge, depending on dot size, opacity, and stroke weight you use.)

Still, an improvement, and I’ve also got a data extractor that’s creating more structured data so I can track individual players.

I did this in D3js because it was easy to. But I want to produce a static final output so there’s really no need for Javascript. I should look into data plotting tools in other languages. Maybe this is a time to try out some more of the big data Python tools, or see what Octave has up its sleeve. I think something like the heatmap algorithm is really what I want.

First light: League of Legends heatmaps

I took a crack at rendering the position data I found in the League of Legends live matc stream. Here’s a first take on TSM v TL game 1

Screen Shot 2015-08-17 at 3.59.13 PM

Interpretation

Not bad, it at least looks recognizable. The main trend is that there’s more activity on blue side (lower left) than red size (upper right). That matches what happened in game; TSM was red and they won, and dominated. The other basic pattern is you see the basic shape of the map and the paths through the jungle. This is expected.

But then it gets more subtle. I love the two blobs at upper left. I think these are times when TSM’s jungler was hiding in those bushes ready to gank for TSM’s top laner, will have to watch the game again to verify he really did spend a lot of time there. Als interesting to see the relative bias of activity over towards Baron instead of Dragon, I suspect that’s not a universal for all games.

Improvement

Lots to do to make this better. Some inspiration: this NYT treatment of similar data, which takes data from many games and uses dots instead of a heatmap. However my goal is more to highlight what’s interesting about a particular game, so have to apply their many-games approach carefully. And also these DotA maps which are basic but complete works.

#1 problem with my treatment is the single color scale: I really want red vs blue ramps for the two teams. But then I don’t want to mix them to purple! I suspect the heatmap treatment is really not the right tool here, I should consider dots like the NYT map. It’s about 26,000 dots in total per game. (600 per minute, games seldom go 60 minutes.) Also should look at hexbinning or whatever the cartohipsters are doing these days.

I’d also like to examine the time axis, see how the movement spreads over time. I don’t really want to make some interactive visualization though, a static image is better. I like what the NYT did breaking the game up into three phases.

Finally it’d be nice to be able to pick out individual players. Particularly the support and jungle since they roam more, but also bot and top to see what happened with lane swaps.

Implementation

The heatmap rendering is from heatmap.js. I like it for being a straightforward canvas implementation, and it is fast as promised. But the rendering is very limited, in particular I can’t come up with any way to render two categories of data in different colors in the same heatmap. (And the canvas is opaque, so I can’t just draw two superimposed, which would be awful for other reasons too.)

The data extraction is some dumb-ass Python to pull the position fields out of the stream data. Quick and dirty, need to clean it up if I do this for real. If a character doesn’t move I don’t draw their position twice right now. Also the stream data is remarkably messy, I need to do extra work to detect game start and end and filter out data from the previous game that sometimes got mixed in. And I should preserve per-player data to allow more flexible visualizations.

LoL live match stats

New feature on Riot’s pro game broadcast site: a live stats board. It updates once a second in your browser showing you game stats. Also features for Twitter messages, game stream info, etc. It’s the stats I’m interested in.

Stats scoreboard

Here’s the data on display:

  • Match type. Game #. Games won / lost by each team. Team and player names.
  • Kills in current game. Also objectives: inhibs, barons, dragons, towers.
  • Total team gold.
  • For each player: kills/death/assists, CS, and gold.

Data contents

The game stats are implemented with a web socket. (There’s also some JSONP being polled for other features; the stats are a web socket.) I wrote a Python program to record the data. They generally send one message a second, about 500 bytes, updates to things like player gold, kills, etc. It’s a pretty efficient implementation.

The data on the web socket is mostly what you’d expect to implement that display. Messages usually contain updates on player stats: total gold, current gold, experience points, and player position. Variables are only in the JSON blob if their value has changed. A bunch of oddball updates sometimes come through for things like CS, player kills, etc. And then teamStats updates for tower kills, etc. They’re also tracking player double kills, triple kills, etc. Nothing in the stream about item purchases that I’ve seen.

There’s also some special messages. The first message on the socket is about 14k and contains all the data that ordinary isn’t changing, stuff like player name. When a new game starts the info about what champions are in the game is sent along. When a game ends there’s a gameComplete message. That kind of thing.

The most interesting thing I’ve found in the data stream is player position. It’s currently not being used by Riot’s web client. Should be possible to use that to animate a version of the game. riftwalk.gg had something like that based on replays before it got shut off, would be nice to feed this stream to that visualization code.

Technical details

My Python client is having the socket closed on it every 90 seconds. I just re-open it for now, seems to work. The web client in Chrome doesn’t seem to be doing that. Wireshark tells me that there’s a ping/pong Chrome is exchanging every 45 seconds. I’m guessing the Python client isn’t responding to pong and after two failed pings the connection closes. A bit confused why the pong doesn’t come through, the Python library looks like it just handles that for me.

Update: I looked in Wireshark and found the Python client is sending pong responses, but they’re getting TCP fragmented into two packets maybe because of the way the async writing code works. I’ve opened an issue on GitHub seeing if my analysis is correct and whether it’s something that could change. Update 2: I guessed right! The author changed the code to not fragment the packet and now I can stay connected. Yay!

The web socket hosted at ws://livestats.proxy.lolesports.com/stats. The socket requires a JSON web token to connect, which is some signed blob, although it’s not tied to any personal secret like a password login. I pulled one out of my browser and decoded it via jwt.io, it contains a bunch of IDs. Also has what looks like an expiration date, token is good for a week. I just pulled the token out of my browser and reused it in the Python code.

New LoL NA servers

Riot is finally moving the North American League of Legends game servers from the west coast to somewhere more central, Chicago,. Their network operations guy RiotAhab has been making a series of great posts about netops, his post about the move is good reading. Also buried in the discussion is a comment from dArtaganan, a Riot employee, giving us a new server IP: 104.160.131.1. (Compare old IPs like 192.64.170.78).

A simple ping from my house to the new IP is 70ms. Some random other Chicago IP was about 60ms. Theoretical best RTT (speed of light in copper) is 30ms. Riot is promising ping increases of “up to 30ms” for west coasters, which would put me at 65ms.

That IP is in AS6507. My route to them from my Kansas server (12ms away) ends at be2217.ccr41.ord03.atlas.cogentco.com, which could be a Cogent datacenter like this one. Or maybe Cogent just provides the link and the warehouse is owned by someone else. Note the old west coast IPs are also in that ASN, Riot didn’t set up a new one.

Riot’s ASN has 110 peers, which is impressive; compare 13 for my ISP or 6 for my server. Google has 200+, mega-backbone he.net has nearly 4000. Anyway, Riot’s peering efforts are clearly visible. I imagine each one of those 110 peers is a separately negotiated contract.

Diagnosing a weird LoL lag issue

I’m having a weird lag problem where I get massive packet loss playing LoL. But the reported ping stays low (35ms) and the game is mostly playable. Some small hiccups that look lag related, more than I’m used to, but it’s not hugely awful. Really don’t know what’s going on.

My logs are telling me I’m losing 2.4% of my packets. That seems awfully bad; 0.1% or so is more typical. Borderline surprised it’s playable, but who knows. It’s not clear why the LoL client still reports the 35ms ping; the usual client behavior is if you’re losing packets the reported ping goes up. Or at least it used to be, maybe that changed?

I’ve done every test I can think of to prove that it’s not my home network in general to blame. I can iperf3 burst UDP traffic all day reliably from my house to somebits.com in Kansas. That shares the same route over my ISP as far as cr1-9greatoaks-te-0-7-0-8.bb.spectrumnet.us; then the somebits packets go through he.net on their way to Kansas while the LoL packets go through spectrumnet up to Portland and Riot’s datacenter. That route looks fine, as well as I can test. (with mtr -u, a UDP traceroute).

Confusing things more, a friend of mine also plays on the same ISP in San Francisco. His client is not showing any lag like I am. But we share almost the same route, our routes converge on the fourth hop from 76-14-93-222.sf-cable.astound.net / 76-14-93-218.sf-cable.astound.net onward. So if there were a bad router it’d be close to my house. But then my link to somebits.com goes through that same route and I can test that thoroughly, and it’s showing no problem.

Frankly all signs point to something being wrong with my Mac, the client itself. Only I can reproduce the problem on a second machine, my laptop! Could it be my router? Possibly. But it’s worked fine in the past. I’ll try to test without the router soon.

Here’s some stats from a Wireshark capture I did in an ARAM I just played. I was Amumu.

LoL server address: 192.64.170.78

Wireshark statistics

  • 39750 packets from server, 44769 packets from client
  • 2003 packets reported lost by the client. 2.4% packet loss rate!
  • 39kbps from server, 17kbps from client
  • Average packet size 228 bytes
"Address","Port","Packets","Bytes","Packets A → B","Bytes A → B","Packets B → A","Bytes B → A","Latitude","Longitude"
"192.64.170.78",5107,84517,9616369,39748,6599894,44769,3016475,"-","-"
"192.168.0.20",53040,84517,9616369,44769,3016475,39748,6599894,"-","-"


==================================================================================================================================
Packet Lengths:
Topic / Item       Count         Average       Min val       Max val       Rate (ms)     Percent       Burst rate    Burst start  
----------------------------------------------------------------------------------------------------------------------------------
Packet Lengths     84519         227.56        54            1038          0.0627        100%          0.2400        73.682       
 0-19              0             -             -             -             0.0000        0.00%         -             -            
 20-39             0             -             -             -             0.0000        0.00%         -             -            
 40-79             46272         62.08         54            79            0.0343        54.75%        0.1600        2.285        
 80-159            26150         101.90        80            159           0.0194        30.94%        0.0900        838.818      
 160-319           7204          228.76        160           319           0.0053        8.52%         0.0500        351.673      
 320-639           4120          437.28        320           639           0.0031        4.87%         0.0600        73.648       
 640-1279          773           814.54        640           1038          0.0006        0.91%         0.0600        73.717       
 1280-2559         0             -             -             -             0.0000        0.00%         -             -            
 2560-5119         0             -             -             -             0.0000        0.00%         -             -            
 5120 and greater  0             -             -             -             0.0000        0.00%         -             -            

----------------------------------------------------------------------------------------------------------------------------------


$ sudo mtr -u 192.64.170.78
                                   My traceroute  [v0.85]
ub (0.0.0.0)                                                        Tue Aug  4 17:43:25 2015
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                                    Packets               Pings
 Host                                             Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. router.nelson.monkey.org                       0.0%   981    0.2   0.2   0.2   0.7   0.0
 2. 76-14-35-1.sf-cable.astound.net                0.0%   981    9.8  11.8   4.0 156.4   9.6
 3. 104.220.254.17                                 0.0%   981    7.4   9.2   3.6  31.3   4.0
 4. 76-14-93-218.sf-cable.astound.net              0.0%   981   14.6  17.2   7.7 234.4  22.8
    76-14-93-222.sf-cable.astound.net
 5. cr1-wsache-a-be-100.bb.spectrumnet.us          0.0%   981   11.8  14.2   9.1  37.2   3.8
 6. cr1-55SMarket-te-0-0-0-8.bb.spectrumnet.us     0.0%   981   11.1  14.7  10.3  37.6   4.7
    cr1-55SMarket-te-0-0-0-10.bb.spectrumnet.us
    cr1-55SMarket-te-0-0-0-9.bb.spectrumnet.us
    cr1-55SMarket-te-0-0-0-19.bb.spectrumnet.us
    cr1-55SMarket-te-0-0-0-11.bb.spectrumnet.us
 7. cr1-9greatoaks-te-0-7-0-6.bb.spectrumnet.us    0.0%   981   11.5  14.2   8.2  36.4   3.7
    cr1-9greatoaks-te-0-7-0-8.bb.spectrumnet.us
    cr1-9greatoaks-te-0-7-0-9.bb.spectrumnet.us
    cr1-9greatoaks-te-0-7-0-7.bb.spectrumnet.us
 8. cr1-pdx-te-0-0-0-4.bb.spectrumnet.us           0.1%   981   44.3  30.8  23.8  56.2   4.5
    cr1-pdx-te-0-0-0-5.bb.spectrumnet.us
    cr1-pdx-te-0-0-0-6.bb.spectrumnet.us
 9. cr2-fdcp-t4-4.bb.spectrumnet.us                0.0%   981   29.4  34.2  25.2 376.9  25.7
10. 216.243.25.86                                  0.0%   981   28.3  29.9  24.8  51.3   4.0
11. ???

Graph of packets / second

Packets per second

Update

Some updates after a few experiments

  • Problem definitely occurs on two different computers, an iMac and a Macbook Air
  • Problem occurs without my router / switch. Still plugged into my cable modem.
  • I played a game with a friend of mine who happens to also be in San Francisco on the same ISP and plays on a Mac. He had no lag, I did. Here’s my Logs of Lag report and here’s his. I lost 80 packets a minute, he lost 2. WTF? According to traceroute our routes are the same after the 4th hop above, so if it’s a problem in the route it’s something very close to my house at my ISP.
  • However, I can happily shove a huge amount of UDP traffic into my house with no problems. And those packets also traverse that same route to hop 4.
  • I see the same problem on a Windows box in my house. (35 packets lost / minute in a Custom game, which is line with results on the Macs I play on.)

My next step is to try playing through a VPN and see if it helps. I’d also like to understand better what it means for the LoL client to know it’s lost 2.4% of packets and yet still report a low ping. That seems odd; usually the reported ping number goes up in response to retransmits, or at least I thought it did.

Update 2

A friend of mine has a VPS at directspace.net, which is either in the same datacenter as Riot NA or else very nearby. He ran an  iperf2 server for me. Here’s some redacted data testing from my problem network.

iperf shows 69 packets out of 26224 lost, and 47 out of order. that’s about normal for a working link I think, and 1/10th the loss rate I’m seeing from the game.

mtr shows at worst 1 packet dropped out of 100. the stddev to hop 4 is higher than I’d like though.

$ iperf -l 300 -u -t 60 -i 10 -c XXX.XXX.XXX.XXX
------------------------------------------------------------
Client connecting to XXX.XXX.XXX.XXX, UDP port 5001
Sending 300 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.65 port 34071 connected with XXX.XXX.XXX.XXX port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec
[  3] 10.0-20.0 sec  1.25 MBytes  1.05 Mbits/sec
[  3] 20.0-30.0 sec  1.25 MBytes  1.05 Mbits/sec
[  3] 30.0-40.0 sec  1.25 MBytes  1.05 Mbits/sec
[  3] 40.0-50.0 sec  1.25 MBytes  1.05 Mbits/sec
[  3] 50.0-60.0 sec  1.25 MBytes  1.05 Mbits/sec
[  3]  0.0-60.0 sec  7.50 MBytes  1.05 Mbits/sec
[  3] Sent 26225 datagrams
[  3] Server Report:
[  3]  0.0-60.0 sec  7.48 MBytes  1.05 Mbits/sec   1.561 ms   69/26224 (0.26%)
[  3]  0.0-60.0 sec  47 datagrams received out-of-order

$ mtr --report -c 100 -u XXX.XXX.XXX.XXX
Start: Wed Aug  5 21:37:40 2015
HOST: ub                          Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- router                     0.0%   100    0.2   0.2   0.2   0.5   0.0
  2.|-- 76-14-35-1.sf-cable.astou  1.0%   100    9.3  11.0   5.4  57.1   7.2
  3.|-- 104.220.254.17             0.0%   100    9.9   9.4   5.0  28.1   4.1
  4.|-- 76-14-93-222.sf-cable.ast  0.0%   100   14.5  15.0   9.9 114.6  11.0
  5.|-- cr1-wsache-a-be-100.bb.sp  0.0%   100   11.9  14.9  10.2  33.2   3.7
  6.|-- cr1-55SMarket-te-0-0-0-8.  0.0%   100   11.9  13.4  10.4  32.0   2.3
  7.|-- cr1-9greatoaks-te-0-7-0-8  0.0%   100   14.6  15.1  10.3  33.1   4.6
  8.|-- cr1-pdx-te-0-0-0-4.bb.spe  0.0%   100   26.6  29.8  26.2  47.5   3.9
  9.|-- cr2-pdx-te-0-1-0-4.bb.spe  0.0%   100   29.7  29.6  26.1  47.8   3.3
 10.|-- directspace.nwax.net       1.0%   100   29.9  31.8  26.0 166.0  15.4
 11.|-- 69-163-34-113.in-addr.arp  0.0%   100   28.1  28.8  25.2  31.4   1.2
 12.|-- XXX.XXX.XXX.XXX            0.0%   100   28.6  29.3  26.1  47.0   2.7

Update 3: I have a theory: out of order packets. My mtr tests are telling me there’s something a bit flaky between hops 3 to 4. Occasionally a packet will take a very long time, like 200ms, and the stddev on that hop is way higher than the others. I wonder if an out of order packet causes the LoL client to drop it or otherwise treat it as a lost packet? To further complicate things, mtr -u shows me that there are many different paths on my route. All the same lengths, but node 4 (the suspect one) has a couple of different IP addresses that show up. If only one path is congested that will cause a lot of out of order packets.

I don’t know what LoL does with out of order packets. ENet, the protocol LoL is based on, is pretty clear about what it does:

ENet provides sequencing for all packets by assigning to each sent packet a sequence number that is incremented as packets are sent. ENet guarantees that no packet with a higher sequence number will be delivered before a packet with a lower sequence number, thus ensuring packets are delivered exactly in the order they are sent.

For unreliable packets, ENet will simply discard the lower sequence number packet if a packet with a higher sequence number has already been delivered. This allows the packets to be dispatched immediately as they arrive, and reduce latency of unreliable packets to an absolute minimum. For reliable packets, if a higher sequence number packet arrives, but the preceding packets in the sequence have not yet arrived, ENet will stall delivery of the higher sequence number packets until its predecessors have arrived.

But I don’t know how LoL uses these features, in particular what packets are marked reliable / unreliable.

The good thing about this theory is it explains a lot of the facts I see, including why my friend at the same ISP doesn’t have the same lag. (He’s beyond hop 4!). The bad thing about this theory is I still can’t really reproduce the presumed failure with iperf. iperf3 does report out of order packets (as an error message!) but I’ve only been able to induce it to do that with ridiculously high bandwidth tests, and even then not reliably. But maybe iperf3 is really polite and sends packets spaced exactly N ms apart so is less likely to have an ordering problem?

Here’s an ICMP traceroute showing the high stddev at node 4.

$ mtr -n somebits.com

                             My traceroute  [v0.85]
ub (0.0.0.0)                                           Wed Aug  5 23:03:04 2015
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                       Packets               Pings
 Host                                Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 192.168.0.1                       0.0%   539    0.3   0.3   0.2  29.1   1.2
 2. 76.14.35.1                        0.4%   539    8.0  11.0   4.7  60.6   7.7
 3. 104.220.254.17                    0.0%   539    8.0   9.6   5.5  30.4   4.7
 4. 76.14.93.222                      0.6%   539   13.5  17.0   9.7 229.9  22.1
 5. 208.76.187.33                     0.0%   539   28.9  14.1  10.2  36.7   4.1
 6. 208.76.185.26                     0.0%   538   12.8  14.6   9.0  35.5   4.8
 7. 208.76.185.58                     0.0%   538   13.6  14.0  10.0  36.8   3.7
 8. 206.223.116.37                    0.0%   538   14.7  16.5   8.5  44.6   5.6
 9. 184.105.213.106                   0.0%   538   38.3  44.2  37.0  74.5   5.9
10. 184.105.222.22                    0.2%   538   91.2  82.6  62.7 121.7  14.5
11. 184.105.213.37                    0.0%   538   71.1  69.6  62.9  96.7   5.8
12. 216.66.78.90                      0.2%   538   56.5  56.6  48.1  83.5   6.2
13. 69.30.209.138                     0.0%   538   49.6  54.4  47.9  83.6   6.1
14. 192.187.107.5                     0.0%   538   53.4  54.9  48.2  87.9   5.4
15. 107.150.51.74                     0.0%   538   51.3  52.1  47.4  96.1   4.8

Update 4: A VPN fixes my problem! I sort of predicted it would, glad to confirm my hunch and also nice to have a workaround until the real problem is fixed. I set up a TCP VPN through Cloak, promised to US West Coast. I ended up going through Seattle. The resulting log shows a little more latency than without the VPN but also nearly no packet loss. Yay!

I set up Cloak because they have a really great Mac client, easy to get going. If I make a habit of this I may consider a VPN endpoint I own up in Seattle / Portland. Would rather just fix my ISP problem though. Don’t want to be paying $10 a month just to fix someone else’s broken service.

Update 5: this problem went away, and I don’t know why. I’m now playing games with 0.2 packets / s, very good, and no obvious lag. It may have been fixed by the Riot server move to Chicago, that’s the most likely explanation. But I’m still struck by the way I was getting this lag and my friend playing the same game with me on the same ISP wasn’t! That fourth hop from me is still showing suspiciously high standard deviation, so whatever that means it may well be unrelated.

LoL API: match data

A long hard look at what is in Riot’s /match API call. It is well documented but those docs are about the individual trees, this is the forest level view. Particular focus on data that’s not visible in the match history view. (This is NA match #1892290414. None of the participants are my friends, but it is ranked and therefore public.)

Long story short, the most interesting data that’s not currently visualized in the match history pages includes:

  • player positions every minute
  • totalTimeCrowdControlDealt
  • 10 minute averages for player performance: CS, gold, etc
  • 1 minute reports on player XP, CS, etc. (gold is currently visualized)

Top level match object:
Metadata about the game. Game type, map, server version, etc.

Teams
some top level stats on team aggregate performance. Very little data, but does have bans.

participantIdentities
summoner id, name, link to match history. This object exists but contains no data for non-ranked games. (No matter whether my API token account is friends with the player or not.)

Participants
Champion, Summoner spells, Masteries, Runes
Explicitly not any identity info other than “highest achieved season tier”.

> Stats
Detailed per-player info on whole match. level, KDA, items, etc
Unvisualized stuff:
double kills, penta kills, unrealKills, killing spree
various “scores”, all set to 0
first tower, first inhib
totalTimeCrowdControlDealt

> Timeline
None of this data is visualized by Match History.
Contains Role and Lane
Also contains average stats every 10 minutes for creeps, xp, gold, csDiff, xpDiff, damageTaken, damageTakenDiff

Timeline
Timestamped frames every 60 seconds

> participant frames
unvisualized: player position, level, XP, CS.
visualized: player gold

> events
timestamped events like item purchases, skill ups, wards placed, etc. some events like champion kills contain positions. (sadly, not wards.)

Riot’s League of Legends API and match privacy

I’ve been dorking around with the Riot API, for League of Legends. They’ve done a remarkably good job on it, particularly for a game company. The API product, the docs and developer registration and stuff, is well executed. (I say this as someone with some personal expertise.) And they are providing a huge amount of data, particularly detailed info on specific matches.

Here’s an example visualization of a match, from Riot’s own web product. All the data behind that match history view is also available in JSON form.

Anyway, one specific question is how to find matches. There’s two methods for looking up matches. The old /game API returns all matches for a given summoner ID (ie, a player). And the newer /matchhistory API returns all matches for a given summoner ID, but only ranked matches. Riot has said repeatedly that they think of ranked matches as public data and will always make that info available to anyone. But that other matches are casual and should be private. OTOH they haven’t implemented that yet, at least not entirely. Here’s the state of things today AFAICT

  1. Ranked game data is entirely public, including summoner identity
  2. Other game data is entirely public too, but does not include summoner identity except...
  3. You can see summoner identity for all games played by friends of yours and...
  4. Your Riot API developer token acts as you, and thus you can see identities of friends.

These principles apply to both the /game and /matchhistory APIs for “find me games from this person”. But they also apply to the very detailed match data returned by /match. They will return a lot of detailed data for any game, even a custom ARAM (as casual as it gets). However if you’re not friends with a player it won’t show you their summoner details. Ie: the game is anonymous.

At least, I think that’s how it works. I should confirm more.

They keep saying they’re going to disable the old /game API. That will make it more difficult to find match IDs for non-ranked games. OTOH they’ve been saying they’re going to do that for a year now and haven’t.

Update: the bit about seeing data for friends may only be true for the old /game API. It seems not to be true for specific match data returned by /match.

League of Legends bandwidth usage increasing

I pulled some new stats out of Logs of Lag, the average bandwidth used by the game client. Each point is the average for all logs I have for the week. It shows that the client has roughly doubled its bandwidth usage over the past three years.

LoL bandwidth usage

The absolute usage is still very small; well under 50kbps, or the speed of good ol’ dialup. (Burst usage is significantly higher though, maybe 4x.) Mostly I find the trend interesting. Also surprised not to see a clear step function as patches are released, although maybe that pattern is hiding in the data.

As with my previous analysis the huge caveat with these reports is that I don’t have an unbiased sample of LoL players. I only have logs  uploaded to me by Logs of Lag users, which are undoubtedly biased towards people with network troubles. I think that bias won’t skew this bandwidth usage number much though, it has much more impact on any inferences I can draw about player ping times, packet loss, etc.

Speaking of those skewed data, here’s an update from last fall’s summary with significantly more sample logs now.

matchLength = 1736.0  (29 minutes)
bestPing = 80ms
medianPing = 90ms
averagePing = 103ms
stdDevPing = 53ms
bytespsIn = 4706 bytes/s
bytespsOut = 666. bytes/s
lostPerMin = 11.5 packets/minute

Modern consoles vs bandwidth

I just got a Playstation 4. Sony seems to have dropped any rules related to game update download sizes. Newish games I bought on disc like Shadows of Mordor or Dragon Age: Inquisition require downloading 8GB “game updates” before they’re playable. Sometimes on the first day the game comes out! And multiplayer titles like Destiny are even worse. 16GB to download the game, another 8GB + 16GB of downloads if I recall correctly.

I started setting up this PS4 and 4 hours later, it’s downloaded 80GB. That’s to install 2 games I bought on disc, 3 games from download, and 2 downloaded demos. I’m just grateful I had the foresight to set this up before hauling the console up to Grass Valley and the 1Mbps Internet there. An 8GB download will take literally 24 hours to download there. Also I have a 30GB cap, so let’s hope updates aren’t frequent.

More Logs of Lag aggregate stats

Following on my analysis of the average LoL game, here’s some scatterplots and histograms of various statistics for games. Specifically, for each game I’m looking at match length (0-3600 seconds is typical), best ping (10-150ms is typical), median ping (10-150ms is typical), and packets lost / minute (0-1 is typical, but long tail).

A huge caveat for this data: this is not a valid statistical sample of all LoL players. This is a random sample of Logs of Lags users, almost certainly biased towards people with network problems. I don’t intend to publish this data widely because it’s not a fair sample.

Honestly, the scatter plot is not the best treatment here; too many dots, not enough correlation. The histograms at top and right examining single variables are probably more interesting. Some notes:

  • Median ping and best ping are pretty tightly correlated. No big surprise there; they are nearly identical on a connection with low jitter and no packet loss. Not sure about the diagonal lines above the x=y line, maybe an artifact of how the game synthesizes a fake ping number in the presence of packet loss?
  • People’s pings are an interesting bimodal distribution, roughly peaking at 50ms and 110ms. I can’t account for the relative unpopularity of 80ms. Well if this were all North American data I’d say it was west coast vs. east coast, but I get a fair amount of European uploads too.
  • Packet loss / minute has a lovely long tail distribution. FWIW, I call anything over 5 a “bad link”; that’s ~30% of my logs, perhaps I should move that number up.
  • I was hoping to see evidence of correlation between packet loss and best ping, on the theory longer connections would be worse. I don’t see any evidence of that in the picture, it’s just a mess of dots. Need a better analysis tool. Same problem with packet loss vs. match length
  • Similarly, I can’t draw any conclusion from median ping vs. match length. That previous graph I did suggests the average ping for players does not go up during the game.

Bandwidth usage of LoL games over time

I had a theory that packet loss often gets worse after about 20 minutes of a League of Legends game, because people tend to group up and there’s more team fights. As a quickie-test of that theory, here’s a graph of the average characteristics of thousands of LoL netlogs for games that last 30-60 minutes.

Screen Shot 2014-11-19 at 4.32.19 PM

Not a lot of trend here. Bandwidth (grey line) does go up over time, but not radically. That could be just as much because cooldowns tend to go down as folks gear up as any effect of people grouping up. No useful visible trend in ping or lost packets, but that may be because the analysis is not good enough.

Lots of errors in this. The regular drops every minute are probably an aliasing problem having to do with the way the logs sample every 10 seconds.. usually. The population of netlogs is a mix of various game types, although by limiting it to 30+ minute games it’s mostly the main Summoners Rift games. (ARAM would significantly distort my hypothesis.)

Averages are a terrible way to calculate aggregate stats about packet loss and ping. But I don’t think they’d hide a trend of average ping or packet loss going up as a game progresses, I’d expect to still see it. Maybe not with the packet loss; the aggregate loss is so low perhaps it’s just not visible.

Hearthstone game logs

I’m playing a little of Hearthstone, Blizzard’s casual online CCG. It’s quite a fun little game, each turn is like solving a puzzle.

There’s a world of Hearthstone trackers out there that record your games and collect statistics. They are scary though, that whole industry is a little shady and I don’t trust them not to install malware. Also most of the trackers work by image detection (!) and there’s reports that some are messing with SSL certificates. Screw that.

There’s an alternative: Hearthstone has a debug log option that causes the game to write a bunch of debug info to a file. It’s not really a game log, it’s mostly about memory management, etc. But it has enough data to reconstruct the game. On the Mac the logging is enabled with ~/Library/Preferences/Blizzard/Hearthstone/log.config and the log ends up in ~/Library/Logs/Unity/Player.log. It’s a big file, 1 megabyte after a single game, but the Blizzard launcher seems to clean it up every launch.

There’s a few tracker apps that use this logging and are open source. I tried TrackOBot and it’s nice, runs on Mac just fine. There’s also Hearthstone Deck Tracker which is way fancier but is Windows only.

The drawback is that the log doesn’t record everything. Trackobot can see what cards you’ve played, for instance, but not what your whole deck is. And it doesn’t capture actions like which cards attacked what. But for high level stats of “I tend to win with Warlock” it’s not bad.

13936 Go games

Inspired by a visualization of which chess pieces die in aggregate games (see on Reddit today) I looked at 13,936 Go games and made a simple map of where people place stones. HSL scale linearly proportional to number of moves, the text is the percentage of games where someone placed a stone on that spot. (A bit fudged; didn’t account for how some games have people placing a stone more than once in the same spot.)

Screen Shot 2014-10-20 at 5.06.38 PM

No big surprises, but it’s nice to do little projects like this.

Logs of Lag summary stats

My Logs of Lag tool now has collected some 25,000+ logfiles. It’s a heavily biased sample: people mostly bring logs to my site if they have network trouble, but some stats nonetheless. Numbers are the average of each stat, with SD in parentheses

  • Best ping: 85ms (153)
  • Median ping: 97ms (389)
  • Packets lost / minute: 8 (120)
  • Game length: 28 minutes (13 minutes)

Would be nice to publish something from this data. I sure wish I had a way to get a representative sample. I wonder if I can convince some group of players to just upload their logs, whether they have problems or no. Would still be biased but maybe useful.

Here’s the kludgey script I use to generate a CSV file of all the results, which I can then feed to my 20 year old C program that calculates averages and standard deviations. Very quick and dirty, I should tackle a project of handling user data as more than flat JSON files.

for f in *; do
  ~/lol-netlog/logToJson.js < $f | 
  jq '"\(.matchLength),\(.packetsLost),\(.packetsLost/.matchLength),\(.medianPing),\(.bestPing)"'
; done > /tmp/logs.csv

League of Legends game protocol

I continue to be interested in understanding League of Legends lag. It’s a custom UDP protocol, so the usual way of measuring TCP packet loss doesn’t work.

I realized today the game must have something like a sequence number in the protocol. Apparently the LoL protocol is based on ENet, an open source “reliable UDP library”. There’s no dissector for ENet included in Wireshark but Google searches suggest several people have written them. packet-lol also has a LoL dissector but it is a couple years old, no idea if it’s still valid.

I’ve been hanging out on Freednode ##loldev recently, a nice little IRC channel. One thing they’re working on is documenting the observer protocol on a GitHub Wiki. But apparently that’s a totally different protocol from the UDP live game, based on HTTP requests for 30 second chunks of the game as well as keyframes, etc. A fair number of third party tools use the spectator protocol, sites like riftwalk.gg are doing some great game analysis. Neat stuff, but not relevant to the lag experienced while playing the game.

Here’s a big stack of links I’ve collected relevant to LoL protocols.

Gaming PC parts list

A friend of mine just ordered parts for a PC, using the Logical Increments lists. Here’s what he came up with.

 

Title Price Quantity Has
Cooler Master HAF X - Full Tower Computer Case with High Airflow Windowed Side Panel and USB 3.0
$159.99 1 0
Intel Core i7-4790K Processor- BX80646I74790K
$339.99 2 1
Crucial MX100 256GB SATA 2.5″ 7mm (with 9.5mm adapter) Internal Solid State Drive CT256MX100SSD1
$109.99 2 1
MSI ATX DDR3 2600 LGA 1150 Motherboards Z97-GD65 GAMING
$175.99 2 1
Noctua NH-U14S for Intel LGA 2011,1156,1155​, 1150 and AMD AM2/AM2+/AM3/3​+,FM1/2 Sockets, U Type, 6 Heatpipe,140mm CPU Cooler Cooling

Offered by Amamax (USA Seller).

$69.99 2 1
Seagate Barracuda 1 TB HDD SATA 6 Gb/s NCQ 64MB Cache 3.5-Inch Internal Bare Drive ST1000DM003
$52.92 2 1
Arctic Silver 5 Thermal Compound 3.5 Grams

Offered by LLYtech.

$7.70 1 0
EVGA GeForce GTX760 w/EVGA ACX Cooler 2GB GDDR5 256bit, Dual-Link DVI-I, DVI-D, HDMI,DP, SLI Ready Graphics Card (02G-P4-2763-K​R) Graphics Cards 02G-P4-2763-KR
$239.99 2 1
EVGA SuperNOVA 750G2 80PLUS Gold Certified ATX12V/EPS12V 750W Power Supply 220-G2-0750-XR
$112.99 1 0
G.SKILL Ares Series 16GB (2 x 8GB) 240-Pin SDRAM DDR3 1600 (PC3 12800) Desktop Memory F3-1600C10D-16​GAO

Offered by DotComFriday.

$149.99 1 0

Steam (MacOS sucks)

The Steam client on MacOS has always been terrible. I mean it’s badly designed as a product, but then also the implementation is terrible. Basically it’s 90% just showing a web page, but that’s always been slow and cranky and broken.

But today takes the cake. Because running Steam has brought my whole system to its knees. Beachball cursors, 10 second delay switching apps, 20 second delay to launch Console.app. Total trash. And as bad as Steam is, the real blame falls on MacOS for freezing because one app is badly behaved. I don’t see anything obviously wrong running top or activity monitor. Is the graphical shell single threaded or something? Steam wasn’t even doing much, just sitting there showing me a web page and downloading an update in the background.

To be fair, I think part of the problem was memory. When I killed Steam and relaunched it a bunch of memory freed up and things are better. So maybe that’s a Steam bug afterall. No Unix kernel schedules memory contention well.

 

 

Logs of Lag ready to go

My Logs of Lag site is ready to launch. It works well, a clean and simple way to drop a League of Legends logfile onto a web page and see some statistics.

Not sure how to properly “launch” this yet. Success would be some visibility on the League of Legends Reddit, I’ll probably post it on Monday but it’s a crapshoot of the first 15 minutes whether it gets upvotes or not. I don’t expect an amazing response, this kind of tool is really something more useful to hang around and be available for months or years when people need it.

I’m pretty happy with how the final project came together. I was worried for a long time about the visual style. I still don’t think it’s great, but adding a basic background image texture and switching the fonts from Helvetica/Arial made a big difference in making it feel “real”. And I don’t want to do the over-produced glitzy graphics thing that’s popular with most gaming sites, I find that a useless distraction.

Ideas for future features:

  • Highlight “bad” data. Ie; if the loss/second is greater than some threshold, make that show up in big angry red warning font. I want to collect some logfiles from users to see what is typical before building a classifier.
  • Parse broken logs. In particular the logfile gets wonky if the game disconnects, would be nice to parse that correctly.
  • An analyzer for a whole directory of files. This is the way lolparse.com works, presenting summary statistics for gameplay in many games. It’d be useful to characterize lag for many games as well. Totally feasible given all the work is client-side, it could be fast. A histogram showing the distribution of median ping and median packets/s loss would be a good start.

And ideas for the server:

  • Replace the Python CGI with a real server. I have a Node version but I’m not sure I like Node. Porting the CGI to Gunicorn would suffice for scaling.
  • Or.. Remove the server entirely. Just make the client Javascript upload stuff to S3.
  • Or.. commit to a real server, and add logins and user data management.

League of Legends packet loss

I play LoL half the time on a wired DSL line in San Francisco and it plays just fine. The other half the time I play on a fixed wireless network link in rural California and I get enough lag it’s not much fun to play. I’m trying to figure out if the source of that lag is my ISP’s wireless network or something else.

LoL has net logs which are remarkably helpful. The LoL client reports it’s losing about 300 packets in a 30 minute game, typically 1 or 2 every 10 seconds. And occasionally one bad lag burst, 20 lost packets in a 10 second frame. That’s consistent with what I see in the game, the occasional lag hiccup and then once or twice a game really bad lag. I’ve also poked around a fair amount into the UDP packet stream for the game to measure bandwidth, burst speeds, etc. It’s hard to diagnose without anything like TCP sequence numbers. But FWIW the game never seems to get much faster than 40,000 kbits/sec or so, well below my ISP’s honest speed of 1 mbit/sec.

I was guessing the link layer of the fixed wireless link is causing the packet loss. But my ISP has been great in helping me figure this out. They tell me they measure link packet loss and there isn’t any. Also the network equipment does have various retransmits etc to work around wireless flakiness. Another possibility is my router, or maybe even something in the Internet outside my ISP. Hard to know!

Along the way I’m trying to learn more about ARP caches. This documentation of the Linux ARP cache is helpful. So is the command “ip -s neighbor list” for inspecting the state of the ARP cache, although I don’t fully understand the output.

 

Battlefield 4 graphs

Some quick data views, looking at player statistics from the game Battlefield 4. I’m scraping stats from a site that lets me get a bunch of numbers for players, statistics like “Kill/Death Ratio” and “Score per Minute” and the like. I collected a bucket of stats for the top 1000 players (by rounds completed) for all 5 platforms, then graphed various variables. Honestly I haven’t found a very interesting story in this data yet, the main thing I’ve learned is that time played is not really correlated with any measure of skill. Ie: no one learns to play better. But more to consider.

Scatter plot is for two variables (lableled on axes), histogram below is the x axis.

Kill/Death Ratio vs. Time Played Win/Loss Ratio vs Kill/Death Ratio

Steam’s lousy throttling

Steam does a lousy job of bandwidth throttling. I had it set to limit downloads to 512kbytes/sec. (Why? Because despite using a fancy router with QoS control, QoS still sucks in 2014. Can’t stream video while downloading, derp). Here’s the graph of throughput from my router. X axis scale is 1 pixel = 2 seconds, max throughput is about 900 kbytes/sec. I turned off throttling halfway through.

Screen Shot 2014-03-02 at 8.35.12 AM

 

So looking at the first half of that graph, what Steam is actually doing is running at full capacity for about 10 seconds, then backing off to the requested 512 kbytes/sec for about 10 seconds, then averaging it out by going slow for 10 seconds. Back and forth. That’s just awesome.

I sure wish QoS worked on the modern Internet. The academic research I’m familiar with was all worried about solving the hard problem of fair congestion management through the whole Internet. I don’t care about that; I just want to manage QoS on one link, from my router to my ISP over the slow pipe.

Battlefield 4 dogtag notes

I’m sort of obssessed with the FPS game Battlefield 4, particularly all the online stats tracking. Here’s my profile. One of the things buried in there is a list of dog tags I’ve taken from other soldiers by cutting their throats with my knife (a totally awesome and challenging feat.) Naturally the webapp uses a JSON file for delivering the list of dogtags to the user, here’s a bit of what’s in it:

data/seenDogTags: tags I’ve taken. basic is for left tags, advanced is for right tags. Example right tag I’ve taken:

"235": {
  "index": 235,
  "isAdvanced": false,
  "name": "THE SACHAL",
  "timestamp": 1385955351,
  "counter": 7,
  "statValue": null,
  "clanTag": "WDD"
}

I believe this means I’ve taken left dogtag #235 a total of 7 times. My last victim was THE SACHAL of clan WDD at the given timestamp. I haven’t found the mapping of indices to tag names but that shouldn’t be too hard. I think left #235 is probably the USA flag dogtag. It’d be a fun little project to draw a map of all the tags you’ve taken, although I have no idea how many people really set their countries. I have mine set to Ascension Island just to be perverse.

The JSON file also has some other stuff in it. data/unlockedDogTagsIndices seems to be the list of tags I can equip. data/basic and data/advanced look like what I have equipped now. And data/seenDogTagsIndices is just a list of tags I’ve taken, a simplified form of what’s in data/seenDogTags.

I love how modern webapps that use JSON data are so easily scrapable.

bf4stats is a third party site that shows my dogtags as a list.

Live streaming LoL with low bandwidth

Trying to watch League of Legends live broadcasts (Youtube) in Grass Valley on my slow fixed wireless link. My link is throttled at 768kbps, with a burst up front up to 2500kbps for a short time (15 seconds?). In San Francisco with the faster DSL I can watch 720p no problem and generally think Twitch is the most reliable. How about on a slow link? Conclusion: YouTube 360p Azubu 360p.

All tests are using Google Chrome on a Mac. Bandwidth is me eyeballing the median off of Tomato’s realtime bandwidth graphs. Numbers may be limited by my ISP’s 768kbps hard cap, I’m not entirely sure when the throttle applies. Measurements were taken during the game when the whole screen is live with scrolling backgrounds; bandwidth is lower if most of the screen is static.

  • 340kbps   youtube 240 live   fmt=92
  • 450kbps   twitch low (240?)
  • 530kbps   azubu 360p
  • 800kbps     youtube 360 live   fmt=93
  • 900kbps     twitch medium (360?)
  • 1100kbps? azubu 480p

All but the last option are reasonably reliable for at least a few minutes watching. Quality is not great. The lower 240p category is hard to watch, 360p isn’t bad. Audio is mostly fine (except Twitch low.) My impression is YouTube quality is better in both speed categories. It also seems to handle stream glitches a bit better. I think Azubu is stretching the truth in their reported resolution. (Update: it’s 360p, just more loss on the compression.)

I wish I knew which codecs everyone was using. No easy way to get that info from the Flash players, although presumably it’s determinable on inspection. YouTube’s debug info has those fmt= codes but there are no entries for that on the Wikipedia page for YouTube formats. This YouTube help page on how to broadcast suggests they’re using H.264 for video and AAC for audio. (The bandwidths line up with my observation, too.) A bit surprised they’re not using WebM/VP8, but maybe it’s a hardware support thing.

The video content is a bit rough for codecs, btw. Rendered graphics. And the whole screen is constantly scrolling, not many static parts of the screen. Even the background alters on scrolling because of the perspective projection the game uses.

lolss

My ISP’s burst interacts strangely with the streaming services. My thinking is that my 768kbps sustained network is just not quite fast enough for Youtube 360 or Twitch Medium, but my ISP doesn’t actually enforce that throttle for 15-30 minutes. Maybe because I’m only a tiny bit above my limit? Dunno.

Also worth noting that only Youtube has the weird sawtooth bandwidth thing. Azubu and Twitch both deliver a more consistent stream. I’m not sure if this really matters, given buffering in the network. I’m willing to bet Youtube is doing what they do on purpose, but I don’t understand why. The “stats for nerds” in YouTube’s player hangs at 0kbps, then bursts up to 1400kbps about 1.5s every 5s or so.

Graph below: YouTube 240p is the jagged line. The smooth line is either Twitch or Azubu, forget which.

Screen Shot 2013-08-31 at 1.29.14 PM Update: after watching a couple of hours I’m using the Azubu 360p stream. The YouTube 360p stream is better quality, but it’s just a tiny bit too much bandwidth for my link; the stream pauses every minute or so, very annoying. Azubu has the stream that’s just right for my bandwidth. They’re a bit odd in they’re serving a 530kbps 360p stream instead of 800kbps. The compression artifacts are awfully visible. But it’s better than the 240p options.

I think Azubu is using the same codec as everyone else. OTOH my Macbook Air’s fan is running pretty hard now, the Flash player seems to be using double the CPU of YouTube’s when viewing full screen. Not a big deal, but something’s different.

Minecraft today

No hacking; that time got spent playing Minecraft instead. It’s an amazing indie game and while I’m mostly done with it, today my friends had a one-day PvP event on the server that was sort of interesting. It doesn’t make for a very good PvP game, honestly.