Repository navigation
LAN play
LAN play turns the title menu's Wireless Play into the game's own LAN mode: two PCs on one local network race each other with no account, no server and no internet. It is off by default. This page is the recipe two PCs (Windows 11 and Linux, the same build) played with, from the tests in #542.
Settings → General → LAN play (start screen, or F1 in game), or LAN = 1 in mkw.ini. It applies at the
next start. With it on, the game's sockets reach only local network addresses: an internet request still gets "no
network", and nothing outside your network is contacted.
- One local network that both see. The game finds rooms by broadcast, so both PCs must be on the same subnet (two PCs on one router or access point is what was tested). A router between them, or client isolation on the access point, was not tested and would block the broadcast.
-
A network with a broadcast address. A VPN adapter such as Tailscale's has a
/32mask and no broadcast: the game refuses it with error 2318-0007. When a real network is there too, it is preferred; the log says so withnifm: … has a /32 mask and no other interface has a local network addresswhen it is not. - UDP ports 49152 and 35000 open, in and out, in both PCs' firewalls.
-
A different address on each PC. With more than one network adapter,
LAN_IP = <your IPv4>inmkw.inisays which one to use. The log shows what was picked:nifm: LAN mode, address … mask ….
- LAN play on in both PCs, and the game started.
- At the title screen, Online → LAN Play on both.
- One PC creates a room; the other sees it in the list and joins.
- The host starts the race with + (Tab).
Each PC keeps its own profile and its own shader cache; nothing else is shared.
On a PC whose GPU shares the system RAM (an APU, a handheld, a laptop without a graphics card), the default GPU
memory cap can be too much for a LAN race. On a 14 GB machine the cap was 6.4 GB, the race's loading pushed the system
into swap, the session ran out of time, and both PCs showed game error dialog 2318-0006 at the same moment.
- One PC failing alone looks like a blocked port. The same error on both PCs at the same moment is the session timing out: check the memory of the PC with the integrated GPU first.
- The fix is a lower cap on that PC:
GPU_MEM_LIMIT = 4096inmkw.ini(MiB). On the test machine 4096 played the race; 3072 played two races with no error. Below 4096 the race can render black on other machines, so try 4096 first. - The log prints the cap it chose:
vk: integrated GPU, N MiB carved out of RAM by the firmware: memory cap M MiB. - On Linux, a reboot empties a swap that earlier attempts filled.
The test machine: AMD BC-250 (Linux, Mesa RADV), 14 GB of RAM shared with the GPU.
GPU_MEM_LIMIT |
GPU memory in use | RAM left | Result |
|---|---|---|---|
| unset (6 399 MiB) | 7 179 MiB | 0 |
2318-0006 on both PCs |
| 4096 | 4 905 MiB | 2.4 GB | the race is played |
| 3072 | ~3 100 MiB | 3.3 GB | two races, no error |
They do not find each other: both report the same address and use the same port. Use two PCs (developers on Linux
can use tools/run/lan2.sh, which puts each copy in its own network namespace).
Tested on v0.1.12 by three players (two Windows, one Linux) over a whole Grand Prix and several Knockout Tours (discussion #148):
- Create a ZeroTier network, join it on every PC and tick Auth for each member in its web console; keep multicast/broadcast on. ZeroTier gives real /24 addresses, which LAN Play needs.
- In each PC's
mkw.ini,LAN = 1andLAN_IP = <that PC's ZeroTier address>: without it the game takes the home network's adapter and nobody sees the group. - Open UDP 35000 and 49152 inbound (Linux with ufw:
sudo ufw allow 35000/udp && sudo ufw allow 49152/udp). - Same game version on every PC; one makes the group in LAN Play, the others join it. No addresses are typed in game.
Tailscale gives /32 addresses and carries no broadcast, so up to v0.1.13 the game refuses it (error 2318-0007). From
v0.1.14, LAN_PEERS in mkw.ini (the other PCs' addresses or names, #345 by @Gael50) makes it work over Tailscale:
tested with 3 races over Tailscale on two PCs.
Sessions longer than a Grand Prix and PCs on different versions of mkw-recomp.
Something wrong or missing here? Say so in Discussions. mkw-recomp is not affiliated with Nintendo.