*deprecated* [Linux] Workaround for lag-less multiplayer *lag fixed*

WARNING!

! ! ! ! ! ! ! ! !

Easier workaround is this one!

strace -f -e write -o /dev/null %command%

Automated bash script for attaching strace

#!/bin/bash need_lines=8 echo "Start scanning for warband network process..." while [ true ] do ps_warband=`ps -efL | grep warband | grep -v grep | grep -v '/bin/sh'` ps_lines=`echo "$ps_warband" | wc -l` if [ "$ps_lines" -eq "$need_lines" ] then thread_pid=`echo "$ps_warband" | awk 'NR=='+$need_lines | awk '{ print $4 }'` echo "Network process found! Attach strace to PID: $thread_pid" strace -o /dev/null -p "$thread_pid"& wait echo "Network process exited! Continue scanning..." fi sleep 0.01 done

Where I tested it...

My little research of game "lag" problem.

Outdated original how-to...

ps -efL | grep mb_warband_linux

i@ubuntu-vm:~/.steam/steam/SteamApps/common$ ps -efL | grep mb_warband_linux

i 24546 24545 24546 0 1 13:49 ? 00:00:00 /bin/sh -c "/home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux"

i 24547 24546 24547 52 7 13:49 ? 00:05:54 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24548 12 7 13:49 ? 00:01:24 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24552 0 7 13:49 ? 00:00:03 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24553 0 7 13:49 ? 00:00:03 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24554 0 7 13:49 ? 00:00:04 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24566 0 7 13:49 ? 00:00:00 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24567 0 7 13:49 ? 00:00:00 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24701 22816 24701 0 1 14:00 pts/11 00:00:00 grep --color=auto mb_warband_linux

ps -efL | grep mb_warband_linux

i@ubuntu-vm:~/.steam/steam/SteamApps/common$ ps -efL | grep mb_warband_linux

i 24546 24545 24546 0 1 13:49 ? 00:00:00 /bin/sh -c "/home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux"

i 24547 24546 24547 62 8 13:49 ? 00:08:57 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24548 11 8 13:49 ? 00:01:41 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24552 0 8 13:49 ? 00:00:04 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24553 0 8 13:49 ? 00:00:04 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24554 0 8 13:49 ? 00:00:05 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24566 0 8 13:49 ? 00:00:00 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24567 0 8 13:49 ? 00:00:00 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24547 24546 24747 80 8 14:03 ? 00:00:02 /home/i/.steam/steam/SteamApps/common/MountBlade Warband/mb_warband_linux

i 24749 22816 24749 0 1 14:03 pts/11 00:00:00 grep --color=auto mb_warband_linux

sudo strace -e write -p 24747

How is this works?

This workaround no longer required, developers fixed the problem in latest Beta!...Most easier workaround without root access requirement:1 - Right-click on the game title under the Library in Steam and select Properties.2 - Under the General tab click the Set launch options... button.3 - Enter this into field and click OK:4 - Close the game's Properties window and launch the game.Enjoy lag-free multilayer!Though this will attach strace to every child thread so it's have higher performance hit than automatic script!I made automatic bash script that attach strace. You can run it before you start game and then it's will attach strace to network thread ever time you connect to some server. :-)Code:This workaround should let you play in multiplayer with Windows performance. It's tested by me on Kubuntu 14.04 with 3.16RC4 kernel, game is running on highest settings with Intel HD4600 with most recent drivers from Oibaf PPA.I'm running i7 4771 and I not sure how well this will work on not that beefy CPUs. :-(This part doesn't important at all so if you just want to get into the lag-less game skip it.So I'm big fan of Warband MP so I'm was really annoyed by fact that MP lagging so much in newly appeared Linux version. I'm tried to understand why it's happen few days ago, but all my previous guesses were wrong: networking specific, too many open sockets, blocked ports, packet loss.Still back in few days I'm noticed that game tried to read "steam.pid" way to often and I'm thinked that it's related to fact of "lags". It's understandable that game using it to track Steam client activity (DRM? Achievements? no idea), but tons and tons of file access every second really not looks like a good thing. So I'm tried to move both steam.pid and game content into tmpfs (RAM). This wasn't too successful so I'm decide to run game while Steam in offline mode and without overlay, but it's still read this file and lagged.Only then I decide to check if there some thread that load CPU more than anothers and bingo! I'm find it and it's was thread that handle networking and read this "steam.pid" so possible this is one that actually using Steam API. Unfortunately I still had no idea how to fix it.Accidentally I leave strace opened for this nasty thread and then when I get into game client there was no lag. Soon I find out that it's what make lag gone: tested it with Steam overlay enabled and confirm that game work properly with strace.- First of all run game normally; no modifications needed.- Once main menu loaded execute this command in terminal:This will print all threads Warband executable running and it's will looks like that:So here is base 7 threads that game using, none of them cause "lag".- Now try to open Multiplayer, find any server you like to play at and join it.- Once you joined server run same command once again:Now there will be 8 threads, e.g new one appear:So basically last thread with PID "24747" it's one that handle networking.- Now attach strace to this process using this command:- As long as "strace" attached to this process game won't lag!There won't be any output because this process do not write anything.This is happen because new networking thread spawned every time you join server.Enjoy lag free game!To be fair I have no idea because I'm not the guy who usually debug blobs. ;-)Possible strace slow-down this thread or make it work faster instead. I still have feeling that problem related to how game watch Steam client running, but this might be just red herring and actual problem might be completely different...