Changes in Networking (with patch)
Moderator: Moderators
No. Reread Licho's posts. Then read Wikipedia's articles on TCP, UDP, and IP.neddiedrow wrote:Could we devise a new method of TCP holepunching?
Holepunching only works with UDP because routers leave ports used by UDP connections open since there's no FIN or ACK packets to track connection lifetimes like TCP has.
Auswaschbar: Holepunching is a pretty popular feature of Spring, and implementing lots of TCP features with UDP is the price we have to pay.
Perhaps if Spring support UPnP and/or auto-hosts were more popular we could switch to TCP, but I'm afraid right now we'd just lose a lot of users.
Thanks for your hard work! 28% overhead seems high, but it may be necessary. Wish I had more time to relearn C++ and tinker with Spring's code!
- Tim Blokdijk
- Posts: 1242
- Joined: 29 May 2005, 11:18
On an indirectly related note, what if I created a new dev site for Spring with an active mailing list and Trac integration with SVN.
I know we had a mailing list, but I'm not even sure where it is anymore. I also know there's a bug tracker, but how much is it even used?
A new Trac site would also let us separate the Dev. Wiki from the main Wiki.
Let me know.
Thanks to the devs for all of your hard work! I'd love to help in non-coding ways.
I know we had a mailing list, but I'm not even sure where it is anymore. I also know there's a bug tracker, but how much is it even used?
A new Trac site would also let us separate the Dev. Wiki from the main Wiki.
Let me know.
Thanks to the devs for all of your hard work! I'd love to help in non-coding ways.
-
- Spring Developer
- Posts: 1254
- Joined: 24 Jun 2007, 08:34
-
- Spring Developer
- Posts: 1254
- Joined: 24 Jun 2007, 08:34
- Tim Blokdijk
- Posts: 1242
- Joined: 29 May 2005, 11:18
-
- Spring Developer
- Posts: 1254
- Joined: 24 Jun 2007, 08:34
Some ideas I had to implement on top of my netcode:
- On timeout, attempt to reconnect (& send over missing part of stream) instead of just dropping.
- On game start, have each client attemp to connect to each other client and collect stats on success/failure rate of this. Pick the client to which most other clients could connect succesfully and mark this as 'backup host'. Now if the host quits, all clients can connect to the 'backup host' and continue playing.
- Factor out CGameServer from the engine itself, in a way so it can be compiled in and run as a thread, but can also be run standalone (for autohosts etc.).
- On timeout, attempt to reconnect (& send over missing part of stream) instead of just dropping.
- On game start, have each client attemp to connect to each other client and collect stats on success/failure rate of this. Pick the client to which most other clients could connect succesfully and mark this as 'backup host'. Now if the host quits, all clients can connect to the 'backup host' and continue playing.
- Factor out CGameServer from the engine itself, in a way so it can be compiled in and run as a thread, but can also be run standalone (for autohosts etc.).
I think this is by far the best enhancement idea because it eliminates the need for "backup hosts."Tobi wrote:- Factor out CGameServer from the engine itself, in a way so it can be compiled in and run as a thread, but can also be run standalone (for autohosts etc.).
You could also do clever things like write a lobby as a web application which could spawn Spring CGameServer processes for people. Writing a web lobby is an idea I've been toying with and wishing I had the time to implement!
Indeed! This would allow us to vastly improve hosting. Hosting could be later integrated into lobby program (you exit spring and hosting continues), autohost will be much less resource hungry, and autohost/lobby full integration with game will be possible. (Reading and writing into chat, exiting game, forcing start etc - those tasks will be much easier with sever implemented directly in autohost or lobby client)
-
- Spring Developer
- Posts: 1254
- Joined: 24 Jun 2007, 08:34
The design changes in this patch are excellent, good job. At least somewhat less monolithic network class
But it causes some serious bugs currently:
Any chance you can fix these things (and preferably also test all demo combinations ):
But it causes some serious bugs currently:
- Start positions aren't sent over the net anymore so players start in left-top corner with choose start positions.
- In local demo playback mode you can not change speed etc. anymore. (maybe this is because net->isDemoServer() always returns false because you use a trick with actually hosting the demo for local demo playback; so serverNet->isDemoServer(), would be true, not net->isDemoServer())
- I got a bunch of when testing local demo playback.
Code: Select all
Overflow when sending to remote connection 39997 5 40000 Overflow when sending to remote connection 39997 10 40000
- GlobalAIs are initialized and loaded in demo playback mode, which is wrong since the commands they gave are stored in the demo already. (Previously this was prevented by giving the watching user the maximum possible player number)
Any chance you can fix these things (and preferably also test all demo combinations ):
- local demo playback of non-gameSetup game
- hosted demo playback of non-gameSetup game
- local demo playback of gameSetup game
- host demo playback of gameSetup game
-
- Spring Developer
- Posts: 1254
- Joined: 24 Jun 2007, 08:34
update:
- start pos had been sent, but there was a type conversion error in CGameServer from uchar -> float, so they were wrong
- you can now change speed etc. in demo playback, isDemoServer() got fixed
- "Overflow when sending to remote connection 39997 5 40000" was a copy'n'past error, the error occured in CLocalConnection and it's because in local playback mode, serverNet don't need any data but client keeps sending... (nothing critical, I will fix it later)
- gu->spectating and gu->spectatingFullView are set to true because client was not able to see enemy units (don't know if it fixes the GloblAI)
edit:
- removed handleerror() and made a class network_error instead (copy'n'paste from content_error)
If i have time, I will join you on wednesday
- start pos had been sent, but there was a type conversion error in CGameServer from uchar -> float, so they were wrong
- you can now change speed etc. in demo playback, isDemoServer() got fixed
- "Overflow when sending to remote connection 39997 5 40000" was a copy'n'past error, the error occured in CLocalConnection and it's because in local playback mode, serverNet don't need any data but client keeps sending... (nothing critical, I will fix it later)
- gu->spectating and gu->spectatingFullView are set to true because client was not able to see enemy units (don't know if it fixes the GloblAI)
edit:
- removed handleerror() and made a class network_error instead (copy'n'paste from content_error)
If i have time, I will join you on wednesday
Last edited by Auswaschbar on 03 Jul 2007, 19:07, edited 1 time in total.