Suggestion for networking

Suggestion for networking

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

SeLfkiLL
Posts: 7
Joined: 09 Jun 2006, 02:43

Suggestion for networking

Post by SeLfkiLL »

I used to think the networking in this game was like Command & Conquer: Generals, where if the host left the game, one of the other peers would become the new host. I found out this was incorrect however when I was the first to be killed and decided to leave the game as the host. I don't think it makes sense that the host should sit there and watch the rest of the game just like any of the other peers wouldn't necessarily want to either. So my suggestion is that a new host should be selected from one of the peers with the next highest CPU clock speed when the original host leaves. This should also repeat if the new host leaves until there are no more peers to become host.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Suggestion for networking

Post by Pxtl »

SeLfkiLL wrote:I used to think the networking in this game was like Command & Conquer: Generals, where if the host left the game, one of the other peers would become the new host. I found out this was incorrect however when I was the first to be killed and decided to leave the game as the host. I don't think it makes sense that the host should sit there and watch the rest of the game just like any of the other peers wouldn't necessarily want to either. So my suggestion is that a new host should be selected from one of the peers with the next highest CPU clock speed when the original host leaves. This should also repeat if the new host leaves until there are no more peers to become host.
Easier said than done. There was a time when retail games included this problem. Currently the best solution is to use a dedicated host machine stuck on spectator mode.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

this would be a bad idea, because many noobs who are good hosts would leave and some poor bastard with a 1.3 ghx with 256 megs of sdram would be left with the bill == not pretty.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Post by Das Bruce »

Forboding Angel wrote:this would be a bad idea, because many noobs who are good hosts would leave and some poor bastard with a 1.3 ghx with 256 megs of sdram would be left with the bill == not pretty.
Well obviously it would find the fastest to host, and its better than nothing.
User avatar
Zenka
Posts: 1235
Joined: 05 Oct 2005, 15:29

Post by Zenka »

If no system is available to take over the host. noboby would and the game would quit.
It's still better to have the option then to have no chooise at all.
I like the idea.
User avatar
Min3mat
Posts: 3455
Joined: 17 Nov 2004, 20:19

Post by Min3mat »

it should include the spectators as well as the players. lovely idea but just how practical is it to code?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Pretty hard, but possible IMHO. It mostly depends on how much of spring assumes the server stays at the same host and IP addresses stay the same etc.

Basically you'd need to pause the game, send a message with a new host IP and only unpause the game after everyone has connected to that IP.

Also it could be a problem that certain people can host and others can't. Spring would need to know beforehand who can, because otherwise when changing hosts it can get stuck in waiting for timeouts for inconveniently long times.
User avatar
caldera
Posts: 388
Joined: 18 Oct 2005, 20:56

Post by caldera »

i think its a good idea, but the cpu and ram are not the only components which should be powerful... its more the internet connection speed (having a 5GHZ Host with 3Gig RAm is nothing if he is behind a 56k modem)...
patmo98
Posts: 188
Joined: 09 Jan 2006, 17:51

Post by patmo98 »

Tobi wrote:Also it could be a problem that certain people can host and others can't.
Do you mean:

1. figuratively can't. ie the computer is too slow

2. or physically can't. ie there is a problem with NAT/Port Forwarding/Firewall
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

I ment physically. You'd just pick the PC with lowest average CPU% on the first part of the game (before host change), so 'figuratively' is not really a problem.

E: Oh, and lowest average ping ms must be considered too of course...
SeLfkiLL
Posts: 7
Joined: 09 Jun 2006, 02:43

Post by SeLfkiLL »

I know that considerations like these are much easier said than done (as I've done a lot of programming myself), however somehow EA Games pulled it off in their version of Command & Conquer: Generals. It was a really nice feature of the networking side of that game since many players (including the host) just gave up sometimes after being defeated or on the verge of being defeated and everyone could keep playing regardless.
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

SeLfkiLL wrote:I know that considerations like these are much easier said than done (as I've done a lot of programming myself), however somehow EA Games pulled it off in their version of Command & Conquer: Generals. It was a really nice feature of the networking side of that game since many players (including the host) just gave up sometimes after being defeated or on the verge of being defeated and everyone could keep playing regardless.
They probably had it planned that way from the start, for us it would probably mean a largescale rewrite of our network connection code.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Post by Das Bruce »

Could you haxxor it into effectively loading a saved game with a different host?
Can we even save games or did I imagine that?
User avatar
PenguinMaster
Posts: 25
Joined: 04 Jun 2006, 04:18

Post by PenguinMaster »

I think you imagined that.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

Das Bruce wrote:Could you haxxor it into effectively loading a saved game with a different host?
Can we even save games or did I imagine that?
You can save them... but you can't load them... I belive they have a test loader somewhere (like using a saved game as a command line argument or something)... but I'm not sure how well it works.
esteroth12
Posts: 501
Joined: 18 May 2006, 21:19

Post by esteroth12 »

it works (somewhat)

every unit is spawned, but they all default to normal... and it loads XTA

this means that you could only svae XTA, and all buildques/orders are terminated, repeat is off, half built units will sit there half-done, etc.

also, group AIs are deleted, so if you were running some MMs with the MMAI, you will run out of E quickly
User avatar
Scikar
Posts: 154
Joined: 30 Jan 2006, 07:13

Post by Scikar »

Does Generals use a P2P system or client/server?
User avatar
Comp1337
Posts: 2434
Joined: 12 Oct 2005, 17:32

Post by Comp1337 »

NECROPOST!
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Post by ginekolog »

most modern games work this way (p2p way):

1. gameserver collects ips and ports when players join game.
2. At start of a game, gameserver checks it ports are reachable on ALL players (that is cns's problem, when 2 or more players are not reachalbe, game pops out "can not connect")
3. After taht i am not sure if it uses server/clients or p2p. I know however that if one leave others can still play.


Spring could have point 2. programmed the same way.
User avatar
clericvash
Posts: 1394
Joined: 05 Oct 2004, 01:05

Post by clericvash »

It is how empire earth did it, if a host left, the game stopped for a bit and it put someone else as the host.

Was a dam good system too.
Post Reply

Return to “General Discussion”