Hello everyone,
I'm releasing a beta/alpha/before-the-verb version of the client software for Mediaeval, a Play by Email strategy game set in a fantasy world.
I won't enter into details about it so this doesn't become one big post. However, Mediaeval was something I was developing in between MURK (see signature) boredom cycles. It just happens that it slowly grew on me and I've started working on it more and more as time passed. Partial blame goes to the wxWidgets library. I really do have lots of fun working with it.
You will find in this post some screenshots plus info on known bugs, leaks and a snippet of my current TODO list dealing with what you are seeing. The executable can also become available on request or if you remind me of some place I can upload it to.
Application typical Main Window with a selected hexagon.
The selected hexagon is built from a byte array with alpha channel support. Something like XPM on steroids. Quiet a cool technique. See: http://www.wxwidgets.org/wiki/index....ing_PNG_Images
Map Window detail with cursor over hexagon.
The map is built on the fly from the database (see Map Legend). Currently the database doesn't hold any info other than terrain type. I'm also planning the code for country border drawing (which is not an easy task despite apparencies). Everything else however is done and the elements you can see at the center of the map, although with their locations being hard coded, are already being drawn with the map elements drawing routines.
MiniMap detail
The small white frame is calculated dynamically on map window size and scrolling operations. The MiniMap implements all of the expected operations on a control like this, except for frame drag which will be there when I get to reduce the minimap flicker.
Map Legend
Map elements are fast to draw; Hexagons are polygons, rivers and roads are splines, borders will be lines and settlements, flag and forces are tiny XPMs. These last are built from static data and colors are set at runtime so that just one byte array is needed (e.g. there's only one army byte array that can be used to draw all 4 army types on all terrain types, except sea of course). This also allows me to draw without transparency support, which makes the whole thing much faster.
KNOWN BUGS:
. The map coordinate panels don't update on first scroll event. Only subsequent events update it, which results in the coordinates not being in sync with map scroll events (and only map scroll events). I know why this happens and it can be fixed. However it's an annoying fix that forces me to change the map window from a wxScrolledWindow object to a wxWindow object with scrollbars. It's on the bottom of the current todo list.
To refresh the coordinate panels and display the right coordinates, just move the mouse pointer inside the map.
LEAKS:
. 78k, as reported by Visual C++ 2005 Express, originating from a singleton object. That is, you can expect a 78k leak per run and no more than that, no matter what you do or how long the app stays on. I've started a thread on this issue on these forums, but unfortunately I allowed it to die. I apologize sincerely to all that replied; It's just been hard these days to be online. I shall reintroduce this issue later. For now I'll endure it.
TODO:
. Everything?
. There's yet some optimizations possible to map drawing. Clipping regions is one and I do need to study about this technique. Another is, naturally, my own code which can probably be improved. If I am going to worry with it or not (particularly reviewing my own code), will depend on general feedback on current map performance.
. The MiniMap flicker is awful and needs to be fixed. This is actually an excellent oportunity to study about those clipping techniques.
. Wait for the next wxWidgets stable release to replace wxNotebook for wxAuiNotebook in the main frame. Not using wxAuiNotebook yet because it leaks on AddPage(). Thankfully it is already fixed on the CVS. wxAuiNotebook has the type of functionality I want to offer users; individual tab close buttons, tab reorder and tabs scroll buttons.
. Users will be able to create and save their own colour schemas for all map elements.
. Will eventually need to ask for help with all the legal mumbo jumbo. The nature of a PBeM game makes it hard for code to be available as Open Source since players can then know all the little secrets of the game. However I would like for at least the client application to be available as open source until I figure out a way to make the server application available without giving away the game secrets that must remain forever away from the players... Anyways, The idea is that anyone can change and do whatever to the code, they however must retain the original authors names, or something like that.