Readme if you have problems with multiplayer

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Readme if you have problems with multiplayer

Post by Bjarni »

this is out of date as it handles stuff regarding networking before we got it fulyl working or had a central server

First of all, network games are not done yet and are as such unsupported. Still here is a guide to get started

you need to start OpenTTD from the command line and use this:
  • -n : makes the computer a server for the game
  • -n IP : makes the computer a client, that connects to the server at the IP
  • -p x : makes the client join company x. The companies are numbered 0-7 where the server is 0. Don't join an AI company as the AI will get weird. If you join a company that is not in the game, you will just look at it without the ability to do anything -p should not be used when you join a game and want to get a new company
OpenTTD uses TCP

Fixes for the most common problems:
  • If you compiled the source yourself, you have to enable network. This is done in the makefile by editing makefile.config. Make sure it has the line ENABLE_NETWORK:=1. Always make clean after you edit anything in makefile.config.
  • Another common problem is that the current server does not transmit the settings, which means that client and server might not use the same settings and that will force the game to desync right away.
    Fix: delete openttd.cfg
    This will force all computers to use the same (default) settings and network should work.
  • OTTD uses port 3979. (the remark about a known trojan horse port was aimed at 12345. Somebody forgot to remove it when the port number changed). You can change the port number yourself if you want to
    edit openttd.cfg
    under [network] add
    port = 123
    where 123 is the port (can be anything)
    of cause all computers needs to use the same port
  • If you are still having problems, you can try to start a server and connect to it yourself with -n 127.0.0.1. The result from that gives a clue to where the problems are
  • You should start the server and start the game before letting any clients join. Make sure that two clients don't connect at the same time as the server can't handle that. Once the client have connected, you can connect the next one
Edit: Current server instead of 0.3.1 - Darkvater[/b]
Last edited by Bjarni on 06 Mar 2006 23:45, edited 7 times in total.
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Re: Readme if you have problems with multiplayer

Post by Korenn »

Bjarni wrote:
  • If you are still having problems, you can try to start a server and connect to it yourself with -n 192.168.0.1. The result from that gives a clue to where the problems are
This should probably be 127.0.0.1 , which is the localhost. 192.168.0.1 may not be the computer itself.
User avatar
CombatGold1
Tycoon
Tycoon
Posts: 4621
Joined: 29 May 2002 15:27
Location: Cardiff, South Wales
Contact:

Post by CombatGold1 »

Can we choose a port? Also, is it TCP or UDP?
Thanks,
Adam Reece.
DjArcas
Engineer
Engineer
Posts: 65
Joined: 24 May 2004 14:02
Contact:

Post by DjArcas »

And I assume 2 player only right now?
The largest multiplayer games in the world - ever.
http://www.projectorgames.net
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

DjArcas wrote:And I assume 2 player only right now?
no. 8 (or was it 6). But they should not connect to the server at the same time. The first one needs to get into the game before the next one joins. This is because the server can't handle a new one connecting before it's done sending map and so on to the first one
Procrastinator
Engineer
Engineer
Posts: 4
Joined: 11 Jun 2004 23:02
Location: Denmark

!network sync error

Post by Procrastinator »

What do you do to get rid of the "!network sync error"-message?
Hard work often pays off after time
- but laziness always pays off now
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Re: !network sync error

Post by Darkvater »

Procrastinator wrote:What do you do to get rid of the "!network sync error"-message?
Unfortunately nothing :cry:
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
DjArcas
Engineer
Engineer
Posts: 65
Joined: 24 May 2004 14:02
Contact:

Post by DjArcas »

"-p x : makes the client join company x. The companies are numbered 0-7 where the server is 0. Don't join an AI company as the AI will get weird. If you join a company that is not in the game, you will just look at it without the ability to do anything"

How can you have a company that's in the game, but not an AI player? ie how do I specify '6 companies, please'
The largest multiplayer games in the world - ever.
http://www.projectorgames.net
LynXX
Engineer
Engineer
Posts: 6
Joined: 11 Jun 2004 23:55
Location: France
Contact:

Post by LynXX »

Correct me if I'm wrong, but the "-p" switch should not be used when launching a new game. All the players just have to launch "openttd -n xxx.xxx.xxx.xxx" to join the party.

"-p" is usefull only in case of desynch, or when loading a network game.
jon
Engineer
Engineer
Posts: 2
Joined: 13 Jun 2004 13:20
Location: England
Contact:

connecting

Post by jon »

-n seems to work fine for me but connecting using -n xxx.xxx.xxx.xxx throws an assertion error "Network Load Error!" and then exits. a bug, or my own stupidity?
User avatar
habell
Transport Coordinator
Transport Coordinator
Posts: 374
Joined: 04 Mar 2004 12:47
Location: Veenendaal, The Netherlands

Post by habell »

Well I've tested the network play in the nightly build of june 16th. Me and two friends played for about 3 hours and we encounterd no errors. :lol:

This new way of creating a networkgame is very user friendly. Thanks for making this happen, OpenTTD team.

I'm wondering when this is added to the released version?
It still gives the message "Not implemented yet", but it seems to work fine.
User avatar
Bouke
Engineer
Engineer
Posts: 93
Joined: 18 Jun 2004 10:11
Location: Oudehorne (Frl), The Netherlands

Post by Bouke »

Please make the clients automatically download the changed map in case of an "network sync error" instead of closing the whole program. That would be much more fun for my friends :wink:.
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

Bouke wrote:Please make the clients automatically download the changed map in case of an "network sync error" instead of closing the whole program. That would be much more fun for my friends :wink:.
you could get something like the quit menu, but it would say "Network desync. Do you want to reconnect and take control of your old company"
It have to be coded though and without looking at the network code, I can't promise anything
However with the current code, you can reconnect to your old company
use
./ttd -p x -n IP
x would be the company you had, server is 0, and company no 8(max) is 7, so use a number from 0-7
you would get problems if you choose an AI company. You can also select a company where somebody already have, so you are two people building on the same company
matthijs
Engineer
Engineer
Posts: 76
Joined: 25 Jun 2004 15:20
Location: Enschede, Netherlands
Contact:

Post by matthijs »

Another common problem is that the server in 0.3.1 does not transmit the settings
I just want to add that even though this implies that this has been fixed in later versions, it apparently is not. Different settings still cause desyncs (or have I found a bug?). Maybe you could change this to `current server' instead of `server in 0.3.1'?

Matthijs
User avatar
lucaspiller
Tycoon
Tycoon
Posts: 1228
Joined: 18 Apr 2004 20:27

Post by lucaspiller »

I think I will have ago tommorow at creating a menu thing for the multiplayer thing that will display some useful info and that you will be returned to incase of a network desync. It will probably just be a console for now, but the GUI seems quite simple so I will have ago at that.

I have a couple of questions though. Firstly what causes a network desync and is it possible to reproduce it easily? Secondly what happens to your company when you disconnect? Does it get taken over by the AI or just left to run by itself?
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

lucaspiller wrote:I think I will have ago tommorow at creating a menu thing for the multiplayer thing that will display some useful info and that you will be returned to incase of a network desync. It will probably just be a console for now, but the GUI seems quite simple so I will have ago at that.

I have a couple of questions though. Firstly what causes a network desync and is it possible to reproduce it easily? Secondly what happens to your company when you disconnect? Does it get taken over by the AI or just left to run by itself?
1st: a desync happens when the random number generator on the server and clients does not produce the same number on a given test. This can be reproduced by making one computer generate a random number while the others do not.
2nd: no idea.
User avatar
Bouke
Engineer
Engineer
Posts: 93
Joined: 18 Jun 2004 10:11
Location: Oudehorne (Frl), The Netherlands

Post by Bouke »

Bjarni wrote:you could get something like the quit menu, but it would say "Network desync. Do you want to reconnect and take control of your old company"
It have to be coded though and without looking at the network code, I can't promise anything
However with the current code, you can reconnect to your old company
use [...]
I allready did know about the reconnect thingy. And that reconnect dialog would be so lovely! I have to help my sister each time she has to reconnect :(.
User avatar
habell
Transport Coordinator
Transport Coordinator
Posts: 374
Joined: 04 Mar 2004 12:47
Location: Veenendaal, The Netherlands

Post by habell »

Bouke wrote:
Bjarni wrote:you could get something like the quit menu, but it would say "Network desync. Do you want to reconnect and take control of your old company"
It have to be coded though and without looking at the network code, I can't promise anything
However with the current code, you can reconnect to your old company
use [...]
I allready did know about the reconnect thingy. And that reconnect dialog would be so lovely! I have to help my sister each time she has to reconnect :(.
You could create a short-cut for this. Just click on the link and you're back in. Thats what I've done, and it works great. :wink:
User avatar
lucaspiller
Tycoon
Tycoon
Posts: 1228
Joined: 18 Apr 2004 20:27

Post by lucaspiller »

Well the good news is that I have got the patch to reconnect on a network desync working. :D The even better news is that it reconnects automatically without the user knowing (apart from a short delay). I will do a bit more testing though to see if I can find any problems but so far there don't seem to be any. :D What this space....

EDIT: At the moment it doesn't actually keep your company. :cry: So I will need to figure out how to fix that - shouldn't be too hard though.

EDIT #2: Ok it does keep the company - I must have chosen to be an observer at the start. At the moment it doesn't reconnect on a "!network sync error" but does reconnect on a "!network is desynched" (which seems to be more common). I am not sure why it doesn't reconnect on the first one as it should work with the same code but doesn't.
Rexxie
Engineer
Engineer
Posts: 109
Joined: 07 Jan 2004 18:37
Location: Norway
Contact:

Post by Rexxie »

Would it be possible to add something that transfers the settings from one user to another, or at least lets you know that they do not match? Kind of like downloading the map when you join, but downloading the settings instead :)

I tried OTTD MP for the first time yesterday and it was a blast, we encountered A LOT of desyncs with the latest nightly build though. I don't know if we managed to get it all corect with the same settings, that might have been the problem.

Went back to 0.3.2.1 and that worked better. But then again, we both reinstalled that, so we obviously had the same settings too. This is why copying the settings would be nice.
- Rexxie
Sanity is a full time job.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 13 guests