Liquid War(6) | Games Manual | Liquid War(6) |
liquidwar - a unique multiplayer wargame
liquidwar [-vh]
Liquid War is a multiplayer wargame. Its rules are very simple but yet original.
As Liquid War is a cross-platform program (it also runs on DOS and
Windows), I could reasonably not provide groff UNIX-style documentation to
Windows user. Therefore, Liquid War's documentation is available in many
formats, including HTML, PostScript and PDF.
I believe these formats are easier to read than this man page. So check out
the /usr/share/doc/liquidwar or /usr/local/share/doc/liquidwar
directories, for this is where HTML and other documentation files should be.
Otherwise, if you are a die-hard man page user, you may continue with this
document 8-)
Liquid War is a wargame. But it is different from common wargames.
When playing Liquid War, one has to eat one's opponent. There can be from 2 to 6 players. There are no weapons, the only thing you have to do is to move a cursor in a 2-D battlefield. This cursor is followed by your army, which is composed by a great many little fighters. Fighters are represented by small colored squares. All the fighters who have the same color belong to the same team. One very often controls several thousands fighters at the same time. And when fighters from different teams meet, they eat each other, it is as simple as that.
Teams are composed of little fighters. These fighters all act independently, so it can happen that one single fighters does something different from what all the other do.
The main goal of these fighters is to reach the cursor you control. And to do that, they are in a way quite clever, for they choose the shortest way to reach it. Check it if you want, but it is true, they *really* choose *the* shortest way to reach the cursor. That is the whole point with Liquid War.
But these fighters are not perfect, so when they choose this shortest way, they do as if they were alone on the battlefield. That's to say that if there is a fighter blocking their way, they won't have the idea to choose another way, which is free from fighters but would have been longer otherwise. So fighters can be blocked.
When two fighters from different team meet each other, they first try to avoid fighting, and they dodge. But if there is no way for them to move, they get angry and attack the guy which is blocking them. Sometimes, they attack each other and both loose health. But it can happen that a fighter is attacked by another one, which is himself not attacked at all.
Here is an example of this behaviour: A blue fighter and a red fighter both want to move to their right, for that would be the shortest way to reach their cursor if there was nobody on the battlefield. But they are blocked by other fighters. If, for instance, the red fighter is on the right and the blue fighter on the left, it is the red fighter which will be eaten.
When a fighter is attacked, he first looses health, that is to say that he gets darker. When his health reaches 0, his color changes and he becomes a member of the team by which he has been attacked. Therefore the number of fighters on the battlefield always remains the same.
When fighters of a same team get stuck together and block each other, then they regenerate, that is to say that they get brighter.
However, I think the best way for you to understand the way it works is to try the game...
When I play Liquid War, I always try to surround my opponents, and it usually works.
By the way, the computer has no strategy at all, he is a poor player, and if you get beaten by him, it means you have to improve yourself a lot!
But still, the computer doesn't do one thing which I've seen many beginners doing: he never keeps his cursor motionless right in the middle of his own fighters, for this is the best way to loose.
Here are some more tips, kindly submitted by Jan Samohyl.
The clever guy who has got the greatest number of fighters in his team at the end of the game. Or the one who exterminates all the other teams!
Liquid War rules have been invented by Thomas Colcombet.
He was trying to find algorithms to find the shortest path from one point to another, and found the Liquid War algorithm. Then it came to his mind that a game could be build upon this algorithm, and Liquid War was born. He programmed the first two versions of Liquid War using Borland Pascal for DOS, and gave me some information about the algorithm so that I could re-program it.
I'm the guy who programmed the latest versions of Liquid War. I enhanced the algorithms, and did quite a bunch of work to have the game playable by (almost) anyone, that's to say create a correct GUI.
If you want to join me, here's all the information you'll ever need:
Christian Mauduit
E-mail: ufoot@ufoot.org
Web site: "https://ufoot.org"
GnuPG public key: CA272B47 -
"https://ufoot.org/gnupg.pub"
GnuPG fingerprint: 71AD 4CBB 345A 5F15 6D03 AA6D 1050 9F67 CA27 2B47
Snail mail: 32 rue Jean Moulin 95100 Argenteuil FRANCE
As Liquid War is now free software, protected by the GPL, anyone is allowed to view, edit, modify, re-compile the source code, and distribute it, as long as Liquid War is still distributed under the GPL.
Here's a list of the contributors:
Many other people helped me by submitting bug reports and patches, and I want to thank them for their precious help. Thanks to all the Debian people too, who nicely maintain the Liquid War .deb package.
This list is for general discussions about Liquid War. Here you can make suggestions, submit bug reports, ask for help, find players, etc... Basically, any question or remark which concerns the game is welcomed on this list.
You can't send messages to the list without subscribing. The only reason for this is that it's one of the only way to block spam efficiently. I first thought it could be OK to allow anyone to post, but liquidwar-user seems to have be harvested by robots, so now I need to restrict posters. However, I insist on the fact that anyone can subscribe, and the subscription to the list is not moderated. So if you are a human being and not a stupid spam robot, you're welcome on the list 8-)
Here's a list of usefull URLs:
I have have set up a web-based chat-box which is accessible here: "https://ufoot.org/liquidwar/v5/metaserver.php"
It's not as good as a good old IRC channel but not everybody can use IRC (because of firewalls and the likes), and I like the idea that people can chat and have the list of available servers in one single web page.
I personnally spend some time on irc.freenode.net so you might use it to find other players - though I'm not really an IRC addict... ...not yet at least!
Here are the channels I recommend:
Quoting Gavin: "I wrote a liquid war fanfic some time ago [...] I wrote it after a friend claimed that there wasn't any liquid war fanfic because it wasn't possible."
So here it is, a Liquid War fanfic, enjoy! (and special thanks to Gavin)
The General presided over his massing army in his seat, or rather hovering ring, of power. It dipped slightly as he flew low over his troops marching through the viscous marsh-like terrain. They were like children: obedient, loyal, and they ate a lot.
Glancing at the status panel mounted in front of him he grimaced; the other five armies: Yellow, Green, Orange, Turquoise, and, of course, Red, were also readying armies of a similar size to his own. His violet clones would have to fight hard and eat well to win this day.
Today would not be a battle of luck, the General mused, it would be a battle of tactics, of alliances, and of betrayal. Every clone was identical - that was the general idea behind clones - and the terrain seemed strangely symmetrical; it would not give advantage to any of the six armies amassed today. Glancing at the hologram of the battlefield projected in front of him the General noted that he would have to move quickly, Orange and Yellow were too close for comfort, though fortunately Baron Red's army of eponymous coloured clones was the furthest.
General Violet's fingertips were sweaty even before they touched the four main control keys in front of him. They were labeled 'W', 'A', 'D', and, of course, the full retreat button - very useful for misleading foes and ambushing them as they pursued - 'S'. The keys were arrange in a roughly equilateral triangular pattern; with 'S' forming the base and being adjacent to both 'A' and 'D', 'W' formed the tip of the triangle.
A long breath left his parched lips as at last he made his move.
"Dammit!" he screamed moments later. He had misjudged Captain Yellow and Commander Orange; he had expected one at least to attack immediately, one he could have handled. They were working together - foiling his attempt to shoot between them to near the center of the battlefield to gain a better vantage point. Yellow had shot down towards him, cutting off his advance, and now Orange had sealed his escape route. "It's not over yet" muttered the General. He opened a voice channel with Commander Orange:
"Very clever. Flawed, but still clever."
"Flawed?" came the reply.
"Yes flawed, when the good Captain is finished devouring my army who do you think he will turn to next?", bluffed the General - his hands worked quickly as he manoeuvred his hovering control ring, all that his troops ever saw of him, carefully towards the weakest section of his attackers. If he could just break out a few units he could soon turn the tide against both Yellow and Orange.
"We have an alliance..." Orange's voice was unsure now.
Time for some sarcasm to through her even more off balance, thought the General,
"I gathered", he spoke softly, slowly, and with too much meaning. Then closing the channel he turned his attention back to his escape.
"Yes!" wooped the ecstatic figure of the General. Fifty or so of his troops had broken free undetected and were even now working their way cautiously towards the camps of the Yellow army, only the front lines were still actively fighting; this opening gambit of Yellow and Orange had turned into a stale siege and Yellow's army had pitched tent.
General Violet steered his hovering guidance ring to the center of the Yellow camp. His troops struck, both those who had got behind the lines and those who were still besieged. Yellow reacted too slowly and suddenly found that her army, was shrinking back from the onslaught. There was nowhere to run to, and bye now her only ally - Commander Orange - had abandoned her to her fate; he was too busy engaging Sir. Turquoise, who had managed to escape from the slaughter that the Baron had caused to the Turquoise ranks and was even now valiantly attacking the flanks of the Orange troops.
A glance at the status panel showed that Yellow's life force was fading quickly: 8%, 3%, 1%, Gone.
The General smiled, he always enjoyed getting the first kill, and by now his armies life force had grown and his clones had replicated. With his, now, formidable fighting force it was no problem to engulf both Sir. Turquoise and Commander Orange's brawling armies and annihilate them. Once again his army grew in size and power. Now if only the Baron didn't notice that..., thought the General.
"Too late!" yelped the General, now thrown into panic, as he saw the approaching Baron. His army had also grown in size and power - having fatally injured the Turquoise army within the opening moments of the battle, and having finally managed to catch the elusive fleeing form of, or what remained of, Emperor Green.
Gripping the controls harder the General thought quickly, his army doesn't so completely outnumber me that this is already over, however unless I can cause him to make a mistake that allows me to take the upper hand then I will inevitably lose. Maybe I can...
This thought was terminated and replaced by another as the Baron's angry red troops broke through the undergrowth that had covered their movements and started to surround the General's army. The thought that now throbbed through the panic-stricken mind of General Violet was simply 'Run!'.
Even as he signaled the retreat and made for what seemed to be the only possible means of escape the Baron's blood red control ring appeared at the opening. The General knew it was over, even before the host of red beings appeared at the opening.
There was no escape. His life force was almost depleted and he was surrounded. Then it was that the Baron decided to communicate:
"Too bad. It was a good game"
The General blinked, gaped, and was generally gobsmacked. Just before his life force completely failed and his own weary eyes closed in defeat he snarled,
"What!? This is not a game!" were the General's dying words.
This section describes how the GUI works. Since programming advanced GUIs with Allegro is not so easy - standard C programming definitely lacks flexibility -, and also since it's somewhat hard for me to figure out what is user-friendly and what's not, Liquid War's menus are not always self-explanatory. I'll just try and do something better next time!
The map menu allows you to choose the map you are going to play on. A map is defined by 3 things:
In the middle of the screen, there is a preview of the level. In this menu, the values of the parameters can be independently changed by:
On each side of the preview, sliders allow you to choose the two textures. There is also a preview of each texture. Below this preview there are 128 little buttons which allow you to choose single colored textures.
The name of the map and its resolution are displayed in the lower part of the screen.
You'll notice that on some maps the texture selection zones simply disappear. This is because these maps are associated with a texture, so choosing a different texture is often not recommended for it won't look as nice as with the right one. If you still want to override this behaviour you can click on the "on/off" button just right to the "Use default texture" label. This is a toggle button which will allow you to use your own textures even on maps that normally come with their own skin.
You'll also notice that a "Random map" button is available. This button generates a new random map using an external program, "lwmapgen", developped by David Redick, available on http://www.cs.clemson.edu/~dredick/lwmapgen/
This program supports many command line options, and if you want a very precise control on the generated maps, you'll need to run it separately. Looking at LW's log file you should be able to see the commands LW issues when calling this program, this can give you ideas on how to launch it manually. Alternatively using the "--help" option (for instance "liquidwar-mapgen --help" under UNIX) should describe how to use it.
This menu allows you to choose the teams which are going to play. There are 6 square zones in this menu. Each of them is associated to a team.
Each team can be either:
The computer plays poorly, so remember that Liquid War is basically a multiplayer game, and that the cpu control is dedicated to beginners only.
You can also choose the color associated to each team by clicking on one of the 12 colored buttons.
Below the 12 colored buttons, there are four buttons which allow you to choose your keys. Click on one of these buttons and then press the key you want to define. Joystick movements and buttons are considered as keys. You can disable the joystick with the button which is at the bottom left of the menu. Mouse input is also possible, and mouse movements are considered as keys too. To define mouse control, click on the button associated to the direction you want to control, and then move the mouse. Then the button should display something like "M->". Mouse sensibility can be set with the little slider at the bottom right of the menu.
Here you can choose the graphic options of the game.
The "Video mode" button allows you to switch between fullscreen and windowed mode. This button is not available under DOS.
The "Brightness" slider allows you to set the brightness of the game.
The "Menu res" slider allows you to set the resolution used by the menus. There are currently 5 possible values, which depend on which platform you're running the game on.
I personnaly think the menus look best with the 640x480 resolution, but some may prefer higher resolutions. Lower resolutions should only be used if you have problems using SVGA video modes.
The "Game res" slider allows you to set the resolution used during the game. The allowed values are the same than those for the menus. I recommend that you don't use resolution higher than 640x480, unless you have a Pentium VIII running a 10GHz.
Page flipping can be toggled. It is up to you to decide wether you keep this option or not. The main disavantage of turning page flipping off is that the info bar and the battlefield can look rahter ugly if they overlap. But if you turn page flipping on you will not easily reach the 166 frames per second I sometimes get on small levels with my K6-225. I personnaly always turn page flipping off.
The viewport size defines how much of your screen will be used by the battlefield.
The "Waves" button allows you to toggle the wave effect. You can also do this while playing, by simply pressing F4.
This section allows you to set the sound volumes. There are 4 sliders, which are:
This menu is the one where you can change the rules of the game.
The "Time" slider controls the time limit. The game will stop after this time is elapsed. You can pause the game by pressing the "F3" key.
By the way, an info bar can display the time left while you are playing. This info bar can be toggled during the game by pressing the "F1" key, and you can change its location by pressing the "F2" key. It also displays how many fighters there are in each team.
The "Army size" slider controls the amount of fighters there will be on the battlefield. The position of the slider reflects the amount of fighters of all the teams together. If there are 4 teams, then each player will have half as many fighters than if there had only been 2 teams.
The "Cursor x" slider controls the speed of your cursor.
Below is a "Min 160x100" box with a slider on its right. This means that maps will automatically be magnified so that they have a size of at least 160x100. Indeed, some of the maps that come with Liquid War were designed in 1995 when 486 Intel computers were common. Therefore the maps were smalls. Today, these maps are not really fun to play on fast computers, so Thomas Harte suggested this automatic magnifying feature, and that was IMHO a smart idea. You can move the slider to the right to make maps use a higher resolution - ie magnify them.
The "Defaults" button of the "Rules" menu will reset rules to their defaults. This way you can tweak rules and then come back to the default rules whenever you want. Note that there's also a "Defaults" button in the main "Options" menu, but it will reset *all* options, including player names... The advantage of the "Defaults" button in the "Rules" menu is that it will only reset rules parameters, and keep the rest of your configuration options untouched.
The "frames/s" slider allows you to limit the number of frames per second. If this slider is set on the left, there won't be any limit, so Liquid War will repaint your screen each time the fighters move. But this can be a weird behaviour if your machine is really fast, for no one cares about 100 fps per second, one can not even see them... So this paramters limits the refreshment rate, so that there can be several logical moves of the fichters for only one screen refreshing. If it is set on its right, the display is limite to 10 fps, so you'll have to find your setting. I personnally set it right in the middle, and get 40 fps. If you press "F5", you'll get the number of frames per second, and if you press "F6", you'll get the number of logical moves per second. You can also press "F7" or "F8", and you will get the percentage of time your computer spends on calculating or displaying the level.
The "rounds/s" slider allows you to limit the number of rounds per second. If this slider is set on the left, there won't be any limit, so Liquid War will run as fast as possible. This setting will be of no use if you use Liquid War on a slow computer or if you play with hudge maps, but sometimes, with a high-end Pentium class computer, it's simply impossible to play on small maps because things simply go too fast. So this parameter is here to help you and avoid the "10000 moves per sec" problem.
This is where the wave parameters are set. The waves are just a graphic effect, which is not really usefull. I don't often use waves, but I still think they can sometimes look nice. Change these parameters if you really mean to do it, but if you don't understand what they mean, it is really OK...
There are 4 different types of waves, each of them being defined by:
If you want to undestand what the "WX", "HY", "WY", and "HX" codes mean, try to pay with only one type of wave, the "Ampli" parameter of the 3 other types of wave being set to 0 (that is to say the slider is on its left position), and sea how it looks like.
The wave effects can be toggled during the game by pressing the "F4" key.
This menu allows the user to change the behaviour of the fighters.
The "Attack" slider sets the agressivity of the fighters. If it is set on the right, fighters eat each other very fast. If it is set on the left, it takes ages to fighters to change teams.
The "Defense" slider sets the capacity that the fighters have to regenerate themselves. The more it is on the right, the faster fighters regenerate.
The "New health" slider sets the health of the fighters which have just changed teams. The more it is on the left, the weaker these fighters will be.
The "Winner help" slider controls a parameter which causes fighters to attack with various strength depending on how many fighters belong to their team. Not very clear... Let's just say that:
The "Cpu strength" parameter never makes the computer more intelligent than a monkey. But if you set it on the right, it advantages the machine outrageously and fighters controlled by the cpu will be really strong. So to get rid of them you'll definitely need to be clever. Again and again, don't forget that Liquid War was conceived as a multiplayer game and that playing against the computer is not really an interesting thing to do.
The "CPU vs human" parameter allows you to control how aggressive CPUs are towards humans.
The "Allow net bots" button can be used to allow bots to connect on network games. Indeed, bots are by default disabled in network games, since in this case LW assumes that bots are useless (there are already several human players). However, turning this option on will allow you to connect bots within the game. It's important to note that this is a per client option, this means that you can't use it to forbid access to bots to a given network game. This option was simply created to avoid confusion when connecting on network games, while still allowing bots to connects if you really want them to.
The "Algorithm" parameter allows you to force the algorithm to standard C mode. There's no real good reason you would like to do this, since the C algorithm is slower than the ASM one. Moreover, the ASM algorithm is automatically disabled if you play against a computer which does not have ASM enabled. Think of this as a testing/debugging option.
Here's a list of keys you might use while playing:
(*) all these figures tend to be clearly false as computer go faster and faster. Basically, the time required for "logic" and "display" operations is getting shorter and shorter, and the tools I use to measure it are not precise enough. Therefore I get approximations which might by plainly wrong.
Since release 5.4.0, Liquid War includes network support, that's to say that people can play over a LAN (Local Area Network). However, due to limitations in Liquid War's legacy code, and also because of the lack of time I have, it might be a little tricky to set up a network game at first. So please read this section carefully.
You should keep in mind that:
You'll basically need 2 computers connected on the same LAN. We'll call them computer A and B. You might be able to play over the Internet too, but the game can be harder to set up and - which is worse - very slow.
You'll also need to know the IP address of computer A. Type "ipconfig" under Windows or "ifconfig" as root under GNU/Linux to get this information if you don't have it.
Liquid War uses a very traditionnal client/server approach. Basically, the server gets informations from all the clients and then dispatches the collected information to everybody.
So you'll need to start a server on computer A by running "liquidwar-server" on GNU/Linux or "lwwinsrv.exe" on windows. This is a console application, ie it does not set up any graphic mode.
Here's a small example of a server start on GNU/Linux:
$ liquidwar-server
How many teams will connect to this server?
At this point you must enter a number between 2 and 6, and then press "ENTER". In this example we will answer 2. The server really needs to know how many teams will be in the game: when enough teams are connected, the game starts. It can also be a good idea to answer 6 systematically and then force game start by clicking the "Start now" button within the client. It's possible to skip this question by typing "liquidwar-server -2" instead of a plain "liquidwar-server".
Use "-2" to get rid of this question.
Register on "www.ufoot.org/metaserver/" (y/n)?
Now if we answer "y", then the server will automatically contact the "meta-server" and it will be listed on "https://ufoot.org/liquidwar/v5/metaserver.php"
This can be convenient for people who want to find other gamers to play with on the Net. For now, let's answer "n", we'll test this meta-server stuff later 8-)
Use "-private" to get rid of this question.
2002-06-03 16:43:00: Listening on port 8035...
2002-06-03 16:43:00: Waiting for 2 teams...
Now the server is ready to accept clients. By default it listens to clients on port 8035. You could change this behavior setting by calling "liquidwar-server -port 8061" for instance, but let's use the default port to make things easier.
Start the client on computer A normally by typing "liquidwar" on GNU/Linux or double-click "lwwin.exe" on Windows.
Go to the "Teams" menu and select 2 teams, a red human and a blue CPU for instance. If you don't know how to do this, then try and play Liquid War on a single computer first. It's important to notice that by default the "blue CPU" won't connect on the network game. It's possible to allow bots to connect on network games, but they are disabled by default.
Now come back to the main menu, and a "Net Game" button should be available. Click it. Now you should be able to:
Since the server is also running on the same machine (A), you can leave the default IP address as is (127.0.0.1).
Now you are ready to start the second client on computer B. Like with computer A, you'll have to:
But this time you'll also need to change the server address, since the client is not running on the same computer than the server.
Now click on "Start game" on computer A. The server should play a "system beep", which is usefull if you run a server and want to be notified of client connections without watching the console all the time, and it should display messages like this:
2002-06-03 16:44:48: Connection from
"127.0.0.1:34677"
2002-06-03 16:44:48: Team "Napoleon" on client
"127.0.0.1:34677" accepted
2002-06-03 16:44:49: Client "127.0.0.1:34677" accepted
2002-06-03 16:44:49: Waiting for 1 team...
And on the client you should see a screen which says "Waiting for 1 team(s)" with the list of connected players below (Napoleon). You do not need to click on the "Start now" button.
Now click on "Start game" on computer B. The server should display messages like this:
2002-06-03 16:49:14: Connection from
"192.168.1.1:1098"
2002-06-03 16:49:14: Team "Henri IV" on client
"192.168.1.1:1098" accepted
2002-06-03 16:49:15: Client "192.168.1.1:1098" accepted
2002-06-03 16:49:15: Client "192.168.1.1:1098" ready
2002-06-03 16:49:15: Client "127.0.0.1:34677" ready
2002-06-03 16:49:15: Sending info to "127.0.0.1:34677"
2002-06-03 16:49:15: Sending info to "192.168.1.1:1098"
2002-06-03 16:49:16: Game start
And at that point, the game should start 8-)
Once the game is over, you can start another network game on the clients without touching the server, because the server automatically restarts and waits for players to connect.
To stop the server - if you want to change its settings for instance - just go to the console where it's running and press CTRL-C.
Docker (see http://docs.docker.com/ for details) is a convenient way to launch a server without re-inventing (rather, re-compiling) the wheel.
You might want to run the server this way if, for instance, you need to have it run on a remote box where you do not wish to install a complex Liquid War stack, Allegro and the rest.
Please visit "https://hub.docker.com/r/ufoot/liquidwar-server/" for a list of available images, once it's installed, running the server should amount to something like:
docker pull ufoot/liquidwar-server
docker run -p 8035:8035 ufoot/liquidwar-server
Additionnally, images are provided to run the metaserver, which is responsible for registering and listing all running games. While there's no real reason to run your own since one should permanently be available on ufoot.org, it's quite straightforward to run your own:
docker pull ufoot/liquidwar-metaserver
docker run -p 8053:8053 ufoot/liquidwar-metaserver
The meta-server is a piece of software which is running on my web site, and allows servers to register themselves so that client can get a list of available servers.
It's written in PHP and is _very_ basic but I believe it's enough for what has to be done: maintain a list of running servers.
The source code for the meta-server is included in the source package of Liquid War, so you might run such a server yourself if you want to. However, by default, servers will register themselves on my web site, and will be listed on "https://ufoot.org/liquidwar/v5/metaserver.php"
Launch the server, and when you get the question:
Register on "www.ufoot.org/metaserver/" (y/n)?
answer "y".
Note that if you're behind a proxy or a firewall, the server might be unable to register itself. Clients might also have problems to connect themselves on your server if there's a machine which does NAT (Network Address Translation) between you and the meta-server.
In the main menu, click on "Net Game" and then "Search for internet games".
Now you should see a list of available servers. You can click on the items in the list to get more informations about a given server. Once you have chosen a server, click on "Join now".
Now you get on a "Waiting for teams" screen. You might be interested in using the "Start now" button. Indeed, if you are 4 players connected on a server that accepts up to 6 players, maybe you'll want to start the game right away without waiting for 2 more players. In this case, every player must click "Start now". A "*" character will replace the "-" in the players list when a player clicks on "Start now". When all the players are displayed with a "*a, the game starts.
You can also chat with other players by entering text in the area above the "Send message" button, and then click on this button. Keep in mind that this is a very primitive chat and that the best way to chat efficiently is IMHO to play in windowed mode and have an IRC client at hand.
Note that you can also get the list of available servers from "https://ufoot.org/liquidwar/v5/metaserver.php" There you'll also find a little chat-box which will allow you to send exchange messages with other players.
You can pass options to the server using the command line. The following parameters are accepted:
These options work on both client and server, even if they are rather "server-oriented".
Liquid War uses TCP sockets, and a single-threaded server. This implies that:
I needed to use TCP sockets, since LW's algorithm can not cope with any data loss and it's not a reasonnable to try and anticipate what the map would be like if the player did not move etc...
I did not implement any complex multithreaded stuff since I'm lazy and however, clients need to have informations about all the other before something can be done. However, implementing a mutltithreaded server could have advantages over the current solution.
In Liquid War, all the clients send their key presses to the server, and then the server dispatches this information to everyone. This has to be done for every round.
You can easily imagine that if a player has a poor connection, with a very long "ping delay", it can take quite a long time to send the information to the server, and then get it back.
So what Liquid War does is that at the beginning of the game, the server sends a couple of "blank" key strokes to the clients. This way, clients receive data from the server before thay have sent any. The number of key strokes sent at the beginning of the game is called the "lag".
So if it takes 200 msec to send and then receive data from the server (approx the time returned by the "ping" command) then with a lag of 6, you can theorically play at a rate of (1/0.2)*6=30 rounds/sec.
On one hand, setting the lag parameter to a high value will avoid many network errors and allow you to play at a very fast pace, but the big drawback is that there will be quite a long time between the instant you send a key stroke to the server and the moment it comes back to you. On the other hand, setting the lag to a low value will limit drastically he number of rounds per second, but make the game more "responsive".
However, since release 5.4.1, the "lag" is modified automatically and should adapt itself to the situation. I've not been able to test it in real conditions yet, but it should work 8-)
Still, setting the lag to a sensible default value can save you some trouble. Indeed, by default, Liquid War will choose a value (6), but it can not guess if you are playing on Internet or on a 100 Mbit LAN, and it can take quite a long time before Liquid War automatically finds the right value. To know the right value which should be used with the "-lag" option, simply play a few games and watch the average lag (which is displayed on the server console every minute) at the end of the game.
Liquid War uses a "light" server, and one of the advantages of this solution is that it allows you to run the server on low-end computers. I personnally run a permanent server on a 486 DX2, and it runs like a charm.
The only thing you have to take care of when running a server is bandwidth. Don't worry, you won't need a 10Mbit connection, basically, each clients sends and receives 12 bytes of data at each round. If you add TCP/IP headers and the facts that stuff will probably be bundled in bigger packets, a client must deliver about 15 Kbit/sec (up and down) for a game that runs at 100 frames/sec. A 56K V90 modem is enough for this.
So if you run a server with 2 clients connected, the server will need to deliver 30 Kbit/sec in both ways. A 56K V90 modem _can_ do that, but your provider needs to be a good one 8-)
And if you run a server with 6 clients, you simply won't be able to reach the 100 frames/sec with a 56K V90 modem. It will necessarly drop to something less than 30 frames/sec, and is likely to drop to about 15 frames/sec. OK this is not a big deal, since few Internet games run at more than 30 frames/sec, but well, if the server has troubles receiving/sending data, everyone will wait, and the fun will go away.
As a conclusion: if you have the choice, choose the friend who has the best bandwidth to run the server, without even considering the power of his computer.
Network support in 5.4 and 5.5 is still experimental in many ways, so you might get weird behaviors. Basically, if you have a problem, just do the following:
Liquid War 5.4.0 and 5.4.1 were very hard to play over the Internet. The reason is that the network routines did not do enough error checking, and therefore there were very often errors when sending and/or receiving the map to the server. Hopefully, this bug should not appear anymore in 5.4.2 or any other recent release.
As you might have noticed, under the box where you can enter the password, a little notice explains that you must choose a "weak" password. Now you'll tell me -> people keep on explaining me that passwords must be something complex like "aS\r!Y9p" and now I'm told to use "hello", what's up?
OK, keep in mind Liquid War is a game. This password stuff is just a way to be able to play with your friends only and keep on using the meta-server's services. Liquid War does not encrypt data and I can see no good reason to do it for, so the password is stored and sent to the server in clear, as plain text.
The consequence is that if you use a valuable password - for instance the one you use to log in on your computer - the guy who runs the server will see your password in the log file if he wishes to. Therefore, use something weak, something that if someones finds out what it is, you won't really care. So "hello" is a wise choice.
Yes.
Any program is likely to have security holes, especially when it's networked. However, I have good reasons to think that Liquid War is safe enough for a game. At least I find it safe enough to run a permanent public server on my personnal computer 8-)
FYI, here are some things which I think make Liquid War rather safe to run:
However, I have not - and I know nobody who has - audited Liquid War for security holes. So there might be some. Therefore you should respect a few things while running Liquid War:
Last point: you should be aware that version 5.4.5 of Liquid War has been proved to be vulnerable to a local buffer overflow, and one should run at least 5.5.9 to get rid of this problem. FYI by the time the exploit was found on 5.4.5, 5.5.9 was already out 8-) See http://www.securityfocus.com/bid/8629 and http://www.securityfocus.com/bid/9453 for more informations.
No.
Or at least, not really. In fact, you can still find the following types of lamers:
Apart from this, I can hardly see any way to cheat. Why? Because the Liquid War server does not store any information about the game. It's not aware of who wins, who looses, it knows nothing. The only thing it does is to transmit key presses between client computers.
This way, if someone plays with a tweaked release of Liquid War, thinking he will fool you, then he will fool you on his computer only... On your computer, everything will be fine. After some time, your screen and his screen will have nothing in common, and both players are likely to think they have won. Except the lamer will stay a lamer.
This also explains why it's required to play with the very same versions of the game during network games. If you plug a 5.5.2 with a 5.5.1, after a minute the screens will be completely different on each client, since there are subtle differences between the 5.5.1 and the 5.5.2 engine. However, you shouldn't be able to do this, since a network error will stop you before you can start to play.
Additionnally, versions 5.5.5 and higher have a checksum system. Every 100 rounds, each client calculates a checksum with its local map, and sends it to the server. If the checksum is incorrect, the server will log a message like:
Checksum error on client "192.168.1.1:1098"
If you see this, then you're in one of the following situations:
FYI, all releases from 5.4.0 to 5.5.4 have a bug which causes clients to desynchronize after a while...
When you launch Liquid War 5, you can use command line options. If you have no problems launching Liquid War, this section should not interest you very much.
You can use several options at the same time. The basic syntax for options looks like this:
lw -option1 -option2 parameter2 -option3 parameter3 -option4 -option5
Note that most of the options are legacy options which where usefull with the initial releases of Liquid War, when you had to run in a Windows DOS box, and when there were still plenty of 486 computers with only 8Mb ram...
These are basic options which can be usefull to figure out which release of Liquid War is installed.
Very usefull options, especially if you can not install Liquid War in default directories or want to put the game in a special place.
These options give you control on how Liquid War treats initialisation errors, how much memory it should reserve, what kind of video mode sit should not choose etc...
These options are usefull if you want to debug the game and trace what's happening.
The server command line options are described in the section which deals which network games in general. IMHO you need to understand how network works in LW before trying to tweak the server 8-)
Everything else 8-)
The external lwmapgen program by David Redick accepts a number of command line options. You can type:
liquidwar-mapgen --help
to get a list of all available options under UNIX. Under Windows the command would be:
lwwinmap --help
Note that lwmapgen is called automatically by Liquid War when you click on the "Random map" button.
The idea behind lwmapgen is that you choose a function which sets the type of map generated, and then pass various arguments to this function. If you do not explicitly choose a function, one will be picked up for you randomly, and all other parameters will use default values.
The most usefull and common options are:
Here's a typical use of lwmapgen:
liquidwar-mapgen --size 3 --function hole --out test.bmp
Liquid War is now a cross-platform game, thanks to Allegro. So now you can play under different OS.
The same source tree will compile on all supported platforms, but with slight differences when running. C preprocessor #defines are used to code some platform specific stuff, and in some cases there are different files for the DOS, Windows and UNIX versions.
As I said, I try to use the same code for all platforms. This is in the long term the best choice. Otherwise there would different branches of the source tree, and I don't think this is a very good solution.
Therefore some optimizations that were performed in the old DOS-only version have been totally removed, for they were 100% platform dependent (ie mode-X asm coding). So the new versions are all a little slower than the old 5.1 stuff, but the performance loss is only about 20%, which is not significant with today's PCs. And anyways the performance loss is most of the time limited to the goog old VGA 320x200x8 mode-X, which starts being kind of obsolete.
This is the original version. It's the fastest one as far as I know, the safest one and it will always be I think, since Allegro was first designed for DOS, and DOS allows a full unconditionnal access to all the hardware ressources LW requires. LW doesn't use any hardware acceleration and it's not been designed to do so. Unfortunately there's no network support for the DOS version of Liquid War.
When running under a Windows box, the DOS release used to be safer than the native Windows port. Now that DOS support is getting really poor with recent versions of Windows, the native Windows release of Liquid War starts begin the good choice for Windows users. And Allegro for Windows is getting quite stable in the 4.x series.
The other reason to choose this release rather than the DOS release is that it has network support.
If you have problems running Liquid War under Windows, please check out the "data\lwwin.log" file which should be written each time you run the game. It contains the information which is displayed on the console under other platforms, and might give you a clue about what's going wrong.
This port is the most recent one, and also the one I prefer. Paths have been changed to an UNIXish style, ie the data is stored in:
/usr/local/share/games/liquidwar
the executable in:
/usr/local/games
and the configuration file is
~/.liquidwarrc
Since not all GNU/Linux distributions have /usr/local/games in their path, I also put a symbolic link to the binaries in /usr/local/bin. I believe Liquid War is quite FHS compliant, so if its default directories do not match your configuration, blame your distro for not following the standards 8-) AFAIK the only touchy directory is /usr/local/share/pixmaps which I've seen on many distribution but does not seem to be referenced in the FHS.
With the latest releases of Allegro, Liquid War is becoming pretty stable under GNU/Linux. You should also know that the GNU/Linux port is usually the most up to date, since I very very seldom boot Windows at home and do most of the coding under GNU/Linux.
This is the latest port, so I expect it to be a little touchy to install and/or run for some time.
Note that to compile the game you'll need to install GNU tools like gmake and gcc. Liquid War won't compile with the genuine make and cc commands.
One thing you might ask is: "why do you provide the binary as a plain .tgz file, it would be much nicer if a standard FreeBSD port was provided instead!". The answer is that the statically linked binary should work flawlessly and does not raise any dependency problem. Also I don't know how to make a BSD port and I'm not really interested in doing it. If it's easy to do, then someone can simply do it and send it back to me. If it's hard to do, then I do not really have the time nor motivation to do it. What I did is make the code and install scripts FreeBSD friendly so that it would be possible to compile the game under FreeBSD. Packaging is another story.
There's currently a beta version of a Mac OS X port for Liquid War. Ryan D. Brown nicely managed to compile and run the game under Mac OS X, and the latest news was that it does basically work. Still, this port did not go through intensive testing, so there might still be some bugs, expecially concerning networking.
There were some byte endianess problems in previous ( <=5.5.8 ) releases of LW, but I tried to fix them and they should be gone now.
As of today, we're trying to find out a convenient way to package and release the Mac OS X version of LW. You can contact us on the mailing list if you're interested in this port.
Liquid War has been ported to the GP2X handheld gaming platform, thanks to the fact George Foot ported Allegro to this platform. More informations on http://www.glost.eclipse.co.uk/gfoot/gp2x/allegro.html
Assuming the environment variables GP2X_USER_PREFIX (where you want Allegro to be installed) and OPEN2X_SYSTEM_PREFIX (where your open2x cross-compiler is) are defined, the following might be used to compile Allegro:
LDFLAGS=-static ./configure --prefix=$GP2X_USER_PREFIX --build=x86_64-pc-linux-gnu --host=arm-open2x-linux --enable-lgp2x=$OPEN2X_SYSTEM_PREFIX --without-x --enable-static --disable-shared --disable-modules --enable-dbglib
Then Liquid War itself can be compiled using:
You can use your own levels whith Liquid War 5. The only thing you have to do is to put your own 256-colors vbitmap files in a special directory, and the program will use them. Currently, BMP, LBM, PCX, and TGA files are supported. It is a good thing to use 256 colors bitmaps, for they waste less disk space than truecolor bitmaps, and Liquid War 5 converts all bitmaps to 32 colors bitmaps. Additionnally, truecolor bitmaps might cause the DOS version to crash randomly... 2-color bitmaps will also cause the program to crash. I warned you!
The best thing you can do to create your user levels is to have a look at the few user files I put in the .zip file and try at first to do something that looks about the same!
Liquid War 5 does many checks on user levels and is much safer than Liquid War 3. Still, try and help the program not to crash, if possible.
Liquid War considers that dark colors are walls and bright colors are associated to the playable area. So you can draw your walls in black, dark blue, etc... And the rest of the map can be of any bright color such as white or yellow.
You can draw a small map on a big bitmap, as long as you use a bright background color. Liquid War will autodetect the range of your map and add the border line if necessary.
Liquid War re-orders all the maps, so that the smallest ones are on the left and the most complicated ones on the right when you choose them with the slider in the "map" menu. So if you can't find the map you just draw, don't worry, it is probably just mixed with the levels from the .dat file.
The default path for maps is "custom\map\" on windows, and "/usr/local/share/games/liquidwar/map" on GNU/Linux.
All you have to do is put a bitmap in the default directory which is "custom\texture\" on windows, and "/usr/local/share/games/liquidwar/texture" on GNU/Linux.
As of Liquid War 5.6.x, it's possible to associate a map with a texture. All you need is to call the maps with the same name (case is important, lowercase recommendend...). Look at the "meditate" custom map which is shipped with Liquid War for instance.
This also works with internal builtin maps (those stored in the datafile) so for instance if you name a custom texture "world1.bmp" it will automatically be associated to the builtin map world1 (to figure out internal names you have to unpack the source distribution and look in the ./data directory). This also works the other way, if you name a map "wood2.bmp" it will be automatically associated with the builtin texture wood2.
Associating a texture with a map requires more work than designing a simple map, but the results is usually much nicer. See the "Kasper - ..." series of maps for instance.
Maybe you will find that the original levels are ugly and unplayable. Well, if you have made user levels and think they are great, just send them to the Liquid War user mailing list. Please use only 256 colors bitmap and zip them before sending them, or else they might be blocked by my provider...
As of today, dozens of user maps have already been included in Liquid War, this is very nice for it happens that every map designer has his own personnal tastes, so the maps all look different.
Still, to be included in Liquid War's mainstream distribution, your maps will need to be placed under the terms of the GNU General Public License, or at least a compatible license. You should have received a copy of this license with Liquid War anyway. Read it 8-)
Of course, you can use *any* map when playing. You can even play with a bitmap you got from a proprietary source - such a proprietary game you bought for instance - but the point is that I can't - and you can't either - distribute such a map along with Liquid War.
However, this is enough legal boring stuff! What you should keep in mind is that I'm always happy when I receive maps from players, and it's a pleasure for me to include them in the mainstream distribution.
If you have played Liquid War, you must have noticed that your army always takes the shortest way to reach the cursor. So the fundamental stuff in Liquid War is path-finding. Once you've done that the game is quite easy to code. Not harder than any other 2D game. Still the path finding algorithm is an interesting one, for it's not a common method that we used.
Basically, at each round (by round I mean a game logical update, this occurs 10 or 100 times/sec depending on the level and/or your machine), the distance from all the points of the level to your cursor is calculated. Now the point is to calculate this fast, real fast. In fact, a "gradient" is calculated for all the points of the level, and the value of this gradient is the distance required for a little pixel/fighter to reach your cursor, assuming that he takes the shortest way. Liquid War does this with a 10% error tolerance, and it's enough for keeping the game interesting.
Once you have this gradient calculated, it's not hard to move your fighters. Basically, you just have to move them toward the adjacent point that has the lowest gradient value, ie is the closest to your cursor.
The Liquid War algorithm has been invented by my friend Thomas Colcombet In fact the Liquid War algorithm has been invented before the game itself. The game came as a consequence of the algorithm, he just thought "mmm, cool, we could make a game with that!".
Later, I enhanced the algorithm, as I coded it. The consequences were a performance increase, especially on simple but big levels. I mean levels with wide areas for teams to move. Still the basis of the algorithm remained the same.
The Liquid War algorithm for path-finding is very efficient:
The Liquid War algorithm is very poor compared to other algorithms when:
The first Liquid War algorithm used to calculate the gradient (the distance from a point to your cursor) for every single point of the map.
With Liquid War 5, I used a mesh system. This mesh system is a structure of squares connected together. Squares may be 1,2,4,8 or 16 units large or any nice value like that, and the gradient is only calculated once for each square. Squares have connections between them, and each connection is associated to a direction.
There are 12 directions:
Well, let me give you an example, supposing that you level structure is:
**********
* *
* *
* **
* *
**********
The * represent walls, that's to say squares where fighters can not go.
Then the mesh structure would be:
**********
*11112233*
*11112233*
*1111445**
*i1114467*
**********
In this mesh, there are 7 zones:
Because it allows the module which calculates the gradient to work much faster. With this system, the number of zones is reduced a lot, and calculus on the mesh can go very fast. At the same time, this mesh structure is complicated to understand by us humans but it's very easy for the computer.
For each zone defined in the mesh, LW calculates an estimation of the distance between the cursor and this zone.
The algorihm is based on the fact that to cross a zone which size is n, n movements are required. Easy, eh?
Here's the way the algorithm works:
for each turn of the game, do:
and then for each zone in the mesh, do:
Well, just ask my friend thom-Thom, he's the one who had the idea of this algorithm!
The basic idea is that by applying this simple rule to all the zones, after a certain amount of time, it's impossible to find any place in the mesh where the rule is not respected. And at this time, one can consider the potiential is right in any point.
Of course when the cursor moves the potential has to be recalculated, but you see, cursors move really slowly in Liquid War, so the algorithm has plenty of time to find a new stable solution...
It's possible to see this algorithm working by typing:
ufootgrad[n]
while playing, where [n] is the number of the team the gradient of which you want to view. The game is still running but you view a team's gradient being calculated in real time instead of seeing the fighters.
If you type ufootgrad0 the display comes back to normal mode.
Once the gradient is calculated for any zone on the battlefield, it's quite easy to move the fighters, hey?
The following method is used to move the players:
There are 4 "level of interest" for directions:
The fighters will try to find any matching situation in this list, and chose the first one.
The behavior of the armies is quite tricky to set up. I had myself to try many algorithms before I came to something nice. In fact, I had to introduce some "random" behaviors. They are not really random for I wanted the game to behave the same when given the same keyboard input, but for instance, fighters will prefer NNW to NNE sometimes, and NNE to NNW some other times. By the way, I think Liquid War could stand as a nice example of the thoery of chaos.
Liquid War 5 is basically a big C program. I've splitted the source code in many small files for I do not like to have to handle big monolithic sources, but this does not mean Liquid War is very modular. In fact Liquid War 5 is quite bloated with global variables and other ugly stuff 8-(
To be honest, it's a big mess. You won't find 2 files coded in the same maner... OK, I'm exagerating a bit. From now I try to make an effort and stick to basic rules such as:
I might decide to rename and cleanup everything some day, for it would help other coders to understand what I wrote, but well, this is certainly not a thrilling task 8-/
Here you'll find the main() function, the main game loop, application-wide constants and other global stuff.
It might be a good start if you want to hack the code.
The menus are coded using the Allegro GUI system. While this system is very powerfull, it's IMHO not adapted to very complex GUIs, and one of its drawbacks is that it's not so easy to redesign something once you've coded it.
Besides, when I started coding the GUI in 1998, I did it in a rather ugly way, and now I'm paying for my being lazy at that time, since I spent hours coding when I want to change something 8-/
These files contain various utilities which are used in the menus.
Here's *the* interesting part. All the rest of the code is just sugar coat to display stuff, receive players commands, communicate with other computers, handle errors, etc... But the real thing is here!
It's funny to note that these files have almost not been modified since Liquid War 5.0.
It's also interesting to note that they represent a small percentage of the total amount of code in the game. This tends to prove - and I'm convinced of it - that game programming does not only consists in having great ideas, but also requires a lot of "dirty" and boring work. Honestly, coding an option menu is as boring as coding Liquid War algorithm is fun.
It looks like nothing, but moving a cursor and deciding where it should go if there's a wall in front of it is not that easy, especially if you want things to work nicely.
Until 5.4.0, Liquid War did not have network support. As it is designed to be multiplayer, one needed to have several players on the same computer. The mouse also needed to be handled in a special way since cursors can *not* pass walls in Liquid War. Additionnally, I wanted all input channels (keyboard mouse and joystick) to be handled in a unified way.
This explains why there's so much code for user input, when one would think at first sight that "polling the keyboard is enough".
These files contain functions to intialize various game components. 100% boring code.
Here lies most of the graphic functions in Liquid War. There's not that much code since Liquid War's strength is not its visual effects, but rather its gameplay.
The only "funny" thing is the wave effect. I'm quite happy with it, and honestly, I do think it is rather fast, given the fact that it uses no 3D hardware at all.
Sound and music routines required some encapsulation, since the game must be able to run even if the sound and/or music did not load correctly.
These functions handle the datafile contents and also the custom data.
Note that the various utilities such as liquidwarcol, liquidwarmap and liquidwartex do not share code with the main executable. This is obviously a design error, for liquidwarmap will handle maps in a very poor way and is unable to autodetect map errors, whereas the game does it rather well. Blame the programmer.
Liquid War has a "generate random map" feature which is available within the game and also as an external program. The source code for the external program is in ./utils/lwmapgen in Liquid War source distribution. This program has been coded by David Redick, is also available on http://www.cs.clemson.edu/~dredick/lwmapgen/ and works on GNU/Linux. Compiling this program under DOS and/or Windows is untested and unsupported.
The random map generator within Liquid War - which of course works on any platform support by LW - uses for its greater part the same source code as the external lwmapgen program.
Time handling is fundamental in a game. Time is used for visual effects (waves...) during the game, it's used to generate some pseudo random stuff, well, it's used everywhere!
Note that on the client, I use 2 "different" clocks. The first counts the "real" time, in seconds. The second one is counts "rounds" and is incremented by 1 at each game round.
These are various utilities use to monitor and control the game while one's playing.
OK, now to all the UNIX guys, I *know* there are many ways to do things in a better and simple way than I did. But keep in mind that in 1998, under DOS, I had a rotten command line and even now I need everything to work on both UNIX and Microsoft platforms.
These utilities are not perfect, but they work, that's all I ask them.
Liquid War now has locale support. Basically, all the labels and texts in the UI are stored in constants. There's simply file per language.
Note to translators: if you decide to translate the menus in another language, keep in mind that all the translations must fit in the various buttons and textboxes. The best resolution to test this - the one where letters take most place - is 640x480.
OK, the API of the log routines is a piece of crap. Now I'm simply too lazy to change it. It works, that's all I ask.
BTW, there's a clear advantage in using custom-made log functions instead of plain calls to "fprintf(stderr,...". It might not be obvious for UNIX users, but think about Windows. Nothing like a "tail -f" there, nor a proper output redirection system. When a user clicks on the Liquid War icon, I want "console" information to be logged in a file!
As usual, I needed to prepare a small set of usefull macros.
It's also important to note that Liquid War uses snprintf instead of sprintf, for using the latter is very likely to cause buffer overflows. Under Linux glibc provides this function but Microsoft does not provide it natively on Windows. Therefore I used a third party snprintf implementation by Mark Martinec: http://www.ijs.si/software/snprintf/ and its source is available in the ./utils directory of Liquid War source distribution.
As you might know, PC Intel based computers are "little-endian" while Sun Sparc stations and Mac computers are "big-endian". This is an issue for LW since in network games maps are transmitted in binary format. Therefore I needed to set up some (un)serialization fonctions.
Liquid War does have thread support, but it is a "limited" thread support. I mean that the game is generally monothreaded, but a few functions use threads. For instance, calls to the meta-server are done within threads.
Basically, I do not really enjoy programming in a multithreaded environnement. So when possible, I chose the monothread path, and used threads only where I simply would not be able to find another acceptable solution.
I also needed to use some mutexes to prevent crashes in the user interface.
Liquid War might sometimes launch external programs. This is (for security reason) not a default behavior and has to be activated and configured by yourself, using the "-callback" command line option on the server for instance.
There are network packages for Allegro, but I decided not to use them. Socket support is not that hard to implement under UNIX and Win32 and besides, I've done it for my job recently, so I just knew how to do it.
Another reason which decided me to code my own toolbox is that I did not want Liquid War to have external dependencies - except Allegro of course. This way, UNIX gamers to not have to set up and/or download a specific network library. It's also easier to integrate the game in projects like Debian if it has few dependencies.
This network code is not a masterpiece, it's just a little set of tools that have proven to work. That's all.
BTW, it's important to notice that when linking with Allegro, most blocking UNIX calls ("sleep" or "recv" for instance) stop working: they alwasys return immediately. This led me to implement weird ugly hacks, like calling "recv" in a loop until it gets what it wants... This is theorically and practically a performance killer, but I found no other way to fix this. And FYI, this is not an Allegro bug, it's a feature 8-)
These files contains network utilities which are Liquid War specific.
The meta-server is called by both client and server. Basically, the server registers itself, and the client asks for a list of servers.
The meta-server itself is just a set of simple PHP scripts with a simple MySQL database. I chose PHP because my provider allows execution of PHP pages, that's all.
The protocol is *very* basic, and uses HTTP 1.0 for requests. Answers are received in plain text, with one information per line. There's no garantee that this would work with any HTTP server, but experience proved that it works with my provider 8-)
The Liquid War server is a rather small program. The only thing it does is accept new players, transmit map and game parameters between them, and then "replicate keys".
By "replicate keys" I mean that the server asks each client what keys have been pressed during the last round, and then dispatches this informations to all clients. This implies that the server has absolutely no idea of who's loosing, who's winning, etc...
All the "logic" of the server is coded in these files, the rest is only utilities and helper functions.
If you have troubles with Liquid War 5, if you think it is a bug, and if it is not described in this file, then just send a (precise...) decription of your problem to the Liquid War user mailing list.
Besides, it happens that now most bug reports come from the Debian tracking system "http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=liquidwar". Thanks to the Debian users and maintainers, it's a very valuable feedback source.
Additionnaly, on online bug tracking system is availalable on "https://github.com/ufoot/liquidwar5/issues". I try to collect everything here : bugs reported on the mailing-list, bugs from Debian, and bugs I found myself. Alternatively you can report bugs directly on it 8-)
Network support in Liquid War is far from being perfect, so there are a bunch of little problems which can appear. Basically, once the game is correctly started on a LAN, you should have no problems, but getting the game started might be difficult.
Some users reported that they were unable to control the Liquid War cursor with the mouse. Well, the answer is a typical Microsoftish "this ain't a bug, it's a feature!".
More seriously, you're supposed to move the cursor with the keyboard in Liquid War. There's no way to handle the cursor "like a mouse pointer" (*). This is due to:
(*) This is not perfectly true, there's a way to control the cursor with the mouse, but it's designed for the case "4 people want to play on the same computer and one single keyboard is not enough". Controlling the cursor with the mouse in Liquid War is possible but yet rather hard to master 8-/ Try it and you'll understand what I mean. This mode can be set up in the "Teams" menu.
On non UNIX platforms such as Windows or DOS, Liquid War is distributed in a .zip file. It's IMPORTANT that you unzip the .zip files with an "unzipper" which preserves the directory structure. Most install problems under Windows come from broken unzipping programs which extract all files in the same directory... WinZip 8.x or the unzip32.exe utility that comes with DJGPP are both able to uncompress Liquid War .zip files correctly.
On Liquid War 5.5.9 and later, the Windows version should detect this problem automatically and warn you with a message which basically says something like "Unable to load datafile. Are you sure Liquid War is correctly installed?". If you get this message, you need to reinstall the game by unzipping it with a "correct" unzipping program which does not wreck directory structrure up.
Sometimes there are some problems when compiling the datafile, this includes:
These bugs are quite hard to get rid off, since I can not reproduce them easily. The good solution would be to completely rewrite the liquidwarcol, liquidwarmap and liquidwartex utilities.
IF your midi music on Liquid War, or indeed any other Allegro game, doesn't work and you are using the OSS (Open Sound System) drivers (these are the sound drivers which come with the standard kernel distribution), this may well be because Allegro only supports "FM synthesis" and not "wavetable" when it is using OSS. FM synthesis is a very old method of making sound from MIDI and has long since been replaced by wavetable synthesis, with the net result that it's quite possible you've got OSS MIDI working nicely in other applications without having FM support set up at all. This is what I found. (It has to be said that I didn't find the FM sound quality quite as bad as people have said, though).
In this situation, it looks to me like you have the following choices:
to implement wavetable midi on OSS :-)
and for the rest of us...
which creates audio from MIDI using a set of patches (more info here: http://www.talula.demon.co.uk/allegro/digmid.html) and plays back through your sound card's audio.
Which is comprised of the following steps:
--IMPORTANT-- If you are using Liquid War, your FM will only work if you go to the map 'Elephant inside a boa' and proceed to chase each other round in circles for at least 10 minutes. This cures a bug in the design of the OPL3 interface which conflicts badly with the core Liquid War algorithms. How the hell the music hardware even knows about the core algorithms I don't know, but that's what I made of the now-defunct opl3-occult-FAQ, from which here is an excerpt:
Many roads a man must take. Those with one-track minds are DOOMED, I tells ya.
---- The Liquid War algorithm calculates distances to one place, the cursor.
And:
Man or machine, face or code, must stand strong and solid; must not just ooze away as slime.
---- We think it might just take objection to the whole 'slimy' nature of the LW beings. As well as it being LIQUID War.
So, our carefully tailored approach, is to firstly have the players going in all the possible different directions evenly by moving around the map in circles, and secondly to divert the opl3's attention from the general slimy liquidness of it all by emphasizing the solidity, reality, and natural goodness of that classic tapestry: an elephant inside a boa.
That and it's a f***ing ace level.
The Liquid War server is a "light" servers which - to some extent - has no idea about what is going on in the game. It simply replicates key strokes between clients and each client maintains its own game state. Normally, the game is designed so that given the same user input, it will behave exactly the same.
However, it happens that sometimes 2 clients can behave differently, and this is a (severe) bug. One consequence is that messages reporting "Checksum errors" appear on the server's and on the client's console output. This bug appears when using non-default rules settings. Basically, if someones tweaks his rules, then the checksum errors appear. Of course I double-triple checked that options were correctly sent on the network, but, well, could not fix the bug. Yet. The short term solution seems to play with default factory settings...
I'm highly interested in bug-reports concerning this problem.
In its latest releases Liquid War is quite stable IMHO. However there are still some issues with network under Windows for instance. I'm aware of these bugs and I'm trying to fix them but this does really take time.
I always welcome bug-reports and patches, as making Liquid War W 5.x.x as stable and bug-free as possible is really important to me - and most of the time players also appreciate stable programs 8-)
The most important bug-fixing area is probably cross-platform support. That is, make sure that the game runs fine on every supported OS. For instance, it's quite common for Mac OS/X and/or FreeBSD users to "crash" the game. This rarely happens on GNU/Linux, just because it has been so much more tested on this platform. This applies to Liquid War itself and also, to some extent, to Allegro.
Let's be clear: no new features in Liquid War 5. It's bloated, complicated, old, uninteresting to hack. All new features should be found in Liquid War 6.
Since summer 2005, Liquid War 6, a complete rewrite of Liquid War, is on its way. See http://www.gnu.org/software/liquidwar6/ or "https://ufoot.org/liquidwar/v6" for more informations.
Whenever Liquid War is released, I usually pass the good news to Freshmeat ( http://freshmeat.net/projects/liquidwar/ ). Then all releases are accessible from the main download page, which is "https://ufoot.org/liquidwar/v5/download".
Releasing the game takes time, for I want all binaries to install properly and sources to compile cleanly. Therefore there might be some delay before the time coding is over and the time a release is actually ready. So for impatients and/or for people who need to test out the very latest versions (eg someone who wants to compile the game on a new platform), it's possible to access the source repository directly.
Historically, Liquid War has used CVS, GNU Arch (aka tla), and now uses git http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html.
So FYI the previously active CVS and GNU Arch repositories, on Sourceforge and Savannah, are currently unmaintained. It has moved to Github.
A typical git command would be:
git clone https://github.com/ufoot/liquidwar5.git
If you are interested, I can open this repository in read/write mode, however one of the points of git is that it is distributed and allows cooperative developpement with multiple depots, so this isn't mandatory. And anyways, importing myself patches received by email has never been a real burden.
Besides, most developpement is now done on Liquid War 6. See http://www.gnu.org/software/liquidwar6/ or "https://ufoot.org/liquidwar/v6" for more informations.
Liquid War is a multiplayer wargame.
Copyright (C) 1998-2018 Christian Mauduit (ufoot@ufoot.org)
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A partICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Christian Mauduit <ufoot@ufoot.org>
v5.6.5 |