Sunday, August 17, 2008

Configuration options

This is the last week of GSOC, the date in which our evaluations begin is tomorrow. It's been a pretty short and exciting trip, sometimes I'm still amazed that I have the chance to work on this at all. On to the additions!

A checkbox for "saving details" was added to the login screen. When checked, the username, password, last server connected to and some other preferences are saved in the user's home directory, so that reinstalling the client will not affect the preferences. The password text is masked now, and saved to disk in hexadecimal format. Pretty primitive, but the idea is just to prevent casual lookers from getting the password.

The configuration dialog was expanded with a couple more options as well as two additional dialog boxes for graphics and sound configuration. The main dialog now has the option to tweak the zooming speed, as well as to adjust the distance scaling. This is meant to help deal with the variety of rulesets which use different units of distance for their maps. The distance unit ratio makes stars further apart the lower it goes, as all distances will be divided by this value when starting a new map.

Graphics options allows the player to change the renderer (although I recommend Direct3D for Windows), resolution and anti-aliasing options. Unfortunately, only the full-screen option works instantly, the rest take place after a restart as only full-screen had a convenient setFullScreen() method which I could use :). Also, each renderer (opengl or direct3d) takes in different values as their configuration. For instance, direct3d takes in resolution and colour depth as a single string, while opengl takes in resolution and colour as different parameters, which means that the user should change the either the renderer alone or the other options without changing the renderer.

For sound, the options are pretty basic (I know it is missing a volume control :)). Setting the driver to other values provided by openal (other than the default 'Generic Software' option) doesn't work for my system, perhaps because I am using on-board sound and not an actual sound card.

Some work was done to allow the client to adapt better to different rulesets. The map centers properly now (I had a dumb bug where I should be reading x and y values, but instead read both values from x). Zoom distance, which is like the 'step size' for zooming, takes into account the distance scale so that larger maps will not take forever to zoom in. Panning takes into account the current zoom level, so it zooms more when zoomed out. Also, a map boundary was added so that the user will not move out of bounds and get lost, although I'm wondering whether this is a good idea as it sometimes results in apparent 'locking' when the camera runs up against the invisible walls. Perhaps the camera could slide along the walls instead, so that the user can still move about smoothly.

One issue with having an adjustable distance scale is that for large distances, the background of stars (which was a particle system) would have to be expanded to encompass everything, thus resulting in a sparser starfield. Although I like the idea of generating the starfield at runtime, increasing the number of stars would have made performance even slower than it already is, so I made a skybox in blender instead. This skybox also replaced the one in the login screen, as it is from the default ogre media - something I am trying to move away from.

The following shot shows a camera placed inside a sphere, with it's field of view set to 90 degrees. The starry texture was done by blender's built-in texture generators: some noise, clouds and playing with layer settings. After that, I rendered a screenshot in every direction and set it as a skybox. Easy to do, but getting good settings for the texture is hard, I haven't really figured it out yet.

The next shot shows the starmap with the skybox in use. Sadly, my computer chugs pretty slowly in this server with 34 players. I believe it's the overlay placement code that's the problem as the polygon-heavy models should have been hidden already.

To end on a high note, I received a nice package this weekend, courtesy of the lead dev mithro. Thank you very much! This made my weekend (well that and Singapore winning it's first Olympic medal in decades, woohoo!)

No comments: