Cross platform multiplayer

Cross platform multiplayer

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
revcompgeek
Posts: 34
Joined: 29 May 2008, 21:06

Cross platform multiplayer

Post by revcompgeek »

I own a PowerBook G4 that I play spring on. The only other computer in the house is a Vista computer and I would like to play multiplayer. I understand the endianness issues with PPC and x86. How hard would it be to add endian switching code into the networking code for the PPC version? Does someone have code for the Mac version or can I just use SVN for Mac modifications?
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: Cross platform multiplayer

Post by Peet »

Aside from the endian issues, a G4 has a significantly different architecture from an x86 processor, which results in differences in FPU math results. The two are unable to maintain a synchronized simulation because of this.
revcompgeek
Posts: 34
Joined: 29 May 2008, 21:06

Re: Cross platform multiplayer

Post by revcompgeek »

In other words, the networking code would have to be re-written to allow for cross-architecture multiplayer. Is the current networking transmitting raw objects?
revcompgeek
Posts: 34
Joined: 29 May 2008, 21:06

Re: Cross platform multiplayer

Post by revcompgeek »

Just a thought: if I used qemu usermode to run spring, would that fix the issues? It probably wouldn't run fast enough anyway.
User avatar
Acidd_UK
Posts: 963
Joined: 23 Apr 2006, 02:15

Re: Cross platform multiplayer

Post by Acidd_UK »

revcompgeek wrote:In other words, the networking code would have to be re-written to allow for cross-architecture multiplayer. Is the current networking transmitting raw objects?
AFAIK, the networking code transmits the player's commands (e.g. "move unit 53 to position 10234,54654"). Because all clients execute that command in the same game simulation frame, the result of the command on all clients is the same. If you change architechture, then your floating point calculations may come out (slightly) differently, leading ot the game states diverging (desync).
User avatar
jackoverfull
Posts: 62
Joined: 10 Feb 2008, 16:32

Re: Cross platform multiplayer

Post by jackoverfull »

revcompgeek wrote:Just a thought: if I used qemu usermode to run spring, would that fix the issues? It probably wouldn't run fast enough anyway.
theoretically it will work, but i doubt that the game will be playable: it's barely usable as it is, on my ibook├óÔé¼┬ª

the game code still needs a lot of things to be enabled to run as it should on non x86 archs├óÔé¼┬ª
revcompgeek
Posts: 34
Joined: 29 May 2008, 21:06

Re: Cross platform multiplayer

Post by revcompgeek »

Acidd_UK wrote:AFAIK, the networking code transmits the player's commands (e.g. "move unit 53 to position 10234,54654"). Because all clients execute that command in the same game simulation frame, the result of the command on all clients is the same. If you change architechture, then your floating point calculations may come out (slightly) differently, leading ot the game states diverging (desync).
I am tempted now to write some identical code on Mac and PC (as much as possible) to test how different the floating point calculations are. It doesn't make sense that the calculations would be even slightly different, because then the calculations wouldn't be accurate, but I guess it could be differences in rounding.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: Cross platform multiplayer

Post by Peet »

Floating point operations, by definition, are not 100% accurate. See this.

edit: very related:
Image
revcompgeek
Posts: 34
Joined: 29 May 2008, 21:06

Re: Cross platform multiplayer

Post by revcompgeek »

Ahh, that makes sense. I guess the only alternative is using GMP or MPFR, or running it in qemu-user. Using GMP or MPFR has the disadvantage of being slow and will be hard to change in the code, and qemu-user has the problems of being slow and that I can't compile it on my Mac. Grrr.
Post Reply

Return to “Help & Bugs”