Arcen Forums

General Category => AI War Classic => AI War Classic - Technical Support => Topic started by: ehendricks on September 29, 2009, 06:10:20 AM

Title: Multiplayer how to?
Post by: ehendricks on September 29, 2009, 06:10:20 AM
Sorry to be postin up a storm, but I'm new to the whole multiplayer gaming gig :)

Anyways, I'm lookin to play AI Wars across a network with a friend.  However, I just can't get it to work.  Can anyone offer me a how to on it?  I've got the Hamachi VPN setup, and I'm reasonably geek-literate, but I'm having no luck here.  Thanks again, guys.
Eric
Title: Re: Multiplayer how to?
Post by: Fiskbit on September 29, 2009, 07:51:44 AM
One thing to check is that you're both using the same port (set in settings) and that that port is forwarded on the host's machine (it doesn't matter for the clients). If that's not it, could you be a little more specific about what is happening?
Title: Re: Multiplayer how to?
Post by: x4000 on September 29, 2009, 08:40:07 AM
The process on a LAN is:
------------------------

1. Host starts game (through lobby or through loading a multiplayer saved game).

2. Client connects to host, either by manually typing in the IP address, or by selecting it in the results list from when it searches on the LAN.

Possible Problems:

A. Client and server have different ports selected in the Settings window (this would only be the case if one of the players had changed this in the past).

B. Client and server are not on the same game version (both must be the same).

C. Client or server has a software firewall, like the Windows Firewall, ZoneAlarm, or something else that is either blocking AI War or the AI War port.  AI War's setup process opens the Windows Firewall port if you use our installer, but if you have something else you might need to either temporarily disable it to test, and then add an exception once you have confirmed the firewall is the issue.

The process over the Internet is:
--------------------------------

1. Host starts game (through lobby or through loading a multiplayer saved game).

2. Client connects to host, either by manually typing in the host's public IP address, or by manually typing in the host's virtual IP address on a VPN solution like Hamachi.

Possible Problems:

A. Any of the problems from the LAN section might still be the issue here, but additionally:

B. Using the wrong IP address.  For Hamachi, the IP addresses always start with 5.whatever, and are shown right in Hamachi.  For a direct connection, use something like http://www.whatismyip.com/ (http://www.whatismyip.com/)

C. If not using VPN software like Hamachi, then you probably are having to traverse a router with NAT on the host's network.  This requires port forwarding (http://portforward.com/cports.htm) for the AI War port.


Those are pretty much the common pitfalls, I can't think of anything else that would generally cause a problem with a game like this.  Hope that helps!
Title: Re: Multiplayer how to?
Post by: ehendricks on September 29, 2009, 07:52:49 PM
Much appreciated guys.  I'll give her  a run tonight!
Title: Re: Multiplayer how to?
Post by: ehendricks on October 01, 2009, 12:28:43 AM
I gave it a shot, but I couldn't get it to work.  When I tried a direct IP connect, it would simply bump me back to the main screen.  It wouldn't show my server IP on the server list, but when I did the direct IP it would show my own IP as a server.  Very confused...
Title: Re: Multiplayer how to?
Post by: x4000 on October 01, 2009, 12:34:51 AM
If you started a server on the client, that could explain why it temporarily showed the IP of the client in the server list.

The client needs to type in the IP address of the host.  If it doesn't work, and just kicks you back to the main screen, then either:
1. You have entered the wrong IP.
2. A firewall is in your way.  See my notes above.  If you've got Symantec Security Suite, or something like that as far as "Antivirus plus more" goes, you may have a firewall you aren't even aware of.  You'll want to consult the documentation for your specific software to see how to add exceptions, it's pretty easy with most of them.
Title: Re: Multiplayer how to?
Post by: irongamer on October 01, 2009, 05:04:05 PM
Tried to start a multiplayer game using the demo with a friend last night.

1. We both forwarded the correct port on our routers.
2. Windows 7 firewall already added AI War for inbound traffic.
3. I added outbound traffic in Windows 7 firewall for AI War.
4. We checked our IP's, successful tracert as well.
5. Could never connect.

We just get the connecting box and then it just dumps us to the main menu.
That means it couldn't find the host right? There is no feed back.

I know my friend has a vpn setup so maybe he didn't configure stuff quite right.
My tracert to his ip worked fine, his went all over the place however...

Does this just sound like a vpn issue on his end?


PS

I am trying out Security Essentials (http://www.microsoft.com/Security_essentials/) from Microsoft.
But I don't think it is causing the problem.
Title: Re: Multiplayer how to?
Post by: x4000 on October 01, 2009, 05:19:03 PM
Did you forward the UDP port, or the TCP port?  The UDP port is the one that needs to be forwarded.

It's a good point that there is no feedback when the connection fails; I think that's a result of the switch to UDP last month, and I've added an issue for that:  http://arcengames.com/forums/index.php/topic,1588.0.html (http://arcengames.com/forums/index.php/topic,1588.0.html).  The game certainly used to give feedback in those situations, but when I redid the network apparently that got lost.

The connection process for this game is remarkably simple, in it's simplest form.  It creates a single connection across a single UDP port between the client(s) and the host.  A lot of games use many different ports in large ranges, which makes things very uncertain and challenging.  Not so here.  If you have the UDP port forwarded properly, and you're unable to connect, then some other software is blocking it. 

Could be the VPN connection on your friend's machine, if it is set to route all traffic through the VPN, or it could be a hardware or software firewall.  Using Hamachi can often bypass the complexities that arise because of all the various security software and hardware that people use nowadays, but even that's not a guarantee when it comes to software firewalls.  My suggestion would be to temporarily turn off all of the security-related processes possible, until you find the one that is blocking you.  Then re-enable it, and figure out how to add an exception.

Personally I just use the windows firewall and a NAT router, but my alpha players use McAffee, Norton, and ZoneAlarm; each one required an exception to be added, of course, but beyond that have worked fine.  Depending on the program -- and there are so many at this stage -- adding an exception can be easier or harder to do, but most are not too bad.

Sorry I can't be more specific, but assuming you are forwarding UDP and not TCP (and assuming that you are on a recent version of the demo -- older versions were TCP, actually; you can Check For Updates in the demo same as the main game, if you are on something older than 1.301), then it boils down to the other software and hardware security devices on your machine and network.
Title: Re: Multiplayer how to?
Post by: Oewyn on October 01, 2009, 05:23:13 PM
This actually has been happening to me as well recently.

It will take a lot of attempts before I am able to connect to my friend's game.  Sometimes Restarting the client (not the one hosting) and attempting to reconnect works.  I meant to bug this a while back, but never got around to it.
Title: Re: Multiplayer how to?
Post by: x4000 on October 01, 2009, 05:49:30 PM
This actually has been happening to me as well recently.

It will take a lot of attempts before I am able to connect to my friend's game.  Sometimes Restarting the client (not the one hosting) and attempting to reconnect works.  I meant to bug this a while back, but never got around to it.

Really? Has anyone else here had this?  This is the first I have heard of such an issue.  I would guess packet loss as a culprit here, but it is hard to know for sure.  Were you one of the players with really bad lag back prior to the udp changeover?
Title: Re: Multiplayer how to?
Post by: irongamer on October 01, 2009, 08:26:21 PM
The UDP port is the one that needs to be forwarded.

Excellent. Ok, I was reading in another post that it only used TCP and not UDP. Was a little confused until you mentioned it was a recent change.

I was talking with my friend and he had not forwarded his UDP port. So we'll give it another spin. Thanks!
Title: Re: Multiplayer how to?
Post by: Oewyn on October 01, 2009, 09:09:07 PM
This actually has been happening to me as well recently.

It will take a lot of attempts before I am able to connect to my friend's game.  Sometimes Restarting the client (not the one hosting) and attempting to reconnect works.  I meant to bug this a while back, but never got around to it.

Really? Has anyone else here had this?  This is the first I have heard of such an issue.  I would guess packet loss as a culprit here, but it is hard to know for sure.  Were you one of the players with really bad lag back prior to the udp changeover?

No, I don't really have packetloss issues with the person who I play with, and our pings are great, usually less than 75ms, we usually play w/ network +0.

It seems like it has gotten worse in the most recent updates, but i remember having issues before 1.14 where restarting the game would sometimes help.
Title: Re: Multiplayer how to?
Post by: x4000 on October 01, 2009, 09:26:43 PM
No, I don't really have packetloss issues with the person who I play with, and our pings are great, usually less than 75ms, we usually play w/ network +0.

It seems like it has gotten worse in the most recent updates, but i remember having issues before 1.14 where restarting the game would sometimes help.

Are you playing on wireless?  If you were having trouble before the changeover to UDP, that is most curious -- two entirely different network stacks having the same issue is strange indeed.  Makes me wonder if a network driver is out of date, or if there's something else interfering. Not that I think the AI War code is infallible or anything, I just haven't heard of this issue until now, and a lot of people play, and if it was on two totally different sets of code that is particularly apt to make me look elsewhere.
Title: Re: Multiplayer how to?
Post by: irongamer on October 01, 2009, 11:36:10 PM
Got multiplayer working.

We both did everything right expect for enabling UDP forwarding.
My router has to set them individually, instead of one option of TCP & UDP. Thought it was a single option, oops.

Thanks for the replies.

May have a handful of purchases coming your way if I can get my friends into it.

We love co-op games (about darn time we see more of these). Almost zero micro management! Great game.  ;D
Title: Re: Multiplayer how to?
Post by: Revenantus on October 01, 2009, 11:37:06 PM
Great to hear. Have fun. :)
Title: Re: Multiplayer how to?
Post by: Oewyn on October 02, 2009, 10:56:17 AM
Are you playing on wireless?  If you were having trouble before the changeover to UDP, that is most curious -- two entirely different network stacks having the same issue is strange indeed.  Makes me wonder if a network driver is out of date, or if there's something else interfering. Not that I think the AI War code is infallible or anything, I just haven't heard of this issue until now, and a lot of people play, and if it was on two totally different sets of code that is particularly apt to make me look elsewhere.

No, it was after the UDP changeover that i began noticing problems.

The problem may be that I initially attempt to connect to the server before it's put up, and then all subsequent attempts seem to fail.  After a client restart the 1st attempt always seems to fail and the 2nd one goes through.  With the connection debugging messages re-added to the UDP stack, i might be able to give you more information, but right now all that happens is it eventually times out and brings me back to the join game menu.
Title: Re: Multiplayer how to?
Post by: Cydonia on October 26, 2009, 05:02:34 PM
Hi

I got contacted by another German newbie who seked my help (he's bad at english^^). He couldn't connect with his friend. I never played multyplayer before and I wanted to find out how anyway, so now I'm looking for the solution, becuase it doesn't work for me neither^^

-connecting via Hamachi
-firewalls off
-direct IP connecting with the hamachi IP

....
"Server connection was lost or could not be established!"
appears after some time.

we're quite puzzled

...


Oh, it just worked... we can't explain, why. I changed an option in windows, but i don't think this made a difference. I guess we just had luck, or bad luck before^^

But about the thing, that puzzled me:

When I looked in the LAN games list, there was no game. I hosted a game, cancelled, and then found my game in the list. thats nothing spezial, I know^^ but one thing was weird: The host's IP was "192.168.1.4". Thats my home-LAN IP, not online IP or hamachi IP. so I thought i the game always tried to connect via my real LAN and decided to ignore hamachi^^

A friend told me to change the priority of my networks and I put hamachi on the top in the windows vista settings. I rebooted. I think my changes did NOTHING because my IP as host in the list remained "192.168.1.4". BUT IT WORKED!!! We could then direct-connect in both directions via hamachi. Maybe the rebooting and restarting of the game amde a difference, or hamachi had an error or whoonearthknows what changed!

Bear in mind that only I changed the order of the networks in windows, but the connection was possible BOTH ways.

So I really don't know what's going on right now and on whose side the problem is, since I didn't try to conenct to anyone else...

I got to go to bed now, so I can't test on this anymore right now^^
But this guy told me, even though we could now connect, he still can't connect to his friend.

I think that's all I can tell you right know^^ If it works for me now, it's fine, but I'll stick to it until the other players both can play together and I'll translate the possible solutions into German for them^^

I will tell you if anything changed or helped asap.


thx for helping :)
Title: Re: Multiplayer how to?
Post by: x4000 on October 26, 2009, 05:09:28 PM
Hi Cydonia,

Thanks for your post.  Glad to see that you got it working, though I'm not sure what the specific issue was there.  A couple of notes:

1. Generally speaking, your computer will recognize itself as 127.0.0.1, or as its local LAN address, rather than as the Hamachi address or other public address.  This is simply standard for networking in general, and would not affect other people's ability to connect to you via Hamachi or through your public IP.

2. Again generally speaking, most of the time the auto-detection of games across Hamachi will not work. That's because the auto-detection requires some broadcast-type messages that Hamachi tends not to transmit.  Hamachi usually only transmits messages that are specifically sent to a given machine on the other side, if that makes sense.  So this would make you have to do the Direct IP Connect for Hamachi addresses, same as over the Internet, in most cases.  Adjusting the priority order of the LAN connections, as you did, isn't something I'd expect to have an effect on that, but if it does then cool. :)

3. Sometimes the network won't connect the first time, and that's the cue for the client to simply try connecting again if they get the "Could not connect" message.  That second time almost always works.  I'm not sure if this is a bug in the network library we are using or what, but this is something that affects a fair number (but not all) of players.  It seems to be below the level of the game itself, whatever the issue is, so we're having trouble pinpointing that too accurately.

Hope that helps!  Do let me know if you have any other questions.
Title: Re: Multiplayer how to?
Post by: Cydonia on October 28, 2009, 02:22:56 PM
Ok, it works now.

All 3 of us could connect. What did we do?

Nothing^^


"3. Sometimes the network won't connect the first time, and that's the cue for the client to simply try connecting again if they get the "Could not connect" message. "

I guess that's what did the job^^


And about this "network priority settings": I set it back to the previous settings and it did still work. So as expected, this setting changed nothing^^ I thought I'd found some really big problem for you to solve, but I didn't. Sorry ;D
Title: Re: Multiplayer how to?
Post by: x4000 on October 28, 2009, 02:25:25 PM
No problem -- thanks for the added info!