[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: network game ?



On Thursday 24 August 2006 8:46 pm, Laurent Chea wrote:
> I've parsed the webcvs and didn't find anything related to network game.
> At the same moment, I read the different function headers to see how the
> game does generally run.
>
> If I've understood correctly, introducing a network game would simply
> consist in sending the recorded History object through the network to
> the opponent.

Simply.  Of course.  :)

> Of course, there are some UI changes to perform, like opening a dialog
> box that asks an IP, and why not introducing some simple chat stuffs,
> and of course there's a lot of little things implied by this network
> feature, but it's about 4 AM now :)

Well, I've got two almost diametrically opposed takes on this.

If I were doing network game, I'd want it to look something like this:

* Client-server
* Both players give orders to their pieces and send these orders to the server
* Server resolves the orders (some potentially complex initiative system would 
be used to resolve conflicts)
* Server checks victory conditions, productions, repairs, etc.
* Server sends a complete update (probably a savegame) to each client

The server would run full-time and be able to handle a configurable number of 
simultaneous games and maps would be able to split between a configurable 
number of players, so you could play with 1-8 players on each map, or 
something like that.

Now, if I were doing a network game and I were writing the code, it would 
actually look like this:

* php script on a webserver would route savegames back and forth between two 
connected clients
* Crimson would use libcurl to send savegames to the php script, play-by-email 
feature would be hacked to provide it

The second approach has several problems that have to be considered.  Here's 
another annoying list:

* Since player's clients resolve the turns, it is wide open to cheating
* Additional dependency that's probably not needed or wanted
* Running a server requires a web server
* http is not interactive enough to provide the kind of network game 
experience players are going to reasonably expect
* Most importantly, marrying http this early would be a Bad Idea because it 
will cause all sorts of bad design decisions in the future that could be best 
avoided.  Using http in crimson fields isn't inherently a bad idea, but 
relying on it for actual network play is.

So there you have it.  When will you have a patch ready?  :)  I'll be happy to 
run a server when there's a server to run.

Dave