X4Online — Real Multiplayer for X4: Foundations [Alpha] [UPDATE #1]

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

eg3r
Posts: 11
Joined: Mon, 16. Mar 26, 12:45

X4Online — Real Multiplayer for X4: Foundations [Alpha] [UPDATE #1]

Post by eg3r »

TL;DR: I'm building a mod that adds real multiplayer to X4: Foundations. Multiple players, one shared universe. It's very early — alpha stage — but some core features work. Here's a first look.

Video: X4Online Alpha Footage

What is X4Online?
X4Online is a native C++ extension that turns X4 into a multiplayer game. Not "send a venture and wait" multiplayer — actual real-time multiplayer where you share a universe with other players.

How it works:
  • One player hosts. Their game IS the server — the full X4 simulation (NPCs, economy, everything) runs on their end.
  • Other players connect as clients. They see the host's universe and interact with it.
  • All game state flows through the host. One universe, one truth.
No separate server software needed. No game reimplementation. X4's own engine does all the heavy lifting — the mod just bridges the gap between instances.

Current Status: Alpha

This is very early. I want to be upfront about that. Right now this is in early alpha, a lot is already working, still a huge amount of work needs to be done to be able to call it "beta".

What works today
  • Host/Client connection - Networking between multiple game instances
  • "On-Foot" Characters in stations/ships work (Animations need sync still, no running/walking animations for now, Doors need sync too)
  • Ships replication (Location, Sector Enter/Leave, Docking - tho ship-crews not yet done)
  • Station Replication (certain details not replicated yet)
  • Cluster/Sector replication
  • Factions replicated (Relations, Ownership of Ships, Stations, Clusters all work)
  • SETA blocking - SETA is automatically disabled when players are connected (can't/shouldn't have time acceleration in multiplayer)
  • A lot more is already done, like Player-Faction credits etc.
What's NOT in yet
This is an ALPHA, so a lot is missing:
  • Economy, trading, cargo, crews
  • Combat, weapons, damage
  • Fleet management
  • A lot of stats, UI, etc.
  • ...
All of these are on the roadmap, but the foundation is now in a good shape.

Technical Details (for the curious)
  • Native C++ extension built on the X4Native framework (another mod by me) — runs inside the game process, no external tools
  • Host-authoritative architecture — the host's game is the single source of truth
  • FlatBuffers serialization — efficient binary protocol for state replication
  • Lock-free threading — network I/O on a background thread, game API calls on the UI thread, bridged with lock-free queues
  • ~20Hz state broadcast with client-side interpolation for smooth visuals
  • < 1ms per frame overhead on the UI thread
The mod reads and writes game state through X4's own exported API functions — spawning ships, reading positions, teleporting objects. No memory hacking, tho RE is used for the X4Native extension where needed (native game loop hooks etc.).

What's Next
The immediate next steps after the current ALPHA:
  • Player actions — client commands (fly, dock, trade) sent to host for execution
  • Economy & stations — shared economy state
  • Combat — weapons, damage, shields
Want to Follow Along?
Feedback, questions, and ideas are welcome. Just keep in mind this is early days — "when will X be ready" is hard to answer right now. The focus is on getting the fundamentals rock solid before building up.

Interested in Contributing?
If you're a modder, a C++ developer, or someone who's been itching to get into game modding — I'd love to have help down the line. This is a big undertaking and there's plenty of room for contributors once the foundation stabilizes. More details on how to get involved will follow soon. In the meantime, feel free to reach out if this is something you'd want to be part of.
Last edited by eg3r on Sat, 28. Mar 26, 19:01, edited 14 times in total.
User avatar
thaurane
Posts: 1
Joined: Thu, 19. Mar 26, 00:05

Re: X4Online — Real Multiplayer for X4: Foundations [Early Alpha / POC]

Post by thaurane »

Created an account just to reply.

This is really cool what you're doing and I hope you gain enough traction to make all your efforts worth while! I wish I had the skills/time to help though...



Also on a side note with the whole discord fiasco I just realized how much I miss old style forums.
dito6210
Posts: 2
Joined: Thu, 29. Nov 18, 19:28
x4

Re: X4Online — Real Multiplayer for X4: Foundations [Early Alpha / POC]

Post by dito6210 »

oh wow that is... amazing, gotta spread the words
eg3r
Posts: 11
Joined: Mon, 16. Mar 26, 12:45

Re: X4Online — Real Multiplayer for X4: Foundations [Early Alpha / POC]

Post by eg3r »

Thank you guys!

And also good news so far, I'd say for a first release where you actually can do something with multiple people, like let them control your fleets is already very close, if everything goes to plan there will be an early alpha release end of the month / first week of April - maybe even 1st of April :D .

:x4:
Mt-Mojo
Posts: 1
Joined: Sun, 22. Mar 26, 00:03
x4

Re: X4Online — Real Multiplayer for X4: Foundations [Early Alpha / POC]

Post by Mt-Mojo »

Interesting! Would you be willing to share your current source code as read only right now? I'm actually quite interested in helping out later on if you open it up for other contributors. But I'm curious to see what you've done so far.
eg3r
Posts: 11
Joined: Mon, 16. Mar 26, 12:45

Re: X4Online — Real Multiplayer for X4: Foundations [Early Alpha / POC]

Post by eg3r »

Mt-Mojo wrote: Sun, 22. Mar 26, 00:08 Interesting! Would you be willing to share your current source code as read only right now? I'm actually quite interested in helping out later on if you open it up for other contributors. But I'm curious to see what you've done so far.
I will release the whole project very soon, it is coming along great - source should be up in a few days - a lot of documents in there too. I spend most of my time researching how X4 systems work internally.

On that note, current status:
  • Full station interior and station sync working (this was quite some work..)
  • Walking and seeing each other in stations work (tho animation sync is tricky, will work on it in beta).
  • Ships sync. in early phase, rotation, positions work great.
:x4:


PS. Source for the base project (X4Native) is already available (info here).
lainio
Posts: 26
Joined: Fri, 5. Jan 18, 09:13
x4

Re: X4Online — Real Multiplayer for X4: Foundations [Early Alpha / POC]

Post by lainio »

Damn thats like super impressive and SUPER exciting!
eg3r
Posts: 11
Joined: Mon, 16. Mar 26, 12:45

Re: X4Online — Real Multiplayer for X4: Foundations [Alpha] [UPDATE #1]

Post by eg3r »

The state has been updated, a lot of new stuff for the current alpha state. All in post #1.
lainio
Posts: 26
Joined: Fri, 5. Jan 18, 09:13
x4

Re: X4Online — Real Multiplayer for X4: Foundations [Alpha] [UPDATE #1]

Post by lainio »

Subscribed to this thread because I'm super interested! Looks pretty good so far!
Mitroll
Posts: 5
Joined: Wed, 19. Dec 18, 05:31
x4

Re: X4Online — Real Multiplayer for X4: Foundations [Alpha] [UPDATE #1]

Post by Mitroll »

Wow, can't wait! It would be a ton of fun to build up an empire with a friend or two!
orgynun
Posts: 1
Joined: Sun, 7. Feb 16, 12:18

Re: X4Online — Real Multiplayer for X4: Foundations [Alpha] [UPDATE #1]

Post by orgynun »

Incredible! I've been hoping and praying someone would implement this. Good job o7 :D

Return to “X4: Foundations - Scripts and Modding”