

			   WELCOME TO MARAUDER



Last updated on July 1, 1999, to work under Linux. Previously updated on 
June 21, 1999, to work with the 3.9.x Allegro WIP versions, and to compile 
under Windows using MSVC.

I wrote this game during 1994 as an experiment into the possibility of using 
genetic evolutionary algorithms to control enemy spaceships. This AI system 
didn't work, so I removed it, and this is what was left. Warning: some of 
the code is really ugly because it was written as part of a larger system 
and then hacked about into its current form. Someday I'd like to add a 
multiplayer network option, but I have yet to find time :-)

The original version of the game used my mode 13h library, Allegro. In 1996 
I ported it to Allegro 2.0, adding support for the SVGA graphics modes and 
sound. You can get Allegro from my homepage, http://www.talula.demon.co.uk/.

Marauder was compiled with DJGPP (DJ Delorie's DOS port of gcc), and runs in 
32 bit protected mode courtesy of Charles Sandmann's DPMI provider, CWSDPMI.
If interested, you can get a copy of both these programs from your local 
SimTel mirror in /vendors/djgpp/.

If you want to contact me, the address is:

    Shawn Hargreaves,
    1 Salisbury Road,
    Market Drayton,
    Shropshire,
    England, TF9 1AJ.

Or on the internet:

    shawn@talula.demon.co.uk




				THE RULES


Many years from now, in a distant corner of the galaxy, blah blah.

Ok. The rules are simple. Earn as much money as you can, and don't get shot.

When you start the game, you will see a little spaceship in the middle of 
the screen. That is you. Use the left and right arrow keys to turn, and the 
up arrow to fire your thrusters. Once you start moving it is not easy to 
stop. You will eventually coast to a halt, but if you are in a hurry you 
will have to turn round and fire your thrusters in the opposite direction.

If you fly around a bit, you will probably come across a planet or another 
ship (HINT: you can see all the planets and ships on the radar display at 
the top right of the screen).

There are two things to remember about planets. One is that if you fly into 
them you get hurt. The other is that if you fly up close to one and then 
press ENTER, you go to the shipyard.

You can do all sorts of neat things in the shipyard, like buying extra 
weapons, repairing damage, and trading cargo. Use the arrow keys to select 
an item, and then press 'b' or 's' to buy or sell (note that you can only 
sell cargo, not weapons). Cargo prices differ from planet to planet, so if 
you want to earn your fortune as the captain of a peaceful merchant ship, 
you can.

The real money (and fun) lies in piracy, though. And for that, you need 
weapons. Your ship comes fitted with a basic attack laser, but there are 
much more lethal armaments available for those who can afford them. The 
proton gun and matter cannon are similar to the laser, but a lot more 
destructive. Missiles are even more lethal, but you have to keep a large 
supply of them to avoid running out in the heat of battle, and the cheap 
black-market ones are often faulty and tend not to fly straight. Torpedoes 
are like missiles, but are more expensive and much better manufactured. 
Finally, mines are cheap and deadly, but if you use them, be careful not to 
blow yourself up in your own minefield.

In the shipyard you can also repair your ship when it is damaged, buy 
shields (which protect you from being damaged), and buy an afterburner. This 
is an improvement to your drive system which boosts your maximum thrust by 
about 300 percent.

Oh yes. Nearly forgot to tell you.

After buying some of these weapons, use the number keys 1-6 to select one 
(the current weapon is shown at the right of the screen), and press SPACE to 
fire.

Should you succeed in destroying any ships, a little rotating blobby thing 
will be left behind. This is the money and cargo that the ship was carrying, 
and it is a good idea to go and pick it up before someone else gets it.




		    FORMAT OF THE SAVED ENEMY AI FILES


You can customise Marauder by writing your own sets of rules for controlling 
the enemy spaceships. A Marauder AI file is an ascii text file with the 
extension MAR. It can contain anything from 1 to 16 enemy definitions, one 
after another. The parser is pretty crude, so you have to be careful how you 
lay these out. Everything is case sensitive, and it probably won't work if 
you do 'creative' things with the spacing.

An enemy definition looks like:

    Speed=<x>
    TurnSpeed=<x>
    Weapon=<x>
    Shields=<x>
    RuleCount=<r>
    <rule 1>
    <rule 2>
    ...
    <rule r>

The meanings of Speed, TurnSpeed, and Weapon are obvious. The range is 0-2.

A rule definition looks like:

    <cond 1> [& <cond 2>] <action>

nb. stuff inside [ ] is optional.

The AI interpreter uses a form of fuzzy logic where each action is given a 
numeric weighting (which may be negative). All the conditions are tested, 
and of the ones which evaluated to true, the action weightings are added. 
Whichever action received the most votes is carried out.

A rule condition looks like:

    <value 1> <operator> <value 2>

A value can be a decimal integer or one of the strings: 
    TreasureDir, TreasureDist, PlanetDir, PlanetDist, ShipDir, ShipDist,
    PlayerDir, PlayerDist, LaserDir, LaserDist, MissileDir, MissileDist,
    BuyPlanet, SellPlanet, Money, Cargo, Damage, V1, V2

Treasure, Planet, Laser and Missile all represent the closest object of that 
type. Player is the ship belonging to the human player, and Ship is the 
closest ship of any type (including the player). The Dir values are from 
0-7, 0=straight ahead, 2=to the right, etc. The Dist values are in pixels 
(the screen is 200 pixels high). BuyPlanet and SellPlanet are non-zero 
depending on whether Planet is a good place to buy or sell cargo,
Money, Cargo and Damage describe the current status, and V1 and V2 are 
internal variables.

Valid operators are: 

    =   equal
    !   not equal
    >   greater than
    <   less than
    }   greater or equal
    {   less or equal
    @   approximately equal
	(difference <= 1)

An action can contain any or all of:

V1=<val>
V2=<val>
    Sets an internal variable. If val=-1, decrements the variable.

Left=<weight>
Right=<weight>
Forwards=<weight>
Fire=<weight>
    The greater the weighting, the more likely the action is to be done.

<item>+<angle>=<weight>
    Specifies a direction relative to another item. The item can be one of 
    Treasure, Planet, Ship, Player, Laser, and Missile. The angle is from 
    0-7: 0 = fly straight towards, 4 = fly away from, etc. The weighting 
    specifies how important this action is.

Some aspects of the AI are handled automatically. In particular, ships will 
not fire unless there is a target in front of them (because it would look 
silly), and to use a shipyard the AI file only has to get the ship near to a 
planet (within 40 pixels). It will then automatically repair damage and buy 
or sell cargo, depending on the state of the ship and the type of the planet.

Have fun!
