Liquid War 6, a unique multiplayer wargame.
Introduction
User's manual
Hacker's guide
Reference
C API
Appendices
Read this chapter to discover Liquid War 6.
Liquid War 6 is a unique multiplayer wargame. Your army is a blob of liquid and you have to try and eat your opponents. Rules are very simple yet original, they have been invented by Thomas Colcombet. It is possible to play alone against the computer but the game is really designed to be played with friends, on a single computer, on a LAN, or on Internet.
An older version, Liquid War 5, is available, but is not part of the GNU Project. Only Liquid War 6 is part of the GNU Project, it is a complete rewrite.
The official page of Liquid War 6 is http://www.gnu.org/software/liquidwar6/. For more information, you can read the Wikipedia article about Liquid War.
As of today, the game is in beta state. It can be installed, and you can toy arround with. You can even play with. It is still far from being complete as some key features are still missing.
What works:
In the near future:
In the long run:
You might be interested in checking the following URLs, which give a view on opened tasks and bugs:
Liquid War 6 is a complete rewrite of Liquid War 5. The rewrite started in 2005. So a good question is “was the rewrite worth it?”...
Here's a list of key improvements:
The most interesting change is still to come, and concerns network games.
Stay tuned.
Liquid War 6 releases are “codenamed” after famous, historical,
real or mythical characters. Here is a short revision history.
For details, see the ChangeLog
and NEWS files distributed with the game. Additionnally, there's
an ever-increasing “stamp” number which is incremented each time
a build is done with a different source.
The game will probably be labelled “6.0.0” when network mode is up and running. Until then there will probably be other improvements concerning gameplay and appearance (“eye candy”). There's a balance to keep between the major goals such as “make that network thingy work” and the very real fact that “hacking must be fun”.
Please remember that development of Liquid War 6 is a volunteer effort, and you can also contribute to its development. For information about contributing to the GNU Project, please read How to help GNU.
Here's a short list of todo items. It is probably too early to start hacking the core engine itself, for it is still under heavy development, might undergo major rewrites, and it's hard for documentation to keep up with the reality of the code. However, there are still many things to do.
Feel free to join the mailing-lists, this is clearly the best place to start with.
There's also a list of opened tasks on Savannah at http://savannah.gnu.org/task/?group=liquidwar6 which you can browse online. Maybe there's some task for you!
Alternatively, you can contact Christian Mauduit.
The Liquid War 6 user's manual hopefully contains any usefull information to install the program and play the game. If you just want to enjoy Liquid War 6 without diving into map creation and programming, this is just for you.
The main discussion list is <help-liquidwar6@gnu.org>, and is used to discuss all aspects of Liquid War 6, including installation, development, game strategies, and whatever subject players and hackers might want to talk about, provided it is Liquid War 6 related. If you don't know on which list to subscribe, this is the one.
To subscribe to it, please send an empty mail with a Subject: header line of just "subscribe" to the -request list, that is
<help-liquidwar6-request@gnu.org>.
You can also subscribe to the list using the Mailman web interface for help-liquidwar6 and consult help-liquidwar6 archives.
Announcements about LiquidWar 6 are made on <info-liquidwar6@gnu.org>. Subscribe to it to be informed of major releases, and other significant news.
To subscribe to it, please send an empty mail with a Subject: header line of just "subscribe" to the -request list, that is
<info-liquidwar6-request@gnu.org>.
You can also subscribe to the list using the Mailman web interface for info-liquidwar6 and consult info-liquidwar6 archives.
Please also consider reading the latest news on Savannah.
There is also a special list used for reporting bugs, <bug-liquidwar6@gnu.org>. Please try and describe the bug as precisely as possible. The more accurate the description, the more chances it will get to be fixed.
While this is the standard GNU way of reporting bugs, modern SPAM standards make it very hard to filter real bug reports from junk on this list. It is more convenient to use a web interface, the URL is: http://savannah.gnu.org/bugs/?func=additem&group=liquidwar6 and you're really encouraged to use it instead of sending emails.
Please take a look at the bug list before submitting new bugs.
Liquid War 6 can be found on http://download.savannah.gnu.org/releases/liquidwar6/ and http://www.ufoot.org/download/liquidwar/v6/.
Downloading the latest file from this place, and compile
it yourself on your computer with a classical
./configure && make && make install is the recommended
way to install Liquid War 6.
Some binary packages might be available. Your mileage may vary.
GNU/Linux based systems are supported, through
Debian .deb and
Red Hat RPM packages.
There is also a Microsoft Windows installer.
However these binaries are not necessarly available for every single version of the game.
Latest work in progress versions can be obtained with GIT. Here's the typicall command which will fetch the latest version:
git clone git://git.sv.gnu.org/liquidwar6.git
If you are behing a firewall and can't use the native GIT protocol, you can rely on the (slower) http protocol:
git clone http://git.sv.gnu.org/r/liquidwar6.git
You can browse the code online, consult log summary, and in a general manner “follow” the project on http://git.savannah.gnu.org/gitweb/?p=liquidwar6.git and http://git.savannah.gnu.org/cgit/liquidwar6.git.
Alternatively, you can download daily snapshots on
http://www.ufoot.org/liquidwar/v6/snapshots/
These files should be built every day, but a make distcheck is
done before creating them. So if the source code is, for some reason, broken, then
they won't be generated. It is a good source if you want the
most up-to-date code which is not completely unstable. This is typically
the place to go if you want to know a reported bug is correctly fixed. Please
do not rely on snapshots generated on the fly by the source content manager,
daily snapshots mentionned above are better since
a make dist has been run on them.
Using a checkout is really for developpers.
This section covers installation from source. Other ways of installing the program are not described here.
All these libraries are mandatory to compile the game. Liquid War 6 won't compile, let alone run, without them. Some of them could probably be replaced by equivalent tools, but this would certainly require a programming effort and some changes in Liquid War 6 source code.
#pragma directives, this should help the game
run faster on SMP systems.
snprintf...)
and Liquid War 6 might use them. In a general manner, Liquid War 6
is part of and designed for GNU. You might however manage to compile
it with limited libc support, this is the case with mingw32 for instance
but, do it at your own risk.
dlopen and dlclose. Check
that you have a /usr/include/ltdl.h file, or install
the corresponding package.
While all these libraries are theorically optional (the game will successfully compile without them), you'll obviously need, for instance, one graphics backend. Otherwise, you'll simply have no display. This is not acceptable. As of today, one can reasonnably consider all SDL-related libraries are required. The rest is truely optional.
OGG/Vorbis
file renderer.
You might find it convenient not to install all the requirements from source, but use your favorite GNU/Linux distribution packages.
On an RPM based GNU/Linux system, a typical command (tested with Fedora 15 “Lovelock”) could be:
yum install \
make gcc glibc glibc-devel binutils \
libgomp \
guile guile-devel gmp gmp-devel libgc1c2 libgc-dev \
libtool libtool-ltdl libtool-ltdl-devel \
zlib zlib-devel expat expat-devel \
libpng libpng-devel libjpeg libjpeg-devel \
sqlite sqlite-devel \
ncurses ncurses-devel readline readline-devel \
libGL libGL-devel libGLU libGLU-devel \
SDL SDL-devel SDL_image SDL_image-devel \
SDL_mixer SDL_mixer-devel \
freetype freetype-devel SDL_ttf SDL_ttf-devel \
libcurl libcurl-devel \
perl lcov global valgrind graphviz gv texinfo-tex \
gtk2-devel rpm-build
On a DEB package based GNU/Linux system this command (tested with Debian 6.0 “squeeze”) would be:
apt-get install \
make gcc libc6 libc6-dev binutils \
libgomp1 \
guile-1.8 guile-1.8-dev guile-1.8-libs libgmp3c2 libgmp3-dev \
libtool libltdl7 libltdl-dev \
zlib1g zlib1g-dev libexpat1 libexpat1-dev \
libpng12-0 libpng12-dev libjpeg8 libjpeg-dev \
libsqlite3-0 libsqlite3-dev \
libncurses5 libncurses5-dev libreadline6 libreadline6-dev \
libgl1-mesa-glx libgl1-mesa-dri libgl1-mesa-dev libglu1-mesa libglu1-mesa-dev \
libsdl1.2debian libsdl1.2-dev libsdl-image1.2 libsdl-image1.2-dev \
libsdl-mixer1.2 libsdl-mixer1.2-dev \
libfreetype6 libfreetype6-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev \
libcurl4-gnutls-dev \
perl lcov global valgrind graphviz gv \
texinfo texlive-base texlive-generic-extra \
libgtk2.0-dev debhelper
Note that those requirements really depend on the exact distribution you have, package names may vary from one to another.
Liquid War 6 uses GNU Automake, Autoconf and GNU Libtool.
Once all the requirements are installed, run:
./configure
make
make install
Liquid War 6 supports the standard ./configure --prefix=/my/path option
(in fact, it supports much more than that) so you can install the game
in any directory. You do not need to be root to install Liquid War 6.
The main package contains some maps so that you can try out
the game. Still, an additionnal package, called extra-maps
or liquidwar6-extra-maps is available, containing more maps.
It really does contain many of them, including most Liquid War 3
and Liquid War 5 legacy maps, plus new Liquid War 6 maps.
On GNU/Linux systems (and possibly any POSIX unixish system) running:
./configure
make
make install
will install the extra maps on your system automatically,
they will then be available in the extra/ sub-directory
when browsing maps.
The ./configure script has a --enable-liquidwar6 switch
which will try and find automatically if there's an existing liquidwar6
binary in the path. If there's such a binary, it will run it and
ask for its map-path and use this value automatically.
Another solution, which works on all platforms including Microsoft Windows and Mac OS X
but also works on GNU/Linux, is to simply unpack the extra-maps
package (unzip or untar) in your custom map directory, or in the
system map directory. There's nothing else to do to install these maps
but simply put them on your hard drive in the right directory.
Typically on an Microsoft Windows system, you would unpack the extra maps in
C:\Program Files\Liquid War 6\map\ (system directory)
and on a Mac OS X system you would unpack the extra maps in
Liquid War 6.app/Contents/Resources/map/ (system directory)
or $HOME/Library/Application Support/Liquid War 6/map (user directory).
On a GNU/Linux or POSIX system
you would unpack them in $HOME/.liquidwar6/map/ (user directory).
Next time you run the game, the maps should be browsable.
If you can't see them, run liquidwar6 --audit and check that
the place where you unpacked the files is actually searched by the binary.
./configure. Running ./configure > configure.log 2> configure.err does help.
/etc/ld.so.conf and running ldconfig as root
can help if some dependencies are installed in exotic places.
CFLAGS, LDFLAGS and LD_LIBRARY_PATH.
./configure --enable-allinone, this will disable
some fancy but somewhat complicated dynamic .so file support,
it can help if shared libraries are handled differently on your system
than on a plain GNU/Linux box.
If none of these help, consider reporting a bug, or search the mailing-lists for help.
Here's a check-list to ensure that your installation is correct:
make install? make check?
liquidwar6 binary in your PATH environment variable?
It might be in /usr/games.
liquidwar6 --pedigree. Look at the output. Check the
compilation date & time, the version number.
liquidwar6 --audit. What do these paths look like?
Are they absolute paths? Do they exist? What's there?
Normally, once the game is installed, all of them should exist,
and be populated with sub-directories and files.
liquidwar6 --modules, to know which modules where compiled.
You need at least one graphical module, for instance mod-gl,
else the game won't run.
liquidwar6 --host, this displays informations about
the host system the binary has been built for.
Now, game looks correctly installed, but you have problems running it.
$HOME/.liquidwar6/ directory, you'll find some files, the main log file log.csv and maybe dump.txt or backtrace.txt. They might contain valuable information, read them. Note that while log.csv is overwritten each time you start the game, dump.txt or backtrace.txt are conserved until a new problem arises. So check the date of these files to be sure you're analyzing the right ones.
Note that byt default on Microsoft Windows $HOME/.liquidwar6/ is replaced by
C:\Documents and Settings\<username>\Liquid War 6 and on Mac OS X it is
in /Users/<username>/Library/Application Support/Liquid War 6/.
liquidwar6 --defaults. This will reset all options to defaults.
You might need to run this when upgrading from a version to another, since
some options might appear, disappear, or defaults values can change.
liquidwar6 --test. This should run a complete test suite, many functions in the game will be tested automatically, and errors reported.
liquidwar6 --show-script-file. Are you really running the right code?
make uninstall && make clean && make && make install.
Many problems can come from using a wrong shared module. You can also launch
the game with the --trap-errors=false switch, this will disable the custom
popup window and allow you to get the real error.
gdb liquidwar6. Type run --trap-errors=false and watch output.
stdout or stderr.
You can change this
by modifying some environment variables: export LD_DEBUG=all.
This is very verbose but does help finding bugs.
./configure --enable-valgrind and
then run it using Valgrind.
find / -type d -a -name "liquidwar6*" 2> /dev/null to ensure you don't
have an old version of Liquid War 6 somewhere else...
Once the game is installed, run it,
click on Quick start with the mouse, and control
the red 'a' cursor with the mouse, or keyboard, both work.
Try and surround the green team, it's a stupid bot, you should win ;)
You army is formed by all the red pixels on the screen, they should
try and rejoin the cursor (the blinking 'a' letter) using the
shortest path. When red and green meet, they fight. Try it, toy arround.
The Quick start button will always make you play red against
a green stupid bot, whatever other options you have set up.
Todo...
Liquid War 6 can be controlled using a reduced set of keys. This is to make the game more portable and allow possible ports to platforms where a full keyboard is not available. Depending on the graphics backend, exact mapping might change, they should hopefully be obvious and intuitive.
Those keys are:
up : the arrow up key
down : the down arrow key
left : the left arrow key
right : the right arrow key
enter : the enter / return key
esc : the escape key
ctrl : the control key
alt : the alt / meta key
pgup : the page up key
pgdown : the page down key
Basically,
It's also possible to control the game with the mouse only, or with a joystick. By default the interface will trap all events and respond on any of these possible devices.
| Keyboard | Mouse | Joystick | Menu action | In-game
|
|---|---|---|---|---|
up
| mouse pointer | stick | previous menu item | move cursor up
|
down
| mouse pointer | stick | next menu item | move cursor down
|
left
| mouse pointer | stick | change menu item value | move cursor left
|
right
| mouse pointer | stick | change menu item value | move cursor right
|
enter
| left-click | button A | validate menu | validate chat line
|
esc
| right-click | button B | back to previous menu | quit game
|
ctrl
| right-click or double-click on any button | button C | N/A | fire
|
alt
| middle-click or triple-click on any button | button D | N/A | alternate fire
|
pgup
| wheel up | button E | previous menu item | zoom in
|
pgdown
| wheel down | button F | next menu item | zoom out
|
A final word about joystick buttons: there's no such thing as standard
joystick buttons, some will come with A,B,C,D, others will
have A,B,start,select,L,R, there's no way to know. By default,
the game will use the buttons with the lowest indexes (returned by
your driver) for the most usefull functions. Validate menu entries is
the most usefull action, zooming in and out the one you can live without.
There's also an (almost) hardcoded shortcut which will quit the game immediately, or at least as quickly as possible, without any prompt or warning.
It is the F10 key.
Think of this feature as the procastinator's “whoops, here comes my boss!!!” emergency function.
As of today, Liquid War 6 is essentially a solo game since network is not working. It allows you to toy arround in arcade mode on any map you wish.
A real solo mode with campaign and goals to reach is planned, how it will be implemented is yet to be defined.
By default, teams behave differently, some of them move more rapidly,
some are more aggressive but vulnerable, some are more defensive but
do not attack as strong as others. This aspect of the game is under
active tuning, things might be unfair by now, you can toy arround
with the various team-profile-... options, any report is
appreciated.
Note that this is very different from Liquid War 5, and can give very different gaming experiences, you can artificially set up arbitrary strong bots, for instance.
Here's a description of the default color settings:
blue:
has a strong attack but is slow
cyan:
has an extremely good defense but is slow
green:
has a better defense than the average
lightblue:
has an extremely strong attack but is very slow
magenta:
is extremely fast but also very vulnerable
orange:
is fast, but has a very weak attack
pink:
has a very strong attack, but is also very vulnerable
purple:
has a very good defense but a weak attack
red:
moves faster than the average
yellow:
has a strong attack
Additionnally, when profiles are used, each team has two weapons, a primary weapon and an alternate one. Think of weapons as special (usually nasty) tricks you can play on your opponents.
Here's a description of available weapons:
atomic:
nuclear explosion, all fighters arround your cursor are about to die
attract:
all fighters from all teams are packed near your cursor
berzerk:
super-strong attack for a limited time, crush your enemies
control:
you take the control of all other teams while your cursor stays in place
crazy:
all your opponents go crazy for some time, acting with no logic
disappear:
you disappear for some time from the battlefield, to reappear later, somewhere
else
escape:
fighters placed as far as possible from cursor, magically escape from any grip
fix:
all other teams are freezed, you can move but not attack them
invincible:
no damage for a limited time, move untouched
kamikaze:
you die along with the strongest team on the battlefield, requires at least 3
teams
mix:
fighters exchange position, their properties being preserved
permutation:
will exchange colors, randomly, requires at least 3 teams (double edged
weapon)
plague:
general disease, all fighters mysteriously loose health
reverse:
fighters continue to move normally, but attacks are done in reverse mode,
backwards
rewind:
make the battlefield be like it was a few seconds ago
scatter:
every fighters of every team scattered in random places
shrink:
reduces the number of fighters on the map
steal:
steals some fighters to other teams
teleport:
fighters placed as close as possible to cursor
turbo:
move faster for a limited time
Note that this is in progress, some of them are NOT IMPLEMENTED YET.
Liquid War 6 needs to name your “node” (you can think as your server instance of the game) and have a unique URL (address) to publish and give to other nodes.
If only one network adapter is attached to your computer and
your address IP is A.B.C.D then by default the game will
pick automatically the address http://A.B.C.D:8056/ and
it should work flawlessly.
Problems can arise if you have a peculiar network configuration,
if you have multiple non-loopback network interfaces, if you use
NAT to protect yourself from intruders and/or if your
context forces you to do so.
In that case, Liquid War won't be able to guess a correct URL
automatically. So you need to set it up manually either
by editing the public-url entry in the config file,
changing environment variable LW6_PUBLIC_URL or
passing the --public-url=http://<host>:<port>/ argument
when running the game. Typically, if you are behind a firewall
which does NAT, use the firewall address. The right address is
the address which, given to remote hosts, will allow them
to connect on your game instance.
A node is started automatically when you run the game. Even if you don't start to play, node starts in the background and exchanges data with other nodes, mostly to discover them and maintain its internal map of existing nodes and games.
So even without starting a network game, you should be able
to point a web browser on your node and see a web page
describing it. Your node address is displayed on stdout
(console) when starting the game. If in doubt, try http://localhost:8056/
which should work unless you modified defaults settings.
When you start a network game, the program simply changes your node state from “idle” to “accepting connections”.
The interface should show you the list of available nodes, just pick one and try and connect to it.
Note that once you're connected on a remote node, you're still acting as an independant node, and other nodes might connect to your node as well as to the other nodes. In short, there's no real server or client, everyone is a client for someone, and can act as a server.
Nodes connected together form a “community”, which can disband, accept new nodes, and in a general manner has its own immaterial life, the first node which created the game might disappear, game can continue without it.
This is why the main network module is called libp2p,
this is a reference to the term “peer to peer”.
Once a node is connected to another one, they've started a “community”. Formally, a stand-alone node accepting for connection is already a community, even if it has only one member, but the only really interesting communities are those formed with several nodes.
A community can't be reached through a given server, to connect to one you just need to connect on one of its member nodes. All nodes are equivalent, there's no master, no root node, nodes collaborate to share the same real-time information and maintaine an up-to-date game state.
Of course, conflicts can arise, and in that case nodes need to agree on an acceptable solution. Normally, the program takes decisions automatically (for instance, it could decide to “kick” a node out of the community) so the player does not have to care about this, but this is expected to be one of the most tricky (and passionating) part of Liquid War 6 hacking.
By default, Liquid War 6 will communicate on port 8056, in both TCP and UDP, and in both ways too (in/out). It's possible to play with partial connectivity, in extreme case, you can even play without direct internet access, using only a mere web proxy.
However, things will go faster and be much easier if the program can use its default native protocol.
Here's an example of a typicall iptables configuration which allows you to play the game full-featured. It's assumed that by default all packets are dropped, this configuration will just open the necessary ports.
# outgoing TCP on port 8056 (liquidwar6)
iptables -A OUTPUT -p tcp --dport 8056 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 8056 -m state --state ESTABLISHED -j ACCEPT
# incoming TCP on port 8056 (liquidwar6)
iptables -A INPUT -p tcp --dport 8056 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 8056 -m state --state ESTABLISHED -j ACCEPT
# outgoing UDP on port 8056 (liquidwar6)
iptables -A OUTPUT -p udp --dport 8056 --sport 1024:65535 -j ACCEPT
iptables -A INPUT -p udp --sport 8056 --dport 1024:65535 -j ACCEPT
# incoming UDP on port 8056 (liquidwar6)
iptables -A INPUT -p udp --dport 8056 --sport 1024:65535 -j ACCEPT
iptables -A OUTPUT -p udp --sport 8056 --dport 1024:65535 -j ACCEPT
If you can't change firewall settings and only have access to the web
through a web proxy, it can still be possible to play (with some restrictions
such as your node not being seen by others) if mod-http is available.
This in turn depends on wether libcurl support was
activated when compiling the game. To use the proxy, you can set
the http_proxy environment variable. For detailed informations,
please refer to libcurl doccumentation.
As stated in the license, the program comes with NO WARRANTY. Period.
However, an important effort has been made so that it can reasonnably be used online, exposed to various “common” attacks.
As far as security is concerned, there are two different issues:
Here's a list of various steps which have been taken to make the program more secure:
--skip-network option is here if you really do
not want to be bothered by networking risks;
strcpy,
equivalents such as strncpy are used;
This being said, Liquid War 6 does not use any strong encryption library to protect the data it sends. All the checksum machinery might be vulnerable to a brute-force and/or strong cryptographic attack, so in theory it's possible to fool the program.
In practise, if you want real privacy, play over a VPN (Virtual Private Network).
Liquid War 6 will try and pick up a default resolution when the game is launched the first time. It won't use your maximum screen resolution but will instead list all available fullscreen modes, and pick up one which is usually something like two thirds of the highest mode. This is to allow switching back and forth between fullscreen and windowed mode using the same settings. This automatically picked-up resolution really depends on your hardware and driver. It is called “standard” in the graphics options menu.
Then it is possible to automatically select the minimum and maximum resolution
your hardware allows in fullscreen mode. These are called “low” and “high”
in the graphics options menu. Just click on the button that display the
resolution, it will change and use the next setting. In windowed mode, the game
won't accept the highest available mode but will instead use a percentage of it,
defined by the --windowed-mode-limit parameter.
You might still be in a case where this is not enough. For instance your maximum resolution is 1600x1200, Liquid War 6 picks a default mode of 1280x960 for you but for some reason you want to play in 800x600, fullscreen. In this case, simply switch to windowed mode, resize the window with the mouse (the resolution button will show you the current resolution) and just choose a resolution near 800x600. It does not even need to be exactly 800x600, 798x603 would probably fit. Then when switching back to fullscreen, you'll be in 800x600, the game will automatically pick up the fullscreen mode which is closest to the current windowed mode resolution.
By default the game will try and run at 60 frames per second. Given the nature of Liquid War 6, this is probably enough. Higher values will maybe give a slightly smoother display, but barely noticeable.
You can activate the display of frames per seconds (aka “fps”) through the menu (“options -> system”) or with the command line (“–display-fps”).
On a single processor system, reducing the number of frames per second might
allow the rest of the game run faster. So if you notice the game is really
slow, in terms of “fighters move slowly” then you might be happy reducing
the display rate and therefore giving power back to the other parts of the
program. On a dual-core (or more) or on a multi-processor system, this is
probably useless since the game is threaded and has a dedicated thread for
display purposes. The command line option to reduce the number of frames
per second is --target-fps.
Additionnally, the parameter --gfx-cpu-usage allows you to force
the display thread to “take a rest” and go idle for some time. This is
advanced settings, most users won't touch this.
As of today, the game is capable of playing Ogg Vorbis audio files. That's it.
In the long run, what is planned is to support Csound which would allow very cool effects, such as dynamically changing the music while the game is running, typically following the action. If there's a lot of fight, the music could reflect this.
For now this is only vaporware, just a nice idea among others, nothing implmented yet.
The config file is a simple XML file. It uses XML only to benefit standard parsing tools, but it's not a structured XML file, in the sense that the tree is so simple that all items are at the same level. It is just a simple key-value binding.
This file is in $HOME/.liquidwar6/config.xml on GNU/Linux and POSIX
systems, in C:\Documents and Settings\<username>\Liquid War 6\config.xml
on Microsoft Windows and in /Users/<username>/Library/Application Support/Liquid War 6/config.xml on Mac OS X.
You're free to edit it manually, but all parameters are changeable with command line options. The program will overwrite this file each time it exits, so if you put comments in it, they will disappear. The advantage of this is that if you mispell something, or if for some reason the game does not understand a value, then when rewriting the file, it will show you it just did not get it.
The file embeds the documentation for all its entries,
it is therefore rather verbose. The documentation is the same you will
find online or by quering the game with the --about option,
also the same you would get reading this manual.
Liquid War 6 uses stdout to output important messages,
and stderr to log warnings and errors.
It will also use syslog if available.
Additionnally, a verbose log is available in $HOME/.liquidwar6/log.csv
on GNU/Linux and POSIX
systems, in C:\Documents and Settings\<username>\Liquid War 6\log.csv
on Microsoft Windows and in /Users/<username>/Library/Application Support/Liquid War 6/log.csv on Mac OS X.
You can read this using any spreadsheet software capable of reading
csv file. It uses the tab (\t) character as a separator.
It contains valuable informations including version and most default
values for the game, and for each line logged, it says where in the
code the log function was called. A must-have for debugging.
There are two ways to report bugs:
The latter (Savannah) is much preferred, because the mailing-list is bloated with spam... It also offers a list of bugs which you should read before submitting a new one.
This hacker's guide is for anyone who is curious about the game, and wants to know how it works. It covers many aspects from simple map creation to technical program internals. A great effort has been done in Liquid War 6 so that it should be much more hackable than previous versions. Any feedback is welcome.
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. It's believed the levels often make the game much more than its engine. This is true for any type of game, and Liquid War is no exception.
So this section is here to help players understand how to hack existing levels, and create new ones, in the hope that 1) they can enjoy their own creations and 2) possibly share their work with others.
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.
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 ./map/ directory of the source Liquid War 6
distribution to see example of maps.
Liquid War 6 does enforce a limit on map size. This is not to frustrate map designers and/or players, simply, it would be a lie to pretend the game can handle arbitrary big maps.
They might look great on your computer but will become unplayable soon on an older machine. And most of the time they don't look that great, carefully crafted 1280×720 just looks awesome and can represent a great level complexity.
Here are the technical limits:
| Type | Max width | Max height | Max surface
|
|---|---|---|---|
| Texture | 3 000 | 2 000 | 6 000 000
|
| Logical map | 1 500 | 1 000 | 1 000 000
|
The texture can be somewhat bigger than the logical map, this allows
for pretty levels while limiting the horsepower needed to move
the fighters and animate everything. Note that you could technically
feed the game with a map.png that is bigger than the logical map
limit, only it will be downscaled when being loaded.
The texture limits are generous enough to accept a full-HD 1920x1080 image, or a 4/3 1600x1200 image, while the “one million pixels” logical map limit is enough to store a 16/9 1280x720 map or a 4/3 1024x768.
Keep in mind that the logical map (map.png) will probably be
scaled whatsoever, even if it's within the absolute limits
(the game adapts the resolution to your computer speed)
and your texture will rarely appear in its native
resolution, will probably be distorted, and so on.
Older versions of Liquid War 6 used to load a plain README file
and use this as metadata. Title was take from map directory name. This is
still supported, but it now also supports the addition of a metadata.xml file
in which you can describe your map.
The following files can be defined:
title: map title, what will appear in the menus
author: map author
description: description of the map, to help players when browsing folders
license: map license (short version, just a simple one-liner, don't use lenghtly copyright
notices here, the README file would be the file to put long legal sections)
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.
Liquid War 6 can handle mutiple layer maps. Think of a pile of maps, one being on top of the other. This allows you to create a volume, the game considers every layer has two axis x and y, and the z axis is to travel through layers. First layer corresponds to z=0, second layer to z=1, and so on.
Here are the files you can use to define layers:
map.png this one is on top, it's always defined (z=0)
layer2.png (z=1)
layer3.png (z=2)
layer4.png (z=3)
layer5.png (z=4)
layer6.png (z=5)
layer7.png (z=6)
A layerX.png file should be designed exactly like map.png.
In fact, map.png could simply have been called layer1.png.
Up to 6 extra layers can be defined
(from layer2.png to layer7.png).
This is a hardcoded limit.
It allows you to define 7 different layers, including
the top map.png layer.
Keep in mind this layer system is not real 3D,
it's more a “2D and a half”
model. Adding layers can considerably slow down the game, so it's
wise to try and use as few layers as possible. Technically, 3 layers
will allow you to build bridges and tunnels, which is probably
the most usefull construction using layers. Fighters can also
have difficulties navigating through layers so piling up layers
in narrow “vertical” z-axis based tunnels is probably not a
great idea.
The ufoot/concept/pass map of the liquidwar6-extra-maps
demonstrates basic layer usage.
It is possible to define a texture for the map by
putting a texture.png or texture.jpeg file.
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, and also import colors from
style.xml if defined.
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.
But to save disk space, it can be convienient to prefer the JPEG
format, use texture.jpeg instead of texture.png
and store the alpha layer in a separated file,
called texture-alpha.jpeg. This avoids handling heavy
PNG files, PNG compression not being performant on most textures.
In texture-alpha.jpeg, black is considered opaque,
and white is transparent. Different levels of gray correspond to
different levels of opacity. Previous versions of the game
used the other way of doing things (black is transparent) because
this is technically, the most obvious way to do things. Black is 0
and transparent is 0. But for a human “reader” of the map
this does not make sense. One generally expects white to be the
equivalent of “undrawn” or “blank”, well, if it's undecided,
void, transparent, whatever, it's white. When the Gimp
flattens an image, it becomes white, not black.
So white is transparent. Period.
If there's a glue.png or boost.png file in the map directory
(you can use one of them or both) then they will be interpreted as follow:
glue.png and boost.png are white, nothing special
happens, fighters follow their default behavior
glue.png is black, fighters will be slowed down. How
slowish they will be depends on the 'glue-power' parameter. If 'glue-power' is
3 then fighters will move three times slower.
boost.png is black, fighters will behave faster. How
fast they will be depends on the 'boost-power' parameter. If 'boost-power' is
2 then fighters will move two times faster.
glue.png or boost.png are gray, they will
be slowed down less or speeded up less depending on how dark the grey is.
There can be, at the same place, some gray or black in both boost.png
and glue.png. How this will behave exactly is not really clear at this
stage, the recommendation is not to do this (it does not really make sense
anyway) but if you do it, game won't complain.
It's also wise not to abuse of boost.png for obviously, a map
filled with “boosted” zones at a X10 pace will require much more CPU
than the same map with no such setting. This might fool the automatic
resampling algorithm and lead to maps that are unplayable. The spirit of
boost.png is just to make a few spots go faster.
It's also important to note that behaving faster or slower means moving faster or slower but also attacking faster or slower, and, in a general manner doing any action with a different pace.
If there's a danger.png or medicine.png file in the map directory
(you can use one of them or both) then they will be interpreted as follow:
danger.png and medicine.png are white, nothing special
happens, fighters follow their default behavior
danger.png is black, fighters die automatically, that is,
they become black and loose health. How dangerous these zones are depends
on the 'danger-power' parameter.
medicine.png is black, fighters regenerate faster, they
become bright and shiny as if auto-healing. How efficient this medicine is
depends on the 'medicine-power' parameter.
danger.png or medicine.png are gray, well,
it's in between, the “danger” and “medicine” effect will be proportional
to the level of gray.
There can be, at the same place, some gray or black in both medicine.png
and danger.png. How this will behave exactly is not really clear at this
stage, the recommendation is not to do this (it does not really make sense
anyway) but if you do it, game won't complain.
The four files:
one-way-north.png (AKA “up”)
one-way-east.png (AKA “right”)
one-way-south.png (AKA “down”)
one-way-west.png (AKA “left”)
can be used to force the fighters to go in one given direction, on some parts of
the map. If an area is black on one of this meta-layers, then fighters will go
in the given direction. For instance, a black zone in one-way-north will
make fighters go to the north (AKA “up” direction) regardless of the cursor
position. The fact that this is a one-way path is understood by fighters and they
will take this in account when choosing the shortest path to go somewhere.
You can combine vertical and horizontal one-way informations, making diagonal
one-way paths.
By default, a simple cursor will be displayed, but you can use a custom per-map cursor. Cursors are defined by two 64x64 bitmaps:
cursor.png is a PNG file, very likely to use transparency, which will
be default be colorized according to the map colors. You can draw it any color,
only greyscale informations will be used. You can keep the original colors if
you really want to by setting colorize-cursor to false, but the default
is to ignore the hue.
cursor-color.png is another PNG file, very likely to use transparency too,
which will always be colorized, replacing white by the team color, and black by the
“dead” color, which by default is black and is usually a dark color. This colorization
is a way to recognize your cursor and know which team it belongs to.
You can define only one of those bitmaps, if doing so, then the other layer will be empty, and won't be filled with the default cursor data. Note that additionnally, a little letter (single character) will be displayed using the team color, so that's yet another way to identify which teams the cursor belongs too. The PNG files really need to be PNG (JPEG won't work) and need to be 64x64, any other size will be ignored.
Whereas style.xml is only about the appearance
of the map, rules.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. rules.xml is special.
This rules.xml file is a direct image of the internal
“rules” structure, so it contains technical, sometimes not very
user-friendly parameters. While hacking rules.xml directly
is a good way to test things, most of the time, the other file
hints.xml contains more high-level informations that do
the job the right way. A typicall example is speed.
See rules.xml reference.
This parameter is only used by the map loader. The map itself contains none of these parameters, they are only clues (hints, in fact..) on “how to load the map” which are passed to the loader.
Let's take an example : speed. This rules.xml file has
a (rather) easy to use “speed” parameter, which will do all the job
of finding the right resolution for your map, the right “rounds-per-sec”
and “moves-per-round” parameters, in short, it will set many
other parameters to fit your needs.
As far as the map designer is concerned, rules.xml and hints.xml
could have been merged (but so would have style.xml) but internally
they are very different: rules.xml contains the real parameters,
the one used by the algorithm whereas hints.xml contains only instructions
which are used once when loading the map and then disappear. The core algorithm
has no idea of what was in hints.xml, once it's loaded.
See hints.xml reference.
This is a simple XML file defining various appearance parameters. It 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.
See style.xml reference.
In this file one can specify per-map team settings. In short, this is where you can say how many bots you want, which color, and so on. This can be on a per-map basis, so that each map has different customized settings, some maps might be fun with only one bot, some other maps might be fun packed with 8 opponents.
Technically, teams.xml will allow you to define up to
4 players and 9 bots. This is an awfull lot considering there are
only 10 colors. Basically, it's OK to simply define:
player1 and player2)
bot1 and bot2)
player2 and bot1 being
the same color, in case of a conflict the game will pick up another color, but
in practice those two entries often correspond to “the second player, bot or human,
coming on the battlefield”.
All in all, this represents 5 entries to set up (main player, other player or first bot which can be the same, then 3 more bots), it's OK to have the rest undefined or set to defaults.
Note that this can also simply be unset, and in that case the game defaults will apply, and the user will be able to change them, whereas if you set these up, the player will somewhat force to used the map settings.
See teams.xml reference.
This is a very important point. Liquid War almost *always* resamples maps, unless you ask it not to do it. This is not recommended, it is believed in the general case, letting the internal algorithm make its own decisions is better than trying to figure out oneself “which is the best resolution”.
The reason is, the right resolution (we're talking here of the logical resolution, how many fighters wide is the battlefield) often depends on the speed and general ressources the of the computer the program is running on. The map designer does not have this information. The program does. It runs a bench at startup. So this way it can choose, at runtime, the resolution which fits best.
The recommended way of doing things is not to try to be too picky about
rules.xml parameters related to speed and also let the default
map size limits in hints.xml to their defaults. Do not use them
unless debugging stuff.
Then the program will resample the map so that the player can play
on it at a reasonnable speed.
If map is too big, and it's often the case, then it will downsize it until
there are sufficiently few fighters so that the CPU can handle the job.
This, of course, is not rocket science. The bench calculation is a
somewhat brute-force approach of doing things. Formally, we would have
to run the map for good to figure out what is the right speed. Still,
this bench gives good approximations.
Previous versions of the game relied heavily on 'fighter-scale' to resample maps, but this is not the case anymore. The 'fighter-scale' is now a minor parameter which is used to upsize maps if they are too small. In 99.9% of the cases, the map is first upsized by 'fighter-scale' for this parameter is by default set low (1.0) then downsized by 'bench-value' for real-life personnal computers can't handle 1600x1200 maps in real-time. Not yet.
There are a bazillion options to control map size, including 'min-map-surface'. They are here because it's important that, ultimately, people can do whatever they want with the game. But for map design, this is another story. Don't use them. Rely on 'bench-value' and just care about game speed. This is achieved by changing the “speed” parameter.
It is possible to store your own custom music file within the map directory.
You can call it whatever you want (you can keep its original name, which is
something music authors usually appreciate, even if there's no strong
“attribution” clause on the license, it can be considered fair use not
to fiddle to much with the name) you just have to place it in the same
directory than the other files like map.png or texture.jpeg.
The following formats are known to work with the default
SDL_mixer based mod_ogg
backend:
ogg (Ogg Vorbis files)
wav
midi (extensions .mid and .midi should both work)
mod, s3m and xm files, AKA “modules”.
To be more precise, here's how things work:
music-file (parameter taken
from style.xml or defined/overriden by player) in the current map
directory;
step 2: if not found, it will try every path in music-path to find
this file. This includes the “system” music directory with musics that
ship with the game, but also the ./music subfolder in the user
directory;
step 3: if still not found, it will try to play a random file, relying
on music-filter to ignore some files.
In rules.xml you can set a special parameter which is exp
and allows you to tell “a player can't load this map if he doesn't have
at least N at his/her exp rating”. Gaining exp (stands
for “experience”) isn't hard, you just need to win a level with exp=N
to gain exp=N+1.
By default, the player's exp is 0 and levels default to 1, so this means
only levels with exp set explicitely to 0 in rules.xml might be
used. Then player wins that level and is given access to all maps by default,
unless these are explicitely set with exp greater than 1.
In solo game, when a player wins a level, he's automatically redirected
to the map which is in the same directory and has exactly the exp
he just gain. For instance, if you win a map with exp=5 then you're
chained to the first map (in alphabetical order) which has exp=6.
By setting up the exp parameter the right way, with a map for each
exp level one can transform a simple map directory in a scenario
that player will automatically follow.
Last, but not least, the game, at startup, only allows you to play red, green, blue and yellow. Other colors are unlocked as you progress among levels. Same things with weapons, there are “liberated” continuously through the game.
This mechanics allows the following behavior:
extra package.
As a final word, yes, it's possible to cheat, fool the exp system, but it's believed this is moot and lame.
Liquid War 6 uses GNU gettext for all
its messages. There's an online manual
about this tool. In practice, what you have to do as a translator is to
edit the po/xx.po file with xx being your language / country code.
For instance, to translate the game in French, one needs to edit po/fr.po.
This is very important, you might already be aware of it if you are familiar
with gettext, but still it's worth mentionning : when a string contains special
characters such as %d or %s (in a general manner, anything with
a % it's important that all translations contain exactly the same number
of %ds and %ss than the original.
For instance:
"foo has %d bars (%s)"
can be translated to:
"ziblug zdonc %d zuc - %s - tac"
The number, order and type of % entries is preserved. To learn more
about these formats, use info printf or man 3 printf. In a
general manner, get informations about printf.
Additionnally, some strings are used by Scheme (Guile) code and not
by C code. Thus, they don't use the standard C/printf convention.
In these strings, what you must preserve and be aware of is the tilde
character ~. Very often you'll see ~a in a string. As
with the printf %, you must preserve the number, order and type
of those. There is a complete
online reference
about this way of formatting strings.
Liquid War 6 has thousands and thousands of messages which could theorically be translated. In practise it's counter-productive to spend time to translate those, as the game is still evolving constantly, and as most of these messages are technical messages which inform about rare bugs and strange conditions. All sort of informations which, while valuable, are not intented for end-users and are more destinated to be reported in bug reports. To select only the interesting messages to translate, the current gettext configuration only uses a reduced set of files.
src/scriptpo.c : the most important file. It contains the definitions used
by all the Guile code, this is where you'll find all the menu labels.
src/lib/sys/sys-log.c : log messages and keywords. These are not the log
messages themselves, it only concerns the log engine. One can for instance
replace WARNING by ATTENTION.
src/lib/hlp/hlp-credits.c : the credits, which are
displayed at game startup in the splash screen.
src/lib/lw6-print.c : contains some messages printed on the console.
As a side note, the file src/lib/hlp/hlp-reference.c contains all the
entries for the various configuration options, anything that can be queried
by liquidwar6 --about=<keyword>. This is several hundred messages. It
might be interesting to translate them some day, but it's obviously not a
priority today.
Technically, Liquid War 6 is a collection of C functions which are exported to Guile. The main binary embeds a Guile interpreter, which will run a Guile script. This script calls the exported C functions, and glues them together.
It should be possible to implement the game without using Guile at all, using C code to make the various modules communicate together. This might seem an easier way to go, not involving several languages. However, using this script level is a good way to achieve several important goals:
Having Guile to implement high-level stuff also decreases, to some extent, the need for object-oriented features of C++. The big picture is : low level code that require speed, optimized data processing, is written in C. Code which is more high level and requires abstraction is written in scheme.
Liquid War 6 makes a heavy usage of threads. Early versions of the game did not have this feature but starting with 0.0.7beta, one can really consider the game is heavily threaded.
There's basically:
So globally, if you have an SMP system, the game will be happy with it. It will also run on a single processor, as the program uses POSIX pthreads it's capable to run on any computer which has pthreads implemented for it.
But, and this is a strong limitation, without pthreads, the game won't run. At all. Or at least, not unless it's almost completely rewritten.
The C code is splitted into several internal libraries. This allow independant testing of various game modules.
The main module, the most important one, is libker, (stands for “kernel”).
This is were the core algorithm is. To some extent, the rest of the code is
just about how to provide this module with the right data and environment.
Logically, if you profle the game, you should find out that a great part
of the CPU time is spent here. Code here is about spreading gradients, moving
fighters and cursors.
The libmap module is here to handle maps, it contains the code to manipulate
maps in memory. But it does not know how to load them from disk. This is the
responsability of another module, libldr, which is linked against libraries
such as libpng or
libjpeg and does the job of transforming those
standard formats into a usable in-memory structure. There's still a third
moduled involved in map handling, it's libtsk, whose job is to load a
level in the background. It has a 2-steps asynchronous loading system which allows
the game to load maps while the user interface is still responsive, and give
a preview of the map as soon as possible, when loading continues in the background,
building optimizing structures which are usefull when playing but not mandatory
just to show the map.
At the other end of the algorithm-chain, the libpil module will “pilot”
things. It's this module which will translate text readable orders (typically
adapted for network usage) into function calls. It has event lists, keeps
them in the right order, and will also permanently maintain
three different states of the game. A backup state which can be used any time
to go back in time and get the game in a stable 100% sure state. A reference state which
is correct but ever changing. Basically backup plus all the orders received
between backup and reference gives reference. And finally a draft state which
is as up to date as possible but might be wrong. This is typically interesting
in network game, where we want to show something moving, something fast, even
if there's lag on the network and other computers fail to send information in time.
In this case we display draft while still keeping reference and updating it
when we finally receive valid informations. Backup would be used to send
bootstrap information when people are joining a new game, or to check up if
things are going right.
A special libbot module is here to handle bot algorithms. A bot is just
a simple move function which takes a game state as an input, and returns
an x,y position, just the way a mouse handler would. How complex a
bot is “under the hood” depends on the type of bot. Current bots are really
basic. Additionnally, libsim will run dummy fight simulations to find
out wether some team has a real advantage on another one, speaking of team
profiles depending on colors.
The libgfx module handles all the graphics stuff. It is itself splitted
in several sub-modules, that is, it does not do anything but load a module
such as mod-gl which will actually contain the implementation. In an
object-oriented language, it would be an abstract class, an inteface. The
implementation does not need to be thread-safe. It's better if it is, for
theorically it could be possible to fire Liquid War 6 with two display
backends running at the same time on the same game instance, but this code
has yet to be written, and it's a rare dual headed configuration which
probably has no real-life usage. If only one graphics backend is activated
at a time, the rest of the implementation garantees there will never
be two concurrent calls to a function is this module. It is the
libdsp (“display”) which handles this. It fires a thread for
rendering purposes, and sends information to this thread, detecting
automatically if it's necessary to acquire a mutex and update rendering
informations. For the caller, this is transparent, one just has to
call an update function from time to time. The module will even perform
“dirty-reads” on a game state being calculated, to render things
in real time, as soon as possible.
An experimental libvox module is under design/development and
might, in the future, provide a real-time voxel renderer. Still pre-alpha
stage.
To ease up the implementation of different graphics backends, a libgui
module contains code which is meant to be used by any graphics backend.
It's just a factorisation module, containing common code and interfaces,
related to displaying things. This is where, for instance, one can find
a high level menu object.
The libsnd module handles sound. It's also an abstract class, an interface,
which uses dynamic backends as implementations.
The libnet module is a wrapper over different network APIs, it
handles Winsock and POSIX sockets in a uniform manner.
The libcli and libsrv contain network client and server code,
implementing the various protocols in dynamically loadable sub-modules.
It's the role of libp2p to glue this together, handle the list
of available servers, the message queue, verifying nobody is cheating,
and so on. All this modules share information about current game
state using code & structures defined in libnod,use message
utilities (format, parse) defined in libmsg and share code concerning connections in libcnx. Additionnally, libdat
provides facilities to store old network messages and sort them.
The libsys module contains most system and convenience functions, it handles
logs, type conversions, timer, memory allocation, it's the fundamental
module every other module depends on. It has a compation libglb
module with all the Gnulib shared code.
The libhlp is used to handle keywords and internal self-documentation
(this is what is used by --list and --about), libcfg
knows how to read and save config files, libcns handles the console,
and libdyn can load .so shared files dynamically.
To glue all this, there are some Guile bindings with helper functions
available in libscm which fills two needs, one being an easy way
to check if Guile linking is working correctly without requiring all other
modules to be available, and also performing automatic checks on some actions
such as registering or executing a function.
Finally there are small modules like libimg (to make screenshots of the game)
which
have been separated because they required special libraries to link with
and/or did not really fit in existing modules for dependencies reasons.
So well, this is a lot of modules. The list might move a bit, but the big picture is here. Each module is testable separately.
Below is a Graphviz diagram, which shows the modules dependencies.

The most important memory structures in Liquid War 6 are:
lw6map_level_t) : this contain the map immutable informations.
This is what resides in memory after a map has been loaded from the disk.
It contains all the various .png and .jpeg files stored
as pixel arrays, resampled if need, and also contains the various map
attributes. Once this structure is ready, the game is capable of displaying
the map on the screen, but it can not do anything with it yet.
lw6ker_game_struct_t) : this one contains the same informations
as the previous structure, only the information has been post-treated so that it's
ready for use by the core algorithm. It will, for instance, contain the famous
mesh structure, which groups squares by packets of 1, 4, 16, 64 or more. The reason
it's been separated from the level is that operations such as creating the mesh
might require a lot of time. So to allow players to see the level while black magic
is still running in the background, it was required to make a difference between
what is required to view the map (“level”) and what is required to play on
it (“game_struct”).
lw6ker_game_state_t) : contains all the variable, ever
changing game data. This is where the position of fighters is stored, their
health, and such things. It is designed to be synchronizable by using mostly
simple calls to memcpy. It heavily relies on the previous structures,
the idea is that one can have several “game_state” plugged on a
single “game_struct”.
All these structures are defined in the ker/ker.h header.
The core Liquid War 6 algorithm is 100% predictable, that is to say, given the same input, it will produce the same results, on any computer. Previous versions of the game also had this property. This is very important for network games, since in a network only informations such as “cursor A is at position x,y” are transmitted. Every node maintains its own internal game state, so it's very important that every node comes with the same output given the same input.
For this reason Liquid War 6 never uses floating point numbers for its core algorithm, it uses fixed point numbers instead. It also never relies on a real “random” function but fakes random behavior by using predictable pseudo-random sources, implementation independant, such as checksums, or modulos.
There are also some optimizations which are not possible because of the predictability requirement, for instance one can not spread a gradient and move the fighters in concurrent threads, or move fighters from different teams in different threads.
If you read the code, you'll find lots of checksums here and there, a global checksum not being enough for you never know where the problem happened. The test suite uses those facilities to garantee that the game will run the same on any platform.
Not being able to rely on a predictable algorithm would require to send whole game states on the network, and this is certainly way too much data to transmit. A moderate 200x200 map has a memory footprint of possibly several megabytes, so serializing this and sending it to multiple computers at a fast-paced rate is very hard, if possible at all, even with a high bandwidth. We're talking about Internet play here.
Liquid War 6 has a modular architecture which allows the programmer (and the player) to plug pretty much any rendering/graphics backend, provided this one is... developped.
As of 2009 the only available backend is still mod-gl, it will
display the game using 3D acceleration, if available, through the
SDL library, using its GL bindings.
Additionnally, versions available for Microsoft Windows and Mac OS X will
probably never any other backends available. For technical reasons, those
platforms do not have the flexibility of GNU/Linux and do not allow
graphical libraries to be loaded dynamically. In practice, both of them
require hacks that override the standard main function. Microsoft Windows
has its WinMain instead, and Mac OS X is even more pedantic,
requiring graphical functions to be executed in the main thread.
So mod-gl is just linked statically in those versions, and
the modularity of the game is purely theorical on these platforms.
This mod-gl module is really one of the key stones of
Liquid War 6, and if you want to change graphical things, it's definitely
the place to hack on. The source is in src/lib/gfx/mod-gl.
The mod-gl backend requires “moderate” hardware, but it
still does require hardware acceleration. Pure software rendering
through mesa for instance, won't
be enough.
So if you're running Xorg on GNU/Linux and there's a DRI driver for your card, the game should run fine.
On the programmer side, the counterpart is that one should not rely
on fancy OpenGL features. Textures have a maximum size of 512x512
for instance. Of course some maps are bigger than this but this
means that internally, mod-gl splits them into smaller tiles,
and displays those tiles one by one.
Inside the mod-gl backend, the src/lib/gfx/mod-gl/gl-utils
directory contains lots of common structures, factorized functions which
can (and should, if appliable) be used.
In addition to all the common
Autoconf switches
such as --prefix, Liquid War 6 has some custom switches:
--enable-console: allows you to turn on/off console support.
Normally this is detected automatically but in case you really want
to disable it on platforms which support it, you can. This will cause
the program no to link against libreadline, among other things.
--enable-gtk: allows you to turn on/off gtk support.
Normally this is detected automatically but in case you really want
to disable it on platforms which support it, you can. This will cause
the program no to link against GTK libs.
--enable-optimize: will turn on optimizations. This will
turn on compiler options such as -fomit-frame-pointer
but also disable some code in the program. Indeed, most of
the advanced memory checking in the game - which ensures it
does not leak - will be turned of. This will certainly speed up
things, however, it's not recommended to turn this on until
program is not stable enough so that memory leaks and other
problems can be declared 'impossible'. Turn this on if you
really have some speed problem, otherwise it's safer to use
the full-featured 'slow' version of the game.
--enable-paranoid: will turn on very picky and pedantic
checks in the code, try this when you suspect a serious memory
bug, a race condition whatsoever, and want to track it down.
Useless for players.
--enable-headless: will allow compilation without any
graphics backend. The game is unplayable in that state but one
can still wish to compile what is compilable, for testing purposes.
--enable-silent: will allow compilation without any
sound backend. The game won't play any music in that state but one
can still wish to compile what is compilable, for testing purposes.
--enable-allinone: will stuff all the internal libraries
into one big executable.
Very convenient for profiling. The major drawback is that
you need to have all the optional libraries installed
to compile all the optional modules. Another side effect is that
with this option there's no more dynamic loading of binary modules,
so if your platform has a strange or buggy support for .so
files, this option can help.
--enable-fullstatic: will build a totally static
binary, that is using the --static option
for gcc and the -all-static option
for libtool. Currently broken, this option could
in the future allow for building binaries that run
pretty much everywhere, without requiring any dependency
but a Kernel.
--enable-gprof: will enable profiling informations.
This will activate --enable-allinone, else you would
only track the time spent in functions
in the main liquidwar6 executable, and exclude lots
of interesting code contained in dynamic libraries.
--enable-instrument: will instrument functions for
profiling. This will turn on the -finstrument-functions
switch when compiling, so that the hooks
__cyg_profile_func_enter and __cyg_profile_func_exit
are called automatically. Then you can link against tools like
cprof or
FunctionCheck.
--enable-profiler: will enable
Google Performance Tools
support. Basically, this means linking against libtcmalloc
and libprofiler. You could activate those by using
LD_PRELOAD or by using your own LDFLAGS but
using this option will also make the game tell you if
CPUPROFILE or HEAPPROFILE are set
when it starts. The pprof -gv output is very handy.
Note that on some systems pprof is renamed google-pprof.
--enable-gcov: will enable coverage informations,
to use with gcov
and lcov.
This is for developpers only. It will activate --enable-allinone,
else there would be some link errors when opening dynamic libraries.
The obtained information is available online:
coverage.
and
GNU global.
--enable-valgrind: will enable some CFLAGS
options which are suitable for the use of
Valgrind, to track
down memory leaks and other common programming errors.
Use for debugging only, usually together with
--enable-allinone.
Liquid War 6 does have a ./debian in both main and extra maps packages,
so it's “debianized”.
To build the main .deb package, untar the main source tarball, then:
make dist cd pkg cp ../liquidwar6-X.Y.Z.tar.gz . # X.Y.Z is the version make deb
Note that you have to copy the source tarball to ./pkg and move
to this directory before typing make deb. This is, among other things,
to simplify the main Makefile.
To build the extra maps .deb package, untar the extra maps tarball, then:
make deb
Liquid War 6 does have a .spec files in both main and extra maps packages.
To build the main .rpm package, untar the main source tarball, then:
make dist cd pkg cp ../liquidwar6-X.Y.Z.tar.gz . # X.Y.Z is the version make rpm
Note that you have to copy the source tarball to ./pkg and move
to this directory before typing make rpm. This is, among other things,
to simplify the main Makefile.
To build the extra maps .rpm package, untar the extra maps tarball, then:
make rpm
This section describes how to compile the game from source under Microsoft Windows. Note that players are encouraged to use a free system such as GNU/Linux, which is the platform Liquid War 6 is being hacked on by default. If you encounter problems with this port, you'll probably save time by installing a double-boot with GNU/Linux coexisting with your previous Microsoft Windows install.
Basically, Liquid War 6 requires
MinGW.
More precisely, it requires MSYS.
A standard Cygwin installation won't
work, because it is too UNIXish to allow third party libraries
like SDL to compile natively.
You might argue that SDL is available for Cygwin, but in reality,
the Cygwin port of SDL is a MinGW port. Indeed, Cygwin brings
all standard POSIX functions including the use of main
instead of WinMain and I suspect this is a problem for
graphical libraries like SDL which do require some sort of direct
access to the OS low-level functions. Therefore, MinGW is more
adapted for it does not define all these functions, and
allows any library to hook on Microsoft Windows internals directly.
Point is then, you also loose the cool effect of Cygwin which
is to have a complete glibc
available,
including network functions like select defined the
POSIX way, and not the WinSock way. If you ever ported code from
POSIX sockets to WinSock 2, you know what I mean. Using MinGW
is also embarassing for some libraries won't compile easily, and
for instance programs which heavily rely on a real TTY
interface to work are usually hard to port. This includes
ncurses
and
GNU readline.
Liquid War 6 tries to have workarrounds for all this, and in
some cases the workarround is simply that embarassing code
is not compiled on Microsoft Windows. For this reason, some
features are not available on this platform. Period.
Now the reason you need MSYS and not only MinGW is that MSYS
will allow ./configure scripts to run, and this eases
up the porting process a lot. MinGW and MSYS packages are
downloadable on the
SourceForge MinGW download page. Alternatively, there is a
mirror on ufoot.org,
but files might be outdated.
To compile Liquid War 6, first download and unzip all the
following files in
the same directory, for instance C:\MSYS.
If you do not have any tool to handle .tar.gz and .tar.bz2
files under Microsoft Windows, which is likely to be the case
when MSYS is not installed yet, you can untar these on any GNU/Linux box,
then upload the whole directory to the target Windows host.
This file list might contain file which are not absolutely mandatory for Liquid War 6, for instance the Fortran 77 compiler is absolutely useless, but installing it won't harm either. Some packages might unzip things the right way, but some do it in a subfolder. You might need to run commands like:
cp -r coreutils*/* .
rm -rf coreutils*
Get rid of useless files:
rm ._.DS_Store .DS_Store
It's also mandatory to move everything that has been installed in
/usr or /usr/local to / since MSYS has some
builtin wizardry which maps /usr on /.
You need to do this if you don't unzip files from a MinGW shell,
which is obviously the case when you first install it. Usefull command
can be:
mv usr/* .
rmdir usr
Next, libintl is not correctly handled/detected by LW6,
and can raise an error like
"gcc.exe: C:/msys/local/lib/.libs/libintl.dll.a: No such file or directory"
so one needs to copy some libraries in /usr/local/lib/.libs/:
mkdir local/lib/.libs
cp local/lib/libintl.* local/lib/.libs/
Another step is to edit /etc/profile and add lines like:
export CFLAGS="-g -I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"
export GUILE_LOAD_PATH="C:\\MSYS\\local\\share\\guile\\1.8\\"
Close and re-launch your msys shell (rxvt) so that these changes take effect. Check that those values are correctly set:
env | grep FLAGS
env | grep GUILE
Finally, your MSYS environment is (hopefully...) working.
Now you need to compile the following programs, from source.
Files are mirrored on ufoot.org for your convenience, however these might be outdated.
Still, there are known to work.
Proceed like if you were under a POSIX system.
Some packages use the --disable-rpath swith, there are various
reasons for which rpath is an issue.
In the same manner, --disable-nls when linking against libintl
or libiconv was painful.
make clean GC; cp pthread.h sched.h /usr/local/include/; cp pthreadGC2.dll /usr/local/bin/; cp libpthreadGC2.a /usr/local/lib/
gmp-4.2.2.tar.gz
then ./configure && make && make install
guile-1.8.5.tar.gz.
Edit libguile/guile.c
and insert #undef SCM_IMPORT
just before #include <libguile.h>.
Edit ./libguile/threads.c and place struct timespec { long tv_sec; long tv_nsec; }; just before #include "libguile/_scm.h".
Then ./configure --disable-nls --disable-rpath --disable-error-on-warning --without-threads && make && make install. The GUILE_LOAD_PATH value must be correctly
set for guile-config to work. For unknown reasons, running guile
can throw a stack overflow error. Don't panic.
See bug 2007506 on SourceForge.net for an explanation on
why the Guile binary shipped with MSYS is not suitable for Liquid War 6.
expat-2.0.1.tar.gz
then ./configure && make && make install
sqlite-amalgamation-3.5.9.tar.gz
then ./configure && make && make install
libpng-1.2.29.tar.gz
then ./configure && make && make install
jpegsrc.v6b.tar.gz
then ./configure && make && make install && make install-lib
curl-7.18.1.tar.gz
then ./configure --without-ssl && make && make install
freetype-2.3.5.tar.gz
then ./configure && make && make install
libogg-1.1.3.tar.gz
then ./configure && make && make install
libvorbis-1.2.0.tar.gz
then LDFLAGS="$LDFLAGS -logg" && ./configure && make && make install
SDL-1.2.13.tar.gz
then ./configure && make && make install
SDL_image-1.2.6.tar.gz
then ./configure && make && make install
SDL_mixer-1.2.8.tar.gz
then ./configure && make && make install
SDL_ttf-2.0.9.tar.gz
then ./configure && make && make install
For your convenience, a zip file containing a complete MSYS "Liquid War 6 ready"
environment is available. It is simply the result of all the operations
described above.
Simply unzip msys-for-liquidwar6-20080819.zip
(about 240 megs) in C:\MSYS\.
All dependencies compiled in /local have been generated
using the command:
cd /usr/local/src
./msys-for-liquidwar6-build.sh > ./msys-for-liquidwar6-build.log 2>&1
Note that this script does't do everything, you'll still need to edit Guile source code and patch it manually.
It might even be possible to use this MSYS environment
under Wine.
Simply unzip it under $HOME/.wine/drive_c, and run
wine "$HOME/.wine/drive_c/windows/system32/cmd.exe" /c "c:\\msys\\msys.bat" and with
luck, you'll get a working shell. Note that this might allow you to compile
the game, but running it is another story. Consider this MSYS over Wine trick
as a hack enabling the use of free software only when compiling for
Microsoft proprietary platform. It is not a reasonnable way to run the game.
If running under a UNIXish platform, or better, GNU, simply run native code.
Use the Windows 32-bit port only if you are jailed on a Microsoft system.
Now, let's come to the real meat, untar the Liquid War 6 source tarball, launch your MSYS shell, and:
./configure
make
make install
Now the binary is in src/.libs/liquidwar6.exe
(beware, src/liquidwar6.exe is only a wrapper).
This binary is an MSYS/MinGW binary, so it read paths “Ã la”
Microsoft, that is, it has no knowledge of what /usr is,
for instance. It requires paths starting by C:\.
This is still experimental. Basically, install MacPorts, and most dependencies with,
except for SDL which you compile from source. The idea is to compile SDL using
the native OS X bindings (and not some other GL files you could have in /opt/local
installed by MacPorts), then compile the game and other SDL dependencies
against this SDL.
The SDL_mixer library might need to be told to compile itself without dynamic ogg support.
By default it seems that it tries to load libvorbisfile.dylib at runtime, and it can fail.
To disable this dynamic loading, use for instance :
/configure --prefix=/opt/extra --enable-music-ogg --disable-music-ogg-shared
Also, it might seem obvious for Mac OS X users, but there are some important issues related to compiling options and handling dynamic libraries at runtime.
ldd does not exist, run otool -L instead.
LD_LIBRARY_PATH is DYLD_LIBRARY_PATH.
.dylib and not .so.
OBJCFLAGS environment variable along with CFLAGS
because the Mac OS X port uses some Objective-C code.
It is very important to have the right SDL flags when linking the Liquid War 6 binaries. For instance it could be:
-I/opt/extra/include -I/opt/local/include -Wl,-framework -Wl,CoreFoundation -I/opt/local/include -D_THREAD_SAFE -Wl,-framework -Wl,Cocoa -Wl,-framework -Wl,OpenGL -Wl,-framework -Wl,Cocoa
The point is to have Cocoa and OpenGL support. Depending on the way you installed SDL,
you might also need to include an SDL framework support, this is mostly if you installed SDL from
.dmg binary images, and not from source with the command line. A typical output of sdl-config --libs is:
-L/opt/extra/lib -lSDLmain -lSDL -Wl,-framework,Cocoa
Another important issue is to include SDL.h, which in turn includes SDLmain.h, in
all the .c source files defining the standard main function. This is done in liquidwar6 but
should you try to link yourself on liquidwar6 libraries and/or hack code, you must do this or
you'll get errors when running the game. Such errors look like:
*** _NSAutoreleaseNoPool(): Object 0x420c90 of class NSCFNumber autoreleased with no pool in place - just leaking
The reason is that SDL replaces your main with its own version of it. One strong implication
is that all the dynamic loading of SDL, which works on sandard GNU/Linux boxes, won't work under
Mac OS X, since SDL hard codes itself by patching main with #define C-preprocessor commands.
A .dmg file (disk image) containing a Liquid War 6.app folder (OS X application)
is available for your convenience. It might work or not. In doubt, compile from source. The complicated part about this package (a “bundle” is OS X language) is that
it needs to embed various libraries which are typically installed in /opt
by MacPorts on a developper's machine. So to build this package a heavy use
of the utilility install_name_tool is required, normally all libraries
needed ship with the binary, remaining depedencies concern frameworks which
should be present on any working Mac OS X install. Still, this is only theory.
Needs to be widely tested.
The layout of the bundle follows:
./Contents/Info.plist: metadata, bundle description file
./Contents/MacOS: contains the main binary liquidwar6 as well as all specific low-level libraries
./Contents/Resources/data: general game data, does not contain maps.
./Contents/Resources/music: music for the game.
./Contents/Resources/map: system maps, you can put your own maps (or “extra” maps) here if you want all users to share them.
./Contents/Resources/script: Liquid War 6 specific scripts, the scheme scripted part of the program.
./Contents/Resources/guile: common shared Guile scripts, part of Guile distribution.
./Contents/Resources/doc: documentation in HTML and PDF formats.
Additionnally, the Mac OS X port uses /Users/<username>/Library/Application Support/Liquid War 6/ to store
configuration file, logs, etc. It does not use $HOME/.liquidwar6 like the default UNIX port.
The Mac OS X port also has a special behavior, in order to load some libraries with dlopen
(SDL_image does this with libpng and libjpeg) it needs to set DYLD_FALLBACK_LIBARY_PATH to a
value that contains these libraries. This is typically in the bundle distributed on the disk image.
On a developper's computer this problem does not appear for those libs are often in places like:
/usr/local/lib
/usr/X11/lib
/opt/local/lib
DYLD_FALLBACK_LIBARY_PATH (but not DYLD_LIBRARY_PATH else
it breaks internal OS X stuff which relies, for instance, on libjpeg library that has the
same name but different contents) but it needs to do it before it is even run, else
the various dyld functions do not acknowledge the change. That is, calling the C
function setenv(), even before dlopen(), has no effect. So the program
calls exec() to re-run itself with the right environment variable. This is why,
on Mac OS X, there are two lines (exactly the same ones) displaying the program description
when it is started in a terminal.
This is not working yet, but there are good hopes that some day, Liquid War 6 can run on a GP2X console. This handled gaming device uses a Linux kernel on an ARM processor, does support most GNU packages through cross-compilation, and has basic SDL support.
To compile Liquid War 6 for GP2X, you first need to set up a working “toolchain”. It's suggested you do this on a working GNU/Linux box. There are several solutions, the recommended one being Open2x. Read the online documentation on how to install Open2x.
Basically, the following should work:
mkdir /opt/open2x # check that you can write here svn co https://open2x.svn.sourceforge.net/svnroot/open2x/trunk/toolchain-new open2x-toolchain ./open2x-gp2x-apps.sh cd open2x-toolchain
Then, for your environment to be complete, you need to set up some environment variables. For instance:
export OPEN2X_SYSTEM_PREFIX=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux
export GP2X_USER_PREFIX=$HOME/gp2x
export CC=${OPEN2X_SYSTEM_PREFIX}/bin/arm-open2x-linux-gcc
export CPP=${OPEN2X_SYSTEM_PREFIX}/bin/arm-open2x-linux-cpp
export CXX=${OPEN2X_SYSTEM_PREFIX}/bin/arm-open2x-linux-g++
export AS=${OPEN2X_SYSTEM_PREFIX}/bin/arm-open2x-linux-as
export CFLAGS=''-I${OPEN2X_PREFIX}/include -I${GP2X_USER_PREFIX}/include''
export CPPFLAGS=''-I${OPEN2X_PREFIX}/include -I${GP2X_USER_PREFIX}/include''
export CXXFLAGS=''-I${OPEN2X_PREFIX}/include -I${GP2X_USER_PREFIX}/include''
export LDFLAGS=''-L${OPEN2X_PREFIX}/lib -L${GP2X_USER_PREFIX}/lib''
export PATH=''${GP2X_USER_PREFIX}/bin:${OPEN2X_SYSTEM_PREFIX}/bin:$PATH''
In this setting, there's a user $HOME/gp2x directory which will
contain all the Liquid War 6 related libraries while the /opt/open2x
remains untouched.
Then you need to install the requirements. All these packages need to
be cross-compiled. To make things clear and non-ambiguous, even if you
have CC set up in your environment variables, pass --build
and --host arguments to the ./configure script of all these
packages. A typical command is:
./configure --build=i686-pc-linux-gnu --host=arm-open2x-linux --prefix=${GP2X_USER_PREFIX}
Here's the list of the requirements:
./configure --prefix=$GP2X_USER_PREFIX --build=x86_64-pc-linux-gnu --host=arm-open2x-linux --disable-pulseaudio --disable-video-directfb
--witout-threads switch to the ./configure
script else it will try (and fail!) to run a test program. Liquid War 6 does
not use Guile threads, it does use threads but uses them “directly” outside
the Guile layer.
--build and --host for this one, they are
unsupported. Package compiles fine anyway.
Next, one needs to install a special version of SDL, which targets the GP2X specifically. This is not a generic SDL, and it does have limitations, which are related to the GP2X peculiar hardware. There are installation instructions about how to do this. The following should work:
cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/open2x login # blank password cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/open2x co libs-gp2x
One of the purposes of Liquid War 6 is to make a cleaner implementation of Liquid War than the previous one, namely Liquid War 5. While the latter has achieved the practical goal of providing a playable implementation of the game, it failed at providing an evolutive platform. Network capabilities where finally added to Liquid War 5, but anyone who played on Internet with someone a few hundreds of milliseconds away would agree that it's far from being perfect. The main reason for this is that it is really had to hack on Liquid War 5, especially when you are not the core developper. The core developper himself, even knowing all the various hacks in the game, is very quickly lost when trying to implement major changes.
To put it short, Liquid War 5 is a global variable hell, a pile of hacks on top of a quick and dirty implementation. Still, it works.
With Liquid War 6, the idea is to take the time to make something stable, something nice which will enable developpers to implement the cool features, and have fun along the way. Of course, this is only a dream, and in the (hopefully "very") long run, Liquid War 6 will also end up as a big unmaintainable mess, like any real-life program, until then, it should remain hackable.
Here are a few guidelines which I think are common sense advice, but they are still worth mentionning:
strcpy or sprintf anywhere in the code.
Nowhere. Use their equivalent strncpy and snprintf systematically,
as they are part of the glibc and are an order of magnitude safer.
Moreover, Liquid War 6 provides wrappers, such as lw6sys_new_sprintf
which handles all the nasty dirty memory allocation stuff for you;
Each of the internal libraries in Liquid War has a “test” program
associated with it. For instance liquidwar6sys-test is
associated to libliquidwar6sys, and its purpose is to
test the features of this library.
While it is fairly easy to test out unitary functions which require no peculiar context, testing high-level functions which requires files, graphical and possibly network contexts to exist is obviously harder to achieve. There's no easy way to draw the line, but the idea is to put in these test executables as many features as possible, to be sure that what is tested in them is rock solid, bullet proof, and that one can safely rely on it and trust that code when running it in a more complex environnement.
These test executables are also very good places to see a library API in action, find code fragments, and make experiments.
Liquid War 6 provides macros to allocate and free memory. One should use them systematically, except when trying to free something allocated by another library, and in very special cases, mostly concerning low-low level operations which are seldom hacked on.
Usage of macros LW6SYS_MALLOC,
LW6SYS_CALLOC and LW6SYS_FREE is straightforward,
read any random chunk of code, for instance ./src/lib/sys/sys-test.c
to see them in action. They are defined in sys/sys.h.
Once used, these macros will track every single call to malloc and free,
and if there's a difference, it will report it. It will also help you by
showing what's in the non-freed memory area, at which line of code
it has been allocated, and when. This is very usefull to track down memory leaks.
Of course a debugger could tell you some of these informations, but experience
shows than when you encounter a memory bug, it's very often impossible to
reproduce it. So you one wastes time trying to reproduce the bug, whereas
with this tool you have the information reported just when the problem happens.
Each library exports a public interface and hides its internal.
Since Liquid War 6 uses standard C and no C++, there's no
real standard way to handle public/private features. The
convention used in Liquid War 6 is to show internal structures
as opaque pointers (void *) whenever some function needs
to operate on a structure which has possibly private fields.
This way the caller function has no way to access the internals,
and we are sure that no reference to any internal implementation
specific feature will appear.
Here's a code excerpt from src/gfx/setup.c:
void _lw6gfx_quit(_LW6GFX_CONTEXT *context) {
/*
* Implementation here.
*/
[...]
}
void lw6gfx_quit(void *context) {
_lw6gfx_quit((_LW6GFX_CONTEXT *) context);
}
The function _lw6gfx_quit (note the “_”) is internal,
declared in internal.h whereas the function lw6gfx_quit
is public, and is therefore exported in gfx.h.
This way, functions in the program using lw6gfx_quit
do not know what is in the _LW6GFX_CONTEXT structure,
and they need not know it.
This does not mean it is not possible to have public structures, only these structures must reflect some truely public, accessible and safe to access structures.
Liquid War 6 is regularly audited with automated tools. You might
need to pass --enable-gcov to --configure if you want
to use thes tools yourself. More precisely:
liquidwar6ker-test or liquidwar6ker-pil.
Bits of code which depend on other libraries are a different story, for
some projects on which Liquid War 6 depends might, for some reason, raise
warnings. But as far as Liquid War 6 is concerned, the goal is simple: zero leak.
Those tools certainly don't garantee the code is perfect, but they do help improving the quality of the program. If you hack, it's recommended you give them a try.
The console can be activated by passing --display-console when starting
the game or by using the system options menu.
When the console is activated, a lw6> prompt should appear in the
terminal which launched the program. If you started Liquid War 6 by clicking
on an icon, console probably won't work at all since stdout and
stdin won't be attached to anything.
The console allows you to type arbitray Scheme/Guile code.
Try, for instance:
(+ 1 2)
(display "foo\n")
You can really break things with this console, it gives you a direct access to all the program internals. At least, all the values which are accessible through the script interface, that is, many of them.
You can call any internal C function which has been exported to Guile, here are some examples:
(c-lw6sys-timestamp)
(c-lw6bot-get-backends)
(c-lw6sys-sleep 2.0)
(lw6-config-get-number "zoom")
(lw6-config-set-number! "zoom" 0.9)
(lw6-config-get-number "zoom")
While syntax (and possibly other) errors will be trapped by the interpreter, note that if you break things inside the game by, say, changing some global value, or in a general manner cause an error elsewhere in the code, the game will really raise a fatal error and stop. That's how you can “break things”.
Still, this console is a very powerfull tool, very usefull for debugging but also for tweaking the game without restarting it and/or navigating through the menu interface.
Liquid War 6 tries to have as few hardcoded data as possible. So many
constants, and pretty much all the image files, are accessible in the
data directory. You can know where it is by launching
liquidwar6 --show-data-dir. If you look in this directory
you'll find different files, among
them XML files.
Let's take an example. Try and find the file gfx/gl/hud/floating/gl-floating-const.xml.
Edit the line with the clock-y1 entry. Change the number after "value".
Re-run the program. Play a game. What happens? Logically you should see that
“something” is not displayed at the same place than before.
You could also modify the textures (JPEG and PNG files). In a general manner it's more cautious to keep them the same size but it depends, sometimes other sizes will work as well.
Many of these parameters are really too technical and obscure to have their place in the main config file (which is already rather big). Use at your own risks, you can really break things touching this, but you can also find out lots of things can be tuned.
Todo...
Todo...
Todo...
This section describes how Liquid War 6 handles network messages. Note that for now this is purely theorical, more of a draft, a plan, it might change before being implemented.
Liquid War 6 does not really have the notion of server or client, any instance of the program can act as both server and client, therefore we use the term node.
A node listens on a given port, in both TCP and UDP, and can
connect to other nodes on the same port. The main identifier
of a node is its public url, which is typically of the
form http://<ip-address>:<port>/. This url is very important
for it is (or at least should be) a unique identifier of the
node over the network.
Liquid War has 3 ways to communicate:
mod-tcp and mod-tcpd.
mod-httpd and client part requires mod-http which might or
not be available, depending on how the game was compiled.
mod-udp and mod-udpd
to work. Using UDP only was not an option when conceiving Liquid War since
it's interesting to have other solutions if, for instance, a firewall
does not allow you to use UDP the way you want.
On each of these channels, messages can be exchanged in two modes, an “out of band” mode (AKA “oob”), and a regular message oriented, here we speak of “connection”.
There are only 3 out of band messages:
PING:
requests for a simple PONG http://server:port/ answer, this is just to
check if a server is a valid server, and if the URL we used to connect on it
is the correct one.
INFO:
requests for a list of key/attributes pairs, which describe the node, telling
for instance its version, its uptime, and so on.
LIST:
requests for a list of other nodess this node is aware of.
You can test out of band messages by simply connecting on your server with a command like:
telnet localhost 8056
At the telnet prompt, simply type:
INFOand press return, and you should have a description of your node.
The complete syntax of OOB messages is:
<COMMAND> [password] [url]
The password and url parameters are optionnal. password can contain either the plain text password or a checksum calculated from the password which is, for security reasons, seeded with the public url of the node we're connecting to, so that this password can't be re-used on another node. url is simply a clue we give to the other node to help find us, the other node will automatically try to detect our IP address and use standard LW6 port 8056, but if for some reason we use a different setting, this is a good way to pass the hint.
As far as OOB is concerned, TCP and UDP work almost the same, HTTP is a bit different, the OOB commands are accessed through the following URLs:
/ping.txt
/info.txt
/list.txt
TCP messages:
LW6 [<passwd>] <version> <client-id> <from-id> <to-id> <serial> <i> <n> <sig> MSG1 <from-id> <to-id> <serial> <i> <n> <sig> MSG2
TCP oobs:
<return> # only works anonymous, same as INFO INFO [<passwd>] [<public-url>] LIST [<passwd>] [<public-url>] PING [<passwd>] [<public-url>]
UDP messages:
LW6 [<passwd>] <version> <client-id> <from-id> <to-id> <serial> <i> <n> <sig> MSG1 LW6 [<passwd>] <version> <client-id> <from-id> <to-id> <serial> <i> <n> <sig> MSG2
UDP oobs:
INFO [<passwd>] [<public-url>] LIST [<passwd>] [<public-url>] PING [<passwd>] [<public-url>]
HTTP messages:
client id & password passed in HTTP headers
/lw6/version/<from-id>/<to-id>/<serial>/<i>/<n>/sig/MSG1 /lw6/version/<from-id>/<to-id>/<serial>/<i>/<n>/sig/MSG2
HTTP public URLs:
/ -> index.html /index.html /favicon.ico /screenshot.jpeg /robots.txt /gpl.txt /info.txt /list.txt /ping.txt
MSG syntax:
<round> <server-id> <command> <arg1> ... <argN>
COMMAND examples:
2 1234abcd1234abcd REGISTER 3 1234abcd1234abcd ADD 5678 YELLOW 4 1234abcd1234abcd SET 5678 20 5 10 1234abcd1234abcd NOP 400 1234abcd1234abcd REMOVE 5678 1000 1234abcd1234abcd UNREGISTER
Sig is a checksum on string:
<from-id> <to-id> <serial> <i> <n> MSG
Summary off all operations required for a release:
LW6MAP_RULES_DEFAULT_EXP and default for --skip-network, which might have been changed will developping.
./src, run ./indent.sh.
./doc, run ./gdoc-update.sh.
NEWS file, in both liquidwar6 and liquidwar6-extra-maps. Check ChangeLog is OK.
doc/liquidwar6.texi.
debian/changelog files in both main and extra maps packages.
make distcheck... (at least!)
RPM package (make -C pkg rpm), check yum install produces a working installation, also check the rpm -e command to verify uninstalling is OK too.
.exe main binary on Microsoft Windows then go back to GNU/Linux and build .exe installer (make -C pkg installer), go back to Microsoft Windows and test the installer (there are often problems at this stage because of missing libraries or other files...).
.dmg Mac OS X disk image, check it works even when /opt and /usr/local or (re)moved, this is important, else execution might rely on binaries which are only on the development machine and do not ship with game.
rsync --rsh=ssh --recursive ./version/ login@dl.sv.nongnu.org:/releases/liquidwar6/version/. Each file must have its .sig corresponding file.
gendocs.sh, carefull, liquidwar6.html is suppressed by this, need to re-create it from previous version and/or index.html which is the same.
index.html, liquidwar6.html and liquidwar6.fr.html so that they reflect the latest release. Check download links are OK.
./configure --enable-gcov ; make clean ; make. Then run src/liquidwar6 --test, stay here and get ready to respond interactively to various questions. Then cd to ./doc/coverage and run make opt. Copy files to web CVS, sync them.
./doc/global and run make opt. Copy files to web CVS, sync them.
./doc/cyclo and run make opt. Copy files to web CVS, sync them.
This describes how to add a new option to the game.
src/lib/def/def-list.txt
src/lib/def/def-update.py run ./def-update.py. This will automatically fill src/lib/def/def.h and script/def.scm. In the code, you should always use LW6DEF_<OPTION> in C and lw6def-<option> in scheme to refer to the option. This does help avoiding typesetting errors.
src/lib/hlp/hlp-list.c, choose a category for it
src/lib/hlp/hlp-reference.c, give it a type, documentation string and default values if needed
src/lib/def/def-list.txt a common practice is to fill it with the output of liquidwar6 --list once the program has been compiled and is aware of the new option.
Unless this is done, program won't accept the option.
This describes how to add a new libxyz internal library:
src/lib/xyz directory. The convention is to use 3 letters names and prefix every global identifier with lw6xyz.
Makefile.am, xyz.h, xyz-test.c and xyz-testmain.c from an existing internal library (libnod is a good source, it does not have complex dependencies).
Makefile.am to fill requirements, make necessary adjustments to other files (many string replaces to make, both lowercase and uppercase).
SUBDIRS and LW6_LIBS sections of src/lib/Makefile.am
AC_CONFIG_FILES of ./configure.ac.
automake and autoconf.
src/lib/lw6-options.c and add a call to lw6xyz_test() for both “check” and “test” cases.
src/lib/lw6-test.c and add a reference to the lw6xzy_test() function.
abc library that depends on xyz, edit the lw6abc_test function so that it contains a reference to lw6xzy_test.
abc library that depends on xyz/xyz.h, edit the abc/abc.h header so that it includes xzy/xyz.h. Also edit src/lib/liquidwar6.h.in.
abc library that depends on libxyz, add a reference to ../xyz/libxyz.la inf the _LDADD section.
doc/gdoc-update.sh and add the entry for xyz.
doc/Makefile.am and add xyz-gdoc.texi in gdoc_TEXINFOS.
./doc, run ./gdoc-update.sh.
doc/liquidwar6.texi to and a new node/section for this internal library.
doc/deps.dot to update dependencies.
./configure && make, fix code if needed.
This describes how to add a new mod-ab module, for instance a new bot, but gfx, snd, cli or srv backends should work pretty much the same:
src/lib/bot/Makefile.am
src/lib/bot/mod-ab, with its Makefile.am (inspired from other existing modules)
configure.ac so that src/lib/bot/mod-ab/Makefile is generated.
doc/gdoc-update.sh and add an entry for mod-ab
doc/Makefile.am and add mod-ab-gdoc.texi in gdoc_TEXINFOS.
./doc, run ./gdoc-update.sh.
doc/liquidwar6texi to add a new node/section for this module.
doc/deps.dot to update dependencies.
src/lib/bot/bot-test.c, change the value of TEST_NB_BACKENDS and modify the code so that the new ab module is tested too.
src/lib/bot/bot-register.c, the code must updated pretty much in every place with the conditionnal LW6_ALLINONE, you need to add the new module.
automake, autoconf, ./configure and make.
Since March, 4th 2010, Liquid War 6 uses GIT to handle source code, track changes, branches, and the rest. It replaces the GNU Arch repository. This old repository contains all sources up to version 0.0.7beta, following versions, including 0.0.8beta, must be retrieved from GIT.
So the following informations only concern those who are interested in previous versions of the game. Anybody else - probably you - should use GIT instead.
See Using GIT.
Still, this quick Arch survival guide is kept in the documentation.
Read the GNU Arch tutorial to learn how Arch works. Note that there are many other source control managers available, some of which provide functionnalities similar to GNU Arch / tla. GNU Arch has been chosen for Liquid War 6 because:
The repository for Liquid War 6 is accessible on http://arch.savannah.gnu.org/archives/liquidwar6. This is a read-only access, but with the distributed nature of GNU Arch, it still allows you to keep track of your own changes, and submit patches. Accessing it in read/write mode with sftp requires a Savannah account and special rights on the Liquid War 6 project.
Here are typicall commands one can use to get Liquid War 6 source from the GNU Arch repository:
tla register-archive http://arch.savannah.gnu.org/archives/liquidwar6
tla get -A liquidwar6@sv.gnu.org liquidwar6--beta
All the patches in the archive are signed with GnuPG, so you can check their authenticity with my public key.
You might need to edit your $HOME/.arch-params/signing/=default.check
file and put the following text in it:
tla-gpg-check gpg_command="gpg --verify-files -"
This section is for those who want to hack the game and set up their own repositories. This will enable you to keep track of your patches, package them, and help the core maintainer merging them in the main repository.
You can introduce yourself and create a repository by issuing commands like:
You can introduce yourself and create a repository by issuing commands like:
tla my-id me@home.net
tla register-archive me@home.net--2008 /home/me/tla-archives
Then, you can get create your own repository, with a command like:
tla tag -S liquidwar6@sv.gnu.org/liquidwar6--beta--0.1 me@home.net--2008/liquidwar6--beta--0.4
The idea is that you create, locally, a depot which has a name that matches the name on savannah (this is for convenience, you could technically give it any name...) and indicate that they represent, today, the same thing.
You can get a working copy of your depot with the command:
tla get me@home.net--2008/liquidwar6--beta--0.4
This will create a complete source tree, which you are free to modify, this is where you should hack.
To synchronize yourself with upstream developments, go into
your copy (the directory created by tla get) and type:
tla star-merge liquidwar6@sv.gnu.org/liquidwar6--beta--0.1
This will apply locally all the changes that happened since the
last synchronization. Of course this is one way to work, you
can decide to cherry pick patches and such stuff, but for most
dayly uses, a good'ol star-merge is fine.
Not that star-merge will only apply patches on your
working copy, not on your repository. The only way to actually
commit the modifications on the repository is to use the
commit command.
When using Arch, you can of course still send patches created
with diff, or even send updated files directly, the way
you would without revision control.
But it can be more convenient to either
/home/me/tla-archives
in our example).
tla mkpatch.
Here's an example of an mkpatch command, and which will
compute the differences between a previous
liquidwar6--beta--0.4--patch-2 snapshot and a not yet
commited latest version:
tla mkpatch {arch}/++pristine-trees/unlocked/liquidwar6/liquidwar6--beta/liquidwar6--beta--0.4/me@home.net--2006/liquidwar6--beta--0.4--patch-2 . my-patch
This will create a my-patch directory, which can be gzipped
and sent by mail.
Sometimes, when signing a patch, you might enter the wrong passphrase several times, or you might press CTRL+D inadvertantly. In that case, tla will be in a half-broken state, telling you it can't acquire revision lock... A quick workarround for this is to go to the depot, find the latest patch, and in this repository, create the following folders:
++revision-lock/+contents
Both are directories, note the two ++ and the single +. the +contents
directory can be empty. Once you've done this, try to re-commit.
There's no CVS or Subversion (AKA “SVN”) source depot for Liquid War 6. Instead, a GIT depot is used. GIT has many advantages over other source control managers (SCM), among them, it's distributed, like GNU Arch.
You can find interesting informations on GIT here:
Simply install git and run the following command:
git clone git://git.sv.gnu.org/liquidwar6.git
If you are behing a firewall and can't have direct TCP/IP access:
git clone http://git.sv.gnu.org/r/liquidwar6.git
Additionnally, source can be browsed online here: http://git.savannah.gnu.org/cgit/liquidwar6.git
You need an ssh access on Savannah and appropriate rights on the project, then you can type:
git clone login@git.sv.gnu.org:/srv/git/liquidwar6.git
If you have developper access to the project, then a simply git push
will commit your changes.
If not (that is, if you checked out anonymously using
git clone git://git.sv.gnu.org/liquidwar6.git for instance, you
can still submit patches. Follow these steps:
git format-patch -p origin this command will generate .patch files, one for each of you commits, which you can send by email. They can be easily integrated in the main source tree by using git apply <file.patch>.
Note that you can need to run git format-patch -p master (with master instead of origin) it not using a fresh checkout. Also consider adding the --stdout switch, eg git format-patch -p master --stdout > my-changes.patch if you're not using a fresh checkout.
This chapter is a technical reference. Most of its content
is self-generated by the program itself. That is to say, most
if its content is already available to you if you have the game
installed. Running liquidwar6 --list
and liquidwar6 --about=<keyword> is very likely to give
you the very same informations, the advantage being that you'll
be sure the information is up-to-date and corresponds to the exact
version of the program you have. However, publishing this in
a reader-friendly way is convenient, plus it enables web search
engines to harvest the content.
--about=<value>Type: string
Will allow you to get informations about a given keyword. Let's say that, for instance, you want informations about the keyword 'map-path'. Simply run 'liquidwar6 –about=map-path'. Note that this internal self-documentation system can describe command line switches as well as XML config file parameters or environment variables, and even some Guile script functions. The '–list' command line switch will give you the list of all available keywords.
--auditDisplay all path values, defaults and current settings. This output is very usefull to track down problems such as missing directories, broken installations. If you get an error message that suggests some file is missing, then give this option a try.
--debugEnables debug mode. This will turn on maximum log information, and display everything on stderr, even messages which are normally only stored in the log file.
--defaultsClears the config file and run the game with default settings. Use this if you suspect you have broken something by tweaking user settings, or when upgrading the game to a new version.
--hostDisplay all known system host properties, including os and cpu informations.
--listReturns the list of all keywords which can be queried for information. This includes command-line options, environment variables, and so on. This is the companion option of '–about'. Results obtained with '–list' can be passed to '–about'.
--modulesTells which modules have been enabled when the game was compiled. It's still possible to add or remove modules afterwards, but this option allows you to know how things were at first.
--pedigreeDisplay all build values, these are general constants which can help debugging, tracing what binary you are running, and so on. It's a good idea to take a look at the output of 'pedigree' if you have problems running the game.
--testRuns a (hopefully) complete test suite which will call most internal Liquid War 6 functions and check out wether they work, in a simple context, without any game interference. Usefull for troubleshooting.
--versionReturns the version of the program, as defined by the GNU Coding Standards.
--example-hints-xmlDumps on stdout an example hints.xml file. Such a file is normally shipped with the game. It is indeed generated using this command.
--example-rules-xmlDumps on stdout an example options.xml file. Such a file is normally shipped with the game. It is indeed generated using this command.
--example-style-xmlDumps on stdout an example style.xml file. Such a file is normally shipped with the game. It is indeed generated using this command.
--example-teams-xmlDumps on stdout an example teams.xml file. Such a file is normally shipped with the game. It is indeed generated using this command.
--list-advancedList advanced options which can be used for fine-tuning the game.
--list-docList documentation-related command line options. These commands allow you to list all the keywords related to a given domain.
--list-funcsList the C-functions which are exported to Guile, thus usable in scripts.
--list-inputList input (AKA controls) related options. Use these to change keyboard, joystick and mouse settingds.
--list-mapList map-related entries, excluding rules.xml, hints.xml and style.xml entries.
--list-map-hintsList 'hints.xml' entries. These parameters enable you to modify the behavior of the map loader.
--list-map-rulesList 'options.xml' entries. These parameters enable you to modify the gameplay.
--list-map-styleList 'style.xml' entries. These parameters enable you to modify the aspect of the game.
--list-map-teamsList 'teams.xml' entries. These parameters enable you to specify which teams should play on the map.
--list-pathList parameters which allow you to override the defaults of the game, and force the game your own file paths and directories.
--list-quickList quick help entries, this includes the GNU standard options and a few troubleshooting tools.
--list-showList command-line options which begin with '–show-...'. These will display on the console many internal parameters. Usefull when debugging.
--show-build-bin-idShows the internal 'bin-id' value. This value does not mean anything in itself but it's supposed to change each time you compile the game.
--show-build-cflagsShows what value you should put in 'CFLAGS' (environment variable) if you want to compile programs that use Liquid War 6 as a library, and include 'liquidwar6.h'.
--show-build-codenameShows the codename associated with this version, generally the name of someone famous who is war-related (a general, an emperor...).
--show-build-configure-argsShows the arguments that have been passed to the GNU Autoconf './configure' script when building the program. This can be very usefull if you want to know how the program has been built.
--show-build-datadirShows the 'datadir' value as passed to the GNU Autoconf './configure' script when compiling the program. Default is '/usr/local/share'. This is the generic, non Liquid War 6 specific data directory. Liquid War 6 related data is stored elsewhere (usually in a sub-directory) see the 'data-dir' switch for more information. 'datadir' is not 'data-dir'. That's the point.
--show-build-docdirShows the 'docdir' value as passed to the GNU Autoconf './configure' script when compiling the program. Default is '/usr/local/share/doc/liquidwar6'.
--show-build-enable-allinoneShows wether the 'allinone' option has been chosen when building the game. This depends on parameters passed to './configure'.
--show-build-enable-consoleShows wether the console has been enabled when building the game. This depends on parameters passed to './configure' and also on the presence of ncurses and readline.
--show-build-enable-fullstaticShows wether the 'fullstatic' option has been chosen when building the game. This depends on parameters passed to './configure'.
--show-build-enable-gcovShows wether the game was build with suitable informations for gcov. This depends on parameters passed to './configure'.
--show-build-enable-gprofShows wether the game was build with suitable informations for gprof. This depends on parameters passed to './configure'.
--show-build-enable-gtkShows wether GTK+ support has been enabled when building the game. This depends on parameters passed to './configure' and also on the presence of GTK+ headers and libs. It uses pkg-config to detect it.
--show-build-enable-instrumentShows wether the game was build with the '-finstrument-functions' GCC switch. This depends on parameters passed to './configure'.
--show-build-enable-mod-csoundShows wether the mod-csound audio backend has been enabled when building the game. This depends on parameters passed to './configure' and also on the presence of the csound library.
--show-build-enable-mod-glShows wether the mod-gl graphical backend has been enabled when building the game. This depends on parameters passed to './configure' and also on the presence of SDL and related libraries.
--show-build-enable-mod-httpShows wether the mod-http network backend has been enabled when building the game. This depends on parameters passed to './configure' and also on the presence of libCurl.
--show-build-enable-mod-oggShows wether the mod-ogg audio backend has been enabled when building the game. This depends on parameters passed to './configure' and also on the presence of SDL and related libraries.
--show-build-enable-openmpShows wether the program was built with OpenMP support. This depends on parameters passed to './configure'.
--show-build-enable-optimizeShows wether the 'optimize' option has been chosen when building the game. This depends on parameters passed to './configure'.
--show-build-enable-paranoidShows wether the game was build with paranoid memory management. This is for debugging purposes, the default already includes some controls, with turned it's really... paranoid.
--show-build-enable-profilerShows wether the game was build with Google Profiler support. This depends on parameters passed to './configure'.
--show-build-enable-valgrindShows wether the game was build with valgrind later use in mind. This depends on parameters passed to './configure'.
--show-build-endiannessReturns the endianness. 'little' corresponds to x86-like systems, 'big' to ppc-like systems.
--show-build-gcc-versionReturns the version of the GNU C compiler which was used to compile the program.
--show-build-gnuReturns 1 (true) if host OS is a GNU system, or at least has been considered as such when compiling, 0 (false) if not.
--show-build-host-cpuShows the host CPU, as defined by 'host_cpu' in GNU Autoconf.
--show-build-host-osShows the host OS, as defined by 'host_os' in GNU Autoconf.
--show-build-hostnameShows the name of the host where the binary was compiled.
--show-build-includedirShows the 'includedir' value as passed to the GNU Autoconf './configure' script when compiling the program. Default is '/usr/local/include'.
--show-build-ldflagsShows what value you should put in 'LDFLAGS' (environment variable) if you want to link programs against libliquidwar6.
--show-build-libdirShows the 'libdir' value as passed to the GNU Autoconf './configure' script when compiling the program. Default is '/usr/local/lib'. This is the generic, non Liquid War 6 specific library directory. Dedicated Liquid War 6 modules are stored elsewhere (usually in a sub-directory) see the 'mod-dir' switch for more information.
--show-build-localedirShows the 'localedir' value as passed to the GNU Autoconf './configure' script when compiling the program. Default is '/usr/local/share/locale'.
--show-build-mac-os-xReturns 1 (true) if host OS is Mac OS X, 0 (false) if not.
--show-build-md5sumShows the MD5 checksum, which has been calculated from the C source files. Complementary with 'show-build-stamp'.
--show-build-ms-windowsReturns 1 (true) if host OS is Microsoft Windows, 0 (false) if not.
--show-build-package-stringShows the package string, that is, 'Liquid War 6 <version>
--show-build-pointer-sizeReturns the pointer size, in bytes. Should be 4 on 32-bit systems and 8 on 64-bit systems.
--show-build-prefixShows the 'prefix' value as passed to the GNU Autoconf './configure' script when compiling the program. Default is '/usr/local'.
--show-build-stampShows the build stamp. A very usefull value, more precise than the version to track down binaries. It is incremented each time the core C code is updated. It won't reflect all the programs for it does not take scripts in account, but if you are running a work-in-progress version, it might be very convenient to use this to know what your are running exactly.
--show-build-top-srcdirShows the top source directory on the machine where the binary was compiled.
--show-build-unixReturns 1 (true) if host OS is a UNIX system, or at least has been considered as such when compiling, 0 (false) if not.
--show-build-versionShows the version. Note that this is different from the standard GNU 'version' command line option which shows a complete message with a short copyright notice. This one will just return the version, without the package tarname or anything else.
--show-config-fileShows the config file path. Default is '$HOME/.liquidwar6/config.xml'.
--show-cwdShows the current working directory, the value that the pwd command would return.
--show-data-dirShows the data directory path. This is where the games searches for most of its data,the most important exception being maps, which are stored elsewhere. Default is '/usr/local/share/liquidwar6-<version>/data'.
--show-default-config-fileShows the default config file path. Default is '$HOME/.liquidwar6/config.xml'.
--show-default-data-dirShows the default data directory path. This is where the games searches for most of its data,the most important exception being maps, which are stored elsewhere. Default is '/usr/local/share/liquidwar6-<version>/data'.
--show-default-log-fileShows the default log file path. Default is '$HOME/.liquidwar6/log.csv'.
--show-default-map-dirShows the default map directory. This is where builtin maps are stored. Default is '/usr/local/share/liquidwar6-<version>/map'.
--show-default-map-pathShows the default map search path. This is where the game searches for maps. It's the combination of command-line arguments and builtin paths. Might return more directories than the one specified in a single 'map-path=dir1:dir2' argument.
--show-default-mod-dirShows the default module directory path. This is where all dynamically loaded modules are stored. Default is '/usr/local/lib/liquidwar6-<version>'.
--show-default-music-dirShows the default music directory. This is where builtin musics are stored. Default is '/usr/local/share/liquidwar6-<version>/music'.
--show-default-music-pathShows the default music search path. This is where the game searches for musics. It's the combination of command-line arguments and builtin paths. Might return more directories than the one specified in a single 'music-path=dir1:dir2' argument.
--show-default-prefixShows the default prefix used. This should logically be the value passed to the GNU Autoconf ./configure script when building the game. Most other path are deduced from this one. Default is '/usr/local'.
--show-default-script-fileShows the default main script file path. This file is very important, since the program is more or less a hudge scheme interpreter, and this file is the file loaded by Guile. In short, it is the main program. Default is '/usr/local/share/liquidwar6-<version>/script/liquidwar6.scm'.
--show-default-user-dirShows the default user directory path. This is where run-time data, config files, log files, are stored. Default is '$HOME/.liquidwar6/'.
--show-log-fileShows the log file path. Default is '$HOME/.liquidwar6/log.csv'.
--show-map-dirShows the map directory. This is where builtin maps are stored. Default is '/usr/local/share/liquidwar6-<version>/map'.
--show-map-pathShows the map search path. This is where the game searches for maps. It's the combination of command-line arguments and builtin paths. Might return more directories than the one specified in a single 'map-path=dir1:dir2' argument.
--show-mod-dirShows the module directory path. This is where all dynamically loaded modules are stored. Default is '/usr/local/lib/liquidwar6-<version>'.
--show-music-dirShows the music directory. This is where builtin maps are stored. Default is '/usr/local/share/liquidwar6-<version>/music'.
--show-music-pathShows the music search path. This is where the game searches for musics. It's the combination of command-line arguments and builtin paths. Might return more directories than the one specified in a single 'music-path=dir1:dir2' argument.
--show-prefixShows the prefix used. This should logically be the value passed to the GNU Autoconf ./configure script when building the game. Most other path are deduced from this one. Default is '/usr/local'.
--show-run-dirShows the run directory, usually the path where the binary is. It depends on how and where the program is launched. It is guessed from the argc/argv values at runtime.
--show-script-fileShows the main script file path. This file is very important, since the program is more or less a hudge scheme interpreter, and this file is the file loaded by Guile. In short, it is the main program. Default is '/usr/local/share/liquidwar6-<version>/script/liquidwar6.scm'.
--show-user-dirShows the user directory path. This is where run-time data, config files, log files, are stored. Default is '$HOME/.liquidwar6/'.
--config-fileType: string
Default value: $HOME/.liquidwar6/config.xml
Set the config file path. This enables you to use whatever config file you like, keeping all other informations in the same place.
--data-dirType: string
Default value: /usr/local/share/liquidwar6-<version>/data
Set the data directory. By changing ths value you'll be able to use an alternative data directory.
--log-file=<value>LW6_LOG_FILElog-fileType: string
Default value: $HOME/.liquidwar6/log.csv
Set the log file path. This enables you to use whatever log file you like, keeping all other informations in the same place.
--map-dirType: string
Default value: /usr/local/share/liquidwar6-<version>/map
Set the map directory path. By changing this value you'll be able to play with your own maps in your own directory. Note that there are other ways to achieve that, but using this option will work. However, a side effect is that you might not see builtin maps anymore.
--map-path=<value>LW6_MAP_PATHmap-pathType: string
Default value: $HOME/.liquidwar6/map:/usr/local/share/liquidwar6-<version>/map
Set the map search path. By changing this value you'll be able to play with your own maps in your own directory. This is different from 'map-dir', since it includes 'map-dir', plus it adds a number of other search paths. Unlike most other parameters, the values given from the command-line, from the environment variables, or from the config file, are not overwritten, but appended. That is to say if you specify a 'map-path' with the command-line argument 'map-path=path', but also define the 'LW6_MAP_PATH' value and finally edit 'config.xml' to change the 'map-path' entry in it, you'll end up with the game searching for maps in all these directories. Additionnally, 'map-dir' and '<user-dir>/map' will always be in the list. Any given value can itself include several pathes, separated by the path separator. This separator is ':' on GNU/Linux, and ';' on Microsoft Windows. For instance, on a GNU/Linux box, you could use the command-line argument 'map-path=/foo/bar/map:/home/user/map/:/map'.
--mod-dirType: string
Default value: /usr/local/lib/liquidwar6-<version>
Set the module directory path. By changing this you will load dynamic shared libraries (game specific modules such as the graphical backend) from an alternative place. Use this at your own risks, for there can always be a binary incompatibility. You've been warned.
--music-dir=<value>LW6_MUSIC_DIRmusic-dirType: string
Default value: /usr/local/share/liquidwar6-<version>/music
Set the music directory path. By changing this value you'll be able to use your own musics in your own directory. Note that there are other ways to achieve that, but using this option will work. The major side effect is that using this option, you really replace the existing builtin musics by your own. If you simply want to add musics you can store them in $HOME/.liquidwar6/music or in the map directory itself.
--music-path=<value>LW6_MUSIC_PATHmusic-pathType: string
Default value: $HOME/.liquidwar6/music:/usr/local/share/liquidwar6-<version>/music
Set the music search path. By changing this value you'll be able to play with your own musics in your own directory. This is different from 'music-dir', since it includes 'music-dir', plus it adds a number of other search paths. Unlike most other parameters, the values given from the command-line, from the environment variables, or from the config file, are not overwritten, but appended. That is to say if you specify a 'music-path' with the command-line argument 'music-path=path', but also define the 'LW6_MUSIC_PATH' value and finally edit 'config.xml' to change the 'music-path' entry in it, you'll end up with the game searching for musics in all these directories. Additionnally, 'music-dir' and '<user-dir>/music' will always be in the list. Any given value can itself include several pathes, separated by the path separator. This separator is ':' on GNU/Linux, and ';' on Microsoft Windows. For instance, on a GNU/Linux box, you could use the command-line argument 'music-path=/foo/bar/music:/home/user/music/:/music'.
--prefixType: string
Default value: /usr/local
Override the prefix value given to the GNU Autoconf ./configure script when building the game. Not all path will be changed, some of them might remain the same, for instance message translations (localedir). But most game-specific data including maps, graphics, sounds, will be searched according to the new given parameter.
--script-fileType: string
Default value: /usr/local/share/liquidwar6-<version>/script/liquidwar6.scm
Set the main script file path. This file is very important, since the program is more or less a hudge scheme interpreter, and this file is the file loaded by Guile. In short, it is the main program.
--user-dir=<value>LW6_USER_DIRuser-dirType: string
Default value: $HOME/.liquidwar6
Set the user directory path. This is where run-time data, config files, log files, are stored. If you override this value, other parameters such as where the config and log files reside, will change.
--player1-control=<value>LW6_PLAYER1_CONTROLplayer1-controlType: string
Default value: mouse
Control for the first player, must be mouse, keyboard, joystick1, joystick2 or custom.
--player1-name=<value>LW6_PLAYER1_NAMEplayer1-nameType: string
Default value: <username>
Name of the first player, the player used by default. A default value is provided, you can of course, change it at will.
--player1-status=<value>LW6_PLAYER1_STATUSplayer1-statusType: boolean
Default value: true
Status of the first player, true if player is activated, false if idle.
--player2-control=<value>LW6_PLAYER2_CONTROLplayer2-controlType: string
Default value: keyboard
Control for the second player, must be mouse, keyboard, joystick1, joystick2 or custom.
--player2-name=<value>LW6_PLAYER2_NAMEplayer2-nameType: string
Default value: player2-<hostname>
Name of the second player. A default value is provided, you'll certainly want to change it.
--player2-status=<value>LW6_PLAYER2_STATUSplayer2-statusType: boolean
Default value: true
Status of the second player, true if player is activated, false if idle.
--player3-control=<value>LW6_PLAYER3_CONTROLplayer3-controlType: string
Default value: joystick1
Control for the third player, must be mouse, keyboard, joystick1, joystick2 or custom.
--player3-name=<value>LW6_PLAYER3_NAMEplayer3-nameType: string
Default value: player3-<hostname>
Name of the third player. A default value is provided, you'll certainly want to change it.
--player3-status=<value>LW6_PLAYER3_STATUSplayer3-statusType: boolean
Default value: false
Status of the third player, true if player is activated, false if idle.
--player4-control=<value>LW6_PLAYER4_CONTROLplayer4-controlType: string
Default value: joystick2
Control for the fourth player, must be mouse, keyboard, joystick1, joystick2 or custom.
--player4-name=<value>LW6_PLAYER4_NAMEplayer4-nameType: string
Default value: player4-<hostname>
Name of the fourth player. A default value is provided, you'll certainly want to change it.
--player4-status=<value>LW6_PLAYER4_STATUSplayer4-statusType: boolean
Default value: false
Status of the fourth player, true if player is activated, false if idle.
--click-to-focus=<value>LW6_CLICK_TO_FOCUSclick-to-focusType: boolean
Default value: false
If set to true, you'll need to click with the mouse to select a menuitem or move the cursor in the game. If not, some actions will be taken automatically without the need to click.
--cursor-sensitivity=<value>LW6_CURSOR_SENSITIVITYcursor-sensitivityType: float
Default value: 1.0
Keyboard and joystick sensitivity while moving the cursor. 1.0 is the default, 0.1 is slow, 10 is reponsive. This is used for moving the cursor during the game only, the option has no impact on menu navigation.
--custom-alt=<value>LW6_CUSTOM_ALTcustom-altType: string
Default value: (c-lw6gui-keyboard-is-pressed 110) ; SDLK_n
Guile custom code associated to the ALT key equivalent.
--custom-ctrl=<value>LW6_CUSTOM_CTRLcustom-ctrlType: string
Default value: (c-lw6gui-keyboard-is-pressed 98) ; SDLK_b
Guile custom code associated to the CTRL key equivalent.
--custom-down=<value>LW6_CUSTOM_DOWNcustom-downType: string
Default value: (c-lw6gui-keyboard-is-pressed 100) ; SDLK_d
Guile custom code associated to the DOWN key equivalent.
--custom-enter=<value>LW6_CUSTOM_ENTERcustom-enterType: string
Default value: (c-lw6gui-keyboard-is-pressed 103) ; SDLK_g
Guile custom code associated to the ENTER key equivalent.
--custom-esc=<value>LW6_CUSTOM_ESCcustom-escType: string
Default value: (c-lw6gui-keyboard-is-pressed 102) ; SDLK_f
Guile custom code associated to the ESC key equivalent.
--custom-left=<value>LW6_CUSTOM_LEFTcustom-leftType: string
Default value: (c-lw6gui-keyboard-is-pressed 99) ; SDLK_c
Guile custom code associated to the LEFT key equivalent.
--custom-pgdown=<value>LW6_CUSTOM_PGDOWNcustom-pgdownType: string
Default value: (c-lw6gui-keyboard-is-pressed 115) ; SDLK_s
Guile custom code associated to the PGDOWN key equivalent.
--custom-pgup=<value>LW6_CUSTOM_PGUPcustom-pgupType: string
Default value: (c-lw6gui-keyboard-is-pressed 119) ; SDLK_w
Guile custom code associated to the PGUP key equivalent.
--custom-right=<value>LW6_CUSTOM_RIGHTcustom-rightType: string
Default value: (c-lw6gui-keyboard-is-pressed 118) ; SDLK_v
Guile custom code associated to the RIGHT key equivalent.
--custom-up=<value>LW6_CUSTOM_UPcustom-upType: string
Default value: (c-lw6gui-keyboard-is-pressed 101) ; SDLK_e
Custom keycode to be used as the UP key equivalent.
--double-click-delay=<value>LW6_DOUBLE_CLICK_DELAYdouble-click-delayType: integer
Default value: 333
Time, in milliseconds, determining wether two consecutive clicks make a double-click or not.
--max-cursor-speed=<value>LW6_MAX_CURSOR_SPEEDmax-cursor-speedType: float
Default value: 10.0
Maximum cursor speed when cursor is controlled with keyboard or joystick joystick 1. Consider using cursor-sensitivity too.
--mouse-sensitivity=<value>LW6_MOUSE_SENSITIVITYmouse-sensitivityType: float
Default value: 1.0
Mouse sensitivity, 1.0 is the default, 0.1 is slow, 10 is reponsive. This is used for moving the cursor during the game only, the option has no impact on menu navigation.
--repeat-delay=<value>LW6_REPEAT_DELAYrepeat-delayType: integer
Default value: 500
Time, in milliseconds, before key repeat will start, use 0 to disable.
--repeat-interval=<value>LW6_REPEAT_INTERVALrepeat-intervalType: integer
Default value: 100
Time, in milliseconds, between two repeats, once repeat has started, use 0 to disable.
--use-double-click=<value>LW6_USE_DOUBLE_CLICKuse-double-clickType: boolean
Default value: false
Wether to use double-click feature, mostly usefull if running on a system that has only one button (such as a tablet-PC or anything with a tactile screen), if your mouse has three buttons, disabling this might avoid some confusion. Basically, if enabled, double-click is equivalent to right-click (fire) and triple-click is equivalent to middle-click (alternate fire).
--use-esc-button=<value>LW6_USE_ESC_BUTTONuse-esc-buttonType: boolean
Default value: true
Decides wether to display an 'esc' (escape) button in the interface. This is usefull for people who control the game with the mouse only, and have a single buttons, or on a touchscreen.
--zoom-step=<value>LW6_ZOOM_STEPzoom-stepType: float
Default value: 1.1
A value, strictly greater than 1, which will be used when zooming. The greater it is, the more sensible the zoom is.
--zoom-stick-delay=<value>LW6_ZOOM_STICK_DELAYzoom-stick-delayType: float
Default value: 1000
How long, in msec, the zoom will stick to its default value.
--capture=<value>LW6_CAPTUREcaptureType: boolean
Default value: false
Enables capture mode, in which a BMP file is dumped on the disk (in your user directory, search for a 'capture' sub-directory).
--fullscreen=<value>LW6_FULLSCREENfullscreenType: boolean
Default value: false
Force the game to fun fullscreen. Note that the graphics backend might ignore this hint.
--gfx-backend=<value>LW6_GFX_BACKENDgfx-backendType: string
Default value: gl
Sets the graphics backend AKA 'gfx' to use. For now the only choice is 'gl' and will use an OpenGL/SDL 3D-accelerated driver.
--gfx-quality=<value>LW6_GFX_QUALITYgfx-qualityType: integer
Default value: 1 Min value: 0 Max value: 2
Sets the overall quality of the graphics backend. Depending on the backend, this can mean different things. For instance for the 'gl' backend, this can change texture filtering (nearest, linear, bilinear...). This is not the same as 'pixelize' which is a per-map option and emulates an old school appearance.
--height=<value>LW6_HEIGHTheightType: integer
Default value: -1
Run the game with the given screen height.Note that the graphics backend might ignore this hint. Use with its companion option 'width'. A negative value will force the use of a default value.
--width=<value>LW6_WIDTHwidthType: integer
Default value: -1
Run the game with the given screen width. Note that the graphics backend might ignore this hint. Use with its companion option 'height'.A negative value will force the use of a default value.
--windowed-mode-limit=<value>LW6_WINDOWED_MODE_LIMITwindowed-mode-limitType: float
Default value: 0.95
When switching back from fullscreen mode to windowed mode, if we're in maximum resolution, then this coefficient will be applied before resizing the window. The idea is that (obviously) a windowed mode is prefered when a little smaller that totally fullscreen. So set this to a value just below 1.0.
--ambiance-exclude=<value>LW6_AMBIANCE_EXCLUDEambiance-excludeType: string
Default value:
If this string is present in a music file name, this file won't be played during the menus, it will be excluded from the list.
--ambiance-file=<value>LW6_AMBIANCE_FILEambiance-fileType: string
Default value:
A music file which will be used to be played during the menus. If not found, game will fallback on random files.
--ambiance-filter=<value>LW6_AMBIANCE_FILTERambiance-filterType: string
Default value: Chadburn
A music filter, used to select the files which are played while navigating in the menus. It works like 'music-filter' except this one is not related to a peculiar map. This is not a complex regex-enabled filter, just a plain string search. Even the '*' wildcard won't work.
--fx-volume=<value>LW6_FX_VOLUMEfx-volumeType: float
Default value: 0.3 Min value: 0 Max value: 1
Set the sound effects volume. This is a floating point value. 0 is mute. Maximum value is 1.
--music-volume=<value>LW6_MUSIC_VOLUMEmusic-volumeType: float
Default value: 0.6 Min value: 0 Max value: 1
Set the music volume.This is a floating point value. 0 is mute. Maximum value is 1.
--snd-backend=<value>LW6_SND_BACKENDsnd-backendType: string
Default value: ogg
Sets the sound backend AKA 'snd' to use. Can be 'ogg' or 'csound' but only 'ogg' will produce sound in the current release.
--water-volume=<value>LW6_WATER_VOLUMEwater-volumeType: float
Default value: 0.2 Min value: 0 Max value: 1
Set the volume for water sounds. This is a floating point value. 0 is mute. Maximum value is 1.
--bind-ip=<value>LW6_BIND_IPbind-ipType: string
Default value: 0.0.0.0
The IP address to bind on when listening to network messages. You can use this to specifically use a given network interface, the default will listen on any available interface.
--bind-port=<value>LW6_BIND_PORTbind-portType: integer
Default value: 8056 Min value: 1 Max value: 65535
The IP port to bind on when listening to network messages. The default should work out of the box, and will ease up the discovery process. That is, if you use your own settings, automatic detection of your server by other servers might not work so well.
--broadcast=<value>LW6_BROADCASTbroadcastType: boolean
Default value: true
Allows the program to send broadcast messages on the network. It can be usefull to disable those if you don't use UDP node discovery and/or if there's a sysadmin arround who does not enjoy permanent broadcasts on his LAN.
--cli-backends=<value>LW6_CLI_BACKENDScli-backendsType: string
Default value: tcp,udp,http
The client backends to use. Most of the time the default is fine, change it only if you specifically want to disactivate some protocol, or if you want to activate a custom-made client backend. It's a comma separated list.
--known-nodes=<value>LW6_KNOWN_NODESknown-nodesType: string
Default value: http://ufoot.org:8056/,http://ufoot.hd.free.fr:8056/
List of known nodes, nodes which the program will try to contact first to get the list of other nodes. This is mostly usefull when program is launched for the first time, after this it should keep an up-to-date list of known servers in its internal database and automatically reconnect to them next time it starts. You might want to change this if you really want to connect to a given server which is not publically listed. The list is comma separated.
--node-description=<value>LW6_NODE_DESCRIPTIONnode-descriptionType: string
Default value: No description.
The description of your node, that is a text that describes your server. This will typically appear when pointing a web client on the public server URL, it is for general information, so if there's something special about your server, say it here.
--node-title=<value>LW6_NODE_TITLEnode-titleType: string
Default value:
The title of your node, that is the name which will be displayed when listing servers. This is different from player name, for there can be several players on a single computer. By default this will be set to hostname.
--password=<value>LW6_PASSWORDpasswordType: string
Default value:
The password to use for network games. Do not use a valuable password, as this is stored as clear text on your hard drive. Still, the game will only send a hash/checksum of the password on the network so eavesdropper won't be able to read it. They can see the hash/checksum and use it if clever, but they can't guess the real password. A blank password means anyone can join your games when you act like a server.
--public-url=<value>LW6_PUBLIC_URLpublic-urlType: string
Default value:
The public URL of your server. By default the game will pick up one for you. In fact, the clients discovering your server should guess the public URL, probably http://<your-ip>:<your-port>/ but you might need to use your own settings if you are using NAT or an Apache reverse-proxy to rewrite HTTP requests.
--skip-network=<value>LW6_SKIP_NETWORKskip-networkType: boolean
Default value: false
If set, then game won't do anything network related. No listen, no connect, no nothing. You are playing locally.
--srv-backends=<value>LW6_SRV_BACKENDSsrv-backendsType: string
Default value: tcpd,udpd,httpd
The server backends to use. Most of the time the default is fine, change it only if you specifically want to disactivate some protocol, or if you want to activate a custom-made server backend. It's a comma separated list.
--chosen-map=<value>LW6_CHOSEN_MAPchosen-mapType: string
Default value: subflower
The last map chosen by the player, locally. This is the map which will be used for a quick-start game, a local game, or a game started as a server.
--force=<value>LW6_FORCEforceType: string
Default value: respawn-team,color-conflict-mode
A comma separated list of options which should be ignored when reading map XML files. For instance, if this contains 'rounds-per-sec,moves-per-round' then whatever values were defined for this in 'rules.xml', then game will ignore them and use the user's values, stored in 'config.xml', running the game at the requested speed. This ultimately allows the player to control everything despite the values set by the map designer.
--use-cursor-texture=<value>LW6_USE_CURSOR_TEXTUREuse-cursor-textureType: boolean
Default value: true
Defines wether the cursor textures should be used. If unset, then the default builtin cursor texture will be used instead of the map specific one.
--use-hints-xml=<value>LW6_USE_HINTS_XMLuse-hints-xmlType: boolean
Default value: true
If set, then hints will be picked up from the map defined hints.xml, if it exists. This is the default.
--use-music-file=<value>LW6_USE_MUSIC_FILEuse-music-fileType: boolean
Default value: true
If set, then the program will use the 'music-file' attribute to choose the music to play. If unset, then a random builtin music will be picked up, regardless of what is specified in 'music-file'.
--use-rules-xml=<value>LW6_USE_RULES_XMLuse-rules-xmlType: boolean
Default value: true
If set, then rules will be picked up from the map defined rules.xml, if it exists. This is the default. Use force-time and force-size to override this and use user-defined values anyway.
--use-style-xml=<value>LW6_USE_STYLE_XMLuse-style-xmlType: boolean
Default value: true
If set, then style will be picked up from the map defined style.xml, if it exists. This is the default. Use force-time and force-background to override this and use user-defined values anyway.
--use-teams-xml=<value>LW6_USE_TEAMS_XMLuse-teams-xmlType: boolean
Default value: true
If set, then teams will be picked up from the map defined teams.xml, if it exists. This is the default. Use force-time and force-background to override this and use user-defined values anyway.
--use-texture=<value>LW6_USE_TEXTUREuse-textureType: boolean
Default value: true
Defines wether the map texture should be used. Of course if there's no map texture, the texture... won't be used. But if there is one, this parameter will force the game to ignore it and play with solid colors. This probably won't look as nice as the textured map in most cases, but some players might find it more readable and confortable to play when throwing eye candy away.
--boost-power=<value>LW6_BOOST_POWERboost-powerType: integer
Default value: 3 Min value: 1 Max value: 10
Defines how fast and powerfull the boost is. That is, if on 'boost.png' it's pitch black and this parameter is set to 3, then fighters will move and act 3 times than what they would do normally.
--color-conflict-mode=<value>LW6_COLOR_CONFLICT_MODEcolor-conflict-modeType: integer
Default value: 1 Min value: 0 Max value: 2
How to handle color conflicts, that is, when a player requests a color, but this color is already used, what should be done? If 0, wether a color already exists won't affect the color of a new cursor. If 1, then two players on the same computer will be allowed to share the same color/team, but if another computer is already playing with a color, any new computer will need to use another team. If 2, then it's impossible for a new cursor to use a pre-existing color, any new cursor will require a new color, if that color is already used, a new color will be picked randomly.
--cursor-pot-init=<value>LW6_CURSOR_POT_INITcursor-pot-initType: integer
Default value: 100000 Min value: 5000 Max value: 500000
Defines the cursor potential at startup. Not really any reason to change it. Theorically, there could be maps where the default value doesn't fit, but none has been seen yet.
--danger-power=<value>LW6_DANGER_POWERdanger-powerType: integer
Default value: 200 Min value: 0 Max value: 10000
Defines how dangerous are the black zones defined in 'danger.png'. The value is used to decrease the fighter health at each move, so you should compare its value to something like 'fighter-attack'. Being on a dangerous zone is a bit like being attacked by an invisible and unknown ennemy.
--exp=<value>LW6_EXPexpType: integer
Default value: 1 Min value: 0 Max value: 99
Level of experience (AKA exp) required to play the current level. If this level is validated (that is, won) then player will be granted with a level of exp+1 and be able to play all the next levels. An exp of 0 means the level is playable by a pure beginner.
--fighter-attack=<value>LW6_FIGHTER_ATTACKfighter-attackType: integer
Default value: 500 Min value: 1 Max value: 10000
Defines how hard fighters will attack others, that is, in one attack, how many life-points the attacked fighter will loose. Increasing this will cause your opponents to melt faster when you attack them. With a low value, it will take ages to take on your opponents. Different styles of game. Can radically change the gameplay.
--fighter-defense=<value>LW6_FIGHTER_DEFENSEfighter-defenseType: integer
Default value: 50 Min value: 0 Max value: 10000
Defines how fast fighters will regenerate after an attack. When this parameter is set low, an attacked fighter, which is very dark and almost dead will take a very long time to regain energy. If the parameter is set high, it can almost instantaneously regain energy.
--fighter-new-health=<value>LW6_FIGHTER_NEW_HEALTHfighter-new-healthType: integer
Default value: 5000 Min value: 1 Max value: 10000
Defines how healthy fighters will be when they appear on the map. This can be either at the beginning of the game of when a fighter changes team. Setting this low will allow battefields to switch from one side to another very fast, for freshly gained fighters will be feeble and very likely to return to their original camp. To calibrate this parameter, keep in mind that the absolute maximum health a fighter can have is always 10000 (ten-thousands).
--fighter-regenerate=<value>LW6_FIGHTER_REGENERATEfighter-regenerateType: integer
Default value: 5 Min value: 0 Max value: 10000
Defines at which speed fighters will self-regenerate, without even begin packed together. This will allow lone fighters to regenerate a bit by hiding somewhere in the map. This is typically a low value, might even be 0.
--frags-fade-out=<value>LW6_FRAGS_FADE_OUTfrags-fade-outType: integer
Default value: 100 Min value: 10 Max value: 100
When a player looses (in deathmatch mode) all player points will be multiplicated by this percentage, for instance if it's 90 and player had 50 points, then player will only have 45 points, then points corresponding to the new death will be added/substrated to its total. This is to avoid players with thousands of points in advance, and keep everyone in the race. A low value will minimize the importance of game start. This is only used in modes where frags are distributed in a proportional way.
--frags-mode=<value>LW6_FRAGS_MODEfrags-modeType: integer
Default value: 2 Min value: 0 Max value: 3
Defines how points are calculated in deathmatch mode, 0 is old school simple mode. 1 is in a mode in which 1 point is attributed to every winner, and looser looses all the corresponding points (total is always 0). 2 isproportional mode, with a total of 0 kept constant, that is, loosers loose as many points as attributed to winners. 3 is a mode in which at each death, winners are attributed a number of points proportional to their fighters, and loosers scores remain untouched.
--frags-to-distribute=<value>LW6_FRAGS_TO_DISTRIBUTEfrags-to-distributeType: integer
Default value: 100 Min value: 10 Max value: 1000
Defines how many points will be distributed when in deathmatch mode. When a player looses, this amont of points will be substracted to its total, and the same amount of points will be distributed to other live players, proportionnally to how many fighters they have on the battlefield.
--glue-power=<value>LW6_GLUE_POWERglue-powerType: integer
Default value: 20 Min value: 1 Max value: 100
Defines how sticky and powerfull the glue is. That is, if on 'glue.png' it's pitch black and this parameter is set to 3, then fighters will take 3 steps to do what would normally take only one step.
--highest-team-color-allowed=<value>LW6_HIGHEST_TEAM_COLOR_ALLOWEDhighest-team-color-allowedType: integer
Default value: 9 Min value: 3 Max value: 9
Id of the greatest/highest color one can use. Normally, you can leave this untouched, the program will automatically fit this according to your exp. Setting an artificially low value will just cause normally available colors to disappear, setting it to a high value does nothing, if you still don't have access to some colors, you still don't, period.
--highest-weapon-allowed=<value>LW6_HIGHEST_WEAPON_ALLOWEDhighest-weapon-allowedType: integer
Default value: 19 Min value: 7 Max value: 19
Id of the greatest/highest weapon one can use. Normally, you can leave this untouched, the program will automatically fit this according to your exp. Setting an artificially low value will just cause normally available weapons to disappear, setting it to a high value does nothing, if you still don't have access to some weapons, you still don't, period.
--max-cursor-pot=<value>LW6_MAX_CURSOR_POTmax-cursor-potType: integer
Default value: 1000000 Min value: 50000 Max value: 5000000
Defines the maximum cursor potential. Not really any reason to change it. Any high value should produce the same results. Low values might reveal algorithm bugs and inconsistencies.
--max-cursor-pot-offset=<value>LW6_MAX_CURSOR_POT_OFFSETmax-cursor-pot-offsetType: integer
Default value: 100 Min value: 1 Max value: 10000
Defines the maximum cursor potential offset. The idea is that in some cases, the potential of a cursor can increase in burst mode, for instance to make this cursor more important than others, so that fighters rally to it, neglecting other cursors (talking about a multi-cursor controlled team). This parameter is here to limit this burst effect and avoid bugs.
--max-nb-cursors=<value>LW6_MAX_NB_CURSORSmax-nb-cursorsType: integer
Default value: 26 Min value: 2 Max value: 26
Defines the maximum number of cursors who can enter the game. Really makes sense in network games. Default value is 26, the maximum.
--max-nb-nodes=<value>LW6_MAX_NB_NODESmax-nb-nodesType: integer
Default value: 12 Min value: 2 Max value: 26
Defines the maximum number of servers who can enter the game. Really makes sense in network games. Default value is 10, and should fit in most cases. Can be raised up to 26.
--max-nb-teams=<value>LW6_MAX_NB_TEAMSmax-nb-teamsType: integer
Default value: 10 Min value: 2 Max value: 10
Defines the maximum number of teams who can enter the game. Really makes sense in network games. Default value is 10, the maximum.
--max-round-delta=<value>LW6_MAX_ROUND_DELTAmax-round-deltaType: integer
Default value: 1000 Min value: 1 Max value: 10000
This is the companion value of 'round-delta'. Will put an absolute limit to the delta, which (what did you think?) is of course incremented in some cases by the core algorithm. If in doubt, don't touch.
--max-zone-size=<value>LW6_MAX_ZONE_SIZEmax-zone-sizeType: integer
Default value: 8 Min value: 1 Max value: 64
Defines the maximum zone size, which is an internal and rather technical parameter. The idea is that to optimize things, Liquid War 6 divides the battlefield in squares, where it can, and tries to make these squares as big as possible, the idea being that everywhere in this square, fighters follow the same intructions. Just a technical optimization. The problem is that setting it too high will reveal the optimization and its tradeoffs to the player, who will see the fighter behave strangely, following invisible paths. Plus, it's ugly. Depending on your tastes (speed, look'n'feel) you'll prefer something nice or something fast. Note that anyways passed a certain value, this does not optimize anything anymore. In doubt, don't touch it.
--medicine-power=<value>LW6_MEDICINE_POWERmedicine-powerType: integer
Default value: 100 Min value: 0 Max value: 10000
Defines how fast fighter will automatically regenerate on black zones defined in 'medicine.png'. The value is used to decrease the fighter health at each move, so you should compare its value to something like 'fighter-defense'. Being on a medicined zone is a bit like being defended by an invisible and unknown friend.
--moves-per-round=<value>LW6_MOVES_PER_ROUNDmoves-per-roundType: integer
Default value: 2 Min value: 1 Max value: 50
Defines how many times fighters move per round. Increasing this will just make fighters move faster, but won't change anything for the rest, that is keyboard and mouse responsivity, and network traffic will stay the same. Multiplying the number of moves per round by the number of rounds per second will give the number of moves per second, which is, in fact, how fast fighters move on the screen.
--nb-attack-tries=<value>LW6_NB_ATTACK_TRIESnb-attack-triesType: integer
Default value: 3 Min value: 1 Max value: 7
Defines how many tries a fighter will do before giving-up attacking and choosing another behvior (defense). By tries we mean: how many directions it will try. Going North? Going North-West? Setting this to a low value will make fighters somewhat less aggressive. This idea is that they'll prefer to switch to the next option, that is, defense/regeneration, if there's no opponent right in front of them.
--nb-defense-tries=<value>LW6_NB_DEFENSE_TRIESnb-defense-triesType: integer
Default value: 1 Min value: 1 Max value: 7
Defines how many tries a fighter will do before giving-up attacking and choosing another behavior (do nothing). By tries we mean: how many directions it will try. Going North? Going North-West? Setting this to a low value, you'll need a very compact pack of fighters for regeneration to operate, else fighters will hang arround unhealthy.
--nb-move-tries=<value>LW6_NB_MOVE_TRIESnb-move-triesType: integer
Default value: 5 Min value: 3 Max value: 7
Defines how many tries a fighter will do before giving-up moving and choosing another behvior (attack or defense). By tries we mean: how many directions it will try. Going North? Going North-West? Setting this to a low value, your fighters will look very stubborn and always try to move in one direction, neglecting the fact that they could dodge. This can lead to queues of fighters and other strange behaviors. On the other hand, setting it too high will cause fighter to always avoid the enemy, and groups of fighters will just pass each other without any fight. Matter of taste.
--respawn-delay=<value>LW6_RESPAWN_DELAYrespawn-delayType: integer
Default value: 3 Min value: 0 Max value: 30
Delay, in seconds, after which teams reappear on the battlefield, when in deathmatch mode. 0 means team right away.
--respawn-position-mode=<value>LW6_RESPAWN_POSITION_MODErespawn-position-modeType: integer
Default value: 1 Min value: 0 Max value: 2
Defines how teams are set up on the map when respawning. 0 means teams respect the pre-defined start positions. 1 means that a random position will be picked, among the existing positions. That is, red could take green's place. 2 means total randomness, teams can appear anywhere.
--respawn-team=<value>LW6_RESPAWN_TEAMrespawn-teamType: integer
Default value: 1 Min value: 0 Max value: 1
Defines what to do when a team dies. If set to 0, team disappears forever, if set to 1, team reappears automatically with fresh fighters. It's a deathmatch mode, where the winner is not the one who stays alive the longest time, since it makes no real sens in this case, but the one who has died less often than others.
--round-delta=<value>LW6_ROUND_DELTAround-deltaType: integer
Default value: 1 Min value: 0 Max value: 100
Conditions by how much the cursor potential will be incremented each time gradient is spreaded. Sounds cryptic? It is. The idea is that at each time you move your cursor of 1 pixel, theorically, you'll need in the worst case to move of 1 more pixel to reach any point on the map. Of course this is not true but this is the default asumption, and gradient spread will fix that. Only in Liquid War 6 this is not even the worst case, for you can control your cursor with the mouse and cross walls. Whenever you cross a wall, you might have done a great distance from the fighters' point of view, if the map is a maze. Thus this parameter, which corrects things, experience shows it does give acceptable results to increase the cursor potential by more than one at each turn. Toy arround with this if you find fighters take wrong paths on some given map. If in doubt, don't touch.
--rounds-per-sec=<value>LW6_ROUNDS_PER_SECrounds-per-secType: integer
Default value: 50 Min value: 1 Max value: 200
Defines the overall speed of the game. All other settings being equal, raising this value will cause the game to behave faster. Everything will be faster, except probably the display since your computer will calculate more game positions in a given time and spend more CPU time. It will also increase network traffic. Values between 10 and 50 really make sense.
--side-attack-factor=<value>LW6_SIDE_ATTACK_FACTORside-attack-factorType: integer
Default value: 20 Min value: 0 Max value: 100
Defines how hard fighters will attack sideways. It's an algorithm trick, fighters attack by default the opponent right in front, but if there's no fighter there, they will still try to attack someone else, maybe sideways. But doing this their attack is not as strong. This parameter enables you to tune this. This is a percentage.
--side-defense-factor=<value>LW6_SIDE_DEFENSE_FACTORside-defense-factorType: integer
Default value: 20 Min value: 0 Max value: 100
Defines how fast fighters will regenerate, when being side by side instead of being right in front of the other. This is a percentage.
--single-army-size=<value>LW6_SINGLE_ARMY_SIZEsingle-army-sizeType: integer
Default value: 30 Min value: 1 Max value: 95
Defines the proportion of the whole available space, which will be occupied by an army at the beginning of the game. You can either imagine playing with almost empty maps, or play very crowded with almost no space left. This is a percentage, but will be multiplied by itself to get the actual surface. That is, 50 means 50%*50%, that is, a square of 1/2 the size of a square map, so it represents 25% (1/4) of the total surface.
--spread-mode=<value>LW6_SPREAD_MODEspread-modeType: integer
Default value: 1 Min value: 0 Max value: 2
If set to 1, then gradient spread will be slower but gain in terms of homogeneity and consistency. You could consider setting this to 0 on very very big maps to save CPU cycles, else the default should work fine.
--spread-thread=<value>LW6_SPREAD_THREADspread-threadType: integer
Default value: 0 Min value: 0 Max value: 1
If set to 1, the core algorithm with fire a separate thread to spread the gradient. By default this is turned off (set to 0). Consider this as an experimental feature, the program is already rather heavily threaded, turning this on will probably not offer any significant performance gain, even on SMP systems. This might change in the future.
--spreads-per-round=<value>LW6_SPREADS_PER_ROUNDspreads-per-roundType: integer
Default value: 5 Min value: 1 Max value: 100
Defines how many times the gradient is spread per round. Gradient spread is a very Liquid War 6 specific feature, just remember that the more often you do it, the more accurately fighters will move. That is, you will be sure they really take the shortest path. Usually this does not have much effect, the default value should fit in most cases, but you might want to decrease it on very simple maps where the gradient is obvious, or increase it on complex maps where you want fighters to be real smart.
--start-blue-x=<value>LW6_START_BLUE_Xstart-blue-xType: integer
Default value: 90 Min value: 0 Max value: 100
X start position for the blue team. This is a percentage of map width, value between 0 and 100.
--start-blue-y=<value>LW6_START_BLUE_Ystart-blue-yType: integer
Default value: 10 Min value: 0 Max value: 100
Y start position for the blue team. This is a percentage of map height, value between 0 and 100.
--start-cyan-x=<value>LW6_START_CYAN_Xstart-cyan-xType: integer
Default value: 35 Min value: 0 Max value: 100
X start position for the cyan team. This is a percentage of map width, value between 0 and 100.
--start-cyan-y=<value>LW6_START_CYAN_Ystart-cyan-yType: integer
Default value: 10 Min value: 0 Max value: 100
Y start position for the cyan team. This is a percentage of map height, value between 0 and 100.
--start-green-x=<value>LW6_START_GREEN_Xstart-green-xType: integer
Default value: 90 Min value: 0 Max value: 100
X start position for the green team. This is a percentage of map width, value between 0 and 100.
--start-green-y=<value>LW6_START_GREEN_Ystart-green-yType: integer
Default value: 90 Min value: 0 Max value: 100
Y start position for the green team. This is a percentage of map height, value between 0 and 100.
--start-lightblue-x=<value>LW6_START_LIGHTBLUE_Xstart-lightblue-xType: integer
Default value: 35 Min value: 0 Max value: 100
X start position for the lightblue team. This is a percentage of map width, value between 0 and 100.
--start-lightblue-y=<value>LW6_START_LIGHTBLUE_Ystart-lightblue-yType: integer
Default value: 90 Min value: 0 Max value: 100
Y start position for the lightblue team. This is a percentage of map height, value between 0 and 100.
--start-magenta-x=<value>LW6_START_MAGENTA_Xstart-magenta-xType: integer
Default value: 65 Min value: 0 Max value: 100
X start position for the magenta team. This is a percentage of map width, value between 0 and 100.
--start-magenta-y=<value>LW6_START_MAGENTA_Ystart-magenta-yType: integer
Default value: 90 Min value: 0 Max value: 100
Y start position for the magenta team. This is a percentage of map height, value between 0 and 100.
--start-orange-x=<value>LW6_START_ORANGE_Xstart-orange-xType: integer
Default value: 65 Min value: 0 Max value: 100
X start position for the orange team. This is a percentage of map width, value between 0 and 100.
--start-orange-y=<value>LW6_START_ORANGE_Ystart-orange-yType: integer
Default value: 10 Min value: 0 Max value: 100
Y start position for the orange team. This is a percentage of map height, value between 0 and 100.
--start-pink-x=<value>LW6_START_PINK_Xstart-pink-xType: integer
Default value: 10 Min value: 0 Max value: 100
X start position for the pink team. This is a percentage of map width, value between 0 and 100.
--start-pink-y=<value>LW6_START_PINK_Ystart-pink-yType: integer
Default value: 50 Min value: 0 Max value: 100
Y start position for the pink team. This is a percentage of map height, value between 0 and 100.
--start-position-mode=<value>LW6_START_POSITION_MODEstart-position-modeType: integer
Default value: 0 Min value: 0 Max value: 2
Defines how teams are set up on the map at game startup. 0 means teams respect the pre-defined start positions. 1 means that a random position will be picked, among the existing positions. That is, red could take green's place. 2 means total randomness, teams can appear anywhere.
--start-purple-x=<value>LW6_START_PURPLE_Xstart-purple-xType: integer
Default value: 90 Min value: 0 Max value: 100
X start position for the purple team. This is a percentage of map width, value between 0 and 100.
--start-purple-y=<value>LW6_START_PURPLE_Ystart-purple-yType: integer
Default value: 50 Min value: 0 Max value: 100
Y start position for the purple team. This is a percentage of map height, value between 0 and 100.
--start-red-x=<value>LW6_START_RED_Xstart-red-xType: integer
Default value: 10 Min value: 0 Max value: 100
X start position for the red team. This is a percentage of map width, value between 0 and 100.
--start-red-y=<value>LW6_START_RED_Ystart-red-yType: integer
Default value: 10 Min value: 0 Max value: 100
Y start position for the red team. This is a percentage of map height, value between 0 and 100.
--start-yellow-x=<value>LW6_START_YELLOW_Xstart-yellow-xType: integer
Default value: 10 Min value: 0 Max value: 100
X start position for the yellow team. This is a percentage of map width, value between 0 and 100.
--start-yellow-y=<value>LW6_START_YELLOW_Ystart-yellow-yType: integer
Default value: 90 Min value: 0 Max value: 100
Y start position for the yellow team. This is a percentage of map height, value between 0 and 100.
--team-profile-blue-aggressive=<value>LW6_TEAM_PROFILE_BLUE_AGGRESSIVEteam-profile-blue-aggressiveType: integer
Default value: 150 Min value: 5 Max value: 2000
Defines how aggressive the blue team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.
--team-profile-blue-fast=<value>LW6_TEAM_PROFILE_BLUE_FASTteam-profile-blue-fastType: integer
Default value: 50 Min value: 5 Max value: 2000
Changes the speed of the blue team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.
--team-profile-blue-mobile=<value>LW6_TEAM_PROFILE_BLUE_MOBILEteam-profile-blue-mobileType: integer
Default value: 0 Min value: -3 Max value: 3
Increases (or decreases if negative) the number of move/attack/defense tries for the blue team. If set to a high value team will appear more mobile and do more things, but it won't change its cruising speed. It's not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.
--team-profile-blue-vulnerable=<value>LW6_TEAM_PROFILE_BLUE_VULNERABLEteam-profile-blue-vulnerableType: integer
Default value: 60 Min value: 5 Max value: 2000
Defines how vulnerable the blue team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.
--team-profile-blue-weapon-alternate-id=<value>LW6_TEAM_PROFILE_BLUE_WEAPON_ALTERNATE_IDteam-profile-blue-weapon-alternate-idType: integer
Default value: LW6MAP_WEAPON_CONTROL Min value: 0 Max value: 19
Id of the default alternate weapon for the blue team, see the documentation about weapons to know what these ids mean.
--team-profile-blue-weapon-id=<value>LW6_TEAM_PROFILE_BLUE_WEAPON_IDteam-profile-blue-weapon-idType: integer
Default value: LW6MAP_WEAPON_REWIND Min value: 0 Max value: 19
Id of the default weapon for the blue team, see the documentation about weapons to know what these ids mean.
--team-profile-blue-weapon-mode=<value>LW6_TEAM_PROFILE_BLUE_WEAPON_MODEteam-profile-blue-weapon-modeType: integer
Default value: 1 Min value: 0 Max value: 2
Weapon mode for blue team. 0 means there's no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.
--team-profile-cyan-aggressive=<value>LW6_TEAM_PROFILE_CYAN_AGGRESSIVEteam-profile-cyan-aggressiveType: integer
Default value: 44 Min value: 5 Max value: 2000
Defines how aggressive the cyan team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.
--team-profile-cyan-fast=<value>LW6_TEAM_PROFILE_CYAN_FASTteam-profile-cyan-fastType: integer
Default value: 40 Min value: 5 Max value: 2000
Changes the speed of the cyan team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.
--team-profile-cyan-mobile=<value>LW6_TEAM_PROFILE_CYAN_MOBILEteam-profile-cyan-mobileType: integer
Default value: 0 Min value: -3 Max value: 3
Increases (or decreases if negative) the number of move/attack/defense tries for the cyan team. If set to a high value team will appear more mobile and do more things, but it won't change its cruising speed. It's not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.
--team-profile-cyan-vulnerable=<value>LW6_TEAM_PROFILE_CYAN_VULNERABLEteam-profile-cyan-vulnerableType: integer
Default value: 12 Min value: 5 Max value: 2000
Defines how vulnerable the cyan team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.
--team-profile-cyan-weapon-alternate-id=<value>LW6_TEAM_PROFILE_CYAN_WEAPON_ALTERNATE_IDteam-profile-cyan-weapon-alternate-idType: integer
Default value: LW6MAP_WEAPON_REVERSE Min value: 0 Max value: 19
Id of the default alternate weapon for the cyan team, see the documentation about weapons to know what these ids mean.
--team-profile-cyan-weapon-id=<value>LW6_TEAM_PROFILE_CYAN_WEAPON_IDteam-profile-cyan-weapon-idType: integer
Default value: LW6MAP_WEAPON_TURBO Min value: 0 Max value: 19
Id of the default weapon for the cyan team, see the documentation about weapons to know what these ids mean.
--team-profile-cyan-weapon-mode=<value>LW6_TEAM_PROFILE_CYAN_WEAPON_MODEteam-profile-cyan-weapon-modeType: integer
Default value: 1 Min value: 0 Max value: 2
Weapon mode for cyan team. 0 means there's no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.
--team-profile-green-aggressive=<value>LW6_TEAM_PROFILE_GREEN_AGGRESSIVEteam-profile-green-aggressiveType: integer
Default value: 70 Min value: 5 Max value: 2000
Defines how aggressive the green team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.
--team-profile-green-fast=<value>LW6_TEAM_PROFILE_GREEN_FASTteam-profile-green-fastType: integer
Default value: 70 Min value: 5 Max value: 2000
Changes the speed of the green team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.
--team-profile-green-mobile=<value>LW6_TEAM_PROFILE_GREEN_MOBILEteam-profile-green-mobileType: integer
Default value: 0 Min value: -3 Max value: 3
Increases (or decreases if negative) the number of move/attack/defense tries for the green team. If set to a high value team will appear more mobile and do more things, but it won't change its cruising speed. It's not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.
--team-profile-green-vulnerable=<value>LW6_TEAM_PROFILE_GREEN_VULNERABLEteam-profile-green-vulnerableType: integer
Default value: 30 Min value: 5 Max value: 2000
Defines how vulnerable the green team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.
--team-profile-green-weapon-alternate-id=<value>LW6_TEAM_PROFILE_GREEN_WEAPON_ALTERNATE_IDteam-profile-green-weapon-alternate-idType: integer
Default value: LW6MAP_WEAPON_MIX Min value: 0 Max value: 19
Id of the default alternate weapon for the green team, see the documentation about weapons to know what these ids mean.
--team-profile-green-weapon-id=<value>LW6_TEAM_PROFILE_GREEN_WEAPON_IDteam-profile-green-weapon-idType: integer
Default value: LW6MAP_WEAPON_CRAZY Min value: 0 Max value: 19
Id of the default weapon for the green team, see the documentation about weapons to know what these ids mean.
--team-profile-green-weapon-mode=<value>LW6_TEAM_PROFILE_GREEN_WEAPON_MODEteam-profile-green-weapon-modeType: integer
Default value: 1 Min value: 0 Max value: 2
Weapon mode for green team. 0 means there's no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.
--team-profile-lightblue-aggressive=<value>LW6_TEAM_PROFILE_LIGHTBLUE_AGGRESSIVEteam-profile-lightblue-aggressiveType: integer
Default value: 200 Min value: 5 Max value: 2000
Defines how aggressive the lightblue team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.
--team-profile-lightblue-fast=<value>LW6_TEAM_PROFILE_LIGHTBLUE_FASTteam-profile-lightblue-fastType: integer
Default value: 20 Min value: 5 Max value: 2000
Changes the speed of the lightblue team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.
--team-profile-lightblue-mobile=<value>LW6_TEAM_PROFILE_LIGHTBLUE_MOBILEteam-profile-lightblue-mobileType: integer
Default value: 0 Min value: -3 Max value: 3
Increases (or decreases if negative) the number of move/attack/defense tries for the lightblue team. If set to a high value team will appear more mobile and do more things, but it won't change its cruising speed. It's not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.
--team-profile-lightblue-vulnerable=<value>LW6_TEAM_PROFILE_LIGHTBLUE_VULNERABLEteam-profile-lightblue-vulnerableType: integer
Default value: 8 Min value: 5 Max value: 2000
Defines how vulnerable the lightblue team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.
--team-profile-lightblue-weapon-alternate-id=<value>LW6_TEAM_PROFILE_LIGHTBLUE_WEAPON_ALTERNATE_IDteam-profile-lightblue-weapon-alternate-idType: integer
Default value: LW6MAP_WEAPON_KAMIKAZE Min value: 0 Max value: 19
Id of the default alternate weapon for the lightblue team, see the documentation about weapons to know what these ids mean.
--team-profile-lightblue-weapon-id=<value>LW6_TEAM_PROFILE_LIGHTBLUE_WEAPON_IDteam-profile-lightblue-weapon-idType: integer
Default value: LW6MAP_WEAPON_TELEPORT Min value: 0 Max value: 19
Id of the default weapon for the lightblue team, see the documentation about weapons to know what these ids mean.
--team-profile-lightblue-weapon-mode=<value>LW6_TEAM_PROFILE_LIGHTBLUE_WEAPON_MODEteam-profile-lightblue-weapon-modeType: integer
Default value: 1 Min value: 0 Max value: 2
Weapon mode for lightblue team. 0 means there's no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.
--team-profile-magenta-aggressive=<value>LW6_TEAM_PROFILE_MAGENTA_AGGRESSIVEteam-profile-magenta-aggressiveType: integer
Default value: 192 Min value: 5 Max value: 2000
Defines how aggressive the magenta team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.
--team-profile-magenta-fast=<value>LW6_TEAM_PROFILE_MAGENTA_FASTteam-profile-magenta-fastType: integer
Default value: 320 Min value: 5 Max value: 2000
Changes the speed of the magenta team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.
--team-profile-magenta-mobile=<value>LW6_TEAM_PROFILE_MAGENTA_MOBILEteam-profile-magenta-mobileType: integer
Default value: 0 Min value: -3 Max value: 3
Increases (or decreases if negative) the number of move/attack/defense tries for the magenta team. If set to a high value team will appear more mobile and do more things, but it won't change its cruising speed. It's not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.
--team-profile-magenta-vulnerable=<value>LW6_TEAM_PROFILE_MAGENTA_VULNERABLEteam-profile-magenta-vulnerableType: integer
Default value: 1920 Min value: 5 Max value: 2000
Defines how vulnerable the magenta team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.
--team-profile-magenta-weapon-alternate-id=<value>LW6_TEAM_PROFILE_MAGENTA_WEAPON_ALTERNATE_IDteam-profile-magenta-weapon-alternate-idType: integer
Default value: LW6MAP_WEAPON_ATTRACT Min value: 0 Max value: 19
Id of the default alternate weapon for the magenta team, see the documentation about weapons to know what these ids mean.
--team-profile-magenta-weapon-id=<value>LW6_TEAM_PROFILE_MAGENTA_WEAPON_IDteam-profile-magenta-weapon-idType: integer
Default value: LW6MAP_WEAPON_FIX Min value: 0 Max value: 19
Id of the default weapon for the magenta team, see the documentation about weapons to know what these ids mean.
--team-profile-magenta-weapon-mode=<value>LW6_TEAM_PROFILE_MAGENTA_WEAPON_MODEteam-profile-magenta-weapon-modeType: integer
Default value: 1 Min value: 0 Max value: 2
Weapon mode for magenta team. 0 means there's no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.
--team-profile-orange-aggressive=<value>LW6_TEAM_PROFILE_ORANGE_AGGRESSIVEteam-profile-orange-aggressiveType: integer
Default value: 48 Min value: 5 Max value: 2000
Defines how aggressive the orange team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.
--team-profile-orange-fast=<value>LW6_TEAM_PROFILE_ORANGE_FASTteam-profile-orange-fastType: integer
Default value: 160 Min value: 5 Max value: 2000
Changes the speed of the orange team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.
--team-profile-orange-mobile=<value>LW6_TEAM_PROFILE_ORANGE_MOBILEteam-profile-orange-mobileType: integer
Default value: 0 Min value: -3 Max value: 3
Increases (or decreases if negative) the number of move/attack/defense tries for the orange team. If set to a high value team will appear more mobile and do more things, but it won't change its cruising speed. It's not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.
--team-profile-orange-vulnerable=<value>LW6_TEAM_PROFILE_ORANGE_VULNERABLEteam-profile-orange-vulnerableType: integer
Default value: 144 Min value: 5 Max value: 2000
Defines how vulnerable the orange team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.
--team-profile-orange-weapon-alternate-id=<value>LW6_TEAM_PROFILE_ORANGE_WEAPON_ALTERNATE_IDteam-profile-orange-weapon-alternate-idType: integer
Default value: LW6MAP_WEAPON_SHRINK Min value: 0 Max value: 19
Id of the default alternate weapon for the orange team, see the documentation about weapons to know what these ids mean.
--team-profile-orange-weapon-id=<value>LW6_TEAM_PROFILE_ORANGE_WEAPON_IDteam-profile-orange-weapon-idType: integer
Default value: LW6MAP_WEAPON_BERZERK Min value: 0 Max value: 19
Id of the default weapon for the orange team, see the documentation about weapons to know what these ids mean.
--team-profile-orange-weapon-mode=<value>LW6_TEAM_PROFILE_ORANGE_WEAPON_MODEteam-profile-orange-weapon-modeType: integer
Default value: 1 Min value: 0 Max value: 2
Weapon mode for orange team. 0 means there's no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.
--team-profile-pink-aggressive=<value>LW6_TEAM_PROFILE_PINK_AGGRESSIVEteam-profile-pink-aggressiveType: integer
Default value: 640 Min value: 5 Max value: 2000
Defines how aggressive the pink team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.
--team-profile-pink-fast=<value>LW6_TEAM_PROFILE_PINK_FASTteam-profile-pink-fastType: integer
Default value: 80 Min value: 5 Max value: 2000
Changes the speed of the pink team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.
--team-profile-pink-mobile=<value>LW6_TEAM_PROFILE_PINK_MOBILEteam-profile-pink-mobileType: integer
Default value: 0 Min value: -3 Max value: 3
Increases (or decreases if negative) the number of move/attack/defense tries for the pink team. If set to a high value team will appear more mobile and do more things, but it won't change its cruising speed. It's not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.
--team-profile-pink-vulnerable=<value>LW6_TEAM_PROFILE_PINK_VULNERABLEteam-profile-pink-vulnerableType: integer
Default value: 640 Min value: 5 Max value: 2000
Defines how vulnerable the pink team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.
--team-profile-pink-weapon-alternate-id=<value>LW6_TEAM_PROFILE_PINK_WEAPON_ALTERNATE_IDteam-profile-pink-weapon-alternate-idType: integer
Default value: LW6MAP_WEAPON_PLAGUE Min value: 0 Max value: 19
Id of the default alternate weapon for the pink team, see the documentation about weapons to know what these ids mean.
--team-profile-pink-weapon-id=<value>LW6_TEAM_PROFILE_PINK_WEAPON_IDteam-profile-pink-weapon-idType: integer
Default value: LW6MAP_WEAPON_INVINCIBLE Min value: 0 Max value: 19
Id of the default weapon for the pink team, see the documentation about weapons to know what these ids mean.
--team-profile-pink-weapon-mode=<value>LW6_TEAM_PROFILE_PINK_WEAPON_MODEteam-profile-pink-weapon-modeType: integer
Default value: 1 Min value: 0 Max value: 2
Weapon mode for pink team. 0 means there's no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.
--team-profile-purple-aggressive=<value>LW6_TEAM_PROFILE_PURPLE_AGGRESSIVEteam-profile-purple-aggressiveType: integer
Default value: 32 Min value: 5 Max value: 2000
Defines how aggressive the purple team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.
--team-profile-purple-fast=<value>LW6_TEAM_PROFILE_PURPLE_FASTteam-profile-purple-fastType: integer
Default value: 80 Min value: 5 Max value: 2000
Changes the speed of the purple team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.
--team-profile-purple-mobile=<value>LW6_TEAM_PROFILE_PURPLE_MOBILEteam-profile-purple-mobileType: integer
Default value: 0 Min value: -3 Max value: 3
Increases (or decreases if negative) the number of move/attack/defense tries for the purple team. If set to a high value team will appear more mobile and do more things, but it won't change its cruising speed. It's not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.
--team-profile-purple-vulnerable=<value>LW6_TEAM_PROFILE_PURPLE_VULNERABLEteam-profile-purple-vulnerableType: integer
Default value: 16 Min value: 5 Max value: 2000
Defines how vulnerable the purple team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.
--team-profile-purple-weapon-alternate-id=<value>LW6_TEAM_PROFILE_PURPLE_WEAPON_ALTERNATE_IDteam-profile-purple-weapon-alternate-idType: integer
Default value: LW6MAP_WEAPON_DISAPPEAR Min value: 0 Max value: 19
Id of the default alternate weapon for the purple team, see the documentation about weapons to know what these ids mean.
--team-profile-purple-weapon-id=<value>LW6_TEAM_PROFILE_PURPLE_WEAPON_IDteam-profile-purple-weapon-idType: integer
Default value: LW6MAP_WEAPON_ATOMIC Min value: 0 Max value: 19
Id of the default weapon for the purple team, see the documentation about weapons to know what these ids mean.
--team-profile-purple-weapon-mode=<value>LW6_TEAM_PROFILE_PURPLE_WEAPON_MODEteam-profile-purple-weapon-modeType: integer
Default value: 1 Min value: 0 Max value: 2
Weapon mode for purple team. 0 means there's no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.
--team-profile-red-aggressive=<value>LW6_TEAM_PROFILE_RED_AGGRESSIVEteam-profile-red-aggressiveType: integer
Default value: 220 Min value: 5 Max value: 2000
Defines how aggressive the red team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.
--team-profile-red-fast=<value>LW6_TEAM_PROFILE_RED_FASTteam-profile-red-fastType: integer
Default value: 160 Min value: 5 Max value: 2000
Changes the speed of the red team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.
--team-profile-red-mobile=<value>LW6_TEAM_PROFILE_RED_MOBILEteam-profile-red-mobileType: integer
Default value: 0 Min value: -3 Max value: 3
Increases (or decreases if negative) the number of move/attack/defense tries for the red team. If set to a high value team will appear more mobile and do more things, but it won't change its cruising speed. It's not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.
--team-profile-red-vulnerable=<value>LW6_TEAM_PROFILE_RED_VULNERABLEteam-profile-red-vulnerableType: integer
Default value: 110 Min value: 5 Max value: 2000
Defines how vulnerable the red team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.
--team-profile-red-weapon-alternate-id=<value>LW6_TEAM_PROFILE_RED_WEAPON_ALTERNATE_IDteam-profile-red-weapon-alternate-idType: integer
Default value: LW6MAP_WEAPON_ESCAPE Min value: 0 Max value: 19
Id of the default alternate weapon for the red team, see the documentation about weapons to know what these ids mean.
--team-profile-red-weapon-id=<value>LW6_TEAM_PROFILE_RED_WEAPON_IDteam-profile-red-weapon-idType: integer
Default value: LW6MAP_WEAPON_STEAL Min value: 0 Max value: 19
Id of the default weapon for the red team, see the documentation about weapons to know what these ids mean.
--team-profile-red-weapon-mode=<value>LW6_TEAM_PROFILE_RED_WEAPON_MODEteam-profile-red-weapon-modeType: integer
Default value: 1 Min value: 0 Max value: 2
Weapon mode for red team. 0 means there's no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.
--team-profile-yellow-aggressive=<value>LW6_TEAM_PROFILE_YELLOW_AGGRESSIVEteam-profile-yellow-aggressiveType: integer
Default value: 200 Min value: 5 Max value: 2000
Defines how aggressive the yellow team is. This is a percentage, if set to 200 then team will attack twice as much as any other team with the default value. Setting this to a high value clearly advantages this team.
--team-profile-yellow-fast=<value>LW6_TEAM_PROFILE_YELLOW_FASTteam-profile-yellow-fastType: integer
Default value: 70 Min value: 5 Max value: 2000
Changes the speed of the yellow team. This is a percentage, if set to 50, then team will move twice slower than other teams with the default parameter. Setting this high is very likely to advantage the team.
--team-profile-yellow-mobile=<value>LW6_TEAM_PROFILE_YELLOW_MOBILEteam-profile-yellow-mobileType: integer
Default value: 0 Min value: -3 Max value: 3
Increases (or decreases if negative) the number of move/attack/defense tries for the yellow team. If set to a high value team will appear more mobile and do more things, but it won't change its cruising speed. It's not obvious to tell wether this is an advantage or not, but it clearly changes the behavior.
--team-profile-yellow-vulnerable=<value>LW6_TEAM_PROFILE_YELLOW_VULNERABLEteam-profile-yellow-vulnerableType: integer
Default value: 90 Min value: 5 Max value: 2000
Defines how vulnerable the yellow team is. This is a percentage, if set to 200 then team will be attacked twice as much as any other team with the default value. Setting this to a high value clearly disadvantages this team.
--team-profile-yellow-weapon-alternate-id=<value>LW6_TEAM_PROFILE_YELLOW_WEAPON_ALTERNATE_IDteam-profile-yellow-weapon-alternate-idType: integer
Default value: LW6MAP_WEAPON_PERMUTATION Min value: 0 Max value: 19
Id of the default alternate weapon for the yellow team, see the documentation about weapons to know what these ids mean.
--team-profile-yellow-weapon-id=<value>LW6_TEAM_PROFILE_YELLOW_WEAPON_IDteam-profile-yellow-weapon-idType: integer
Default value: LW6MAP_WEAPON_SCATTER Min value: 0 Max value: 19
Id of the default weapon for the yellow team, see the documentation about weapons to know what these ids mean.
--team-profile-yellow-weapon-mode=<value>LW6_TEAM_PROFILE_YELLOW_WEAPON_MODEteam-profile-yellow-weapon-modeType: integer
Default value: 1 Min value: 0 Max value: 2
Weapon mode for yellow team. 0 means there's no weapon, 1 means one weapon per team, defined by the weapon-id parameter, 2 means random weapon.
--total-armies-size=<value>LW6_TOTAL_ARMIES_SIZEtotal-armies-sizeType: integer
Default value: 60 Min value: 1 Max value: 95
Defines the proportion of the whole available space, which can be occupied by all the armies present together. Setting this low, whenever a new team arrives on the map, fighters might be stolen to other teams, otherwise the ame would get too crowded. This allows you to play with reasonnably enough fighters with 2 players, while still allowing interesting gameplay with many players. This is a percentage, but will be multiplied by itself to get the actual surface. That is, 50 means 50%*50%, that is, a square of 1/2 the size of a square map, so it represents 25% (1/4) of the total surface.
--total-time=<value>LW6_TOTAL_TIMEtotal-timeType: integer
Default value: 900 Min value: 10 Max value: 864000
Defines the maximum time of the game, in seconds. Note that in some cases, the game can end much earlier if some player has managed to win before the bell rings. Also, technically, this value will be translated into rounds and moves, and the game engine will wait until enough rounds and moves have been played. So if the computer is too slow and the desired speed is not reached, then the game will last for a longer time.
--use-team-profiles=<value>LW6_USE_TEAM_PROFILESuse-team-profilesType: integer
Default value: 1 Min value: 0 Max value: 1
If set, then all the team-profile-... values will be taken in account. This enables a mode in which teams behave differently according to their colors. If you disable this, then all teams will behave the same, which is more fair, but might not be as fun.
--vertical-move=<value>LW6_VERTICAL_MOVEvertical-moveType: integer
Default value: 1 Min value: 0 Max value: 7
Defines when to process a vertical move (along the Z 'depth' axis). If set to 0, fighters never spontaneously move along this axis. If set to 1, it will be tried just after the first move failed. If set to 2, it will be tried just after the second move failed. And so on.
--weapon-charge-delay=<value>LW6_WEAPON_CHARGE_DELAYweapon-charge-delayType: integer
Default value: 30 Min value: 1 Max value: 600
How long it will take for weapons to charge and be usable, by default. Unit is seconds.
--weapon-charge-max=<value>LW6_WEAPON_CHARGE_MAXweapon-charge-maxType: integer
Default value: 200 Min value: 100 Max value: 1000
Maximum (percentage) of charge intensity that one have. For instance, if this is 400, then if you wait four times more than required before firing, then you weapon will have four times its default power, but if you wait five times more it will still be four times more powerfull, it's just the limit after which it's useless to charge.
--weapon-duration=<value>LW6_WEAPON_DURATIONweapon-durationType: integer
Default value: 3 Min value: 1 Max value: 60
How long all weapons (for which duration makes sense) will last. Unit is seconds.
--weapon-tune-berzerk-power=<value>LW6_WEAPON_TUNE_BERZERK_POWERweapon-tune-berzerk-powerType: integer
Default value: 3 Min value: 1 Max value: 100
Use to specifiy how strong berzerk mode is, if set to 3, then attacks will be 3 times as efficient in berzerk mode.
--weapon-tune-turbo-power=<value>LW6_WEAPON_TUNE_TURBO_POWERweapon-tune-turbo-powerType: integer
Default value: 3 Min value: 1 Max value: 10
Defines how fast fighters move in turbo mode, if set to 3, then fighters move and act 3 times as fast.
--x-polarity=<value>LW6_X_POLARITYx-polarityType: integer
Default value: 0 Min value: -1 Max value: 1
Defines how the map will be wrapped on the X (horizontal) axis. If set to 0, nothing is wrapped. If set to 1, the right and left borders are connected, any fighter can disappear on the right border and reappear on the left border, for instance. If set to -1, it will be wrapped but also inversed, that is on a 320x240 map, a fighter disappearing on the left border at position (0,60) will reapper on the right border at position (319,180). You can combine it with 'y-polarity'.
--y-polarity=<value>LW6_Y_POLARITYy-polarityType: integer
Default value: 0 Min value: -1 Max value: 1
Defines how the map will be wrapped on the Y (vertical) axis. If set to 0, nothing is wrapped. If set to 1, the top and bottom borders are connected, any fighter can disappear on the top border and reappear on the bottom border, for instance. If set to -1, it will be wrapped but also inversed, that is on a 320x240 map, a fighter disappearing on the bottom border at position (40,239) will reapper on the top border at position (280,0). You can combine it with 'x-polarity'.
--z-polarity=<value>LW6_Z_POLARITYz-polarityType: integer
Default value: 0 Min value: 0 Max value: 1
Defines how the map will be wrapped on the Z (deep) axis. If set to 0, nothing is wrapped. If set to 1, when using a 4 layer map, for instance, fighters on layer 1 will be able to go directly to layer 4 even if layers 2 and 3 are filled with walls. A value of -1 is forbidden, this is not like x and y axis, it does not really make sense. Consider this an advanced setting which might save a layer in some tricky cases, the default value of 0 should fit in most cases.
--background-color-auto=<value>LW6_BACKGROUND_COLOR_AUTObackground-color-autoType: boolean
Default value: true
Defines wether hud colors will be set automatically from base and alternate colors. This is a time saver to keep map designers from requiring to redefined every single color in the game. You only need to set color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg. Then hud_color_frame_bg, hud_color_frame_fg, hud_color_text_bg and hud_color_text_fg will be automatically set.
--downsize-using-bench-value=<value>LW6_DOWNSIZE_USING_BENCH_VALUEdownsize-using-bench-valueType: boolean
Default value: true
If set, then the game will automatically downsize a map according to the 'bench-value' parameter. Downsizing means: a 1600x1200 maps becomes 200x150, for instance. Downsizing causes fighters to be bigger because map resolution is lower. This will avoid running the game on a too big map, with your computer not being able to handle it at the required speed.
--downsize-using-fighter-scale=<value>LW6_DOWNSIZE_USING_FIGHTER_SCALEdownsize-using-fighter-scaleType: boolean
Default value: false
If set, then the game will automatically downsize a map according to the 'fighter-scale' parameter. Downsizing means: a 1600x1200 maps becomes 200x150, for instance. Downsizing causes fighters to be bigger because map resolution is lower. This can be usefull if you don't want fighters to be too small.
--fighter-scale=<value>LW6_FIGHTER_SCALEfighter-scaleType: float
Default value: 1.0
Defines how wide (in pixels) fighters must be. This parameter is very important and will largely condition the number of fighters on the map. It is used when loading the map. If it is, for instance, set to 1, there will be exactly a fighter per pixel on the screen. That is, if you play 640x480 on an empty map, the maximum fighters you could have is about 300000. The idea is that by changing the resolution, you also define the density of the map. In pratice, this is done in the hope that someone with a slow computer will pick up a low resolution and therefore play small levels. Conversely, someone with a brand new computer with powerfull CPU & GPU will use great resolutions and be happy with many fighters on the map. Still, changing the resolution after loading the map will not affet the number of fighters. Same for network games, the first player, who loads the map, defines its properties according to its own settings.
--guess-colors=<value>LW6_GUESS_COLORSguess-colorsType: boolean
Default value: true
Defines wether colors should be set automatically from texture colors. If set to true, then the program will try to pick up colors automatically from the texture, and will override the values of the color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg parameters. How these colors are picked up can't be garanteed, so if the map does not have strong contrast or if there can be any form of ambiguity, it's safe to set this to false and define one's own colors.
--guess-moves-per-sec=<value>LW6_GUESS_MOVES_PER_SECguess-moves-per-secType: boolean
Default value: true
If set, then loader will use 'time-to-cross-level' to guess the game speed parameters.
--hud-color-auto=<value>LW6_HUD_COLOR_AUTOhud-color-autoType: boolean
Default value: true
Defines wether hud colors will be set automatically from base and alternate colors. This is a time saver to keep map designers from requiring to redefined every single color in the game. You only need to set color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg. Then hud_color_frame_bg, hud_color_frame_fg, hud_color_text_bg and hud_color_text_fg will be automatically set.
--max-map-height=<value>LW6_MAX_MAP_HEIGHTmax-map-heightType: integer
Default value: 1000
Allows you to give a maximum map height. When designing a map you might wonder: this is dumb I'm conceiving this map I know its height, why should I limit it? Now think of the play who plays on a old slowish computer with a tiny screen. He might redefine this himself, and does not necessarly wishes to fire Gimp to rescale the map.
--max-map-surface=<value>LW6_MAX_MAP_SURFACEmax-map-surfaceType: integer
Default value: 1000000
Allows you to give a maximum map surface. Map surface is simply (width * height). This parameter is just here to save you the hassle of defining both 'max-map-width' and 'max-map-height' in a consistent manner.
--max-map-width=<value>LW6_MAX_MAP_WIDTHmax-map-widthType: integer
Default value: 1500
Allows you to give a maximum map width. When designing a map you might wonder: this is dumb I'm conceiving this map I know its width, why should I limit it? Now think of the play who plays on a old slowish computer with a tiny screen. He might redefine this himself, and does not necessarly wishes to fire Gimp to rescale the map.
--menu-color-auto=<value>LW6_MENU_COLOR_AUTOmenu-color-autoType: boolean
Default value: true
Defines wether menu colors will be set automatically from base and alternate colors. This is a time saver to keep map designers from requiring to redefined every single color in the game. You only need to set color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg. Then menu_color_default_bg, menu_color_default_fg, menu_color_selected_bg, menu_color_selected_fg, menu_color_disabled_bg and menu_color_disabled_fg will be automatically set.
--min-map-height=<value>LW6_MIN_MAP_HEIGHTmin-map-heightType: integer
Default value: 30
Allows you to give a minimum map height. When designing a map you might wonder: this is dumb I'm conceiving this map I know its height, why should I limit it? Now think of the player who decided to play with highly-defined maps because he has a super calculator and a hudge screen. He might redefine this himself, and does not necessarly wishes to fire Gimp to rescale the map.
--min-map-surface=<value>LW6_MIN_MAP_SURFACEmin-map-surfaceType: integer
Default value: 3600
Allows you to give a minimum map surface. Map surface is simply (width * height). This parameter is just here to save you the hassle of defining both 'min-map-width' and 'min-map-height' in a consistent manner.
--min-map-width=<value>LW6_MIN_MAP_WIDTHmin-map-widthType: integer
Default value: 40
Allows you to give a minimum map width. When designing a map you might wonder: this is dumb I'm conceiving this map I know its width, why should I limit it? Now think of the player who decided to play with highly-defined maps because he has a super calculator and a hudge screen. He might redefine this himself, and does not necessarly wishes to fire Gimp to rescale the map.
--resample=<value>LW6_RESAMPLEresampleType: boolean
Default value: true
If set to true, maps will always be resampled to a size which depends on your screen resolution, zoom factor, and the rest. If false, maps will be set at the exact resolution of map.png.
--speed=<value>LW6_SPEEDspeedType: float
Default value: 1.0
This parameter is the main parameter on which game speed depends. The map loader will garantee, by downscaling the map, that to cross the level (by crossing the level we mean, for instance, going from top-left corner to bottom-right corner in a straight line) a fighter will take a constant amount of time. Under the hood, the loader might of course rescale the map but it will also change game speed so that, at the end, fighters take a constant time to cross the level. This is, indeed, the most important thing, players do not care much if internally there are X or Y moves per second, the global game experience depends on how fast fighter movement looks on the screen. The default settings corresponds roughly to one second to cross the level. If you set this to 2.0, it will go twice faster.
--system-color-auto=<value>LW6_SYSTEM_COLOR_AUTOsystem-color-autoType: boolean
Default value: true
Defines wether system colors will be set automatically from base and alternate colors. This is a time saver to keep map designers from requiring to redefined every single color in the game. You only need to set color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg. Then system_color_bg and system_color_fg will be automatically set.
--upsize-using-bench-value=<value>LW6_UPSIZE_USING_BENCH_VALUEupsize-using-bench-valueType: boolean
Default value: false
If set, then the game will automatically upsize a map according to the 'fighter-scale' parameter. Upsizing means: a 160x120 maps becomes 400x300, for instance. Upsizing causes fighters to be smaller because map resolution is higher. This will avoid useless pixelish 'jumbo fighters' look when your computer is powerfull enough to do better.
--upsize-using-fighter-scale=<value>LW6_UPSIZE_USING_FIGHTER_SCALEupsize-using-fighter-scaleType: boolean
Default value: true
If set, then the game will automatically upsize a map according to the 'fighter-scale' parameter. Upsizing means: a 160x120 maps becomes 400x300, for instance. Upsizing causes fighters to be smaller because map resolution is higher. This can be usefull if you don't want fighters to be too big.
--view-color-auto=<value>LW6_VIEW_COLOR_AUTOview-color-autoType: boolean
Default value: true
Defines wether view colors will be set automatically from base and alternate colors. This is a time saver to keep map designers from requiring to redefined every single color in the game. You only need to set color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg. Then view_color_cursor_bg, view_color_cursor_fg, view_color_map_bg and view_color_map_fg will be automatically set.
--wall-grease=<value>LW6_WALL_GREASEwall-greaseType: integer
Default value: 0 Min value: -5 Max value: 5
This parameter allows you to make walls (AKA map foreground) thicker, or thiner, when map is loaded. Indeed, when map are resampled, and especially when they are downscaled, some walls may disappear, or some passages may be blocked. The loader can't automatically figure out wether it's more important to keep an existing wall or to keep an open passage for fighters. This parameter helps doing so, if you set it to a low value, level will be less greasy, and many passages might open themselves. On the contrary, if grease is at a high level, then a thin line of almost isolated pixels might become a thick wall. There's no real garantee your wall or passage will always be present, but it's a same bet to assume on a 'tunnel-like' level one needs to set grease to a low value, and on a 'wide open' level with few walls one needs to set grease to a high value.
--animation-density=<value>LW6_ANIMATION_DENSITYanimation-densityType: float
Default value: 1.0f Min value: 0 Max value: 10
Density of the background animation, that is, for instance, if the background animation is about displaying bubbles, using a high value will display many bubbles. A value of 1.0 corresponds to the default setting.
--animation-speed=<value>LW6_ANIMATION_SPEEDanimation-speedType: float
Default value: 1.0f Min value: 0 Max value: 10
Speed of the background animation, that is, for instance, if the background animation is about displaying bubbles, using a high value will cause bubbles to move very fast. A value of 1.0 corresponds to the default setting.
--background-color-root-bg=<value>LW6_BACKGROUND_COLOR_ROOT_BGbackground-color-root-bgType: color
Default value: #000
Defines the main background color. This is, for instance, the color which will be used to clear the screen before drawing thing. Will be automatically guessed from the map texture if color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--background-color-root-fg=<value>LW6_BACKGROUND_COLOR_ROOT_FGbackground-color-root-fgType: color
Default value: #ccc
Defines a color which will be used together with color-base-bg to compose the background. It can be wise to have a minimum contrast between this color and color-base-bg, but it is not mandatory, especially if other colors are manually redefined. Will be automatically guessed from the map texture if color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--background-color-stuff-bg=<value>LW6_BACKGROUND_COLOR_STUFF_BGbackground-color-stuff-bgType: color
Default value: #333
Defines a color which will be used together with color-alternate-fg to draw things (animations, sprites, text, whatever) in the background. It should be different enough from color-alternate-fg so that one can really distinguish these colors. Will be automatically guessed from the map texture if color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--background-color-stuff-fg=<value>LW6_BACKGROUND_COLOR_STUFF_FGbackground-color-stuff-fgType: color
Default value: #fff
Defines a color which will be used to draw things (animations, sprites, text, whatever) in the background. It should be different enough from color-alternate-bg so that one can really distinguish these colors. Think of this as the sprite, the text, the whatever-needs-to-be-seen-uses-this color. Will be automatically guessed from the map texture if color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--background-style=<value>LW6_BACKGROUND_STYLEbackground-styleType: string
Default value: bubbles
The background defines, of course, what is displayed at the background, but it also conditions the colors used for other items, such as the menus for instance. The possible values are 'void' and 'bubbles'.
--blink-cursor=<value>LW6_BLINK_CURSORblink-cursorType: boolean
Default value: false
If set, then cursor will blink, allowing you to see what's under the cursor. It's just a matter of taste, you might to always have your cursor displayed, or prefer to have it disappear from time to time so that you can see the action below
--color-alternate-bg=<value>LW6_COLOR_ALTERNATE_BGcolor-alternate-bgType: color
Default value: #333
Defines the alternate color, more precisely, its bg (background) part. Colors are always defined by a bg/fg pair. Most colors in the game can be deduced from this one, usually to color a map you only need to define color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg.
--color-alternate-fg=<value>LW6_COLOR_ALTERNATE_FGcolor-alternate-fgType: color
Default value: #fff
Defines the alternate color, more precisely, its fg (foreground) part. Colors are always defined by a bg/fg pair. Most colors in the game can be deduced from this one, usually to color a map you only need to define color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg.
--color-base-bg=<value>LW6_COLOR_BASE_BGcolor-base-bgType: color
Default value: #000
Defines the base color, more precisely, its bg (background) part. Colors are always defined by a bg/fg pair. Most colors in the game can be deduced from this one, usually to color a map you only need to define color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg.
--color-base-fg=<value>LW6_COLOR_BASE_FGcolor-base-fgType: color
Default value: #ccc
Defines the base color, more precisely, its fg (foreground) part. Colors are always defined by a bg/fg pair. Most colors in the game can be deduced from this one, usually to color a map you only need to define color-base-bg, color-base-fg, color-alternate-bg and color-alternate-fg.
--colorize=<value>LW6_COLORIZEcolorizeType: boolean
Default value: true
If set, then all background drawings including textures will use the background colors. This means, for instance, that if background colors are set automatically by color-auto from the map texture, then the background will adopt the same range of colors than the map itself. In short, the background will mimic the map.
--colorize-cursor=<value>LW6_COLORIZE_CURSORcolorize-cursorType: boolean
Default value: true
If set, then all cursors will use the automatic guessed colors, or the specified colors, but basically they won't be displayed using their native colors. This can be usefull for you can wish to use a generic non-colored texture for your cursor and let it be colorized automatically so that it's accorded to the level.
--cursor-size=<value>LW6_CURSOR_SIZEcursor-sizeType: float
Default value: 1.0f Min value: 0 Max value: 10
Size of the cursors on the map. 1 is the default, setting it to a higher value will make cursors bigger, a lower value will make them smaller.
--hidden-layer-alpha=<value>LW6_HIDDEN_LAYER_ALPHAhidden-layer-alphaType: float
Default value: 0.1f Min value: 0 Max value: 1
Whenever players are supposed to be hidden behind a wall, for instance if they are in layer 2 and layer 1 is filled with walls, it's still possible to see them, but with a low alpha value (almost transparent). This parameter allows you to trick this value, 0 will make these players absolutely invisible, 1 will make them totally opaque, like if they were on layer 1.
--hud-color-frame-bg=<value>LW6_HUD_COLOR_FRAME_BGhud-color-frame-bgType: color
Default value: #000
Defines the background color for the hud frame. Ignored if hud-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--hud-color-frame-fg=<value>LW6_HUD_COLOR_FRAME_FGhud-color-frame-fgType: color
Default value: #ccc
Defines the foreground color for the hud frame. Ignored if hud-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--hud-color-text-bg=<value>LW6_HUD_COLOR_TEXT_BGhud-color-text-bgType: color
Default value: #333
Defines the background color for hud text. Ignored if hud-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--hud-color-text-fg=<value>LW6_HUD_COLOR_TEXT_FGhud-color-text-fgType: color
Default value: #fff
Defines the foreground color for hud text. Ignored if hud-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--hud-style=<value>LW6_HUD_STYLEhud-styleType: string
Default value: floating
The hud is where informations about the game are displayed. This means, who is winning, are other status-like informations. Possible values include 'floating' and 'tactical'.
--keep-ratio=<value>LW6_KEEP_RATIOkeep-ratioType: boolean
Default value: true
Defines wether the map should keep its ratio, or if it should be stretched to fill the shape of your screen.
--menu-color-default-bg=<value>LW6_MENU_COLOR_DEFAULT_BGmenu-color-default-bgType: color
Default value: #333
Defines the default background color for menus. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--menu-color-default-fg=<value>LW6_MENU_COLOR_DEFAULT_FGmenu-color-default-fgType: color
Default value: #fff
Defines the default foreground color for menus. In fact, this is the main color for menu text, the color used to draw letters in menus. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--menu-color-disabled-bg=<value>LW6_MENU_COLOR_DISABLED_BGmenu-color-disabled-bgType: color
Default value: #000
Defines the background color for a disabled menu item. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--menu-color-disabled-fg=<value>LW6_MENU_COLOR_DISABLED_FGmenu-color-disabled-fgType: color
Default value: #ccc
Defines the foreground color for a disabled menu item. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--menu-color-selected-bg=<value>LW6_MENU_COLOR_SELECTED_BGmenu-color-selected-bgType: color
Default value: #fff
Defines the background color for a selected menu item. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--menu-color-selected-fg=<value>LW6_MENU_COLOR_SELECTED_FGmenu-color-selected-fgType: color
Default value: #333
Defines the foreground color for a selected menu item. Ignored if menu-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--menu-style=<value>LW6_MENU_STYLEmenu-styleType: string
Default value: cylinder
The menu style is simply the name of the engine used to power the menu system. The only possible value, for now, is 'cylinder'.
--music-exclude=<value>LW6_MUSIC_EXCLUDEmusic-excludeType: string
Default value: Chadburn
If this string is found in a music file name, it will be excluded from the list when playing in random mode.
--music-file=<value>LW6_MUSIC_FILEmusic-fileType: string
Default value:
Allows you to play a custom music file (typically your own ogg music) and override default game music. If file does not exist, game will use its internal music. The file will be searched for in the current 'music-path' but also in the current map directory. No absolute or even relative path are allowed, only a plain filename with no slash or backslash. Avoid special characters at all cost.
--music-filter=<value>LW6_MUSIC_FILTERmusic-filterType: string
Default value:
A music filter, used when files are played randomly. This is not a complex regex-enabled filter, just a plain string search. Even the '*' wildcard won't work. If you want precise control on what music file to play, please consider reorganizing your files and/or use the 'music-file' parameter.
--pixelize=<value>LW6_PIXELIZEpixelizeType: boolean
Default value: false
Depending on the renderer capabilities, will try to pixelize some parts of the game. This can be used to emulate the old LW5 appearance.
--system-color-bg=<value>LW6_SYSTEM_COLOR_BGsystem-color-bgType: color
Default value: #333
Defines the system background color, used when displaying system info, such as the number of frames per second. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--system-color-fg=<value>LW6_SYSTEM_COLOR_FGsystem-color-fgType: color
Default value: #fff
Defines the system foreground color, used when displaying system info, such as the number of frames per second. This will typically be text color. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--team-color-blue=<value>LW6_TEAM_COLOR_BLUEteam-color-blueType: color
Default value: #00f
Defines the color for the blue team. Syntax is HTML-like, #RGB or #RRGGBB.
--team-color-cyan=<value>LW6_TEAM_COLOR_CYANteam-color-cyanType: color
Default value: #0ff
Defines the color for the cyan team. Syntax is HTML-like, #RGB or #RRGGBB.
--team-color-dead=<value>LW6_TEAM_COLOR_DEADteam-color-deadType: color
Default value: #000
Defines the color for the teams when they are dead. By default it is black, this means when a team is weak it becomes black. Syntax is HTML-like, #RGB or #RRGGBB.
--team-color-green=<value>LW6_TEAM_COLOR_GREENteam-color-greenType: color
Default value: #0f0
Defines the color for the green team. Syntax is HTML-like, #RGB or #RRGGBB.
--team-color-lightblue=<value>LW6_TEAM_COLOR_LIGHTBLUEteam-color-lightblueType: color
Default value: #8bf
Defines the color for the light blue team. Syntax is HTML-like, #RGB or #RRGGBB.
--team-color-magenta=<value>LW6_TEAM_COLOR_MAGENTAteam-color-magentaType: color
Default value: #f0f
Defines the color for the magenta team. Syntax is HTML-like, #RGB or #RRGGBB.
--team-color-orange=<value>LW6_TEAM_COLOR_ORANGEteam-color-orangeType: color
Default value: #f80
Defines the color for the orange team. Syntax is HTML-like, #RGB or #RRGGBB.
--team-color-pink=<value>LW6_TEAM_COLOR_PINKteam-color-pinkType: color
Default value: #f8b
Defines the color for the pink team. Syntax is HTML-like, #RGB or #RRGGBB.
--team-color-purple=<value>LW6_TEAM_COLOR_PURPLEteam-color-purpleType: color
Default value: #b8f
Defines the color for the purple team. Syntax is HTML-like, #RGB or #RRGGBB.
--team-color-red=<value>LW6_TEAM_COLOR_REDteam-color-redType: color
Default value: #f00
Defines the color for the red team. Syntax is HTML-like, #RGB or #RRGGBB.
--team-color-yellow=<value>LW6_TEAM_COLOR_YELLOWteam-color-yellowType: color
Default value: #ff0
Defines the color for the yellow team. Syntax is HTML-like, #RGB or #RRGGBB.
--view-color-cursor-bg=<value>LW6_VIEW_COLOR_CURSOR_BGview-color-cursor-bgType: color
Default value: #333
Defines the background cursor color. Will typically be used to draw the shape of the cursor. Ignored if view-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--view-color-cursor-fg=<value>LW6_VIEW_COLOR_CURSOR_FGview-color-cursor-fgType: color
Default value: #fff
Defines the foreground cursor color. Will typically be used to draw text in the cursor. Ignored if view-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--view-color-map-bg=<value>LW6_VIEW_COLOR_MAP_BGview-color-map-bgType: color
Default value: #000
Defines the background map color. If there's no map texture defined or if use-texture is false, this is the color of the places where armies will go. Ignored if view-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--view-color-map-fg=<value>LW6_VIEW_COLOR_MAP_FGview-color-map-fgType: color
Default value: #ccc
Defines the foreground map color. If there's no map texture defined or if use-texture is false, this is the color of walls, what armies can't go through. Ignored if view-color-auto is set. Can be #RGB, #RGBA, #RRGGBB or #RRGGBBAA.
--view-style=<value>LW6_VIEW_STYLEview-styleType: string
Default value: flat
The view style conditions which renderer is used for the map, the area where fighters are displayed. This is not the graphics backend. Indeed, the graphics backend defines which technical tool one uses (which library) one runs, wether this parameter says what kind of rendering one wants.
--waves=<value>LW6_WAVESwavesType: boolean
Default value: true
Activates the wave effect, that's to say level appears to be under water when playing.
--x-wrap=<value>LW6_X_WRAPx-wrapType: boolean
Default value: true
Defines wether the map should be wrapped on the x axis. This is the companion of 'x-polarity', if no polarity is defined, map can't be wrapped, but in some cases, one might wish to have a map with polarity but without wrapping if, for instance, textures do not tile nicely.
--y-wrap=<value>LW6_Y_WRAPy-wrapType: boolean
Default value: true
Defines wether the map should be wrapped on the y axis. This is the companion of 'y-polarity', if no polarity is defined, map can't be wrapped, but in some cases, one might wish to have a map with polarity but without wrapping if, for instance, textures do not tile nicely.
--zoom=<value>LW6_ZOOMzoomType: float
Default value: 1.0f
Defines the map zoom. If lower than 1.0, map will occupy only a fraction of the screen, if greater than 1.0, some areas will be outside the screen, and the player will need to scroll through it.
--zoom-max=<value>LW6_ZOOM_MAXzoom-maxType: float
Default value: 30.0f
Defines the max map zoom. If set to a high value, you'll be able to dynamically view the map with hudge fighters, seeing only a fraction of the level.
--zoom-min=<value>LW6_ZOOM_MINzoom-minType: float
Default value: 0.3f
Defines the min map zoom. If set to a low value, you'll be able to dynamically view a very small, reduced map.
--bot-iq=<value>LW6_BOT_IQbot-iqType: integer
Default value: 100 Min value: 0 Max value: 200
The IQ (intelligence quotient) of bots. Typically, a value of 100 will make the bot behave normally, performing at its best. A value of 0 will just make it act the worst way it can. Values over 100 probably won't change anything compared to 100, but this truely depends on which bot backend you're running.
--bot-speed=<value>LW6_BOT_SPEEDbot-speedType: float
Default value: 1.0f
The speed of bots, 1 means normal speed, higher value will speed it up, lower will slow it down. Note that this only has an impact on bot engines, not on the game speed itself.
--bot1-ai=<value>LW6_BOT1_AIbot1-aiType: string
Default value: idiot
AI engine for bot number 1.
--bot1-color=<value>LW6_BOT1_COLORbot1-colorType: string
Default value: green
Color for bot number 1.
--bot2-ai=<value>LW6_BOT2_AIbot2-aiType: string
Default value: idiot
AI engine for bot number 2.
--bot2-color=<value>LW6_BOT2_COLORbot2-colorType: string
Default value: blue
Color for bot number 2.
--bot3-ai=<value>LW6_BOT3_AIbot3-aiType: string
Default value: random
AI engine for bot number 3.
--bot3-color=<value>LW6_BOT3_COLORbot3-colorType: string
Default value: yellow
Color for bot number 3.
--bot4-ai=<value>LW6_BOT4_AIbot4-aiType: string
Default value: follow
AI engine for bot number 4.
--bot4-color=<value>LW6_BOT4_COLORbot4-colorType: string
Default value: cyan
Color for bot number 4.
--bot5-ai=<value>LW6_BOT5_AIbot5-aiType: string
Default value: random
AI engine for bot number 5.
--bot5-color=<value>LW6_BOT5_COLORbot5-colorType: string
Default value: magenta
Color for bot number 5.
--bot6-ai=<value>LW6_BOT6_AIbot6-aiType: string
Default value: follow
AI engine for bot number 6.
--bot6-color=<value>LW6_BOT6_COLORbot6-colorType: string
Default value: orange
Color for bot number 6.
--bot7-ai=<value>LW6_BOT7_AIbot7-aiType: string
Default value: idiot
AI engine for bot number 7.
--bot7-color=<value>LW6_BOT7_COLORbot7-colorType: string
Default value: lightblue
Color for bot number 7.
--bot8-ai=<value>LW6_BOT8_AIbot8-aiType: string
Default value: idiot
AI engine for bot number 8.
--bot8-color=<value>LW6_BOT8_COLORbot8-colorType: string
Default value: purple
Color for bot number 8.
--bot9-ai=<value>LW6_BOT9_AIbot9-aiType: string
Default value: idiot
AI engine for bot number 9.
--bot9-color=<value>LW6_BOT9_COLORbot9-colorType: string
Default value: pink
Color for bot number 9.
--nb-bots=<value>LW6_NB_BOTSnb-botsType: integer
Default value: 2 Min value: 0 Max value: 9
Number of bots on the map. 0 means no bots, if set to 1 the the bot1-... settings will be used, if set to 2 then bot1-... and bot2-... will be used, and so on.
--player1-color=<value>LW6_PLAYER1_COLORplayer1-colorType: string
Default value: red
Color of the first player, must be red, green, blue, yellow, cyan, magenta, orange, lightblue, purple or pink
--player2-color=<value>LW6_PLAYER2_COLORplayer2-colorType: string
Default value: green
Color of the second player, must be red, green, blue, yellow, cyan, magenta, orange, lightblue, purple or pink
--player3-color=<value>LW6_PLAYER3_COLORplayer3-colorType: string
Default value: blue
Color of the third player, must be red, green, blue, yellow, cyan, magenta, orange, lightblue, purple or pink
--player4-color=<value>LW6_PLAYER4_COLORplayer4-colorType: string
Default value: yellow
Color of the fourth player, must be red, green, blue, yellow, cyan, magenta, orange, lightblue, purple or pink
--base64-decodeIf specified, program will take stdin and base64 decode it to stdout. This is for testing purpose (for network messages for instance). Will decode in standard base64 encoding using characters + and / but also the url-compliant version using - and /, see RFC 4648 for details.
--base64-encodeIf specified, program will take stdin and base64 encode it to stdout. This is for testing purpose (for network messages for instance). Will *not* use standard base64 encoding using characters + and / but - and _ instead to be url-compliant, see RFC 4648 for details.
--benchRuns a benchmarking test which will report an approximative performance estimation of the game on your computer.
--bench-value=<value>LW6_BENCH_VALUEbench-valueType: integer
Default value: 20
Contains the current bench value of the computer running the game. This is used internally to choose the right map settings. You can override this value and use your own but... use at your own risk. Pretending you have a faster computer than what you really have can lead to confusion.
--bin-id=<value>LW6_BIN_IDbin-idType: integer
Default value: 0
The internal 'bin-id' value. Note that this is not necessarly equal to the value returned by 'show-build-bin-id'. When they are different, it is assumed this is because of a software upgrade.
--checkRunning the game with '–check' is almost like running '–test', the difference is that '–check' will not run tests which involve graphics or sound backends, so it's adapted to pure console mode. This can be usefull for automated checks on a build farm, or if you want to check things in a headless (pure console) environment.
--commands-per-sec=<value>LW6_COMMANDS_PER_SECcommands-per-secType: integer
Default value: 10
Defines the number of commands per second. When a command is generated, orders are actually sent to the game engine, for instance, 'this cursor moved there'. So this option will affect game responsiveness, setting this to a high value will make the game more responsive but consume bandwidth on network games.
--daemonStart the game in daemon mode, this is typically used with the server mode, if you want the process to be detached from the console and executed in the background.
--debug-layer-id=<value>LW6_DEBUG_LAYER_IDdebug-layer-idType: integer
Default value: 0 Min value: 0 Max value: 6
A team id which will be used for debugging purposes, for instance when displaying gradient.
--debug-team-id=<value>LW6_DEBUG_TEAM_IDdebug-team-idType: integer
Default value: 0 Min value: 0 Max value: 9
A team id which will be used for debugging purposes, for instance when displaying gradient.
--dirty-read=<value>LW6_DIRTY_READdirty-readType: integer
Default value: 2 Min value: 0 Max value: 2
How to handle dirty reads and locks when displaying stuff. If set to 0, there will be no dirty reads at all, a lock (mutex) will be set whenever it's needed. If set to 1, display might be done with inconsistent data, however the data itself won't be modified while displaying. If set to 2, displayed data can (and will) be modified while the rendering thread is running.
--display-background=<value>LW6_DISPLAY_BACKGROUNDdisplay-backgroundType: boolean
Default value: true
Decides wether the background animation/image should be displayed at all.
--display-console=<value>LW6_DISPLAY_CONSOLEdisplay-consoleType: boolean
Default value: false
Defines wether the interactive system console must be displayed. Note that console support must have been enabled at compilation time. It might not be available on your computer, for instance if you are running a system such as Microsoft Windows.
--display-cursors=<value>LW6_DISPLAY_CURSORSdisplay-cursorsType: boolean
Default value: true
Debugging option which can be set to 'false' to disable the display of cursors when playing.
--display-debug-gradient=<value>LW6_DISPLAY_DEBUG_GRADIENTdisplay-debug-gradientType: boolean
Default value: false
Set this to 'true' to display the gradient, this is usefull to debug the core algorithm or understand how it works.
--display-debug-zones=<value>LW6_DISPLAY_DEBUG_ZONESdisplay-debug-zonesType: boolean
Default value: false
Set this to 'true' to display the zones, this is usefull to debug the core algorithm or understand how it works.
--display-fighters=<value>LW6_DISPLAY_FIGHTERSdisplay-fightersType: boolean
Default value: true
Debugging option which can be set to 'false' to disable the display of fighters when playing.
--display-fps=<value>LW6_DISPLAY_FPSdisplay-fpsType: boolean
Default value: false
Set this to 'true' to display the number of frames per second. When this gets too low... play a smaller map, buy a new computer or contribute and hack Liquid War 6 so that it runs faster!
--display-hud=<value>LW6_DISPLAY_HUDdisplay-hudType: boolean
Default value: true
Decides wether the hud (informations while playing) should be displayed.
--display-log=<value>LW6_DISPLAY_LOGdisplay-logType: boolean
Default value: true
Set this to 'false' to disable the display of error messages on the screen. Mote that you can miss valuable informations.
--display-map=<value>LW6_DISPLAY_MAPdisplay-mapType: boolean
Default value: true
Debugging option which can be set to 'false' to disable map (level) display when playing.
--display-menu=<value>LW6_DISPLAY_MENUdisplay-menuType: boolean
Default value: true
Debugging option which can be set to 'false' to disable the display of menus.
--display-meta=<value>LW6_DISPLAY_METAdisplay-metaType: boolean
Default value: true
Set to 'false' to disable the display of meta information, this includes the help, tootips and breadcrumbs in menus.
--display-mouse=<value>LW6_DISPLAY_MOUSEdisplay-mouseType: boolean
Default value: true
Set this to 'false' to always hide the mouse pointer.
--display-mps=<value>LW6_DISPLAY_MPSdisplay-mpsType: boolean
Default value: false
Set this to 'true' to display the number of moves per second. In theory the game should maintain this constant but in practise it can get low if your computer is too slow or too busy.
--display-preview=<value>LW6_DISPLAY_PREVIEWdisplay-previewType: boolean
Default value: true
Decides wether a map preview should be displayed when choosing a level.
--display-progress=<value>LW6_DISPLAY_PROGRESSdisplay-progressType: boolean
Default value: true
Decides wether a progress bar should be displayed when a long operation is realized as a background task.
--display-score=<value>LW6_DISPLAY_SCOREdisplay-scoreType: boolean
Default value: true
Decides wether the score screen should be displayed.
--display-splash=<value>LW6_DISPLAY_SPLASHdisplay-splashType: boolean
Default value: true
Set this to 'false' to disable the display of the splash screen at game startup.
--display-url=<value>LW6_DISPLAY_URLdisplay-urlType: boolean
Default value: false
Set this to 'true' to display the URL (homepage) of the game. This is mostly used when doing screenshots, so that generated images contain a link to the homepage.
--executed-again=<value>LW6_EXECUTED_AGAINexecuted-againType: boolean
Default value: false
This environment variable/keyword is used to detect wether the program has been launched by itself with an internal execv call. This is used as a workarround to set some environment variables (DYLD_LIBRARY_PATH on Mac OS X for instance) before the program is run, as sometimes using setenv() inside the program does not work.
--gfx-cpu-usage=<value>LW6_GFX_CPU_USAGEgfx-cpu-usageType: float
Default value: 0.75 Min value: 0 Max value: 1
Percentage of the CPU which will be used by the display thread. It's wise to leave some time to other threads to execute. The OS does it naturally, but setting this helps the whole process by explicitely pausing (sleep call) the display thread. You could change this to a low value if you have lagging games but smooth display.
--gfx-debug=<value>LW6_GFX_DEBUGgfx-debugType: boolean
Default value: false
Enables dedicated graphics debugging tools. This is different from 'debug' mode which is global, this one is really graphics specific.
--io-per-sec=<value>LW6_IO_PER_SECio-per-secType: integer
Default value: 20
Defines the number of calls to input/output functions per second. This can affect speed of menus but also cursors, but won't change the speed of the game itself. It's a cosmectic, comfort option.
--loader-sleep=<value>LW6_LOADER_SLEEPloader-sleepType: float
Default value: 0.5
Defines how long the loader thread should wait between two polls. Default value should fit in most cases.
--log-level=<value>LW6_LOG_LEVELlog-levelType: integer
Default value: 3 Min value: 0 Max value: 4
Defines the log level, that is, how verbose the program will be regarding logs and console output. 0 (ERROR) is the minimum, only errors are reported. 1 (WARNING) means errors + warnings. 2 (NOTICE) displays most important messages. 3 (INFO) is the default, the log file will contain all messages but debug stuff. 4 (DEBUG) logs everything, including debug informations.
--log-timeout=<value>LW6_LOG_TIMEOUTlog-timeoutType: integer
Default value: 5000
Delay, in msec, for which a log message will stay displayed on the screen.
--magic-number=<value>LW6_MAGIC_NUMBERmagic-numberType: integer
Default value: 14741
This 'magic' number probably requires an explanation. It's used to estimate how big a map can be built. The calculus is very approximative, basically bench_value*magic_number=total_fighters_on_map*rounds_per_sec*moves_per_round with total_fighters_on_map depending on various parameters such as map size but also how many fighters are on the map. The map loader will try and adjust the map size so that it is just big enough not to saturate your CPU while being as high-res as possible. The magic number in itself has no real meaning, the higher it gets, the more optimized it means the game is. Normally you shouldn't change this but if you find the map resizing is too agressively pessimistic, or if for some reason bench returns bogus values, you can modify it.
--max-local-bench-value=<value>LW6_MAX_LOCAL_BENCH_VALUEmax-local-bench-valueType: integer
Default value: 800
Even if your computer is very fast, this parameter will be used to tame the optimism of the test, and do not load maps in very high detail. It's believed at some point, it's best to keep your extra power to deal with unordinary situations rather than waste it on useless details. Game should be fun with that setting, but if you really want to use your shiny CPU at its maximum, raise this.
--max-network-bench-value=<value>LW6_MAX_NETWORK_BENCH_VALUEmax-network-bench-valueType: integer
Default value: 200
On network games, we need to be sure everyone can play in correct conditions, therefore maps won't be loaded with more details than this, by default. You're free to increase this parameter but it can cause your games to be unjoignable by some people.
--memory-bazooka-eraser=<value>LW6_MEMORY_BAZOOKA_ERASERmemory-bazooka-eraserType: boolean
Default value: true
The memory eraser is a tool which will systematically fill allocated memory with 'M', and overwrite all allocated bytes with 'F' before freeing memory. It will even handle realloc calls. This is usefull to track bugs. Indeed, with this option enabled, freshly allocated memory will never contain zeroes unless one calls calloc, and if you ever free some memory zone before being done with it, it will be filled with junk and therefore not be usable. The memory bazooka must be big enough if you want this feature to actually work.
--memory-bazooka-size=<value>LW6_MEMORY_BAZOOKA_SIZEmemory-bazooka-sizeType: integer
Default value: 99991
The memory bazooka is a brute-force tool, conceived after a full night spent tracking some memory leak. The idea is to keep a track of all allocated pointers, when the data was allocated (timestamp), where in the code (file, line), and even point out what data there is in that place. A memory bazooka report at the end of the game will just show what's left. There should be nothing. This parameter is here to avoid wasting CPU cycles on a feature which is very debug-oriented and does not really make sense for the casual user. Set it to 0 for best performance, something like 100 might just be helpfull, but 1000000 is the right way to seriously debug code.
--net-log=<value>LW6_NET_LOGnet-logType: boolean
Default value: false
Activates network log, that is, logs everything sent/received over the network, except data which is sent through a third party library such as libCurl. This is mostly for debugging purpose, it can lead to rather big log files.
--network-reliability=<value>LW6_NETWORK_RELIABILITYnetwork-reliabilityType: integer
Default value: 1000 Min value: 1 Max value: 1000000000
The program assumes network is non-reliable, however the problem with those assumptions is that when you test, network is always reliable, even with non-garanteed protocols like UDP. This option will force the program to actually ignore some calls to send or recv functions, simulating a network disfunction. This is to ensure the internal mecanisms correcting network problems do work for good, on daily regular use. It's not possible to set it to a perfect behavior, never dropping any packet, however using the default settings you probably won't even notice the performance drop induced by having to fix problems. The highest the number is, the most reliable network will look, the algorithm is simply to drop one message out of X.
--open-relay=<value>LW6_OPEN_RELAYopen-relayType: boolean
Default value: false
Enables forwarding of abritrary network messages. If open relay is forbidden, the game will only forward messages when physical sender and logical sender are the same. This is to say if messages come from A for C and is sent by A to B, B will forward it to C. But if message comes from X to C and is sent by A to B, then B won't forward it. In practice, it means without open relay, messages can only be forwarded once.
--pilot-lag=<value>LW6_PILOT_LAGpilot-lagType: integer
Default value: 10
Maximum lag, in rounds, until the game engine is slowed down. This will typically be usefull if your computer is too slow for the map resolution and the game speed you set up.
--quick-startStart the game just like if the player had requested a quick start, without showing any menu.
--resetClears the config file so that the game will run with defaults next time. The idea is to get rid of traces of previous executions. The difference with '–defaults' is that '–reset' does not run the game, while '–defaults' does.
--reset-config-on-upgrade=<value>LW6_RESET_CONFIG_ON_UPGRADEreset-config-on-upgradeType: boolean
Default value: true
If set, then a reset (config file set to defaults) is run every time you upgrade the game.
--serverStart the game in server mode, without requiring any graphics backend. Server mode is usefull if you just want to start a network node without hosting any real game on it. It can be used to list existing nodes and sessions or as a bounce server in case some clients can't contact each other because firewalled. If you only want to start a server game on your computer, don't use this option, just start the game normally and start a game server by clicking on the GUI buttons.
--simulate-basicSimulates some fights using the basic colors red, green, yellow and blue. Will output on the console a percentage based on scores obtained by the teams. This is typically for map designers and/or people who want to fiddle with team profiles, if some team is really stronger than another one, it should appear in these percentages.
--simulate-fullSimulates some fights using all available colors. This can be very long, it will run approximatively 1000 games consecutively, you can look in the log file to see the progress. Will output on the console a percentage based on scores obtained by the teams. This is typically for map designers and/or people who want to fiddle with team profiles, if some team is really stronger than another one, it should appear in these percentages.
--target-fps=<value>LW6_TARGET_FPStarget-fpsType: integer
Default value: 60
Defines how many frames will be displayed per second. Of course this is a maximum value, if your hardware can't keep up with this value, display will just be slow, no matter what value you define here. Note that you might really wish to have something rather low here, to keep network and 'logic' function responsiveness. Passed 60 frames per second, speed is really only for visual comfort, as Liquid War 6 is now so fast-paced that it requires 200 frames/sec to outperform opponents.
--trap-errors=<value>LW6_TRAP_ERRORStrap-errorsType: boolean
Default value: true
If set to true, will trap segmentation fault and floating point errors, and display messages about those in a custom box instead of the default one
--trojan=<value>LW6_TROJANtrojanType: boolean
Default value: false
Make the program act like a (stupid) trojan horse, trying to fake messages, sending various inconsistent informations. This is to check the normal version of the program is able to detect such a fake and kick it out of the game. It's of no use for regular players, be sure to unset this if you want to play for good.
--z-decodeIf specified, program will take stdin and z-decode it to stdout. This is for testing purpose (for network messages for instance). Z-decoding, here means verifying there a Z at the beginning, base64 decode and pass the content through Zlib inflating. I content is not Z-prefixed, will be returned as is.
--z-encodeIf specified, program will take stdin and z-encode it to stdout. This is for testing purpose (for network messages for instance). Z-encoding, here means passing the message through Zlib deflating then base64 encoding and prefix it with a Z.
c-gettextCalls GNU gettext to convert string in current locale. Note that '_' (plain underscode) is exported as well, so that code can be written using '_' as a function.
c-lw6cfg-unified-get-log-fileWrapper on lw6cfg_unified_get_log_file.
c-lw6cfg-unified-get-map-pathWrapper on lw6cfg_unified_get_map_path.
c-lw6cfg-unified-get-music-pathWrapper on lw6cfg_unified_get_music_path.
c-lw6cfg-unified-get-user-dirWrapper on lw6cfg_unified_get_user_dir.
c-lw6dsp-get-fullscreen-modesWrapper on lw6dsp_get_fullscreen_modes.
c-lw6dsp-get-last-frame-rendering-timeWrapper on lw6dsp_get_last_frame_rendering_time.
c-lw6gui-joystick1-get-move-padWrapper on lw6gui_joystick1_get_move_pad.
c-lw6gui-joystick1-pop-button-aWrapper on lw6gui_joystick1_pop_button_a.
c-lw6gui-joystick1-pop-button-bWrapper on lw6gui_joystick1_pop_button_b.
c-lw6gui-joystick1-pop-button-cWrapper on lw6gui_joystick1_pop_button_c.
c-lw6gui-joystick1-pop-button-dWrapper on lw6gui_joystick1_pop_button_d.
c-lw6gui-joystick1-pop-button-eWrapper on lw6gui_joystick1_pop_button_e.
c-lw6gui-joystick1-pop-button-fWrapper on lw6gui_joystick1_pop_button_f.
c-lw6gui-joystick1-pop-pad-downWrapper on lw6gui_joystick1_pop_pad_down.
c-lw6gui-joystick1-pop-pad-leftWrapper on lw6gui_joystick1_pop_pad_left.
c-lw6gui-joystick1-pop-pad-rightWrapper on lw6gui_joystick1_pop_pad_right.
c-lw6gui-joystick1-pop-pad-upWrapper on lw6gui_joystick1_pop_pad_up.
c-lw6gui-joystick2-get-move-padWrapper on lw6gui_joystick2_get_move_pad.
c-lw6gui-joystick2-pop-button-aWrapper on lw6gui_joystick2_pop_button_a.
c-lw6gui-joystick2-pop-button-bWrapper on lw6gui_joystick2_pop_button_b.
c-lw6gui-joystick2-pop-button-cWrapper on lw6gui_joystick2_pop_button_c.
c-lw6gui-joystick2-pop-button-dWrapper on lw6gui_joystick2_pop_button_d.
c-lw6gui-joystick2-pop-button-eWrapper on lw6gui_joystick2_pop_button_e.
c-lw6gui-joystick2-pop-button-fWrapper on lw6gui_joystick2_pop_button_f.
c-lw6gui-joystick2-pop-pad-downWrapper on lw6gui_joystick2_pop_pad_down.
c-lw6gui-joystick2-pop-pad-leftWrapper on lw6gui_joystick2_pop_pad_left.
c-lw6gui-joystick2-pop-pad-rightWrapper on lw6gui_joystick2_pop_pad_right.
c-lw6gui-joystick2-pop-pad-upWrapper on lw6gui_joystick2_pop_pad_up.
c-lw6gui-keyboard-get-move-padWrapper on lw6gui_keyboard_get_move_pad.
c-lw6gui-keyboard-pop-arrow-downWrapper on lw6gui_keyboard_pop_arrow_down.
c-lw6gui-keyboard-pop-arrow-leftWrapper on lw6gui_keyboard_pop_arrow_left.
c-lw6gui-keyboard-pop-arrow-rightWrapper on lw6gui_keyboard_pop_arrow_right.
c-lw6gui-keyboard-pop-arrow-upWrapper on lw6gui_keyboard_pop_arrow_up.
c-lw6gui-keyboard-pop-key-altWrapper on lw6gui_keyboard_pop_key_alt.
c-lw6gui-keyboard-pop-key-ctrlWrapper on lw6gui_keyboard_pop_key_ctrl.
c-lw6gui-keyboard-pop-key-enterWrapper on lw6gui_keyboard_pop_key_enter.
c-lw6gui-keyboard-pop-key-escWrapper on lw6gui_keyboard_pop_key_esc.
c-lw6gui-keyboard-pop-key-pgdownWrapper on lw6gui_keyboard_pop_key_pgdown.
c-lw6gui-keyboard-pop-key-pgupWrapper on lw6gui_keyboard_pop_key_pgup.
c-lw6gui-menu-set-breadcrumbsWrapper on lw6gui_menu_set_breadcrumbs.
c-lw6gui-mouse-pop-button-leftWrapper on lw6gui_mouse_pop_button_left.
c-lw6gui-mouse-pop-button-middleWrapper on lw6gui_mouse_pop_button_middle.
c-lw6gui-mouse-pop-button-rightWrapper on lw6gui_mouse_pop_button_right.
c-lw6gui-mouse-pop-double-clickWrapper on lw6gui_mouse_pop_double_click.
c-lw6gui-mouse-pop-simple-clickWrapper on lw6gui_mouse_pop_simple_click.
c-lw6gui-mouse-pop-triple-clickWrapper on lw6gui_mouse_pop_triple_click.
c-lw6gui-mouse-pop-wheel-downWrapper on lw6gui_mouse_pop_wheel_down.
c-lw6ker-game-struct-checksumWrapper on lw6ker_game_struct_checksum.
c-lw6map-exp-get-unlocked-team-colorWrapper on lw6map_exp_get_unlocked_team_color.
c-lw6map-exp-get-unlocked-weaponWrapper on lw6map_exp_get_unlocked_weapon.
c-lw6map-exp-is-team-color-allowedWrapper on lw6map_exp_is_team_color_allowed.
c-lw6map-exp-is-weapon-allowedWrapper on lw6map_exp_is_weapon_allowed.
c-lw6map-team-color-index-to-keyWrapper on lw6map_team_color_index_to_key.
c-lw6map-team-color-index-to-labelWrapper on lw6map_team_color_index_to_label.
c-lw6map-team-color-key-to-indexWrapper on lw6map_team_color_key_to_index.
c-lw6map-weapon-index-to-labelWrapper on lw6map_weapon_index_to_label.
c-lw6pil-get-reference-current-seqWrapper on lw6pil_get_reference_current_seq.
c-lw6pil-get-reference-target-seqWrapper on lw6pil_get_reference_target_seq.
c-lw6pil-local-cursors-set-mainWrapper on lw6pil_local_cursors_set_main.
c-lw6pil-local-cursors-set-mouse-controlledWrapper on lw6pil_local_cursors_set_mouse_controlled.
c-lw6sys-build-get-configure-argsWrapper on lw6sys_build_get_configure_args.
c-lw6sys-build-get-enable-allinoneWrapper on lw6sys_build_get_enable_allinone.
c-lw6sys-build-get-enable-consoleWrapper on lw6sys_build_get_enable_console.
c-lw6sys-build-get-enable-fullstaticWrapper on lw6sys_build_get_enable_fullstatic.
c-lw6sys-build-get-enable-gcovWrapper on lw6sys_build_get_enable_gcov.
c-lw6sys-build-get-enable-gprofWrapper on lw6sys_build_get_enable_gprof.
c-lw6sys-build-get-enable-gtkWrapper on lw6sys_build_get_enable_gtk.
c-lw6sys-build-get-enable-instrumentWrapper on lw6sys_build_get_enable_instrument.
c-lw6sys-build-get-enable-mod-csoundWrapper on lw6sys_build_get_enable_mod_csound.
c-lw6sys-build-get-enable-mod-glWrapper on lw6sys_build_get_enable_mod_gl.
c-lw6sys-build-get-enable-mod-httpWrapper on lw6sys_build_get_enable_mod_http.
c-lw6sys-build-get-enable-mod-oggWrapper on lw6sys_build_get_enable_mod_ogg.
c-lw6sys-build-get-enable-openmpWrapper on lw6sys_build_get_enable_openmp.
c-lw6sys-build-get-enable-optimizeWrapper on lw6sys_build_get_enable_optimize.
c-lw6sys-build-get-enable-paranoidWrapper on lw6sys_build_get_enable_paranoid.
c-lw6sys-build-get-enable-profilerWrapper on lw6sys_build_get_enable_profiler.
c-lw6sys-build-get-enable-valgrindWrapper on lw6sys_build_get_enable_valgrind.
c-lw6sys-build-get-endiannessWrapper on lw6sys_build_get_endianness.
c-lw6sys-build-get-gcc-versionWrapper on lw6sys_build_get_gcc_version.
c-lw6sys-build-get-includedirWrapper on lw6sys_build_get_includedir.
c-lw6sys-build-get-package-nameWrapper on lw6sys_build_get_package_name.
c-lw6sys-build-get-package-stringWrapper on lw6sys_build_get_package_string.
c-lw6sys-build-get-package-tarnameWrapper on lw6sys_build_get_package_tarname.
c-lw6sys-build-get-pointer-sizeWrapper on lw6sys_build_get_pointer_size.
c-lw6sys-build-get-top-srcdirWrapper on lw6sys_build_get_top_srcdir.
c-lw6sys-get-default-config-fileWrapper on lw6sys_get_default_config_file.
c-lw6sys-get-default-data-dirWrapper on lw6sys_get_default_data_dir.
c-lw6sys-get-default-log-fileWrapper on lw6sys_get_default_log_file.
c-lw6sys-get-default-map-pathWrapper on lw6sys_get_default_map_path.
c-lw6sys-get-default-music-dirWrapper on lw6sys_get_default_music_dir.
c-lw6sys-get-default-music-pathWrapper on lw6sys_get_default_music_path.
c-lw6sys-get-default-script-fileWrapper on lw6sys_get_default_script_file.
c-lw6sys-get-default-user-dirWrapper on lw6sys_get_default_user_dir.
c-lw6sys-openmp-get-num-procsWrapper on lw6sys_openmp_get_num_procs.
c-lw6sys-set-memory-bazooka-eraserWrapper on lw6sys_set_memory_bazooka_eraser.
c-lw6sys-set-memory-bazooka-sizeWrapper on lw6sys_set_memory_bazooka_size.
This chapter contains a description of all modules and a list of all documented C functions in the program. It contains many references and is self-generated from C comments using gdoc by Simon Josefsson.
In order to reduce the number of pages of printed output, this complete reference is, by default, disabled in printable versions of the documentation (PostScript, PDF). This is both to make the manual more readable and to avoid wasting paper. Think about the environment.
It is however available in the HTML version of the documentation, which you can read online on http://www.gnu.org/software/liquidwar6/manual/html_node/.
Additionnally, the following adresses contain various view on the source code, giving informations on all the internal and public C interfaces:
./liquidwar6 --test.
It shows what functions are actually tested, and how many times they are called.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/index.html.
video_mode: the new video mode
This callback is here because gfx needs to update the config when the screen is resized. But... we did not want to make gfx depend on cfg "directly". It's cleaner to pass parameters with Scheme, in the long run, it should make things easier. So this callback is the solution. Another side effect is that this way there's a tangible obvious trace of this updating of config status by the gfx module. Seeing it sticking out like a thumb isn't a bad thing.
Return value: none
Functions which will call
quit(),free(),destroy() on whatever smob object that has threads and/or requires hardware ressources. This is to be called before the Guile interpreter ends. This is because when it garbage collects objects at the end of the program, it has no idea of what order to use when freeing objects. So if an object which uses another one in a thread is freed after the other is freed, you get a (rather unexplainabled if not warned) segfault.Return value: none
argc: number of args as passed to main argv: array of strings as passed to main
Fixes environment variables (path related) so that program can find its requirements. This must be called early in the program flow (else other calls might fail).
Return value: 1 if success, 0 if failure
Register all the functions, make them callable from Guile. This is a very simple yet long and very usefull function, without it Guile has no knowledge of what LW6 is.
Return value: 1 on success, 0 if failed.
c_line: the line typed by the user
This function will be called every time a message is typed on the console. It runs the given line in the current Guile environment.
Return value: none
argc: number of args as passed to main argv: array of strings as passed to main
Initializes global values to their defaults.
Return value: 1 on success, 0 if failed
argc: number of args as passed to main argv: array of strings as passed to main
Frees global values. Will also garbage collect objects in case Guile failed to do it perfectly (or we failed to tell Guile how to do it).
Return value: none.
argc: the argc parameter of the
main() function, that is, the number of command-line args.argv: the argv parameter of the
main() function, that is, an array containing pointers on command-line args.This function is directly called by
main(). This means by linking against libliquidwar6 and calling it, you would have a program that is almost exactly the "official" upstream liquidwar6 binary, except you can tweak it and have all the power to call whatever other functions you like, embed it. In short, everything the binary does, you can do it in your own binarn, by linking against the library and calling this function.Return value: 1 if success, zero if failure. Note that this is the "standard" C / liquidwar6 way to proceed, but your
main() function should return 0 if success, else an error code. Typical use is "return !lw6_main(argc, argv);".
argc: the number of command-line args, as passed to
main()argv: an array of strings containing command-line args, as passed to
main()run_game: a pointer to a boolean which will contain true (1) if the game must be launched, or false (0) if the option is such that game must be skipped. Example: –copyright, –help, ...
Return value: non-zero if success, 0 if error. The error can be, for instance, the test suite returning "no, tests were not OK".
Displays the copyright of the game (short version).
Return value: none
Displays the copyright of the game (long version).
Return value: none
Displays the program bench value.
Return value: none
Displays the program pedigree, think of this as version on steroids.
Return value: none
Displays the host on which the program was compiled.
Return value: none
Displays various paths used by the game.
Return value: none
Displays the list of modules compiled with the game.
Return value: none
Displays the list of 'players' options.
Return value: none
Displays the list of 'graphics' options.
Return value: none
Displays the list of 'network' options.
Return value: none
Displays the list of 'map rules' options.
Return value: none
Displays the list of 'map hints' options.
Return value: none
Displays the list of 'map style' options.
Return value: none
Displays the list of 'map teams' options.
Return value: none
Displays the list of 'advanced' options.
Return value: none
Displays the about message for a keyword.
Return value: none
Displays 'hello' at the beginning of the program.
Return value: none
Displays 'goodbye', typically use at end of program to know it's over and everything went fine.
Return value: none
c_dsp: the display object
Creates an SCM 'dsp' object from C data.
Return value: the SCM object
dsp: the dsp to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'dsp' object.
Return value: a pointer, *not* a copy, must not be freed
dsp_smob: the smob to free
Frees a dsp smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_snd: the sound object
Creates an SCM 'snd' object from C data.
Return value: the SCM object
snd: the snd to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'snd' object.
Return value: a pointer, *not* a copy, must not be freed
snd_smob: the smob to free
Frees a snd smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_map: the map object
Creates an SCM 'map' object from C data.
Return value: the SCM object
map: the map to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'map' object.
Return value: a pointer, *not* a copy, must not be freed
map_smob: the smob to free
Frees a map smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_menu: the menu object
Creates an SCM 'menu' object from C data.
Return value: the SCM object
menu: the menu to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'menu' object.
Return value: a pointer, *not* a copy, must not be freed
menu_smob: the smob to free
Frees a menu smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_game_struct: the game struct object
map: the map (SCM object) referenced
Creates an SCM 'game-struct' object from C data. Passing the map object enables the garbage collector not to free the map until the game struct is freed.
Return value: the SCM object
game_struct: the game_struct to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'game_struct' object.
Return value: a pointer, *not* a copy, must not be freed
game_struct_smob: the smob to free
Frees a game_struct smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_game_state: the game state object
game_struct: the game struct (SCM object) referenced
Creates an SCM 'game_state' object from C data. Passing game_struct enables the garbage collector not to free the game_struct until the game_state is freed.
Return value: the SCM object
game_state: the game_state to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'game_state' object.
Return value: a pointer, *not* a copy, must not be freed
game_state_smob: the smob to free
Frees a game_state smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_pilot: the pilot object
Creates an SCM 'pilot' object from C data.
Return value: the SCM object
pilot: the pilot to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'pilot' object.
Return value: a pointer, *not* a copy, must not be freed
pilot_smob: the smob to free
Frees a pilot smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_bot: the bot object
game_state: the game state
pilot: the pilot
Creates an SCM 'bot' object from C data. Passing game_state and pilot enables the garbage collector not the free them until bot is freed.
Return value: the SCM object
bot: the bot to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'bot' object.
Return value: a pointer, *not* a copy, must not be freed
bot_smob: the smob to free
Frees a bot smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_look: the look object
Creates an SCM 'look' object from C data.
Return value: the SCM object
look: the look to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'look' object.
Return value: a pointer, *not* a copy, must not be freed
look_smob: the smob to free
Frees a look smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_loader: the loader object
Creates an SCM 'loader' object from C data.
Return value: the SCM object
loader: the loader to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'loader' object.
Return value: a pointer, *not* a copy, must not be freed
loader_smob: the smob to free
Frees a loader smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_db: the database object
Creates an SCM 'db' object from C data.
Return value: the SCM object
db: the db to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'db' object.
Return value: a pointer, *not* a copy, must not be freed
db_smob: the smob to free
Frees a db smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
c_node: the node object
db: the db (SCM object) referenced
Creates an SCM 'node' object from C data. Passing db enables the garbage collector not to free db until node is freed.
Return value: the SCM object
node: the node to convert (SCM object)
Gets the internal C pointer corresponding to the scheme 'node' object.
Return value: a pointer, *not* a copy, must not be freed
node_smob: the smob to free
Frees a node smob, we need a special function to do that as structures like assoc hold pointers to these objects and therefore need a proper callback when being destroyed.
Return value: none
Register all smobs to Guile.
Return value: 1 on success, 0 if failed.
mode: 0 for check only, 1 for full test
Runs the liquidwar6 core module test suite, this will mostly test how Guile script integration works, loading a sample script and running it. It does not launch all the other sub modules tests.
Return value: 1 if test is successfull, 0 on error.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/bot/index.html.
backend: backend to use
seed: parameters required to build bot (game state, among other things)
Initializes a bot object. Must be performed before any other call. The seed is absolutely required, for a bot really needs to know what map/context it's working on, including at creation time
Return value: 1 on success, 0 on failure.
backend: unitialize a bot backend
Closes a bot, but does not free all ressources.
backend: bot to work on
x: next x position (out param)
y: next y position (out param)
Queries the bot for its next move, this is actually the one interesting function in the whole bot API.
Return value: 1 on success, 0 on failure.
backend: bot to represent
Gives a human readable representation of bot
Return value: dynamically allocated string.
argc: argc, as passed to
mainargv: argv, as passed to
mainList available bot backends. The hash contains pairs with id and name for each backend. The id is the technical key you can use to load the backend, the name is something more readable you can display in an interface. The backend objects themselves are not instanciated by this (in fact, they are, but released on the fly) you need to load and initialize them afterwards.
Return value: hash containing id/name pairs.
argc: argc, as passed to
mainargv: argv, as passed to
mainname: string containing bot key, typically got from
lw6bot_get_backendsCreates a bot backend, this is just about loading the dynamic library if needed, and/or check bot engine is available, and connect to it. It does not perform initialization.
Return value: bot backend.
backend: bot backend to destroy
Frees the ressources associated to a bot, which must have been properly uninitialized before.
Return value: none.
mode: 0 for check only, 1 for full test
Runs the
botmodule test suite. Will try several engines and query basic moves.Return value: 1 if test is successfull, 0 on error.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/bot/mod-brute/index.html.
Defined to tell mod_brute is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it's declared makes its GPL compatibility obvious. Having this declared is required.
Return value: none
Returns the pedigree for mod-brute, giving details about the module, including name, description, licence, date/time of compilation.
Return value: dynamically allocated object.
Creates a mod-brute backend.
Return value: backend pointer.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/bot/mod-follow/index.html.
Defined to tell mod_follow is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it's declared makes its GPL compatibility obvious. Having this declared is required.
Return value: none
Returns the pedigree for mod-follow, giving details about the module, including name, description, licence, date/time of compilation.
Return value: dynamically allocated object.
Creates a mod-follow backend.
Return value: backend pointer.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/bot/mod-idiot/index.html.
Defined to tell mod_idiot is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it's declared makes its GPL compatibility obvious. Having this declared is required.
Return value: none
Returns the pedigree for mod-idiot, giving details about the module, including name, description, licence, date/time of compilation.
Return value: dynamically allocated object.
Creates a mod-idiot backend.
Return value: backend pointer.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/bot/mod-random/index.html.
Defined to tell mod_random is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it's declared makes its GPL compatibility obvious. Having this declared is required.
Return value: none
Returns the pedigree for mod-random, giving details about the module, including name, description, licence, date/time of compilation.
Return value: dynamically allocated object.
Creates a mod-random backend.
Return value: backend pointer.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/cfg/index.html.
context: opaque pointer on a context
Overwrites any existing option with command line args
Return value: 1 if success, 0 if error
context: opaque pointer on a context
Sets all values to their defaults.
Return value: 1 if success, 0 if error
cfg_context: a context returned by
lw6cfg_initOverwrites any existing vale in the config with environment variables prefixed by LW6_.
Return value: 1 if successfull, 0 if error.
user_dir: the user directory
exp: the exp (out param)
Gets exp from file.
Return value: 1 on success, 0 on failure
user_dir: the user directory
exp: the exp
Saves exp to file.
Return value: 1 on success, 0 on failure
key: the key of the value to format
value: the value to format
type: the type of the value to format
Formats, converts, a given value to its cannonical representation. Booleans will be converted to true/false, strings containing integers will be stripped from junk, and so on. This is a performance killer but will ensure everything is correct.
Return value: a newly allocated string, containing the same as the input, but reformatted the pedantic way.
key: the key of the value to format
value: the value to format
Formats, converts, a given value to its cannonical representation. Booleans will be converted to true/false, strings containing integers will be stripped from junk, and so on. This is a performance killer but will ensure everything is correct. This function will automatically guess the type of the value from its description in the help system.
Return value: a newly allocated string, containing the same as the input, but reformatted the pedantic way.
cfg_context: a context returned by
lw6cfg_initfilename: a file path, absolute or relative
Loads the given config file, and stores its values into the current context. Parameters which are both in the config file and given as command line parameters, will be taken from the command-line.
Return value: 1 if successfull, 0 if error.
context: context to query
key: key to search
Returns wether a key exists within context or not.
Return value: 1 if exists, 0 if not
context: context to query
key: key to search
Returns the current value for a given query, the returned value is always a string, typically the string one would pass on the command line or set in a config file
Return value: pointer to string, must not be freed.
context: context to modify
key: key to search and change
value: new value
Sets a given key to the specified value, this is a string only function, pass the value you would pass on the command line or set in a config file.
Return value: none
context: context to query
key: key to search
Returns an option as an integer. Note that this function does not know wether the parameter should really be an integer or not, so you can call it even on non-integer values, but of course results will have no real meaning.
Return value: option value converted to int
context: context to modify
key: key to search and change
value: new value
Set a config option to an integer value. Note that this function does not know wether the parameter should really be an integer or not, so you can call it even on non-integer values, at your own risk.
Return value: none.
context: context to query
key: key to search
Returns an option as a boolean. Note that this function does not know wether the parameter should really be a boolean or not, so you can call it even on non-boolean values, but of course results will have no real meaning.
Return value: option value converted to boolean
context: context to modify
key: key to search and change
value: new value
Set a config option to a boolean value. Note that this function does not know wether the parameter should really be a boolean or not, so you can call it even on non-boolean values, at your own risk.
Return value: none.
key: key to test
Tells wether a key should be saved in the config file. Typically, some options you don't want to savem such as the location of the config file itself. Most of those non-savable parameters are path-related. This does not mean no paths are saved in the config file.
Return value: 1 if must be saved, 0 if not
cfg_context: a context returned by
lw6cfg_initfilename: a file path, absolute or relative
Save current options into the given config file. Before saving the file, all command line arguments will be read and will override current values. This means the saved file will contain values given as command line arguments.
Return value: 1 if successfull, 0 if error.
argc: number of command line arguments, as given to
mainargv: a list of command line arguments, as given to
mainInitializes a config context object. This object is hidden behind an opaque void * pointer to avoid direct access to its elements.
Return value: an opaque pointer, must be freed with
lw6cfg_quit.
cfg_context: a context returned by
lw6cfg_initFrees a config cfg_context object. You must call this once you're done with the context.
Return value: none.
argc: number of command line arguments, as given to
mainargv: a list of command line arguments, as given to
mainOverwrites the config file with defaults. Use this to get rid of old configurations.
mode: 0 for check only, 1 for full test
Runs the
cfgmodule test suite.Return value: 1 if test is successfull, 0 on error.
argc: number of command-line args, as passed to
mainargv: arry of command-line args, as passed to
mainkey: the key to query
Unified "value" getter, which gets informations from environment variables, command line, and config file. The rules is that the command-line argument always has the last word. It will override any other value. Follows environment variables, which will be used if no command-line argument is supplied. Note that these are "LW6_" prefixed and uppercased environment variables as opposed to lowercased and "dash-separated" keys. Finally, if there's no environment variable, nor any config-file corresponding entry, the value will be searched in the config file. If there's no information in the config file, NULL is returned.
Return value: a string with the value. Can be NULL. Must be freed.
argc: number of command-line args, as passed to
mainargv: arry of command-line args, as passed to
mainGets the user dir, taking all parameters in account, that's to say the "LW6_USER_DIR" env value, the "–user-dir" command-line paramater and the LW6DEF_USER_DIR config file entry.
Return value: the directory path, might be NULL, must be freed.
argc: number of command-line args, as passed to
mainargv: arry of command-line args, as passed to
mainGets the log file, taking all parameters in account, that's to say the "LW6_LOG_FILE" env value, the "–log-file" command-line paramater and the LW6DEF_LOG_FILE config file entry.
Return value: the directory path, might be NULL, must be freed.
argc: number of command-line args, as passed to
mainargv: arry of command-line args, as passed to
mainGets the user dir, taking all parameters in account, that's to say the "LW6_MUSIC_PATH" env value, the "–music-path" command-line paramater and the LW6DEF_MUSIC_PATH config file entry.
Return value: the directory path, might be NULL, must be freed.
argc: number of command-line args, as passed to
mainargv: arry of command-line args, as passed to
mainGets the user dir, taking all parameters in account, that's to say the "LW6_MAP_PATH" env value, the "–map-path" command-line paramater and the LW6DEF_MAP_PATH config file entry.
Return value: the directory path, might be NULL, must be freed.
type: type as an enum
Returns the string corresponding to a given type, suitable for use in XML files. For instance if you pass
LW6HLP_TYPE_INTthen you will obtain the string int (string of 3 chars containing i, n and t.Return value: string, must not be freed.
xml_key: key found in XML file
xml_value: value found in XML file
target_key: key we're searching for
value: the value if found (out param)
Tries to find a value in a key/value pair. If
xml_keyandtarget_keymatch, then will put the corresponding value (converted to int) in thevalueparam. Typically, you would call this in a loop on every single entry found in an XML file, in an expat callback.Return value: none.
xml_key: key found in XML file
xml_value: value found in XML file
target_key: key we're searching for
value: the value if found (out param)
Tries to find a value in a key/value pair. If
xml_keyandtarget_keymatch, then will put the corresponding value (converted to boolean) in thevalueparam. Typically, you would call this in a loop on every single entry found in an XML file, in an expat callback.Return value: none.
xml_key: key found in XML file
xml_value: value found in XML file
target_key: key we're searching for
value: the value if found (out param)
Tries to find a value in a key/value pair. If
xml_keyandtarget_keymatch, then will put the corresponding value (converted to float) in thevalueparam. Typically, you would call this in a loop on every single entry found in an XML file, in an expat callback.Return value: none.
xml_key: key found in XML file
xml_value: value found in XML file
target_key: key we're searching for
value: the value if found (out param)
Tries to find a value in a key/value pair. If
xml_keyandtarget_keymatch, then will put the corresponding value (as a string) in thevalueparam. Typically, you would call this in a loop on every single entry found in an XML file, in an expat callback.Return value: none.
xml_key: key found in XML file
xml_value: value found in XML file
target_key: key we're searching for
value: the value if found (out param)
Tries to find a value in a key/value pair. If
xml_keyandtarget_keymatch, then will put the corresponding value (converted to a color) in thevalueparam. Typically, you would call this in a loop on every single entry found in an XML file, in an expat callback.Return value: none.
filename: full path of file to read
callback_func: callback function to be called on each element
callback_data: additionnal pointer passed to callback function
Will parse a file and call the given callback on each element. This is an over-simplified way to read XML file, in fact we just explain plain non-nested simple elements but this is exactly what LW config files are made of.
Return value: 1 on success, 0 on failure.
f: file to write data to (append mode)
key: key to write
value: value to write
Writes an int entry into an opened XML file.
Return value: none.
f: file to write data to (append mode)
key: key to write
value: value to write
Writes a boolean entry into an opened XML file.
Return value: none.
f: file to write data to (append mode)
key: key to write
value: value to write
Writes a float entry into an opened XML file.
Return value: none.
f: file to write data to (append mode)
key: key to write
value: value to write
Writes a string entry into an opened XML file.
Return value: none.
f: file to write data to (append mode)
key: key to write
value: value to write
Writes a color entry into an opened XML file.
Return value: none.
f: file to write data to (append mode)
key: key to write
value: value to write
Writes an entry into an opened XML file, will try and guess type from the internal help system, typically, if this is a standard config file entry (the one documented by the about command line function) it will pick up the right type. The reason not to use this all the times is that sometimes, one might to to store non-standard options, and additionnally, guessing the type does consume some CPU.
Return value: none.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/cli/index.html.
backend: backend to use
Initializes a client backend. Must be performed before any other call.
Return value: 1 on success, 0 on failure
backend: unitialize a cli backend
Closes a cli, but does not free all ressources.
backend: backend to use
node_info: information on the current node
oob_data: data of the out-of-band request
Processes the required out-of-band tasks, this typically, for a client, includes broadcasting. Depending on parameters passed in oob_data, might actually do a broadcast or simply call a given host and see what's the answer. A typicall exchange is PING then INFO and finally LIST. It's the responsability of the client to take the OOB initiative and contact the server.
Return value: 1 on success, 0 on failure.
backend: backend to use
local_url: our local public url
remote_url: the remote url we want to connect to
remote_ip: remote IP address
remote_port: remote IP port
password: password to use (if needed)
local_id: our local id
remote_id: the remote id
dns_ok: wether the remote announced URL matches DNS information
network_reliability: network reliability (the highest, the better)
recv_callback_func: callback func to be called when data is received
recv_callback_data: pointer on additionnal data to pass to callback func
Opens a connection with a remote host. Be carefull with the implementation of
recv_callback_func, it should be at least reentrant, and when it accesses shared data, use locks.Return value: new object.
backend: backend to use
connection: connection to use
Closes a connection, this will free the connection object.
Return value: none.
backend: backend to use
connection: connection to use
physical_ticket_sig: signature of physical sender
logical_ticket_sig: signature of logical sender
logical_from_id: id of logical sender
logical_to_id: id of logicial target
message: text of message to send
Sends a message to a peer over a given connection.
Return value: 1 on success, 0 on failure.
backend: backend to use
connection: connection to use
Performs required duty on connection, depending on the backend, this can include sending messages and/or receiving them. Must be called on a regular basis.
Return value: none.
backend: backend to use
connection: connection to represent
Gives a human readable representation of the connection.
Return value: dynamically allocated string.
public_url: the address of the distant server to test
verify_callback_func: a function which will be called when a node has been verified
verify_callback_data: additionnal data passed to the callback func
Create a new OOB structure, copying required objects. We need to make copies for this is for usage in a separate thread. The thread member is not set here since the right way to do things is first to set up data then to fire the thread.
Return value: new object
oob: the object to free
Frees an OOB structure.
Return value: none
Returns the list of the default cli backends.
Return value: comma separated string, must not be freed.
argc: argc, as passed to
mainargv: argv, as passed to
mainList available cli backends. The hash contains pairs with id and name for each backend. The id is the technical key you can use to load the backend, the name is something more readable you can display in an interface. The backend objects themselves are not instanciated by this (in fact, they are, but released on the fly) you need to load and initialize them afterwards.
Return value: hash containing id/name pairs.
argc: argc, as passed to
mainargv: argv, as passed to
mainname: string containing cli key, typically got from
lw6cli_get_backendsCreates a cli backend, this is just about loading the dynamic library if needed, and/or check cli engine is available, and connect to it. It does not perform initialization.
Return value: cli backend.
backend: backend to destroy
Destroys a cli backend.
Return value: none.
mode: 0 for check only, 1 for full test
Runs the
climodule test suite.Return value: 1 if test is successfull, 0 on error.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/cli/mod-http/index.html.
Defined to tell mod_http is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it's declared makes its GPL compatibility obvious. Having this declared is required.
Return value: none
Returns the pedigree for mod-http, giving details about the module, including name, description, licence, date/time of compilation.
Return value: dynamically allocated object.
Creates a mod-http backend.
Return value: backend pointer.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/cli/mod-tcp/index.html.
Defined to tell mod_tcp is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it's declared makes its GPL compatibility obvious. Having this declared is required.
Return value: none
Returns the pedigree for mod-tcp, giving details about the module, including name, description, licence, date/time of compilation.
Return value: dynamically allocated object.
Creates a mod-tcp backend.
Return value: backend pointer.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/cli/mod-udp/index.html.
Defined to tell mod_udp is compatible with GNU General Public License. Of course it is. This function does nothing, but the fact it's declared makes its GPL compatibility obvious. Having this declared is required.
Return value: none
Returns the pedigree for mod-udp, giving details about the module, including name, description, licence, date/time of compilation.
Return value: dynamically allocated object.
Creates a mod-udp backend.
Return value: backend pointer.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/cns/index.html.
callback: handler function.
Installs a console handler.
Return value: none.
Polling function for console, must be called on a regular basis.
Return value: none.
line: line to add
Adds a line to the console history, won't add it if it's NULL or empty.
Return value: none.
Tells wether console is supported.
Return value: 1 if console can be enabled, 0 if not
mode: 0 for check only, 1 for full test
Runs the
cnsmodule test suite.Return value: 1 if test is successfull, 0 on error.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/cnx/index.html.
local_url: the local public URL
remote_url: the remote public URL
remote_ip: the remote IP address
remote_port: the remote port
password: the password to use
local_id: the local ID
remote_id: the remote ID
dns_ok: 1 if no DNS mismatch, 0 if IP does not match public URL
network_reliability: drop 1 out of X packets
recv_callback_func: a callback to call when data is received
recv_callback_data: additionnal data to pass to the callback
Create a connection object. This object in itself does nothing, it's just to share common structures among modules, more precisely, between cli and srv code. It's the responsability off the caller/backend to handle the
backend_specific_datafield which is NULL after this call.Return value: newly allocated object.
connection: object to free
Frees a connection object. It's the responsibility of the caller/backend to handle the
backend_specific_datafield.Return value: none.
connection: the connection concerned
now: the current timestamp
Tells wether a new foo message must be issued.
Return value: 1 if true, 0 if false.
connection: the connection concerned
now: the current timestamp
next_foo_delay: the delay (msec) before next foo message is sent
Generates a new foo_bar_key, and schedules the next foo message send timestamp.
Return value: none.
connection: the connexion to lock
Acquires a "send" lock on the connexion, the idea is to avoid too threads sending data using the same socket at the same time. Note that each backend must call this when accessing the socket, there's no top-level lock for the sake of performance.
Return value: 1 on success, 0 if not.
connection: the connexion to lock
Releases a "send" lock on the connexion, the idea is to avoid too threads sending data using the same socket at the same time. Note that each backend must call this when accessing the socket, there's no top-level lock for the sake of performance.
Return value: none.
connection: the connexion concerned
Will filter and return true only in "rare" cases when packets must be artificially dropped for testing purpose.
Return value: 1 if message must be sent/received, 0 if not
seed: a seed to blur the password, can be NULL
password: the password, can be NULL
Calculates the checksum of a password, and returns it as a string, ready to be sent on the network. If password is empty or NULL, then an empty (but not NULL unless internal error) string will be returned. All LW6 protocols should send these checksums instead of real passwords, then on server side value can be checked against both real password and its checksum. The seed is here so that eavesdropper can't reuse the checksum to connect on random sessions. Seed can typically be the node 'public_url' value.
Return value: a dynamically allocated string
seed: a seed to blur the password, can be NULL
password_here: the local password, can be NULL
password_received: the password received from network, can be NULL
Tells wether a password received over the network is valid. The
password_hereargument (the local password) will be checksumed so thatpassword_receivedis checked against both clear and checksumed values, so it can be in any form.Return value: 1 if OK, passwords are the same, 0 if not.
mode: 0 for check only, 1 for full test
Runs the
cnxmodule test suite.Return value: 1 if test is successfull, 0 on error.
ticket_table: the ticket table to fill with zero
Fills the ticket table struct with 0s.
Return value: none.
ticket_table: the ticket table to init
hash_size: the hash size for both recv/send hashs
Initialize a ticket table, that is, set it up with two empty hashs. Recv hash is filled automatically as it's queried for tickets, send hash must be filled explicitely with info from the network.
Return value: none.
ticket_table: the ticket table to clear
Clears the object (frees memory).
Return value: none.
ticket_table: the ticket table to query
peer_id: the id of remote node
Gets the ticket used to communicate with peer, to check its incoming (recv) messages. If ticket does not exist yet, it's automatically generated so tunction will always return a non-zero value.
Return value: the ticket used to check incoming messages.
ticket_table: the ticket table to query
peer_id: the id of remote node
Acknowledges the ticket used to communicate with peer, to check its incoming (recv) messages has been received. This is to avoid sending it again when it has been received, as it's kept "forever" by peer, we never need to send it again.
Return value: none.
ticket_table: the ticket table to query
peer_id: the id of remote node
Acknowledges the ticket used to communicate with peer, to check its incoming (recv) messages has been received. This is to avoid sending it again when it has been received, as it's kept "forever" by peer, we never need to send it again.
Return value: the ticket used to check incoming messages.
ticket_table: the ticket table to query
peer_id: the id of remote node
Gets the ticket used to communicate with peer, to stamp the outgoing messages. If ticket does not exist yet, 0 is returned, indeed this value must be initialized with the value the peer gives us.
Return value: the ticket used to stamp outgoing messages.
ticket_table: the ticket table to query
peer_id: the id of remote node
send_ticket: the ticket to use to stamp outgoing messages
Sets the ticket used to communicate with peer, to stamp the outgoing (send) messages. This value should be received from the network. Note that once it's set, it's impossible to change it, it will remain the same for the whole duration of the node existence.
Return value: NULL
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/dat/index.html.
mode: 0 for check only, 1 for full test
Runs the
datmodule test suite.Return value: 1 if test is successfull, 0 on error.
Creates a new warehouse object.
Return value: new object, allocated dynamically
warehouse: the object to free
Frees a warehouse object.
Return value: new object, allocated dynamically
warehouse: the object to purge
Purges a warehouse object.
Return value: new object, allocated dynamically
warehouse: the warehouse object to query.
Tells how many nodes are registered in the object.
Return value: integer, number of nodes
warehouse: the warehouse object to query.
Returns the local id.
Return value: 64-bit id.
warehouse: the warehouse object to query.
Returns the latest (highest) serial number given for local node.
Return value: integer, latest serial number
warehouse: warehouse object to use
logical_from: from who the message came from originally
full_str: message of the form serial i n seq from cmd
Puts an atomic string in the object, this kind of string is typically received on the network.
Return value: 1 on success, 0 on error
warehouse: object to work on
The various
get_seqfunctions can perform slowly if we don't pre-calculate the serial number of draft and reference atoms. So this calculation is not within the functions themselves but can be cached by using this function. Just call it and after you might query the object for reference and draft info.Return value: 1 on success, 0 on failure.
warehouse: warehouse object to use
msg: message
Puts a message in the object. The message will be splitted into several atoms if needed, it can be arbitrary long.
Return value: 1 on success, 0 on error
warehouse: object to query
Tells the lowest seq referenced in the warehouse. Does not mean this is the lowest ever received, only we really have no chances of going below that point, nothing is stored, either complete or partial, below that.
Return value: integer.
warehouse: object to query
Tells the highest seq referenced in the warehouse. Does not mean an actual message can be built from it, only we've got some traces of such a high seq.
Return value: integer.
warehouse: object to query
Tells the highest seq that can be considered as a valid draft. This is not exactly the maximimum seq encountered, for here we want at least one complete message and not just one chunk of data (an atom) referring to a high seq, we want the complete stuff. However there can be missing messages in between.
Return value: integer.
warehouse: object to query
Tells the highest seq that can be considered as a reference. Being considered as a reference means we received all messages for this seq *and* at least one message from the following seq, and this for every node involved. This being said, we're sure to have the right information, nothing is missing.
Return value: integer.
warehouse: object to query
seq_min: lowest sequence number (round or chat index)
seq_max: highest sequence number (round or chat index)
Gets the list of messages for a given sequence (round or chat index), polling all the nodes. The from and to boundaries are included.
Return value: a list of strings.
warehouse: object to query
logical_to: the id of the node that we want to send data to
Returns all the messages that were not sent for the given warehouse.
Return value: a list of strings, containing atoms.
There are no functions in libdef, only a header file with constants.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/dsp/index.html.
argc: argc as passed to
mainargv: argv as passed to
maingfx_backend_name: the id/name of the gfx backend to use
Creates a dsp_backend object. The created object won't be displaying things until
lw6dsp_initis called. No thread is created, but the graphics backend is loaded into memory. If video mode is not available, it will appear later, when trying to start displaying things, this function only allocates memory and checks code is available in case of a dynamically loaded gfx backend.Return value: a newly allocated object.
dsp_backend: the dsp_backend object to free
Frees all ressources used by a dsp_backend object. Note that you must call this on a inactive 'stopped' dsp_backend object.
Return value: none.
dsp_backend: the object to represent
Gives a short human-readable description of the object.
Return value: a newly allocated string, must be freed.
dsp_backend: the dsp_backend to start
param: parameters to pass to the display funcs
resize_callback: a function which will be called when there's a resize event
Starts a dsp_backend object, that is, fire a separate thread and start rendering. This will set up a video mode, so it's very likely to fail if for some reason the video context isn't right, for instance if you try to set up graphical stuff but only have console access.
Return value: 1 if success, 0 if error.
dsp_backend: the dsp_backend to stop
Stops a dsp_backend, that is, cancel rendering and unset the video mode, hardware shouldn't be used any more after this call.
Return value: none.
dsp_backend: the dsp_backend to update
param: parameters to pass to the dsp_backend funcs
Passes a new set of parameters to the display function. This is in fact the only way to pass informations to the dsp_backend object once it's been started. This function will acquire a mutex, copy parameters, then give control back to the main thread while display keeps on going with new parameters in the background. It will get input informations. You really must call it often otherwise the screen won't get updated, or, at least, it will always display the same informations. It should be reasonnable to call this 10 or 20 times per second, the display itself can be faster, run at 60 or 100 fps to show smooth animation (eye candy).
Return value: 1 if success, 0 if error.
dsp_backend: the dsp_backend to query
Returns the number of frames displayed since the display was started.
Return value: the number of frames displayed.
dsp_backend: the dsp_backend to query
Returns the rendering time of the last frame. Gives clues about performance.
Return value: the number of milliseconds it took to draw screen
dsp_backend: the dsp_backend to query
Returns the current frames per sec display rate. This is the instant value, it changes very often even if display seems smooth.
Return value: the current instant display rate.
dsp_backend: the dsp_backend to query
Returns the current frames per sec display rate. This is not absolutely accurate but fits for displaying info to the player, it's an average.
Return value: the current averaged display rate.
dsp_backend: the dsp_backend to query
video_mode: a structure which will contain the results
Returns the current video mode, the one obtained by the driver. This function is also a way to know wether display is running correcly or not, by testing its return value.
Return value: 1 if ok, 0 if failure (mode not set)
dsp_backend: the dsp_backend to query
fullscreen_modes: a structure which will contain the results
Returns the current available fullscreen modes. Note that this one will only work if display is started, unlike
lw6gfx_get_fullscreen_modeswhich is used internally. The reason is that in this dsp module context, we need the thread to be launched, and the thread does start/stop display on its own.Return value: 1 if ok, 0 if failure (mode not set)
param: the structure to initialize
Fills a display param struct with zeros, this is mandatory before any use. Think of it as a raw memset.
Return value: none.
mode: 0 for check only, 1 for full test
Runs the test suite for the dsp module. In check (0) mode, won't test much to avoid failure because of missing graphical environment.
Return value: 1 if OK, 0 if error.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/dyn/index.html.
Opens a .so file directly, using a valid (full) path name.
Return value: a handle to the module, once it's opened. You might still need to call a module specific
init() function, but it's another story.
argc: the number of command-line arguments as passed to
maintop_level_lib: the top-level library concerned, this means is it "cli", "gfx", "snd" or "srv". This will tell the function to search for the .so file in the correct subdirectory. Think of this as a category.
Opens a .so file corresponding to the given backend, it is capable to search for system libraries installed after "make install" but if not found, it will also search in the current build directory, finding the .so files in hidden .libs subdirectories.
Return value: a handle to the module, once it's opened. You might still need to call a module specific
init() function, but it's another story.
handle: the backend to close.
Closes an opened backend. Note that you must call any backend specific clear, destroy, deinit, exit, function before.
Return value: 1 if success, 0 on error.
handle: the backend concerned
func_name: the function name, as a NULL terminated string
Finds a C function in the given backend.
Return value: a pointer to the function, NULL if not found.
argc: the number of command line args, as passed to main
argv: the commind line args, as passed to main
top_level_lib: the library category to query (gfx, snd, cli, srv ...)
Returns an assoc which lists all the available modules. The key of the assoc entries in the module internal name such as 'gl' and the value associated is a NULL terminated string describing the module, for instance 'OpenGL'.
Return value: an assoc object containing key/label pairs.
argc: the number of command-line arguments as passed to
maintop_level_lib: the top-level library concerned, this means is it "cli", "gfx", "snd" or "srv". This will tell the function to search for the .so file in the correct subdirectory. Think of this as a category.
backend_name: the actual name of the backend, this is the name of the .so file, between "libmod_" and ".so". For instance, to find "libmod_gl.so", the right argument is "gl".
Get the full path to a .so file corresponding to the given backend, it is capable to search for system libraries installed after "make install" but if not found, it will also search in the current build directory, finding the .so files in hidden .libs subdirectories.
Return value: the full path of the .so file, needs to be freed.
mode: 0 for check only, 1 for full test
Runs the
dynmodule test suite, testing most (if not all...) functions. Will try to load libraries and query them for standard LW6-expected functions.Return value: 1 if test is successfull, 0 on error.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/gfx/index.html.
backend: the graphical backend to use
video_mode: the video mode to use at start up
resize_callback: a callback function which will be called at each resize event
Sets up the graphical backend for good, initializing a video mode and allocating ressources. This call can typically fail if there's no device available, if the user doesn't have enough rights to access the hardware, and so on.
Return value: 1 on success, 0 if not
backend: the backend to quit
Uninitializes the backend, that is, exits the graphical mode. All threads that use graphics must be closed when this is called.
Return value: none.
backend: the backend to represent
Returns a readable version of the backend object.
Return value: a newly allocated pointer.
backend: the backend to use
video_mode: the new video mode
This function changes the video mode. Note that the first time you set up the graphical environment you must call
lw6gfx_initbut to change the current mode, use this function. It should reload backend data automatically if needed (textures for instance). Note that before giving up and failing this function will try alternate video modes, and you're not garanteed to have the right mode after the call, even if it returns true. To check this, uselw6gfx_get_video_mode.Return value: 1 on success, 0 on failure;
backend: the backend to use
video_mode: the current video mode (will be overwritten, out parameter)
This function returns the current video mode.
Return value: 1 on success, 0 on failure;
backend: the backend to use
fullscreen_modes: the available fullscreen modes (will be overwritten, out parameter)
This function returns the current video mode.
Return value: 1 on success, 0 on failure;
backend: the backend to use
This function "pumps" events, that is gets pending events, puts them in queues, maintains internal states up to date. You really must call this very often or no input will be processed at all.
Return value: a pointer on the internal input state, musn't be freed.
backend: the graphical backend to use
mask: display flag, tells what to display
look: the look, the skin, contains display options
level: the level to display
game_struct: the game_struct associated with the level
game_state: the game_state associated with the level
local_cursors: the cursor to center the focus on
menu: the menu to display
progress: the value of the progress indicator
fps: the number of frames per second to display
mps: the number of moves per second to display
log_list: log messages to display
capture: wether to enable capture mode or not
gfx_debug: wether to enable gfx debugging tools
debug_team_id: for debug display, team to display informations about
debug_layer_id: for debug display, layer to display
This is the major drawing function, the one that encapsulates all others. As the program uses a separate thread to display things, we just pass this function many parameters, and let it do its job alone. So many parameters might sometimes be useless. It also allows the graphics backend decide wether menus and hud and background should interact. Or not.
Return value: 1 on success, 0 on failure.
argc: argc, as passed to
mainargv: argv, as passed to
mainList available gfx backends. The hash contains pairs with id and name for each backend. The id is the technical key you can use to load the backend, the name is something more readable you can display in an interface. The backend objects themselves are not instanciated by this (in fact, they are, but released on the fly) you need to load and initialize them afterwards.
Return value: hash containing id/name pairs.
argc: argc, as passed to
mainargv: argv, as passed to
mainname: string containing gfx key, typically got from
lw6gfx_get_backendsCreates a gfx backend, this is just about loading the dynamic library if needed, and/or check gfx engine is available, and connect to it. It does not perform initialization.
Return value: gfx backend.
backend: gfx backend to destroy
Frees the ressources associated to a gfx, which must have been properly uninitialized before.
Return value: none.
mode: 0 for check only, 1 for full test
Runs the
gfxmodule test suite. In check-only mode, this function won't test many things, for it requires a graphical mode to be available to perform the complete test.Return value: 1 if test is successfull, 0 on error.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/gfx/mod-gl/gl-utils/index.html (as there are many sub-directories in this module, please refer to the test coverage directory index for complete information).
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/glb/index.html.
buf: the data to encode
size: the size of data to encode
Encodes data into base64. Memory allocation is done automatically.
Return value: newly allocated string.
size: the size of the decoded data
base64_str: the string to decode
Decodes data from base64. Memory allocation is done automatically. Note that this function only works for strings, other data might not be handled correctly.
Return value: newly allocated pointer, NULL on error.
str: the string to encode
Encodes a string into base64.
Return value: newly allocated string.
str: the string to decode
Decodes a string from base64.
Return value: newly allocated string, NULL on error.
buf: the data to encode
size: the size of data to encode
prefix: a prefix string
Encodes data into base64. Memory allocation is done automatically. The encoded string will be prefixed with
prefix.Return value: newly allocated string.
size: the size of the decoded data
base64_str: the string to decode
prefix: a prefix string
Decodes data from base64. Memory allocation is done automatically. Note that this function only works for strings, other data might not be handled correctly. The encoded is expected to start with prefix
prefixand then contain base64 data.Return value: newly allocated pointer, NULL on error.
str: the string to encode
prefix: a prefix string
Encodes a string into base64. The encoded string will be prefixed with
prefix.Return value: newly allocated string.
str: the string to decode
prefix: a prefix string
Decodes a string from base64. The encoded is expected to start with prefix
prefixand then contain base64 data.Return value: newly allocated string, NULL on error.
key: the key buffer
key_sizebuf: the data to analyse
buf_size: the size of data to analyse
Calculates an SHA-1 sum of buffer, using key to seed calc.
Return value: newly allocated string, containing 20 chars checksum.
key: a key (string)
str: the string to calculate the checksum for
Calculates an SHA-1 sum of a string, using key to seed calc.
Return value: newly allocated string, containing 20 chars checksum.
key: the key buffer
key_sizebuf: the data to analyse
buf_size: the size of data to analyse
Calculates an SHA-1 sum of buffer, using key to seed calc.
Return value: a 32-bit unsigned integer
key: a key (string)
str: the string to calculate the checksum for
Calculates an SHA-1 sum of a string, using key to seed calc.
Return value: a 32-bit unsigned integer
mode: 0 for check only, 1 for full test
Runs the
glbmodule test suite.Return value: 1 if test is successfull, 0 on error.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/gui/index.html.
button: the button to update
timestamp: the current ticks (milliseconds)
Registers a "down" (press) event on a button.
Return value: none.
button: the button to update
Registers a "up" (release) event on a button.
Return value: none.
button: the button to query
Tells wether a button is pressed or not.
Return value: 1 if pressed, 0 if not.
button: the button to query
Tells how many times the button has been pressed. Typical usage: the button is pressed, released, pressed, released several times. Then, after all this, you want to know how many times it has been pressed. Querying its state with
lw6gui_button_is_pressedwon't tell you much but thispop_pressfunction will return 1 for each press there's been.Return value: 1 if there's a press event in the queue, 0 if empty.
button: the button to query
Tells how many times the button has been simpleclicked. This is different from a simple press, in fact, there's a delay, we must wait until the double-click delay is elapsed to make sure this is a simple click... Designed for use with mouse to differentiate fire and alternate fire.
Return value: 1 if there's a simpleclick event in the queue, 0 if empty.
button: the button to query
Tells how many times the button has been doubleclicked. Typical usage: the button is doubleclicked, released, doubleclicked, released several times. Then, after all this, you want to know how many times it has been doubleclicked.
Return value: 1 if there's a doubleclick event in the queue, 0 if empty.
button: the button to query
Tells how many times the button has been tripleclicked. Typical usage: the button is tripleclicked, released, tripleclicked, released several times. Then, after all this, you want to know how many times it has been tripleclicked.
Return value: 1 if there's a tripleclick event in the queue, 0 if empty.
button: the button to update
repeat_settings: the repeat settings
timestamp: the current ticks (milliseconds)
Updates the repeat informations for a button, must be called regularly, as often as possible.
Return value: none.
dst: the target button object
src: the source button object
Synchronizes two button objects. This is typically used to pass data from one thread to another. This is not a simple copy, it will handle data such as "when was it pressed last" it an intelligent manner, popping src data to put it in dst, and clearing src.
Return value: 1 if success, O if failure.
dst_x: the x coord to return
dst_y: the y coord to return
dst_x0: the x coord of point 0 in destination coord system
dst_y0: the y coord of point 0 in destination coord system
dst_w: the width of the area in destination coord system
dst_h: the width of the area in destination coord system
src_x: the x coord in source coord system
src_y: the y coord in source coord system
src_x0: the x coord of point 0 in source coord system
src_y0: the y coord of point 0 in source coord system
src_w: the width of the area in source coord system
src_h: the width of the area in source coord system
Registers a "down" (press) event on a button.
Return value: 1 if OK, 0 if error (unable to calculate).
x: x coord (in/out param)
y: y coord (in/out param)
x_flip: flip on x (out param, -1 or +1)
y_flip: flip on y (out param, -1 or +1)
w: width
h: height
x_polarity: x polarity (-1, 0 or 1)
y_polarity: y polarity (-1, 0 or 1)
Same as
lw6map_fix_coordsexcept it operates on floats. Usefull for cursor and other rendering operations. Additionnally, will keep track of inversions, that is to say if map is flip in one or another way. Be carefull, the flip values are -1 or 1 so that it's easy to multiply an offset by it, for instance, but this means testing if flip is not 0 will always return true, you must test if flip is stritly positive or negative.Return value: none
input: the input struct to initialise
Initialises an input structure, don't use twice, it won't free a previous init.
Return value: a pointer to the newly allocated object.
input: the input struct to uninitialise
Unitialises an input structure, need to call it to free event queue.
Return value: a pointer to the newly allocated object.
Creates an input structure, which can be used to handle input state & buffer.
Return value: a pointer to the newly allocated object.
input: the input object to free.
Deletes an input structure.
Return value: none.
input: the input struct to reset
Resets an input structure. Must have been initialized before. It will empty all queues and mark everything as unpressed.
Return value: 1 on success, 0 if failure.
input: the input to update
repeat_settings: the repeat settings (delay + interval)
timestamp: the current ticks (milliseconds)
Updates the repeat informations for an input, must be called regularly, as often as possible.
Return value: none.
input: the input to update
Tells an input object that one of its descendants has been modified. This will affect the return value of
lw6gui_input_need_syncReturn value: none.
input: the input to test
Tests wether an input object contains was modified and needs synchronisation.
Return value: 1 if sync is need, 0 if not.
dst: the target input object
src: the source input object
Synchronizes two input objects. This is typically used to pass data from one thread to another. This is not a copy, it will brute-force copy the static data such as mouse position, but anything like a queue will be treated in a "empty source and fill target with data" scheme. So source will be affected by this, the key buffer will be emptied, and so on. And if there are key in the target buffer, they won't be overwritten but kept in front of the FIFO list.
Return value: 1 if success, O if failure.
i: index to check
Checks wether the index is correct. Does not mean the joystick exists, it's just to avoid out of bounds errors.
Return value: 1 if within range, 0 if not.
joystick: joystick to update
x: x-axis position, as returned by the driver
limit: the limit, under this, buttons are considered unpressed.
timestamp: current ticks (timestamp in ms)
Updates the x axis of a joystick, this will convert an information of analog type such as "joystick is here" to a pad-like information such as "pressed in that direction".
Return value: 1 if within range, 0 if not.
joystick: joystick to update
limit: the limit, under this, buttons are considered unpressed.
timestamp: current ticks (timestamp in ms)
Updates the y axis of a joystick, this will convert an information of analog type such as "joystick is here" to a pad-like information such as "pressed in that direction".
Return value: 1 if within range, 0 if not.
joystick: the joystick to update
repeat_settings: the repeat settings (delay + interval)
timestamp: the current ticks (milliseconds)
Updates the repeat informations for a joystick, must be called regularly, as often as possible.
Return value: none.
dst: the target joystick object
src: the source joystick object
Synchronizes two joystick objects. This is typically used to pass data from one thread to another.
Return value: 1 if success, O if failure.
joystick: the joystick to query
move_pad: the structure which will contain the results
Returns the state of the joystick in a uniform, non-device specific structure containing only the up/down/left/right information.
Return value: none, the value are stored in
move_pad.
keysym: the keysym to check
Tells wether the keysym is valid or not.
Return value: 1 if valid, 0 if not
keyboard: the keyboard structure which stores keyboard state
Pops (in FIFO mode) a keypress stored in the keyboard buffer. You must free the obtained keypress object after you're done with it.
Return value: a newly allocated pointer, or NULL if no keypress pending.
keyboard: the keyboard structure which stores keyboard state
Tells wether a key is pressed or not. The function will test out of bound values.
Return value: 1 if pressed, 0 if not.
keyboard: the keyboard structure which will store the keypress
keysym: the keysym for the keypress
unicode: the ASCII/unicode code for the keypress
label: the label for the keypress
timestamp: the current ticks (timestamp in ms)
Registers a keypress event, that is, puts it in the event queue. This function does not take an
lw6gui_keypress_tstructure but separated args, this is because it will construct the object internally. You may freelabelafter calling this, an internal copy will be done. This function will also maintain the array of key states up to date.Return value: 1 if success, O if failure.
keyboard: the keyboard structure which will store the keypress
keysym: the keysym for the keypress
Registers a key release event.
Return value: 1 if success, O if failure.
keyboard: the keyboard to update
repeat_settings: the repeat settings (delay + interval)
timestamp: the current ticks (milliseconds)
Updates the repeat informations for a keyboard, must be called regularly, as often as possible.
Return value: none.
dst: the target keyboard object
src: the source keyboard object
Synchronizes two keyboard objects. This is typically used to pass data from one thread to another. Will pop the src queue to fill the dst queue.
Return value: 1 if success, O if failure.
keyboard: the keyboard to query
move_pad: the structure which will contain the results
Returns the state of the keyboard in a uniform, non-device specific structure containing only the up/down/left/right information.
Return value: none, the value are stored in
move_pad.
keysym: the keysym to use
unicode: the unicode value for this keysym
label: the label (optional, might be NULL)
Creates a keypress structure, the only reason for needing a contructor is that the label field needs be duplicated.
Return value: a pointer to the newly allocated object.
keypress: the keypress object to free.
Deletes a keypress structure.
Return value: none.
keypress: the keypress to work on
Returns a human-readable representation of the keypress.
Return value: a newly allocated string
title: the string to be displayed, what the user sees. Can be freed after the call is done, function will make a copy internally.
help: a string introducing the menu, describing what it does, giving hints on how to use it.
popup: a string to be displayed in popup mode when menu is displayed for the first time.
esc: the label to be displayed in the ESC button
enable_esc: wether to enable the escape button.
Constructs a new menu object. Note that you can always call other functions to modify it afterwards.
Return value: a pointer to the newly allocated object.
menu: a pointer to the menu.
Frees the menu, checking if things are OK before doing so.
Return value: none.
menu: a pointer to the menu.
Gets the memory occupied by the menu. Could be usefull to help a garbage collector taking decisions or reporting erros, for instance.
Return value: the number of bytes used.
menu: a pointer to the menu.
Constructs a readable description of the object. Usefull for debugging, or to introspect things using scripts, at run-time. Does not necessarly describe all the informations about the object, but helps knowing what it is.
Return value: a string describing the object, must be freed.
menu: a pointer to the menu.
title: the new title, you can free it after calling the function, an internal copy will be made.
Change the title of the menu. Use this function to change the title, don't try to access the struct directly. The idea is to have safe memory management.
Return value: none
menu: a pointer to the menu.
help: the new help, you can free it after calling the function, an internal copy will be made.
Change the help of the menu. Use this function to change the help, don't try to access the struct directly. The idea is to have safe memory management.
Return value: none
menu: a pointer to the menu.
popup: the new popup, you can free it after calling the function, an internal copy will be made.
Change the popup of the menu. That is to say, its popup. Use this function to change the popup, don't try to access the struct directly. The idea is to have safe memory management.
Return value: none
menu: a pointer to the menu.
Closes the popup, in practice, this is equivalent to setting the popup string to "" or NULL.
Return value: none
menu: a pointer to the menu.
Tells wether a popup is defined. Behavior is simplistic, at creation (when a non-NULL non-empty popup string has been set) then the popup is displayed. In this state, popup is considered to be defined. Then it can be close, and after this action the popup ain't here anymore, program continues the way it started.
Return value: 1 if has popup, 0 if does not
menu: the menu we want to query
position: the order of the item we want
Gets the menu item at the given position. First item is 0, last is N-1. Returns a pointer on the real object, not a copy.
Return value: a pointer to a menu item, NULL if out of range.
menu: the menu we want to modify
position: the position of the item we want to select
allow_scroll: wether scrolling should be allowed when displaying it
now: the current time, as a timestamp.
Selects the item at the given position. Use this function to be sure that only one item is selected, and all other states are consistent. Timestamp is needed for the sake of eye-candy.
Return value: 1 if success, 0 if failure (out of range).
menu: the menu we want to modify
state: 1 to select, 0 to unselect
now: the current time, as a timestamp.
Selects the escape item, this does not affect other items, it's mostly. to handle eye candy.
Return value: none.
menu: the menu we want to modify
state: 1 to enable, 0 to disable
now: the current time, as a timestamp.
Enables the escape item, this does not affect other items, it's mostly. to handle eye candy.
Return value: none.
menu: the menu to scroll
Scrolls a menu up, used as a callback for mouse wheel up for instance. The idea is just to decrement the first displayed item index.
Return value: 1 if OK, 0 if failed (out of range).
menu: the menu to scroll
Scrolls a menu down, used as a callback for mouse wheel down for instance. The idea is just to increment the first displayed item index.
Return value: 1 if OK, 0 if failed (out of range).
menu: the menu to scroll
breadcrumbs: list of strings containing breadcrumbs
Set the breadcrumbs, that's to say the readable, logical path to get to a given menu. This is just eye candy, not linked to any logic at this level.
Return value: 1 if OK, 0 if failed.
menu: the menu to center
position: the position of the menuitem to be put in the center
max_displayed_items: the maximum number of items displayed
Centers the menu on a given menuitem. Typically used when pushing a menu with a menuitem selected 'anywhere' in the list.
Return value: none.
menu: the menu we want to modify
menuitem: the item to insert
position: the position the new item will occupy ("insert before" mode)
now: the current time, as a timestamp.
Inserts the given item in the menu. All items starting at the insert position will be "pushed" (that is, their position incremented by 1). Once the menuitem is inserted, the menu object will take care of memory management and automatically free it when needed.
Return value: 1 if success, 0 if failure (memory problem, out of range).
menu: the menu we want to modify
menuitem: the item to insert
now: the current time, as a timestamp.
Appends the given item to the menu. Once the menuitem is appended, the menu object will take care of memory management and automatically free it when needed.
Return value: 1 if success, 0 if failure (memory problem).
menu: the menu we want to modify
position: the item to insert
now: the current time, as a timestamp.
Removes an item from the menu. It will automatically be freed.
Return value: 1 if success, 0 if failure (out of range).
menu: the menu concerned
max_displayed_items: the maximum number of items to display at once
Updates the display range. The reason for having this is that the first item, that is, how far we scroll in a very long menu, depends on the previous position. Plus you have to handle limit cases (begin/end). Thus, this function, which will automatically pick-up a suitable position. Of course,
first_item_displayedis not necessarly equal toselected_item.Return value: none.
menu: the menu to work on
label: the label of the menuitem to append
tooltip: the tooltip of the menuitem to append
value: the value of the menuitem to append
enabled: wether the inserted menuitem should be enabled
selected: wether the inserted menuitem should be selected
colored: wether the inserted menuitem should use value as its color
now: current time (timestamp)
Inserts a menu item at the given position. The idea is that the menu item object is automatically constructed on the fly, and an id is returned, which can be passed to '_using_id' menu-related functions. This is typically for using in scripts. The idea is that the script just keeps a copy of the id returned, and can this way operate directly on the menuitem without keeping a pointer, a smob or anything internally. From the C point of view, having a real C structure enables persistent data from one display to the other, and this is nice and conveninent. I acknowledge the prototype is scary.
Return value: 0 if error, or else an id which will later be used with '_using_id' functions.
menu: the menu to work on
label: the label of the menuitem to append
tooltip: the tooltip of the menuitem to append
value: the value of the menuitem to append
enabled: wether the appended menuitem should be enabled
selected: wether the appended menuitem should be selected
colored: wether the appended menuitem should use value as its color
now: current time (timestamp)
Appends a menuitem using the same logic as
lw6gui_menu_insert_for_id_usethat is to say a parameter is returned which can later be used to directly operate on a given menuitem, without having its pointer, and even if its position changes.Return value: 0 if error, or else an id which will later be used with '_using_id' functions.
menu: the menu to work on
menuitem_id: the id of the menuitem to remove
now: current time (timestamp)
Deletes the menuitem with the given id. Very important: the id is not the position. Id are arbitrary numbers that stick to menuitems, but they are not directly linked with the position. This function is practical to use if, for some reason, you don't have the pointer on the menuitem.
Return value: 1 if success, 0 if failure (out of range).
menu: the menu to work on
menuitem_id: the id of the menuitem to synchronize
label: menu label
tooltip: menu tooltip
value: value
enabled: wether it's usable or not
selected: 1 if the menuite is current item
colored: wether to use color
now: current time (timestamp)
Updates the menuitem with the given id. Very important: the id is not the position. Id are arbitrary numbers that stick to menuitems, but they are not directly linked with the position. This function is practical to use if, for some reason, you don't have the pointer on the menuitem. In practice, it's heavily used in the game to transmit informations from the scripts to the core C engine. Additionnaly, this function will automatically synchronize the
selected_itemfield of the menu struct.Return value: 1 if success, 0 if failure (out of range).
menu_a: first item to compare
menu_b: second item to compare
Compares two menus.
Return value: 1 if they are the same, 0 if not
menu: the menu to duplicate
Duplicates a menu structure.
Return value: a pointer to the new menu.
dst: the target menu
src: the source menu
Synchronizes two menus, this supposes that they represent the same menu, but simply in a different state. This function does not really copy src to dst, it has a special behavior, indeed everything is copied from src to dst, except the
first_item_displayedandnb_items_displayedwhich are taken from dst and copied to src. This is because in practise, those values are updated in the display loop/thread, which is the one which uses the target. This is not very orthodox, but should work.Return value: 1 if success, 0 if failure
label: the string to be displayed, what the user sees. Can be freed after the call is done, function will make a copy internally.
tooltip: the string to be displayed as a tooltip, describing the menu item in detail. Can be NULL if you don't want to use this feature.
value: the value. No GUI function uses this, this is the "real" value associated to the item.
enabled: wether the menu item can be selected, used, and so on
selected: wether the menu item is the item selected among all menu items.
colored: wetherr the menu item must, when drawn, be colored according to its value.
Constructs a new menuitem object. Note that you can always call other functions to modify these values afterwards, this might change rendering since
lw6gui_menuitem_set_valueorlw6gui_menuitem_set_labelwill, for instance, modify the "when was that item last modified" information.Return value: a pointer to the newly allocated object.
menuitem: a pointer to the menuitem.
Frees the menuitem, checking if things are OK before doing so.
Return value: none.
menuitem: a pointer to the menuitem.
Gets the memory occupied by the menuitem. Could be usefull to help a garbage collector taking decisions or reporting erros, for instance.
Return value: the number of bytes used.
menuitem: a pointer to the menuitem.
Constructs a readable description of the object. Usefull for debugging, or to introspect things using scripts, at run-time. Does not necessarly describe all the informations about the object, but helps knowing what it is.
Return value: a string describing the object, must be freed.
menuitem: a pointer to the menuitem.
label: the new label, you can free it after calling the function, an internal copy will be made.
now: the current time, as a timestamp.
Change the label of the menu item. That is to say, what the user sees. Use this function to change the menuitem value, don't try to access the struct directly. The idea is 1) to have safe memory management and 2) to keep the
last_changemember up to date. It can be later used for eye-candy effects.Return value: none
menuitem: a pointer to the menuitem.
tooltip: the new tooltip, you can free it after calling the function, an internal copy will be made.
now: the current time, as a timestamp.
Change the tooltip of the menu item (the explanation of what the item is about) Use this function to change the menuitem value, don't try to access the struct directly. The idea is 1) to have safe memory management and 2) to keep the
last_changemember up to date. It can be later used for eye-candy effects.Return value: none
menuitem: a pointer to the menuitem.
value: the new value.
now: the current time, as a timestamp.
Changes the value of a menuitem. This is the internal value, not what the user sees. Use this function to change the menuitem value, don't try to access the struct directly. The idea is to keep the
last_changemember up to date. It can be later used for eye-candy effects.Return value: none
menuitem: a pointer to the menuitem.
state: 1 to select, 0 to unselect
now: the current time, as a timestamp.
Switches the menuitem to (un)selected state. Use this function, don't try to modify the struct members directly. The idea is to have the
last_selectparameter up to date. It can be later used for eye-candy effects.Return value: none
menuitem: a pointer to the menuitem.
state: 1 to enable, 0 to disable
now: the current time, as a timestamp.
Switches the menuitem to enabled/disabled state. Use this function, don't try to modify the struct members directly. The idea is to have the
last_selectparameter up to date. It can be later used for eye-candy effects.Return value: none
menuitem: the menuitem we want to identify
Returns a checksum which can be used to know, for instance, wether the menuitem has changed or not, and if we should redraw it.
Return value: a checksum.
menuitem_a: first item to compare
menuitem_b: second item to compare
Compares two menuitems.
Return value: 1 if they are the same, 0 if not
menuitem: the menuitem to duplicate
The menuitem to duplicate.
Return value: a pointer to the duplicted menuitem.
dst: the target menuitem
src: the source menuitem
Synchronizes two menuitems, this supposes that they represent the same item, but simply in a different state.
Return value: 1 if success, 0 if failure
mouse: the mouse object to work on
screen_pos_x: the x position on screen
screen_pos_y: the y position on screen
timestamp: current timestamp
Registers a mouse move event.
Return value: note.
mouse: the mouse object to poll
screen_pos_x: pointer to the x position (can be NULL), will be updated even if no move
screen_pos_y: pointer to the y position (can be NULL), will be updated even if no move
Asks wether the mouse has moved or not.
Return value: 1 if mouse was moved since last call, 0 if not.
mouse: the mouse to update
repeat_settings: the repeat settings (delay + interval)
timestamp: the current ticks (milliseconds)
Updates the repeat informations for a mouse, must be called regularly, as often as possible.
Return value: none.
dst: the target mouse object
src: the source mouse object
Synchronizes two mouse objects. This is typically used to pass data from one thread to another. Will handle "mouse move" attribute and clear it in src if needed while setting it in dst.
Return value: 1 if success, O if failure.
mouse: mouse struct to update
To be called when one wants to start recording a drag session, typically when left button is pressed.
Return value: none.
mouse: mouse struct to update
To be called when one wants to stop recording a drag session, typically when left button is released.
Return value: none.
mouse: mouse struct to query
delta_x: x movement (on screen, out param can be NULL)
delta_y: y movement (on screen, out param can be NULL)
pos_x: x pos (on screen, out param can be NULL)
pos_y: y pos (on screen, out param can be NULL)
speed_x: x speed (on screen, out param can be NULL)
speed_y: y speed (on screen, out param can be NULL)
To be called when one wants to stop recording a drag session, typically when left button is released.
Return value: none.
point: point to test
rect: rectangle in which point is supposed to be
Tests wether a point is inside a rectangle, this is typically used to know if a point is inside the right texture or if we're outside.
Return value: 1 if OK, 0 if outside
quad: quad to test
rect: rectangle in which quad is supposed to be
Tests wether a quad is inside a rectangle, this is typically used to know if a quad is inside the right texture or if we're outside.
Return value: 1 if OK, 0 if outside
rect: the structure to initialize
x1: x for top left corner
y1: y for top left corner
x2: x for bottom right corner
y2: y for bottom right corner
Initializes a rect structure, will calculate w & h.
Return value: none.
rect: the structure to initialize
x: x for top left corner
y: y for top left corner
w: width
h: height
Initializes a rect structure, will calculate x2 & y2.
Return value: none.
dst: the structure which will contain the result
src: the source rect
clip: the clipping rect (boundaries)
Clips a rect (think of rectangle clips).
Return value: none.
segment: segment to test
rect: rectangle in which segment is supposed to be
Tests wether a segment is inside a rectangle, this is typically used to know if a segment is inside the right texture or if we're outside.
Return value: 1 if OK, 0 if outside
smoother: the structure to initialize
value: the value to use for now
duration: the duration of a standard move, in ticks (msec)
Initializes a smoother object, with a default value. The important point is the duration which will condition all the behavior of the object.
Return value: none.
smoother: the structure to use
value: the target value
Forces a smoother object to immediately point on a value.
Return value: none.
smoother: the structure to use
value: the target value
now: the current timestamp
Sets a new target, will automatically calculate current speed to smooth the next returned values.
Return value: none.
smoother: the structure to use
now: the current timestamp
Returns the current value of the smoother.
Return value: a float.
smoother: object to modify
step: step size, typically twice the map size
Companion function of
lw6pil_coords_fix_x10, this one will fix a smoother target to avoid crazy scrolls when cursor is on a map edge.Return value: none.
mode: 0 for check only, 1 for full test
Run tests in the gui module.
Return value: 1 if successfull, 0 if failed.
triangle: triangle to test
rect: rectangle in which triangle is supposed to be
Tests wether a triangle is inside a rectangle, this is typically used to know if a triangle is inside the right texture or if we're outside.
Return value: 1 if OK, 0 if outside
closest: the closest video_mode found
wished: the wished video_mode
available: a list of available video_modes (list of lw6gui_video_mode_t *)
Finds the closest video_mode available, this is just a small utility to cope with different screen shapes and avoid requesting 640x480 when it's just not available but there's a 640x400 instead.
Return value: 1 if the wished video_mode exists in available list and was found, else 0 if the wished video_mode doesn't exist and an approximative match was picked.
mode_a: first mode to compare
mode_b: second mode to compare
Compares two video modes, to know if they're the same.
Return value: 1 if equal, 0 if not.
dst: the target video mode
src: the source video mode
Applies the ratio of src to dst, for instance if src is 16/9, then dst will be made 16/9 too, trying to keep the same surface.
Return value: 1 on success, 0 on failure
viewport: the viewport to initalize
screen_w: screen width
screen_h: screen height
drawable_x1: viewport min x
drawable_y1: viewport min y
drawable_x2: viewport max x
drawable_y2: viewport max y
center_x: center of display (in map coordinates)
center_y: center of display (in map coordinates)
map_w: map width (shape)
map_h: map height (shape)
x_polarity: x polarity
y_polarity: y polarity
x_wrap: wether to wrap horizontally
y_wrap: wether to wrap vertically
keep_ratio: wether to adapt to viewport shape or keep original
global_zoom: global zoom is style_zoom * dynamic_zoom
scroll_limit: inside this zone, don't scroll
use_old_center: wether to take previous center in account
Initializes all the (jumbo?) viewport structure which will contain valuable informations for a simple "flat" display. Special renderers might not find usefull some fields and handle wrapping and zooming their own way, but this offers a basic skeleton.
Return value: 1 if ok, 0 on failure
viewport: the viewport to use
screen_x: the x coord on the screen
screen_y: the y coord on the screen
map_x: the x coord in map coordinates
map_y: the y coord in map coordinates
clip: wether to clip returned values
Translates from map coords to screen coords. Returned values might be outside screen boundaries if clip is 0. If screen coords are outside drawable area anc clip is 1, then they will be clipped.
Return value: NULL
viewport: the viewport to use
map_x: the x coord in map coordinates
map_y: the y coord in map coordinates
screen_x: the x coord on the screen
screen_y: the y coord on the screen
wrap: wether to use polarity informations to wrap coords.
Translates from screen coords to map coords. If wrap is set, it will interpret coords the way
lw6map_coords_fix_xywould, only it can still be formally outside map boundaries for it can return a value exactly equal to w,h while in interger mode it would be w-1,h-1.Return value: NULL
viewport: viewport to work on
map_dst_x: map det x coord (out param)
map_dst_y: map dst y coord (out param)
map_src_x: map src x coord
map_src_y: map src y coord
screen_dx: drag x (on screen)
screen_dy: drag y (on screen)
Used to calculate the new "center" when in drag mode.
Return value: none.
zone: the structure to initialize
x1: x for top left corner
y1: y for top left corner
x2: x for bottom right corner
y2: y for bottom right corner
Initializes a zone structure, will calculate w & h.
Return value: none.
zone: the structure to initialize
x: x for top left corner
y: y for top left corner
w: width
h: height
Initializes a zone structure, will calculate x2 & y2.
Return value: none.
dst: the structure which will contain the result
src: the source zone
clip: the clipping zone (boundaries)
Clips a zone (think of rectangle clips).
Return value: none.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/hlp/index.html.
keyword: the keyword we want to check out
Checks wether a given keyword is documented or not.
Return value: 1 if documented, 0 if not.
type: the type of the data associated to the keyword, will be written
default_value: the default value for the keyword, will be written
min_value: the min value for the keyword, will be written
max_value: the max value for the keyword, will be written
keyword: the keyword we want help about
Returns the documentation string associated to a keyword. The keyword might be a command-line option, a Guile function, an XML file entry. Raises a warning if the keyword is undocumented, but never returns NULL, you can use the returned value without checking it. String is localized if a translation is available. It's safe to call this function with type or other parameters being NULL.
Return value: a help string, never NULL, must not be freed. Additionnally, type will be updated.
keyword: the keyword we want the type of
Returns the type of a keyword. Calls lw6hlp_about internally.
Return value: the type, might be LW6HLP_TYPE_VOID.
keyword: the keyword we want the default for
Returns the default value for a keyword. Note that it can be NULL! The returned value is always a string, it's suitable to store in the config file, it's the value a user would pass on a command line, the one he wants documented.
Return value: a pointer, which can be NULL, must not be freed.
keyword: the keyword we want the min for
Returns the min value for a keyword. Wether this is relevant for a given keyword does not affect the fact that you can call this function. A min and max of zero means min and max make no sense.
Return value: the value (integer)
keyword: the keyword we want the max for
Returns the max value for a keyword. Wether this is relevant for a given keyword does not affect the fact that you can call this function. A min and max of zero means min and max make no sense.
Return value: the value (integer)
id: the id of the credits line to return
Returns a "credit line", that is a short sentence, about 30 to 50 chars, saying who developped the game, created graphics, giving important URLs, and so on. One can pass an arbitraty high
id, no risk.Return value: the string, must be freed.
keyword1: the 1st keyword
keyword2: the 2nd keyword
Checks wether a keyword matches another. Not only a string comparison, will also try and guess if the error is only about dash "-" replaced by underscode "_", for instance.
Return value: 1 if matches, 0 if different.
Returns the list of keywords concerning quick options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning self-documentation system.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the show options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the path options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the players options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the input options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the graphics options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the sound options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the network options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the map options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the rules options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the hints options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the style options.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning the teams options.
Return value: list of static strings (can't modify them)
Returns the list of C-function exported to Guile.
Return value: list of static strings (can't modify them)
Returns the list of hooks.
Return value: list of static strings (can't modify them)
Returns the list of keywords concerning advanced options.
Return value: list of static strings (can't modify them)
Returns the list of command-line aliases.
Return value: list of static strings (can't modify them)
Returns the list of team_colors.
Return value: list of static strings (can't modify them)
Returns the list of weapons.
Return value: list of static strings (can't modify them)
Returns the list of all available keywords.
Return value: list of static strings (can't modify them)
list: a pointer to a list of keywords
f: the file to print the content to
Prints all the keywords from the list. One keyword per line.
Return value: none.
list: a pointer to a list of keywords
f: the file to print the content to
Prints all the keywords from the list, with the associated keyword help, to the given file. Output is formatted to fit on the standard terminal/console.
Return value: none.
keyword: the keyword to print help about
f: the file to print the content to
Displays the help about a keyword, to a file, directly. It's formatted for the purpose of the –about=<value> option.
Return value: none
Initializes the help reference, this must be called before any call to lw6hlp_about or such help related functions.
Return value: 1 on success, 0 if failed
un-initializes the help reference, this must be called at the end of the program.
Return value: 1 on success, 0 if failed
mode: 0 for check only, 1 for full test
Runs the
hlpmodule test suite.Return value: 1 if test is successfull, 0 on error.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/img/index.html.
mode: 0 for check only, 1 for full test
Runs the
imgmodule test suite.Return value: 1 if test is successfull, 0 on error.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/ker/index.html.
game_state: game state to represent
Gives a string representation, an ASCII capture of the game. This representation is suitable for debugging, typically print it to a VT100 console.
Return value: dynamically allocated string.
cursor: the cursor to reset
Sets a cursor to defaults (disabled). This function will not touch the node_id and cursor_id fields, so you can call it on an already used cursor, it will stay usable.
Return value: none
game_struct: game_struct use to construct the object
progress: progress indicator
Creates a game state from a game struct. The game struct must be kept (never freed) while game_state is in use.
Return value: newly created object.
game_state: the object to free
Frees a game_state object, releases all required objects. At this stage the map_struct must still be available.
Return value: none
game_state: the game_state to modify
game_struct: the game_struct to point to
This can be used when one makes a copy (dup) of a game struct and for some reason want the game_state to point on this new copy. Of course you should make the game_state point to a game_struct that is identical to the one that was used to construct the object in the first place. Use at your own risk.
Return value: none
game_state: the game_state to query
Returns the approximative amount of memory taken by the object.
Return value: number of bytes (approximation)
game_state: the game_state to query
Gives a readable representation of the object.
Return value: newly allocated string, must be freed
dst: the destination game_state
src: the source game_state
Tells wether src and dst can be synced. This is not a fool proof function but in most cases it will raise the error, use it to avoid blunders. It just compares
dstandsrcand tries to guess if they correspond to the same logical objects.Return value: 1 if they are syncable, 0 if not.
dst: the destination game_state
src: the source game_state
Fundamental function, used to carbon copy a game state to another, this is intensively used to keep too tracks of the game state, one most-up-to-date but probably wrong, the one we use to display on the screen, and one slightly outdated (or very outdated if network is slow) but that we're sure of, something 100% bullet proof we can rely on.
Return value: 1 on success, 0 on error
game_state: the game_state to copy
progress: progress indicator
Dups (copy) a game_state object. The newly created object points to the same game_struct but is an independant copy, you can play a whole different game on it. In practice this is often used to create the game_state objects for anticipation in network games.
Return value: newly created object
game_state: the game_state to query
Calculates the checksum of a game_state, this can be very usefull to make sure two states are identicall (prevent network errors and/or cheating).
Return value: 32-bit checksum
game_state: the game_state to query
shape: the shape (out param)
Retrieves the shape (w*h*d)of the game_state.
Return value: none.
game_state: the game_state to query
Retrieves the width (shape.w) of the game_state.
Return value: the width.
game_state: the game_state to query
Retrieves the height (shape.h) of the game_state.
Return value: the height.
game_state: the game_state to query
Retrieves the depth (shape.d, AKA number of layers) of the game_state.
Return value: the depth.
game_state: the game_state to act on
node_id: the id of the node to register
Registers a node in the game, this must be done, else no action will be allowed (such as adding a cursor or moving it). There's a limited number of nodes allowed, and ids must be unique.
Return value: 1 on success, 0 on failure.
game_state: the game_state to act on
node_id: the id of the node to register
Unregisters a node in the game, this must be done when a node leaves the game, it will free ressources and allow others to connect.
Return value: 1 on success, 0 on failure.
game_state: the game_state to query
node_id: the node to test
Tells wether a node is present in a game.
Return value: 1 if node is in game, 0 if not
game_state: game_state to query
node_id: the node to get info about
last_command_round: the last round for which a command was issued (out parameter)
Queries information about a given node, mostly, what was the last round we got a command.
Return value: 1 on success, 0 on error.
game_state: the game_state to act upon
node_id: the node issuing the command
cursor_id: the id of the cursor to add
team_color: the color we wish
Adds a cursor in a game. Note that if there's already a cursor with that id, it will fail, and the color is only the color we wish, we might indeed be attributed another color on a successfull call.
Return value: 1 on success, 0 on error.
game_state: the game_state to act upon
node_id: the node issuing the command
cursor_id: the id of the cursor to remove
Removes a cursor from the game, corresponding teams will be removed if needed.
Return value: 1 on success, 0 on failure.
game_state: the game_state to query
cursor_id: the cursor to test
Tells wether a cursor is present in the game.
Return value: 1 if cursor exists, 0 if not.
game_state: the game_state to query
cursor: the cursor data (out param)
cursor_id: the cursor to query
Return value: 1 on success, 0 on failure.
game_state: the game state to query
cursor: the cursor (out param)
i: the index
Gets the cursor information, using its index. This is usefull to walk the whole cursor without knowing their ids.
Return value: none.
game_state: the game_state to act upon
cursor: the cursor
Sets a cursor, that is, changes its position, this is pretty much anything we can do about a cursor except adding or removing it, just because of Liquid War very simple rules. The passed pointer may be freed after the call, only the
cursor_id,node_id,x,yandfirefields are used, others are ignored. More precisely, theenabledwill be ignored, it's not a valid way to add/remove teams.Return value: 1 on success, 0 on failure
game_state: the game_state to query
team_color: the team color to test
Tells wether a team color is present in the game. Note that this is different from cursor ids.
Return value: 1 if team exists, 0 if not.
game_state: the game_state to query
team_color: the color to get informations about
nb_cursors: number of cursors with this color (out param)
nb_fighters: number of fighters with this color (out param)
Gets informations about a given color. Indeed, a color can have several cursors, and knowing how many fighters there are with a given color is probably the most important things about a color.
Return value: 1 on success, 0 on failure.
game_state: the game_state to query
Tells how many teams there are in a game. This is different from the cursors number, there can be more cursors than teams, because a team can have several cursors.
Return value: the number of teams.
game_state: the game_state to act upon
team_mask: a binary mask of which gradients (teams) must be spreaded
Spreads the gradient, that is, calculates the potential of each point on the map, ie the distance to the closest cursor. The binary mask allows gradient to be spread for only some teams, this is usefull in a multithreaded context, as gradients can be calculated separately.
Return value: none
game_state: the game_state to act upon
team_mask: a binary mask of which teams must be moved
Moves the fighters, note that you must calculate the gradient from time to time else they go to the wrong places. The
team_maskallows the moving of only some given teams, but moving (for instance) even teams then odd teams isn't the same as moving odd teams then even teams. Whereas as far as gradient calculation is concerned, this could have been true, you could have multithreaded that.Return value: none.
game_state: the game_state to act upon
Finishes a round, that is, vaccums various stuff, checks if some team has lost, and so on. This is complementary to the spread and move steps, it should be called at each round.
Return value: none.
game_state: the game_state to act upon
This is a fundamental function, it's called at each round, it fires all the complex calculations in the game, the real core algorithm. Every time this function is called, the round is "over" and the game state is ready for the next... round. It's equivalent to calling the spread, move and finish functions.
Return value: none.
game_state: the game_state to query
Returns the number of moves done on this game.
Return value: number of moves.
game_state: the game_state to query
Returns the number of spreads done on this game.
Return value: number of spreads.
game_state: the game_state to query
Returns the number of rounds done on this game.
Return value: number of rounds.
game_state: the game_state to query
Returns the number of playable rounds in the game, that is the number of rounds to be played if game goes up to the time limit. This is a fixed number, if game slows down then time is stretched, but the the exact maximum number of rounds is known at game start, and it is the number returned by this function.
Return value: number of rounds in the game
game_state: the game_state to query
Tells wether the game is over or not. The answer depends on time limit, game rules, and of course what happened on the battlefield.
Return value: 1 if over, 0 if not.
game_state: game_state to query
cursor_id: the cursor to test
Tells wether a cursor was the winner after a game is over.
Return value: 1 if cursor is in winning team, 0 if not.
game_state: the game_state to query
excluded_team: a team to exclude
Returns the winner, if you set excluded_team to something else than a valid team number (for instance -1, but 0 is a valid team) then this team will be excluded from search. This is usefull if you want to find out who's the best positionned player while excluding yourself, for instance if you're a bot.
Return value: the winner team number, note that it can be invalid (-1) if there's no winner (for example, there are no teams on the map).
game_state: the game_state to query
excluded_team: a team to exclude
Returns the looser, if you set excluded_team to something else than a valid team number (for instance -1, but 0 is a valid team) then this team will be excluded from search. This is usefull if you want to find out who's the worst positionned player while excluding yourself, for instance if you're a bot.
Return value: the looser team number, note that it can be invalid (-1) if there's no looser (for example, there are no teams on the map).
game_state: the game_state to query
Gets the number of active fighters, this is relatively constant within the game, it does not change when someone looses, but it can vary when a new team arrives or disappears.
Return value: number of fighters.
game_state: the game_state to query
Returns the time elapsed, this is not the real time you'd time with an atomic clock, rather the time that would have elapsed if game had been run at its nominal speed. There can be a difference if your computer is too slow, among other things.
Return value: time elapsed, in seconds.
game_state: the game_state to query
Returns the time left, this is not the real time you'd time with an atomic clock, rather the time that would theorically be left is game was to be run at its nominal speed. There can be a difference if your computer is too slow, among other things. You shouldn't rely on this to know wether a game is over or not, there's another dedicated function for that.
Return value: time left, in seconds.
game_state: the game_state to query
i: the index of the history point
team_id: the team to query
Returns the number of fighters at some point in the past (the lower i, the oldest). The history scrolls automatically and erases itself at some point, it's of constant length. This is the global, long term history, reflects the whole game and could be used for an end-game score screen.
Return value: number of fighters at that time.
game_state: the game_state to query
i: the index of the history point
team_id: the team to query
Returns the number of fighters at some point in the past (the lower i, the oldest). The history scrolls automatically and erases itself at some point, it's of constant length. This is the latest, short term history, reflects the recent game evolutions and could be used to display an in-game monitor.
Return value: number of fighters at that time.
game_state: game_state to query
Returns the maximum value, that is, the maximum number of fighters, all teams combined, for this history. This can be used to scale charts. This function for the global long term history.
Return value: max number of fighters.
game_state: game_state to query
Returns the maximum value, that is, the maximum number of fighters, all teams combined, for this history. This can be used to scale charts. This function for the latest short term history.
Return value: max number of fighters.
game_state: game_state to query
x: x position
y: y position
z: z position
Gets the id of a fighter in a given position. Previous versions of the game used to have this declared inline static for speed, but the price to pay in terms of maintainability was too high: too much stuff from the ker module had to be kept public. This functions is very likely to be called often when one wants to know what's happening on the battlefield, to draw it, for instance. If there's no fighter, the id is negative, any id equal or greater than 0 (returned by this function) is valid.
Return value: the id of the fighter at that position.
game_state: game_state to query
fighter_id: the id of the fighter
Gets a fighter by its id. Internally, all fighters are stored in an array so it could be "safe" to get fighter with id 0 then walk the array. Previous versions of the game used to have this public (the array), it has been hidden since.
Return value: pointer to the fighter with the given id.
game_state: game_state to query
x: x position
y: y position
z: z position
Gets a fighter by its position. This function will check for boundaries, if there's no fighter in this place, it will return NULL, but nothing worse can happen. More precisely, if the place is in a wall, it won't bug, unlike the non-bullet-proof equivalent of this function.
Return value: pointer to the fighter at this position, or NULL if none.
game_state: game_state to query
x: x position
y: y position
z: z position
Gets a fighter by its position. This function will not check for boundaries, if there's no fighter in this place, not only will it probably not return a valid value, but it will also even segfault before that, trying to access non-existing structures in menory. So only call this if you're sure there's a fighter here.
Return value: pointer to the fighter at this position, or NULL if none.
game_state: the game_state to query
team_id: the team id (color)
Gets the potential of a zone. In practice this is not needed to make the game function, you need not call this to know how to move fighters, however the information can be interesting for debugging.
Return value: the potential
game_state: game_state to query
team_color: the team color to query
Returns the charge ratio for a given team/color. A value of 100 means fire is enabled, more than 1000 means super-charge, under 100 means you have to wait.
Return value: integer value.
game_state: game_state to query
team_color: the team color to query
Returns how much of the weapon is yet to be consumed for a given team. More than 1000 means extra time, 1000 is standard time to be elapsed, 0 means it's over.
Return value: integer value.
game_state: game_state to query
team_color: the team color corresponding to last weapon (out param)
weapon_id: the corresponding weapon_id (out param)
per1000_left: how much of the weapon is yet to be spent (out param)
Returns informations about the latest weapon, this is typically for drawing purposes, just query this and you know if you need to paint everything in red, green, whatever, as far as the default backend is concerned. In case there's no weapon, well, parameters are untouched. Pointers can be passed as NULL.
Return value: 1 if found, 0 if not.
level: the level on which the game_struct is based
progress: progress indicator
Creates a new game_struct from a level. The game_struct is different from the level in the sense that the game_struct does contain algorithmic specific optimizations, it's a ready-to-use struct desgined for execution speed, while the plain level just stores information.
Return value: newly allocated object
game_struct: the game_struct to free
Frees a game_struct object, releasing all required stuff. The source level must still be available when freeing this.
Return value: none
game_struct: the game_struct to modify
level: the level to point to
This can be used when one makes a copy (dup) of a level and for some reason want the game_struct to point on this new copy. Of course you should make the game_struct point to a level that is identical to the one that was used to construct the object in the first place. Use at your own risk.
Return value: none
game_struct: the game_struct to query
Returns the approximative amount of memory taken by the object.
Return value: number of bytes (approximation)
game_struct: the game_struct to query
Gives a readable representation of the object.
Return value: newly allocated string, must be freed
game_struct: the game_struct to copy
progress: progress indicator
Dups (copy) a game_struct object. The newly created object points to the same game_struct but is an independant copy, you can play a whole different game on it. In practice this is often used to create the game_struct objects for anticipation in network games.
Return value: newly created object
game_struct: the game_struct to query
Calculates the checksum of a game_struct, this can be very usefull to make sure two structs are identicall (prevent network errors and/or cheating).
Return value: 32-bit checksum
game_struct: the game_struct to query
shape: the shape (out param)
Retrieves the shape (w*h*d)of the game_struct.
Return value: none.
game_struct: the game_struct to query
Retrieves the width (shape.w) of the game_struct.
Return value: the width.
game_struct: the game_struct to query
Retrieves the height (shape.h) of the game_struct.
Return value: the height.
game_struct: the game_struct to query
Retrieves the depth (shape.d, AKA number of layers) of the game_struct.
Return value: the depth.
game_struct: the game_struct to query
x: x position
y: y position
z: z position
Tests wether a given position is foreground, that is, occupied by a wall.
Return value: 1 if foreground (wall, fighters can't move), 0 if not
game_struct: the game_struct to query
x: x position
y: y position
z: z position
Tests wether a given position is background, that is, there's no wall.
Return value: 1 if background (wall, fighters can move), 0 if not
game_struct: game_struct to query
nb_zones: the maximum zone size (out param, can be NULL)
max_zone_size: the maximum zone size (out param, can be NULL)
This function gets information about the internal zoning system, can be used for debugging.
Return value: none.
game_struct: game_struct to query
i: index of the zone to query
zone_pos: coord of the zone, top-left corner (out param, can be NULL)
zone_size: size of the zone (out param, can be NULL)
This function gets information about the internal zoning system, can be used for debugging.
Return value: none
game_struct: the game_struct to query
x: x pos
y: y pos
z: z pos
Gets the zone id for a given position. The id returned can then be used to query for a potential, for instance.
Return value: the zone id
game_struct: the game_struct to query
there: the closest free slot (out param)
here: where we'd like to be
Tries to find the closest free slot (there) near a given position (here). This is typically used internally to find out where to apply the cursor when it's flying over walls.
Return value: none
game_state: the game_state to work on
next_pos: the next position (out param)
current_pos: the current position
team_color: the team color
Tries to find the best move given a position and a team. Note that this function does not check for the presence of another fighter, it will only check walls and can even (sometimes) fail when there's a path. The reason is that it uses the game_state at a given round and does not recalculate gradient while a real fighter has an ever-changing gradient. Whatsoever, this can be used to move cursors like they were fighters, it's not perfect but gives a good illusion.
Return value: 1 if best place found, 0 if not.
score_array: the score array to modify
game_state: the game_state to get the information from
Updates a score array, that is, calculates all scores, so that they can be displayed, for instance.
Return value: 1 on success, 0 on failure.
even: even team mask (out param)
odd: odd team mask (out param)
round: round concerned
Returns a default team mask for a given round, even and odd will contain ready to use masks (for spread and move functions for instance).
Return value: none.
even: even team mask (out param)
odd: odd team mask (out param)
game_state: the game_state concerned
Returns an optimal team mask for a given round, even and odd will contain ready to use masks (for spread and move functions for instance). The difference with the default team mask is that this one will test for which teams are present and try and manage to find an equilibrated set of odd/even teams.
Return value: none.
team_color: color index
team_mask: team mask
Tells wether a given team is concerned by a team mask.
Return value: 1 if concerned, 0 if not.
team_color: color index
Gives the mask corresponding to a given color.
Return value: bitwise mask.
mode: 0 for check only, 1 for full test
Runs the
kermodule test suite. Will perform deep checksums and *really* check many things. If this passes, the algorithm is fine. What could make it fail is a serious bug and/or some weird combination of endianess, byte alignment...Return value: 1 if test is successfull, 0 on error.
View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/ldr/index.html.
body: the body to read, must point to allocated memory
dirname: the directory of the map
param: map parameters
hints: map hints
display_w: the display width
display_h: the display height
ratio: wished map ratio
bench_value: the bench value (depends on computer capacity)
magic_number: arbitrary constant
progress: structure to transmit loading progress
Reads the map body, that is, all the layers.
Return value: 1 if OK, 0 if failed.
style: the style structure to process.
hints: additionnal hints to know what to set automatically
Deduces all colors from background color, if needed. The function will check color_auto parameters and replace all other colors by base and alternate colors if needed. Note that the background color itself is not changed by this function. Background can only be guessed from texture.
Return value: none.
cursor_texture: the cursor texture (out param)
dirname: the directory we load the data form (map dir)
Reads the cursor texture information, if not available, will use defaults
Return value: 1 on success, 0 on failure.