First, an introduction... I'm fairly new to Glest (about three months of use) and I absolutely love the game. But I really miss multiplayer capabilities. So much that I want to start developing them.
I've seen all the other threads on Multiplayer, and they end up being begging threads. I started thgis thread to discuss the challenges and possible solutions for developing a glest multiplayer game. I've downloaded the code and browsed it, and I must say, it's truly an example of good programming style. Kudos to the team.
I've done a lot of server programming (I work for a software firm), however never for games. So while this is a first for me, I'm already somewhat familiar with what will need to be done.
Before I set out to startr writing code, I'd like to find out if there are already any projects underway to provide this functionality. I pulled the latest files from the CVS and there's no real multiplayer support in them as of yet.
From what I've seen. Some of the challenges:
1. Glest is fairly extensible. This means that the factions must be the same across all the clients connecting to the server. Need either a way to enforce this or a way to synchronize the client machines with the factions on the server. I think that the server would be the limiting agent for the factions, but certainly open to ideas here. I can't see starting a game and having to wait 20 minutes while all the 3d models are synched. Having said that, I do consider it a novel idea to "baseline across all connected players."
2. Glest is fairly open. This means that theoretically, someone could decrease the resource requirements for units and cheat. This is similar to the above, except that this is probably easier to control. Problem being that the definition for the object is in the same XML file as the graphics definition. The easy fix for this is to load from filesystem, and if you connect to a server, then the server overrides those values.
3. How to propigate the events? From my light reading, this is the most troublesome part of network play, especially when you move beyond LAN parties (because of bandwidth). For RTS games, all the changes from all the objects from all the members must be synched every tick. The question becomes how to handle change requests. Does the change get propigated to the server, and sent to all the clients at the same time, or is the change done first locally, then the server is told what happened, and the server propigates remotely? Apparently, in the game development world, it's split as to how to handle this. I'm leaning toward all the change vectors (move requests, attack requests, build requests, etc.) go to the server, then sent to all clients (including the requesting client) at the same time, In my opinion, that's the best way to ensure that the game is synchronized across ticks.
Pseudocode:
Loop
Raise EVENT -> Send to Server
Server Acknowledge EVENT -> Broadcast to all connected users (and AIs)
Users and AIs receive event -> Perform EVENT
end loop
4. Network optimization. Lots of data to synch. Won't touch this until 1,2,3 above are designed. Might need real data to see if this is a relevant concern. I presume it is, so I at least want to develop with that in mind.
Other topics for consideration? Any other feedback?
For what it's worth, I pulled the source for dark oberon and looked at the network algorithms there, and I have a feel for what needs to be done. This is quite an intrusive change, and basically every event that is currently developed would have to be redeveloped to include network play. I'm still thinking a lot of this through, and I might code up some stuff in the next few weeks as a sample. SDL has excellent network capabilities built in, and since that's already in use for the glest project,. I'll start there.
Also, as a warning, I use Linux. So if I get it done, it will be done on Linux first. I'll make every event to be platform independant, and SDL should definitely help there, but I thought the disclaimer was appropriate.
Please, please let's keep this as a discussion of HOW it should work.
Geoff