Tuesday, March 31, 2009

Towards Network Play in OpenFracas

The ability to play OpenFracas over the network has been a goal of mine for a long time. It's been on the radar since the project began, and has been in development in some form or anther on and off since last summer. Thanks to my most recent shot at it, though, it is actually starting to fall into place now.

About a year ago, OpenFracas 0.4 was released, and with it was a new client-server model upon which all further development has been based on. This was driven by the realization that networking would eventually become an important part of the game, and that it would be best if this were not bolted on as an afterthought when that time came.

Last summer, I began working in earnest on a method by which OpenFracas could communicate over the network. While I eventually shelved the project after realizing that I was probably approaching the problem the wrong way, I did succeed in producing a very nice wrapper for network connections which allowed for easy transmission of simple messages in a data serialization specification called YAML. This is the same serialization
specification that OpenFracas 0.6 uses for the new map format that it introduced.

Recently, I have taken another shot at completing this long-standing goal, and have had more success this time around. After some tinkering to refamiliarize myself with the work I had done previously (the useful parts, anyways), I started working on getting the game's front-end to communicate with the backend over the network. Right now, I have a kind of proof-of-concept implementation where a single instance of the game runs messages back and forth between the backend and the frontend over the network, as opposed to just making function calls, and I've been working recently on cutting down on the number of calls that the front-end has to make to the back-end in order to decrease network lag.

I still need to make adjustments to the GUI to allow people to open network slots for a new game, or to join network games on other people's computers. This whole project is useless without the ability for the user to actually enable and configure it to at least some limited degree, so its not really in a state where it can be demo'ed, but I'm hopefull that I'll soon have something a little more visual to show for my efforts.

No comments: