Sunday, July 27, 2008

Ship designs and order queues

After chatting with mithro this week, I found that the ship designer in the pywx client was an old part of the code (untouched in a year), and that ship design was not considered a priority (since only MTSec supports it). What I did instead was a viewer for ship designs in the game:

The design list on the left is colour coded by player, and the information pane is currently showing etower333's scout design. Wasn't that guy in a previous post as well? How long has that game been going on anyway?

Order queue management has also been added.

After selecting an order from the queue, you can use the delete button to remove it or the edit button which will bring up the arguments window to edit the existing values. The new button also serves to create a new order after selecting from the available orders list on it's left. This change led me to venture back into the rather untidy order handling code, which I have cleaned up a little.

A minor change is that double-clicking on an object will focus and zoom in on it.

One thing I have been looking into is introducing sound and battle scenes into the client.

Battle scenes in thousand parsec are defined by a BattleXML file, which is a file format detailing how many sides there are in a battle and the makeup of the individual fleets together with a turn-by-turn breakdown of how the battle went. A sample pygame viewer as well as documentation on the format can be gained from the battleviewer git repository, although I have not run the viewer yet. One problem with BattleXML is that currently it is only supported by tpserver-py and not tpserver-cpp, which is the more popular server. Another issue is that it has to be implemented by the ruleset specifically and requires a media definition file to map 3d models to ingame objects as well as any weapon effects. Perhaps there could be a random battle generator so that support can be easily added for all rulesets?

Sound support is already available in Python-Ogre via OpenAL, a cross-platform api for 3d sound. So it's really a matter of finding the right sound effects. I've found a program called song04 which generates ambient soundscapes, it sounds quite alright and I'll be trying it out as a background soundtrack next week.

In somewhat related news, my old computer is probably on it's last legs as it frequently hangs upon startup (or the kernel starts to panic), and it has no internet access as the network adapter refuses to connect despite using the same settings which worked before. I guess it's rather fortunate that I got a new PC recently.