Network play

Ok Me and my wife are sitting side by side and trying to network a game so we can figure it out so a friend in a different province can play.

So far I have tried Just going to server game. Then i click Listen. Then I globally advertise. She see's it but when she tries to connect she cant it says

Java.net.connect exception: connection refused: connect

So I tried starting Invade earth and before I even started a new game we tried to get her to connect. Same error.

Then I tried sitting in the New game where you can select players, colors etc. She tried to connect there aswell, same error.

I made both players human and still cant connect. I tried to even connect to my own game in that menu and didnt work.

THen I started the game and didnt press anything and she tired to conect and didnt work.

I then tried cancelling my game and joining one that the other person had available and couldnt connect either way.

Then we re-read and I started a server. Clicked Listen. Advertised globally. I clicked on Invade Earth but didnt start a game or anything.
She then tried to connect stil had a failure.

How do we do it please. We dont uderstand or maybe there is a setting I have to change. I dotn know alot about changing java coding etc so anything you can do to help me out would be greatly appreciated we are excited to try this game online.

Re: Network play

Are you behind an internet gateway computer? For example, if you are on a school or corporate network, when you host a server no one outside the network will be able to connect---they can see it listed, but will receive a "connection failure".

The only solution is to find someone to host who is not behind a gateway. A normal home internet connection should work. This requirement only applies to the server---if someone has such a host already, anyone should be able to connect through the internet (even from behind a gateway).

[You should always be able to join your own game. One way to guarantee this is change the server's IP address box to say "localhost" then connect to "localhost" in the connection dialog---but if you do this no one else can connect.]

The basic procedure is this:
1. Someone not behind a gateway starts a server by clicking Listen.
(2.) "Advertise" makes it show up on the server list. However, it isn't necessary to play if the other players know your IP address.
3. Everyone starts a client (Invade Earth).
4. Everyone connects. If you listed your server, it will appear when they click Server List. Otherwise they can type the IP address in the little box that starts with "localhost".
5. Anyone can start a new game.

A connection failure probably means either the server is behind a gateway *or* their computer has a firewall that is blocking your connection.

Also, If you check the server list page or subscribe to the RSS feed you can see who is on. For example, my live.com homepage tells me who is playing Invade Earth when I start Internet Explorer. If you see other servers up you can try to connect to them.

Re: Network play

k.

To answer a few questions.

I am in a home residence but through a router and wireless internet. Do I need to configure my wireless router?

my wife if we had a network would be on it. we seen someone elses that wasnt my server posting so we were seeing someone else's.

Is there a port I should try? not 2210?

Re: Network play

If you want to receive outside connections to your server (i.e. not on your home network), you will need to configure your router to forward incoming connections on port 2210 to your computer. How to do this depends on your network setup and type of router, but you should be able to find a quick howto for your specific brand of router with a google search.

Re: Network play

Also we tried my friend who is also in a home on a wireless router. He set it up by my instructions on the phone and it failed to connect same error. his windows asked him and he allowed/unblocked everything.

My firewall is off so is the wife's.

Could it be the port we are listening to, or the router is blocking??

Re: Network play

K i willt ry that out thanks.

Re: Network play

K. I found out how to do it and have had a connection already.
i advertised as 2 players max. then when he opens his client and connects he gets the map to show while mine remains grey.

we tried him starting a game but when he changes the player to say a agent it shows as an anonymous he can choose.

then i tried starting a gamewhile he was connected but couldnt work.

I tried connecting to myself and i couldnt. i advertised as 2 players so thats how he found me and we were on the phoneso a second later after hitting connect to me it showed one connection.

also my wife is on the same router. how come she cant connect to me?

probably something simple too

so i forwarded ports to my I.P addrss i found then i know that is right cuz of connection.

We retried it again so i started the server. Clicked advertise. I advertised it globally as 2 max players and testing as the comments.

Then we tried him starting a game. He had on his screen as player 1 and player 2. He was able to set player 1 as anonymous and the same for player 2. Then started the game.

Nothing happened on my side.

Now the question is.... how come when he makes a new game there is also a network connection he can connect there as well as when you first log on and click game/connect.

WHich one do we have to use?

Then we tried..him pressing Game/connect and connecting to me.
THen I started a game. I have 2 players and I can only make them both human.

I'm sure it's a simple problem lol but i cant figure it out.

Re: Network play

The connection panel on the "players setup" dialog is just for convenience---it's identical in function to the other one.

Here's the process for starting a network game:

1. Everyone connects. Change your name from Anonymous to something (anything) else so people can recognize your computer. Note that even the person hosting has to connect to his own server.
2. The Lobby box at the bottom shows who is connected. You should now be able to chat with people.
3. Now someone should start a New Game. For each player, you can choose either an Agent (AI) or the various connections that will be listed by name--- Anonymous, Joe, Smith, Lebatt, etc.... whoever is connected. Anyone who is connected can control zero or more players (usually just one).
4. Once that person clicks "start game" it should load for everyone.

If you can't connect to your own server through the Advertisement list, try this: in Invade Earth, when you connect with the small dialog box, change the IP address to say 0.0.0.0

Re: Network play

0.0.0.0 wouldn't putting "Localhost" do the same?

Re: Network play

I don't think so... with this connection library, "localhost" is only visible to clients on the identical computer as the server (no remote connections). "0.0.0.0" binds it to the correct IP address---then it will be open to other computers.

Re: Network play

A little bit off topic, but if Invade Earth is moved to GPLv3, we could use UPNPLib to automatically forward the correct ports to the host machine. Most newer routers are UPNP compatible; it might simplify the network process for a lot of people.

I'm planning on writing a (mostly) comprehensive networking guide for Invade Earth to answer the most common questions... but still, automatic setup is always better. :)

Re: Network play

sounds good, I'll look into that one.

Re: Network play

I wonder how much rewriting of network stuff this will require...

They do say there could be problems with certain versions of Linux, though I'm sure they'll work that out eventually. The real issue is that UPNPLib seems to be written to replace a Java RMI system, and Invade Earth uses a special library to simplify things. I'd have to write a bunch of wrapping code to translate.

Re: Network play

Ah, I didn't realize that it would be such an undertaking. (And if it isn't stable on Linux yet, that wouldn't be the best idea anyway.) Maybe sometime in the future.

I finished the networking guide; it should cover most of the questions that people have.

Re: Network play

Nice. The guide answers the FAQ that we get on this forum, so that should help some people.