I've already begun implementing the new and improved networking engine so I'm going to quickly lay it out:
1) Glob2 will use SDL_net, and TCP sockets - Glob2's current system implements TCP functionality on top of UDP, because of the demand for absolute sychronization at every frame, TCP functionality is nesseccarry, and no better way than to use actual TCP. 2) The NAT problem is solved by YOG routing. Me and Leo considered this a decent option. - Glob2 sends barely any network traffic (at most 2 kb/s per client, practically nothing considering our webserver had multi gigabytes per day) - Right now there are hardly ever net games unless they where pre-organized. The system can scale too. If glob2 suddenly becomes a hotspot of online activity, there can be yog-usa1, yog-europe1, yog-europe2, done by YOG redirection 3) The YOG server is built right into glob2 and shares code with the client. - For LAN games, the person would run feature-reduced YOG on their local system - (This system would use a sort of moduleapproach, where there is password based login system and there is anonymous login system. There is a game list system, and there is a system where all connected users are part of the same game.) - As well, for people without NAT issues, they can offer to host the game themselves, using the same principle, the main YOG will just redirect, to take the load off the main YOG 4) I've currently got three classes, NetMessage, NetConnection, and NetListener. They all wrap SDL_net at a fairly low level. I have made the choice to use boost::auto_ptr for all Net engine stuff. There are allot of dynamically allocated objects that are created and destroyed frequently in different parts of the code. - NetListener listens for incoming connections, and can create a NetConnection if there are any - NetConnection interfaces with SDL_net, wrapping it with a NetMessage based system. It queues messages in a non blocking manner. - NetMessage is an abstract base class. It is similar in theme to Order. I like the design of Order classes myself. - The one subclass of NetMessage (right now, many to come), is NetSendOrder, which bassically wraps the Order class 5) The system is going to be optimized for low bandwidth consumption - This is critical, it reduces latency, reduces the load on our servers, and in general reduces the load on the internet as a whole. - Packets may be compressed just before being sent to SDL_net if its found effective ** this part i'm not to sure about quite yet ** 6) NetMessage will use a cascading system. At each level, some different part of glob2 will filter out the messages it handles. 95% of them will be handled by the net code itself, but some of them may cascade further. -- Really. I'm not lieing. Bradley Arsenault. _______________________________________________ glob2-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/glob2-devel
