Next: , Previous: Configuration, Up: Top


13 Designing levels

13.1 Introduction

As of Liquid War 5, most levels have been contributed by players. While the maintainer of Liquid War 6 has technical knowledge to develop the game, artistic talent and taste might not be his domain of excellence 8-)

Therefore contribution are truely welcomed when they take the form of a new, original, fun and good looking level.

Note that this manual might refer to levels and maps: they are just two different names to describe the very same thing. It's an alias.

13.2 Format description

13.2.1 Basics

Liquid War 6 stores level information in a plain directory.

There is no such thing as an opaque .dat binary file. The name of the level is the name of the directory itself, and its elements are the files contained in it.

Files must follow a precise naming scheme. For instance Liquid War 6 expects a map.png file to be present in each map directory.

All image files in a level use the Portable Network Graphics or JPEG format.

It is possible that in the long term, Liquid War 6 will be able to handle levels as .tar.gz or .zip files. In that case these files will only be a compressed image of the actual level directory.

See the ./data/map/ directory of the source Liquid War 6 distribution to see example of maps.

13.2.2 Image files

13.2.2.1 map.png

This is the only required file in a level.

In fact, the existence of map.png makes a directory a level. When checking wether a directory is a correct level, Liquid War 6 simply tests the existence and validity of map.png.

This image is a simple black & white area, where white zones are the background, the sea, the places where fighters can move, and black zones are the foreground, the walls, the places where fighters can't go.

This informations can be stored in a 2-color indexed file, or in a grayscaled or even truecolor RGB file, but color information won't be used. Internally, Liquid War 6 will read the color of every point. If it is over 127 on a 0 to 255 scale, it will be considered as background, if it is below 127, it will be considered as foreground.

In future versions, different levels of gray will allow map designers to make places that are deep (several fighters in the same place) and places with a single thin layer of water (default mode).

13.2.2.2 elevation.png or elevation.jpeg

The idea of this layer is to provide information about elevation, for map renderers that can use it. It has nothing to do with gameplay, only used for shading and/or eye candy graphical effects.

Not implemented yet.

13.2.2.3 texture.png or texture.jpeg

A texture used for the map. It does not need to have the same dimensions as the map itself. Indeed, textures can be much more precise than the actual logical map.

There's no theorical limit on how big a texture can be, more precisely, it can be much bigger than any hardware/driver maximum texture size. In practice, a too big texture will waste your video card RAM, and slow everything down. Sizes ranging from 640x480 to 1600x1200 are reasonable texture sizes.

If you don't define this, the map.png file will be used as the texture.

Note that the shape of the texture defines the shape of the map, that is, the ratio with which it will appear on the screen.

The PNG alpha layer will be used for transparency. To save disk space, it can be convienient to prefer the JPEG format and store the alpha layer in a separated file.

13.2.2.4 texture-alpha.jpeg

When one uses a JPEG format for the texture (texture.jpeg), for the sake of disk space (reduces both disk usage and bandwidth by drastically reducing the size of package tarballs), one looses the alpha layer, since JPEG format has no support for this.

A workarround is to create a texture-alpha.jpeg file, and store alpha informations in it. White is considered opaque, black is transparent. Different levels of gray correspond to different levels of opacity.

13.2.2.5 background.png or background.jpeg

This file can be used to automatically fill background zones (that is, where fighters can move, areas filled with liquid) using a texture tiling approach, the way it was done in Liquid War 5.

Not implemented yet.

13.2.2.6 foreground.png or foreground.jpeg

This file can be used to automatically fill foreground zones (that is, where fighters can't go, walls) using a texture tiling approach, the way it was done in Liquid War 5.

Not implemented yet.

13.2.3 style.xml

13.2.3.1 What is this for?

A simple XML file defining various appearance parameters. Has absolutely no effect on gameplay. These settings can ultimately be overriden by the player, but the idea is that if the map designer thinks this level looks better with this or that option, let him say it in this file.

13.2.3.2 Reference

The file has a very simple key/value structure, available options (keys) are:

13.2.3.3 Example

Here's an example style.xml file, which does not change anything from the default settings:

<?xml version="1.0"?>
<lw6mapparam>
  <bool key="keep-ratio" value="true" />
  <float key="zoom" value="1.0" />
  <string key="background-style" value="water" />
  <string key="menu-style" value="cylinder" />
  <string key="view-style" value="flat" />
  <string key="hud-style" value="floating" />
  <color key="team-color-red" value="#ff0000" />
</lw6mapparam>

13.2.4 options.xml

13.2.4.1 Power for the map designer

Whereas style.xml is only about the appearance of the map, options.xml allows the map designer to change pretty much any parameter.

Ultimately, the player can still ignore these settings and overide them with its own values, but the idea is: most game options are only pertinent in a given context. For instance, on some maps it's interesting to move slowly, on some other it's interesting to move fast. Some maps might be playable packed with fighters everywhere, some other might be much more fun with almost nobody on them.

The approach in Liquid War 5 was to make the options available, but let the player himself find the right settings for the right map. The consequence is that no one ever used all those cryptic options in the advanced options menu, and probably 99% of the players ended up playing with default settings. This is not that bad, but given the fact that changing a few parameters one can totally transform the gameplay, it has decided been that in Liquid War 6, the map designer suggests the right options that matches his map.

This does not prevent the player from toying with options himself, he can still do it.

There's also one important point to note: all these options are technically implemented as integer parameters. We certainly do not want any float here, since, and it is a Liquid War specific behavior, the game must be 100,00% predictable and behave the same on every platform. As there is nothing like exactness when speaking of floats, those are forbidden here. As for strings, we are dealing here with low-level internals, and this section is not about telling a story. They are technical options only. Booleans are implemented with the usual false = 0 and true = 1 convention. Note that other config files in Liquid War 6 might rely on floats, strings, and booleans with conventionnal true and false values, but not this one. options.xml is special.

13.2.4.2 Everyday options

These are the basic parameters that any map designer should consider modifying. Not that it is mandatory to change them, but it is really worth asking oneself wether it might or not be usefull to change something here.

13.2.4.3 Usefull but not mandatory options
13.2.4.4 Advanced cryptic options
13.2.4.5 Example

13.2.5 README

A README which describes the map. Should contain a short description, and copyright information.

It is a deliberate choice not to use specific fields to store these informations and use a global README instead. It makes both program code and map design simpler.

Note that the file must be called README and not README.TXT or readme.txt whatsoever.

13.3 Migrating levels from Liquid War 5

Todo...

13.4 Legal issues

13.4.1 Why data must be free

Many Free Software games come with a free game engine, but without free data. A very good example of this is Doom. While the engine of this game is free, released under the GNU GPL, the data required by it is still proprietary. The Freedoom project addresses this issue, and aims at creating a complete Doom-based game which is Free Software. This requires time and energy, and it is very usefull since a Free Software game without free data to run with is not really usable.

All the data in Liquid War 6 are released under the GNU GPL, along with the source code. Data is considered as being part of the game, since running Liquid War 6 without any level makes no sense.

While the act of running Liquid War 6 is not restricted (see the complete terms of the GNU GPL), no non-free levels or graphics will be distributed with the game.

13.4.2 Common pitfalls

Here are some points you should think about before designing new maps: