Sign in to follow this  
Mr. Jaggers

Cross-platform multiplayer restriction question

Recommended Posts

I've read that Brütal Legend has multiplayer matchmaking restricted by platform.

I'd like to understand this a little bit better... my understanding is that it is a case of all desktop platforms grouped together for online gameplay (Windows, and now Linux & Mac), and each console grouped together separately. Hence, desktop versions vs desktop versions, PS3 vs PS3 only, Xbox vs Xbox only. I had assumed that this was an issue of closed-console platforms in contrast with desktop OS's.

Recently, the suggestion has been floated in Linux game news circles that the cross-platform multiplayer restriction is truly per-platform. Hence, Windows vs Windows, Linux vs Linux, Mac vs Mac only (and of course, consoles as described above). Which is it?

I can't test this today, but even if I could, I'm not sure it would be as convincing as some words from the actual dev team.

Would a Double Fine team member be so kind as to provide a brief, but crystal clear, response to this? At your convenience of course, but the earlier I have an answer, the earlier I could report it back to my gaming communities and clear up a great deal of confusion.

Thanks loads, folks!

Share this post


Link to post
Share on other sites

BL's matchmaking is restricted by platform/OS (i.e. 360 vs 360, Win vs Win, Linux vs Linux, etc).

The reason for this is that BL uses a deterministic peer-to-peer multiplayer model. In this model, there is no central/official server that makes all the important decisions and tells everyone else what happened. If there was, cross OS multiplayer would be much more possible. However, in the case of BL (and Iron Brigade), each player basically runs their own server and players only send their input to the other players. It's as if everyone had their keyboards/mice/controllers plugged into a single machine. Except, they aren't the same machine, but they have to act as if they are. What this means is that the game must be 100% deterministic, i.e. given the same inputs, each instance of the game must produce the same output. If the games don't have the same output, then you get what we call a desync, which is sort of a butterfly effect where the games could continue, but each player would have an increasingly divergent version of the game.

In order to produce the exact same outputs, the game's code needs to execute *exactly* the same on all of the machines involved. Any difference in how the process does, say, floating point math (i.e. PS3's Cell vs Intel) would break that requirement. Even on machines with the same hardware (i.e. Windows vs Linux), we have to use different compilers and rely on different OSs. These differences in how, say, a compiler optimizes code can introduce subtle changes that will not be deterministic with the same code compiled on another processor.

It is, theoretically, possible to make a windows binary and a linux binary deterministic, but it's a daunting proposition on a codebase as complex as Brutal Legend. It would require a vast investment of tech and QA, and would probably be quite fragile, easily broken by a subtle change in compiler behavior, OS update, etc.

Anyway, I hope that helps answer your question!

Share this post


Link to post
Share on other sites

Thank you Nathan, for the prompt and detailed answer! I can't say it's the happiest explanation for me to have read, but it does explain why the architecture is sensitive to these variations. I'm honestly quite happy to play the game at all on Linux (and I'm sure that many Mac gamers feel the same way).

Share this post


Link to post
Share on other sites
The reason for this is that BL uses a deterministic peer-to-peer multiplayer model. In this model, there is no central/official server that makes all the important decisions and tells everyone else what happened. If there was, cross OS multiplayer would be much more possible. However, in the case of BL (and Iron Brigade), each player basically runs their own server and players only send their input to the other players. It's as if everyone had their keyboards/mice/controllers plugged into a single machine. Except, they aren't the same machine, but they have to act as if they are. What this means is that the game must be 100% deterministic, i.e. given the same inputs, each instance of the game must produce the same output. If the games don't have the same output, then you get what we call a desync, which is sort of a butterfly effect where the games could continue, but each player would have an increasingly divergent version of the game.

In order to produce the exact same outputs, the game's code needs to execute *exactly* the same on all of the machines involved. Any difference in how the process does, say, floating point math (i.e. PS3's Cell vs Intel) would break that requirement. Even on machines with the same hardware (i.e. Windows vs Linux), we have to use different compilers and rely on different OSs. These differences in how, say, a compiler optimizes code can introduce subtle changes that will not be deterministic with the same code compiled on another processor.

But that sounds like horrible netcode :gulp:

Brown paper bag code if I ever heard of it. PCs aren't homogeneous at all, what with different processors, graphic cards, drivers... Surely you must have some sort of abstraction?

Share this post


Link to post
Share on other sites

But that sounds like horrible netcode :gulp:

Brown paper bag code if I ever heard of it. PCs aren't homogeneous at all, what with different processors, graphic cards, drivers... Surely you must have some sort of abstraction?

The above is a simplified explanation, but deterministic peer-to-peer is a very common approach to network multiplayer in games, especially in sports, RTS, and brawler games. Like anything it has it's pros and cons, but I wouldn't describe it as "horrible" or "brown paper bag".

As far as having an "abstraction", the full details are obviously more complex than a simple explanation. We don't require every system to be deterministic, only ones that affect gameplay (i.e. sound and rendering can be non-deterministic) and we use a mix of compile time and runtime techniques to ensure that FPU calculations remain determinstic during the game's execution, even if the CPU FPU mode is modified by gfx drivers, OS, etc. I wouldn't really call these techniques an "abstraction" per se, but they do ensure that someone on Windows XP w/ an Intel CPU and AMD GPU can play against a Win 7 player using an AMD CPU and NVIDIA GPU (or whatever).

The tougher spot is cross-OS play, which really is more about cross-compiler play. We use different compilers for OSX, Linux, and Windows, and we allow the compilers a great deal of room to optimize the final code so that folks get the best possible performance. However, different compilers optimize in different ways, and these choices can affect the overall determinism, especially of floating point calculations. As I said above, it's theoretically possible to iron out all of these differences, but it would certainly take a lot of time and might require disabling various optimizations. We also use middleware in our games, some of which has closed source components (i.e. Havok) and sorting out this sort of thing with external partners can be even more time consuming. Cross platform/OS play has not (yet) been enough of a priority to justify this investment.

And there you have it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this