Docs / Playing / User guide
LAN play
In the launcher, multiplayer is on the Multiplayer page:
- Connect by Code → Invite friends: Set up a hosted duty, choose map, bus and duty on the Drive page and start the duty. The session code then appears on the Multiplayer and Running games pages, with Copy code; send it to your friends.
- Connect by Code → Join friends: paste the code, confirm the session (the page shows the host's map, time, weather and players), then choose your bus on the Drive page and start. The map, time, date and weather are the host's.
- Servers: a list of dedicated servers (see SERVER.md) to add, ask and join, over UDP or WebSocket.
From the command line, --lan-host [port] hosts a session (UDP, port 27015 by default, or
the first free one of 27015 to 27024 when no port is given; a port given is used as it is), --lan-join <where> joins one and
--lan-name is your name.
--lan-join takes the session code, an ip, ip:port, a host
name, a bare port (a host on this machine) or auto (find a host on the local network by
broadcast).
A session code looks like OMSI-7Q4K-2M9X-HD3P-R8TZ-KC5W-NB6E (no look-alike characters). It carries the session id and up to three addresses of the host, a VPN's first - Hamachi
(25.x.x.x), Radmin VPN (26.x.x.x), ZeroTier, Tailscale (100.64.0.0/10) - then the LAN's.
The joining game says hello to all of them at once and takes the one that answers.
Over
the internet no VPN or port forwarding is needed: the host asks its router to forward the
port (UPnP), both games learn their public address (STUN) and meet through a public
message relay that passes only the addresses (UDP hole punching), and when none of that
gets through, the host's free Cloudflare quick tunnel is the way in (the game fetches
cloudflared itself the first time it hosts).
When nothing answers within 10 s, the joining game gives up and says why that may be. Two routers that both change their port for every destination (some mobile networks) cannot be punched through; a dedicated server or a VPN works there.
Whichever way, the host's firewall must let the game receive UDP on its port (27015 by default; Windows counts a Hamachi network as public). A busy host (loading a heavy part of the map) still answers, and the joining game waits up to 8 s for it before it loads anything.
The joining game plays on the host's map whatever map was chosen before, when that map is installed or comes with the host's mods (below); one that is not is said in the HUD.
Everybody sends the state of their own bus up to twenty times a second (five while nothing changes, about 60 bytes: a bit-packed datagram with the pose, pedals, lights, indicators, doors, wheel travel, the rear sections of an articulated bus and the vehicle's own lamp, switch and sound variables); everything else is text.
The host relays and owns the world: a joining player takes its date, time, weather and season, and its clock keeps everybody in step.
The other players' buses run their own AI scripts with the sender's inputs, are drawn and heard where they stand, and are obstacles for the AI traffic like your own bus - as long as that bus type is installed locally, otherwise your own type stands in for it.
/ opens the chat line (Enter sends, Esc drops it; when your keyboard file gives / to
something else, such as a manual gearbox, the key left of 1 or \ opens it instead) and
V hides and shows the chat; both keys can be changed on the Controls page. Joining and
leaving are announced there.
The chat grows with the window like the rest of the interface, and has a size of its own on top: Ctrl + the mouse wheel over it, or Settings → General → Chat size (50-300 %). The host checks everything it takes in and limits how much a player may send.
Every variable of the other buses. Besides the pose, each game sends all script
variables of its bus (floats and strings: a gearbox's state, a display's or an IBIS's text,
a ticket printer, what a plugin or setvar set): ten times a second the ones that changed,
and all of them in turn in between, so lost datagrams are repaired and a player who joins
late receives the whole state.
Strings of up to 1 MiB arrive whole. The copy of a bus in the other games keeps the owner's values against what its own scripts would make of them.
When the two games have different versions of the bus, the variables both versions have
are still passed on by name, as long as the model and sound configurations use them the
same way; variables only one version has are skipped. OMSI_NO_VAR_SYNC=1 switches it
off, OMSI_DEBUG_VAR_SYNC=<variable> logs what arrives for one variable.
Request a passenger door. While on foot, press Ctrl+Alt+S within 3.2 metres of
an entry point outside a bus, or an exit point inside the bus you are riding. The request feeds that door's PAX_Entry<n>_Req or PAX_Exit<n>_Req, alongside
simulated passengers.
It remains active until the door opens or you leave the point, change buses or start stepping through a door. AI buses and other players' buses support this; an exit request also asks an AI bus to serve its next stop. Change or clear the combination on the Controls page (Keyboard → The game) under "Passenger: request entry / exit". In multiplayer a request goes to the bus's owner (or to the host for AI buses).
AI scripts in LAN play. AI vehicles read the current game date, time, weather and sun
through L.S.*, from their initialization on. A client's copies of the AI buses get the
host's timetable state (schedule_active, the whole GetTT* stop list and times, the
current stop, the terminus and the delay) before their scripts start.
The host's mods. What the host's session uses that is not in the OMSI 2 folder itself (its map, bus, objects, splines, AI vehicles and people from the content folder or archives, also a content folder inside the OMSI 2 folder) is listed with a SHA-256 per file and served over TCP on the session's port;
a joining game fetches what it lacks before it loads the map
and keeps the downloads for the next time (~/.openomsi/lan-store). Listing a big add-on map
takes the host a while after it starts; a joining game waits for it. Maps installed straight into the OMSI 2 folder are not passed on: both
players need them.
The host's mods are for playing the session, not for keeping: they travel encrypted (ChaCha20-Poly1305, with a key agreed per connection and bound to the session), and the joining game never writes them to the disk in plain form.
~/.openomsi/lan-store holds each
file sealed and named by a keyed hash, and the game reads them decrypted into memory only;
copying them out of the game's folders gives noise, and so does listening on the network.
That is all it does: openOMSI is open source and the decryption runs on the player's own computer, so a changed build or a dump of the game's memory still gets the files, and the store's key lies on the same computer (sealed by Windows for the user's account, elsewhere a file only the user can read: obfuscation, not a lock). The host's own copy is the host's mod folder, unprotected.
One world. The host simulates the AI traffic, the timetable buses, the people on the pavements and at the stops, the riders of the timetable buses and the traffic lights for everybody, around every player (it loads the ground and fills the streets around the others too).
A client simulates none of that: it draws the host's world, 160 ms in the past so that it glides between the host's frames.
Only its own bus and the passengers who board it are its own: when its bus stands at a stop with a door open, it asks the host for the people waiting there; the host hands over those still waiting and keeps those who meanwhile went for another bus, so nobody is ever on two buses.
The people walking up to a client's bus and those getting off are sent back up, so the host sees them too.
Money and the timetable of your own duty stay local - but the host's timetable leaves the tour each player drives to that player (its AI bus goes, and comes back from the next departure when the player leaves), and everybody sees the passengers in everybody's bus: the riders of a player's bus travel with the world frames and sit in that bus in every other game.
Animated parts. The variables a bus's animations follow (doors, wipers, needles, the rear sections too) move on the other players' copies in step with the bus itself, also after a pause, and hold their last state while datagrams are lost.
Script textures. Matrix displays and other [scripttexture] surfaces come from the
player driving that bus: the other games show exactly what the owner's scripts drew, also
to a player who joins late. Both games need the same bus with the same texture slots; a
stand-in bus (a type you do not have) shows none.
Script sound events. (T.L.name) and (T.F.name) sounds come from the player driving
that bus (and from the host for AI vehicles), in order and once each.
The receiving game plays its own installed sound file - sound files are never transferred - with its own sound configuration's interior, exterior and position rules; a stand-in bus plays none. A player who joins later does not hear earlier events again.
All players need the same LAN protocol version: a host turns away a game of another one (with a message saying so). Windows, macOS and Linux play together.
Something wrong or missing? Fix it on GitHub or open an issue.