Civ4 PitBoss Available

Felix928 said:
Is it possible to run a PitBoss server on one machine behind a firewall and have someone connect via Internert and have a player internally to the server connect using the private IP address from a different machine?

We seem to be having NAT issues. Only one player can connect to the server hosted game successfully. The other player hangs on "Contacting Peers" and is unable to join the game even though the server connection is successful. I believe this is because both players internally are trying to use 2056 UDP.

Is this supposed to be a viable hosting scenario and does anyone have any recommendations? We'd like to use DirectIP and avoid having to use the Internet lobby to middle-man the connection.

Just to confirm, (re: my earlier post) I'm seeing the same problem. I've been successfull with several other games working in in an analogous mode without problems.

Has anyone played a pitboss game with 2 clients on an internal LAN successfully?
 
After some hacking about (which I won't go into here - had to copy some dlls from my WinXP install, which may be quasi-legal in the States), I managed to get WINE on my Debian box in a state where it seemed happy enough to load PitBoss.

It crashed immediately, but I'm not sure how much of it was WINE and how much of it is PB. The fact that WINE's exit code is 0 seems to suggest that it's PB, but looking at the error, it seems WINE should be responsible for giving PB an XML parser or something.

I know it reads the config file, because it actually GENERATED one when I had the wrong link. I thought I'd be smart and replace the Windows link files (_Civ4...) with Unix softlinks, but it just overwrote the Unix links and created a full set of directories (including "My Games") in my home directory:
Code:
grantek@kenshi:/stuff/civ4$ ls -l _Civ4Config.lnk
lrwxrwxrwx  1 grantek staff 24 2006-01-16 19:05 _Civ4Config.lnk -> _civ4/CivilizationIV.ini

grantek@kenshi:/stuff/civ4$ wine PitBoss.exe
[...]

grantek@kenshi:/stuff/civ4$ ls -l _Civ4Config.lnk
-rw-rw-r--  1 grantek staff 394 2006-01-16 19:10 _Civ4Config.lnk
grantek@kenshi:/stuff/civ4$ file _Civ4Config.lnk
_Civ4Config.lnk: MS Windows shortcut
grantek@kenshi:/stuff/civ4$ strings _Civ4Config.lnk | tail -1
Z:\home\grantek\My Games\civ4\CivilizationIV.ini

grantek@kenshi:~/My Games/civ4$ ls
CivilizationIV.ini  Logs  Patch       Replays  ScreenShots
CustomAssets        MODS  PublicMaps  Saves    TransferredMaps
The default ini file that it creates looks like this (blank lines removed to save space):
Code:
[GAME]
; Move along
CheatCode = 0
[CONFIG]
; Sync input to smooth interface (may run slower)
SyncInput = 0
; Force numlock always on while playing
ForceNumlock = 0
[DEBUG]
; Break on memory allocation order #
BreakOnAlloc = -1
I copied my valid CivilizationIV.ini into the place where PB looks, and PB seems to touch it (updates the "modified" timestamp), but it doesn't alter it.

And now, the actual error. The full error output is below. The two waveout errors at the top are because I don't have my sound card properly configured :)
Code:
grantek@kenshi:/stuff/civ4$ wine PitBoss.exe 
Invoking /usr/lib/wine/wine.bin PitBoss.exe ...
err:wave:OSS_WaveOutInit open(/dev/mixer1) failed (No such file or directory)
err:wave:OSS_WaveInInit open(/dev/mixer1) failed (No such file or directory)
fixme:system:SystemParametersInfoW Unimplemented action: 55 (SPI_SETMOUSEKEYS)
fixme:system:SystemParametersInfoW Unimplemented action: 59 (SPI_SETSTICKYKEYS)
err:ole:CoGetClassObject class {373984c9-b845-449b-91e7-45ac83036ade} not regist
ered
err:ole:create_server class {373984c9-b845-449b-91e7-45ac83036ade} not registere
d
fixme:ole:CoCreateInstance no classfactory created for CLSID {373984c9-b845-449b
-91e7-45ac83036ade}, hres is 0x80040150
err:ole:CoGetClassObject class {f6d90f11-9c73-11d3-b32e-00c04f990bb4} not regist
ered
err:ole:create_server class {f6d90f11-9c73-11d3-b32e-00c04f990bb4} not registere
d
fixme:ole:CoCreateInstance no classfactory created for CLSID {f6d90f11-9c73-11d3
-b32e-00c04f990bb4}, hres is 0x80040150

App::Active
CVRESMGR: shared 0, loaded 0, copied 0, cloned 0, failedLoads 0
Caught uninit exception
Wine exited with a successful status
It actually gets to the last "fixme" line, pops up an error message, then spits the rest out, as shown in the attached image.

I guess my question is: can anyone tell me if this is WINE or PB?
 

Attachments

  • wine-pb.png
    wine-pb.png
    6.6 KB · Views: 524
There's a FAQ entry under the unofficial tech support thread here on the forums.

Try copying the msxml*.dll files and running "wine regsvr32 msxml msxml2 msxml3". I can't get it to work beyond that though -- for some reason it keeps trying to use msxml2 which is picky about UTF encoding.
 
ensignyu said:
There's a FAQ entry under the unofficial tech support thread here on the forums.

Try copying the msxml*.dll files and running "wine regsvr32 msxml msxml2 msxml3". I can't get it to work beyond that though -- for some reason it keeps trying to use msxml2 which is picky about UTF encoding.

Hmm not that it helps but that FAQ may address my issue with running .NET/Windows 98 and Pitboss. I'll try that tonight

Tals
 
[EDIT: SEE IMPORTANT EDITS AT THE END OF THIS POST]

I don't think it's possible to both host a game using PitBoss and play in it at the same time, if you have only one IP address and you're using NAT (unless you're hosting a LAN party and *all* your players are inside the NAT).

here's my hypothesis:

1. Civ4 is a peer-to-peer game (at least when played in Direct IP mode).
2. PitBoss is a peer that controls only the AI players (if any) and handles the saving of games.
3. All peers must use the same UDP port (2056) and there is no way to override this.

the implication of the above is that every participant in the game must have a unique IP address and UDP port pair. since the UDP port can't be changed, this means that every participant must have a unique IP address reachable by every other participant. "participant" includes the PitBoss server itself.

if you have only one public IP address, which you share among multiple machines using NAT, then you cannot possibly have two machines up at the same time that are both reachable by every other participant -- only one of the two machines can be 'bound' to port 2056 on your NAT router.

the only solution I can think of for this problem is to run a VPN server (such as OpenVPN), and require that all participants in the game play the game tunneling their traffic through the VPN. in this way, you can give each participant a unique IP address reachable by every other participant, even if one or more of the participants are sharing an IP address on the 'public' Internet.

the obvious solution, of course, is for Firaxis to patch the client and PitBoss to allow arbitrary ports to be specified. at a minimum, PitBoss needs to be able to listen on any port, and the clients need to be able to specify the server port (so that a player with one IP address can both host and play at the same time) and the clients also need to be able to override their own port (so that multiple players who are sharing a single IP address can play at the same time). this would require the peer-to-peer protocol to be updated, of course -- the server would have to inform newly connecting players of both the IP address *and* port of each of the existing players (I assume that, right now, the server sends IP addresses only, and the port is assumed to be 2056 in all cases).

I haven't tested the VPN solution yet, but I'm figuring it should work.

-ken

[EDIT: for those of you reading this thread late, it turns out that assumption #3 above is false. it is possible to change the port on any client, and on the PitBoss server as well. read the rest of the thread to find out how. the result of this is that it is in fact possible for multiple players to share an IP address, and that it works fine. the "obvious solution" above, listing a number of required patches, is unnecessary -- all of those features are already present in Civ4 and in PitBoss.]
 
kgober said:
I don't think it's possible to both host a game using PitBoss and play in it at the same time, if you have only one IP address and you're using NAT (unless you're hosting a LAN party and *all* your players are inside the NAT).
I have several times hosted pitboss, while playing from same PC, and others have connected using direct IP from internet at same time.

(And I use NAT)
 
OK not gone into the detail here :) But I am slightly confused why you think you shouldnot be able to connect to pitboss via the external ip address for your external players and for the host to connect internally using the internal IP.

Tals
 
because, when the internal host tries to connect to the external players (this is what makes it peer-to-peer, rather than client-server), it will fail. the external players can connect to the pitboss, or they can connect to you, but they can't connect to both, because you're both (to them) trying to appear at the same IP address and port.

also, this whole thing assumes that you're using two machines, rather than trying to run pitboss and the normal client both on the same machine.

-ken
 
tals said:
OK not gone into the detail here :) But I am slightly confused why you think you shouldnot be able to connect to pitboss via the external ip address for your external players and for the host to connect internally using the internal IP.

Tals


I'm hosting a pitboss game, and have about 8 people connecting from outside my firewall. I connect to it from inside using my private IP address. You can also host and connect to the pitboss on the same machine.

Only problem I have had so far is sometime it seems the amount of people allowed to connect to the server at one time is limited. I have had 2 people outside my firewall connected and i could not connect until one of them left. They have reported to me they have seen 3 people connected at one time. So I'm still wondering of the capabilities of the Pitboss host in regards to the number of players that are allowed to direct connect, either it be internal, external, or both types of users.

You can also have it on Gamespy where users can connect as well as have people using the direct connect method. I have openend ports for gamespy as well as directconnect.

Also, can you just not change the port in the _Civ4Config (CivilizationIV.ini) file if you want to. I haven't tested it, but isn't that where it pulls it from?

; NetComm Port
Port = 2056
 
clearly there is still a lot of mystery surrounding pitboss, making it hard to predict when it will work and when it won't.

I think the best thing to do in order to understand it is to determine once and for all whether civ4 multiplayer is a client-server architecture or peer-to-peer. I will need to set up a third machine on my network running civ4 to find out.

also, I'll need to find out what changing the port in the .ini file does -- whether it changes the source port the game listens on, the target port it sends to, or both.

-ken
 
Firearm said:
Also, can you just not change the port in the _Civ4Config (CivilizationIV.ini) file if you want to. I haven't tested it, but isn't that where it pulls it from?

; NetComm Port
Port = 2056

Yes you certainly can, in fact players from the same LAN connecting over the internet to a pitboss game can use different ports to allow them to connect to the same game even though they have the same public IP.

CS
 
I know you can turn logging on from the INI file and it will show you the IP and port of the person loggin in. I just have not had time to actually change and test this out. Since it seems to be working for my current game, I didn't want to rock the boat.
 
kgober said:
because, when the internal host tries to connect to the external players (this is what makes it peer-to-peer, rather than client-server), it will fail.

Pitboss can't require that the players connect directly to one another. They might not even be running the game at the same time---this is the whole point of Pitboss.
 
The PitBoss is essentially a "player 0" app... it's still peer-to-peer, so it is subject to all of the same rules as regular multiplayer.
 
DaviddesJ said:
Pitboss can't require that the players connect directly to one another. They might not even be running the game at the same time---this is the whole point of Pitboss.
I don't mean *all* the possible players, only the currently connected ones. for me, this would turn out to be all the players anyway, because we simply wouldn't play if not everyone was on (we play simultaneous turns). our intended use of Pitboss is simply to reduce end-of-turn lag, by moving compute-intensive tasks to a machine optimized for that. ideally nobody's client would have to be responsible for handling the AI players (and we include a *lot* of AI players -- we try to have at least three times as many AI's in a game as human players, and would prefer four to five times as many if it were practical).

-ken
 
Maybe I have a basic misunderstanding about the intent of PitBoss... We are trying to use it to host a DirectIP game for 6 people with concurrent connections. While I understand its use for PBEM type games, I had thought that it would also serve as a competant server for simultaneous turns, real-time type games.

If it is true that the port changes can be made client side and the server will recognize traffic on any port attempting to connect, then we should have a viable solution right there.

More testing tonight :)
 
I think their is some confusion here raised by some rather odd posts :)

To be clear:

Yes pitboss will work with clients both sides of a firewall concurrently or not (that's its point :) ) - I would recommend that those inside the firewall use the internal network, those outside it use the external ip address that is port forwarded (within the firewall/router) to 2056 UDP (although I have both TCP and UDP) to the internal IP address

I and others have experienced issues with internal and external connections operating at the same time, others haven't. In terms of my own experience I know I can connect with at least one other connected but whether I have problems above that I am not sure. Most of the issues I experienced were at the game start when it was transferring files around at setup stage so I put it down to that.

Hopefully that clarifies it :)

Tals

p.s great to see Soren hooked into this thread, any update on when the next pitboss/client will be coming :)
 
Felix928 said:
Maybe I have a basic misunderstanding about the intent of PitBoss... We are trying to use it to host a DirectIP game for 6 people with concurrent connections. While I understand its use for PBEM type games, I had thought that it would also serve as a competant server for simultaneous turns, real-time type games.

If it is true that the port changes can be made client side and the server will recognize traffic on any port attempting to connect, then we should have a viable solution right there.

More testing tonight :)


Just portt forward 2056 UDP to the internal IP address of the server. External clients can then connect to it using your internet IP address. You would connect via the internal ip address. You can run pitboss and a client on the same machine

Tals
 
tals said:
Just portt forward 2056 UDP to the internal IP address of the server. External clients can then connect to it using your internet IP address. You would connect via the internal ip address. You can run pitboss and a client on the same machine

Tals
I tried that, it didn't work. the external client was able to connect to the server if I wasn't connected from my own internal client, but if I was connected to the server, then the external client would time out trying to contact peers.

likewise, if the external client was connected, then *I* would get a timeout contacting peers.

it seems as if there are two phases to a connection attempt: first the client establishes contact with the server, then it establishes contact with the other peers. the first phase works fine (assuming the port forwarding rule has been set up in the router). the problem I'm seeing is with the second phase.

-ken
 
it seems as if there are two phases to a connection attempt: first the client establishes contact with the server, then it establishes contact with the other peers. the first phase works fine (assuming the port forwarding rule has been set up in the router). the problem I'm seeing is with the second phase.

Ok this is the first time someone appears to have made sense of this issue - hopefully the Civ devs can now develop this further. In my cse my experience has been I have been on a pitboss server where the host has been in game - we chatted :) On my own we're planning for a get together on Thursday so it maybe more clearer from my perspective.

p.s thinking about it - I don't know whether the host runs the server on his own machine - which could be slightly different - I need to check that :)
 
Top Bottom