Built-in network server
So, we need a server that can be started whenever necessary for multiplayer games. The server should run its own game, and the client game states should be copies of this. Servers word in the progress of the game would be The Law.
For all this, we need to separate the game logic from the rendering and input handling as well as possible. A separate main() should be created for a dedicated server binary, which we could use as a test program.
What needs to happen:
- [x] Making game_state non-global
- [x] Serialization
- [ ] SDL_event in handle_event() functions needs to be hidden, wrapped, whatever. Any SDL dependencies need to be removed from the game logic code.
- [ ] A new game_state for networking (net_game_state ?), which only handles the necessary physics and ticks of objects. Rendering and standard input handling needs to be ignored.
- [ ] Net_game_state had to be run from either the dedicated server binary, or in a new thread along with the client. It has to be able to open ports (or a pipe for local game, or whatever) for clients to join. More planning required.
We also need a system for matchmaking users, unless you plan this to be a dedicated server that can only hold 2 people at once?
Also, should we push this to 0.7?
The idea was to allow max 32 or 64 players or something like that. We could host eg. tournaments and other game modes this way.
Not sure if it should be moved, since huntercool already kind of started with this. We can move this later in 0.6 process, if it seems that nobody is interested for now,
Oh, and. We could use this server to traverse NAT. Eg. http://en.wikipedia.org/wiki/STUN
I am still all for using IRC for lobby chat and matchmaking.
Also, could we please use ELO ( http://en.wikipedia.org/wiki/Elo_rating_system) for ranking?
On Tue, Jan 7, 2014 at 7:07 PM, Tuomas Virtanen [email protected]:
Oh, and. We could use this server to traverse NAT. Eg. http://en.wikipedia.org/wiki/STUN
— Reply to this email directly or view it on GitHubhttps://github.com/omf2097/openomf/issues/102#issuecomment-31762481 .
I wouldn't mind using IRC; after all it's a fully working chat, and we wouldn't need to re-invent the wheel.
I don't know much about ELO; will read about it.
We don't need STUN if the server is on a public IP.
I still think this is unlikely to make 0.6.