aibots - An improved clone of A.I.Wars in Perl
% aibots [-r|o|c] [-s] [-m] <map> <bot1 bot2...> % aibots duel Samurai Thief Sofixti Lancer % aibots
This is a clone of A.I. Wars (http://www.tacticalneuronics.com/ai.htm) in pure perl, with Tk and console interfaces.
A.I. Wars
Tk
Please consult the above URL for general information about this game.
-c: Console mode -s: Silent (Win32 only) -m: Music (Win32 only) -o: Messages only -r: Results only
The Path to AIBots pics/, wavs/, bots/, maps/ settings. Defaults to the install path of Games/AIBots.
pics/
wavs/
bots/
maps/
Games/AIBots
The drop-down menu in the bottom-left corner lists all available maps. The ones in square brackets (e.g. [Solania]) denotes a "level" with pre-defined bots.
Beginners are encouraged to start with the Open or Arena map.
Open
Arena
Press this key to cycle through all available backgrounds. This has no effects on the actual game.
The nine menus in the bottom lets you pick bots to duel with each other. Click on an empty menu to select; select the empty entry to delete a bot.
You could press the watch botton next to each bots, to have its statistics listed on the upper-left corner.
Displays author and version info.
After the maps and bots are selected, the Play button will be enabled. Press it to start the duel. All bots act upon their programs without human intervension.
You could press the Pause button anytime during the game; press again to resume.
A game usually ends when there's only one remaining team left on the field. Before the game ends normally, you could press the Stop button to end a long endgame prematurely.
Toggles beterrn slow, medium and fast. You could slow down the game during close encounters, and fast-forwards boring intervals.
If the Win32::Sound module is installed, AIBots could play sounds upon each event.
When the game is playing, the black button in the upper-left corner will display the Bot currently under Watch. Press that button to toggle the target.
The bot being watched will be surrounded by the [ ] symbol, and has its statistics listed on the upper panel, like this at the beginning of a game:
[ ]
[Mage-2] Score: 0 Ammo: 30 Life: 10 Fuel: 2499 [Turn Right]
These columns denote the bot's type (Mage), number (2), current score (0), ammo left (30), life points, (10), fuel (2499), and the action of this turn (Turn Right).
Also, the window title will display (Tick: 1), means this is the first step into the game.
In AIBots, players compete with each other not by reflexes, but ability to program 'Bots'.
Score accumulated with each bots determines a game's outcome. The primary mean to gain score is to deal damage to other team's Bots. Additionally, the last Bot standing will receive a 500 point bonus.
To inflict damage, Bots need weapons. All weapons except for Energy Zaps consume ammo points. The Life points represents the maximal damage a bot can take before dying. When a Bot's killed, it's turned into a Flag.
Turning, Moving and Launching projectile weapons consume fuel points. When a Bot runs out of fuel, it could not perform any of above actions anymore. The rate of fuel burning increases propotionally with damage received.
Life points and Ammo will not regenerate, but are replenished on Flag, Vault, and Strategy Points.
Each Tick, all Bots executes one Action Command and any number of other commands in turn.
The heading of each Bot determines the direction of weapon, move forward and move backward commands.
Bots do not stack. An attempt to move onto another bot results in a Bump.
Bots appear at random Spawn tiles when the game begin.
Entry Points in digits are for the bot with the identical number.
After the game begins, spawn tiles are treated as empty tiles.
Walls cannot be passed or destroyed.
Fences cannot be passed, but could be destroyed with any weapon.
If a damaged Bot moves on a Flag tile, it regains all Life points and increases 30 Ammo and 350 Fuel.
If the Bot is undamaged, Flag deals 5 damage to it.
A Bot moves into a Mine tile suffers 5 damage to its Life points and Fuel burn rates. If the mine was layed by an enemy, the enemy receives 400 points of Score.
Vault contains 20 points of Ammo.
Any weapons inflicted on the Vault tile will cause an explosion, which deals 3 damage to all adjacent Bots' Life and Fuel burning rates.
Vaults next to each other will explode simultaneously.
Bots staying on the Strategy Node tile will receive 1 points of Fuel every 5 turns, 1 point of Ammo every 10 turns, and heals 1 point of Life every 15 turns.
Laser is the most basic weapon. It consumes 1 point of Ammo, and attacks to five tiles forward. Laser beam will stop after hitting the first object.
When hit, Bots with Shield Off state will receive (6 - distance) points of damage. Shielded bots receives (3 - distance) points of damage in the first two tiles only.
Burn rate damage caused by Laser equals to its Life point damage.
Bazookas consume 10 Ammo and 300 Fuel points each. They fly with the speed of 1 tile per Tick, and explode upon impact.
Upon explosion, a Bazooka deals 7 (shield off) / 4 (shield on) damage to adjacent Bots.
Direct hit to a Bot causes 9 / 6 points of damage, depends on its shield state.
Burn rate damage caused by Bazookas equals to its Life point damage.
Grenades consume 5 Ammo and 200 Fuel points each. They fly with the speed of 1 tile per Tick, and explode upon impact.
Upon explosion, a Grenade deals 5 (shield off) / 2 (shield on) damage to adjacent Bots.
Direct hit to a Bot causes 7 / 4 points of damage, depends on its shield state.
Burn rate damage caused by Grenades is 12 / 9 upon direct impact, 4 / 1 collateral.
Energy Zap consume 1 point of Life, and deals 2 points of Life and Burn rate damage to all adjacent Bots.
Energy Zap is the only weapon capable of destroying Flag and Mines.
Self-destruct deals the same amont of damage as remaining life points to all adjacent Bots, both to Life and Burn rate points.
A self-destructed Bot will not turn into a Flag.
Shields could be Enabled or Disabled at any given time.
Bots receives less damage when shielded, but cannot fire any weapon except for Enegy Zaps and Self-Destruct.
When Enabled, a Bot will leave a Landmine in the original tile every time it moves, which consumes 5 Ammo points.
Bots with Cloak enabled will not be seen by other Bots via $enemy_[x/y/h] and $friend[x/y/h] variables.
$enemy_[x/y/h]
$friend[x/y/h]
A Bot lose 10 Fuel and 2 Ammo points each turn when cloaked.
Bazooka Impact: Unshieled +500, Shielded +300. Collateral: Unshielded +400, Shielded +200. Grenade Impact: Unshieled +500, Shielded +300. Collateral: Unshielded +200, Shielded +100. Laser Actual damage * 20 Destruct Actual damage * 50 Energy Zap +100 Vault +200 Mine +400
+50 for every Life points left, or -50 for every points below 0.
-1 for every point of Burn rate causes by damage.
The last Team surviving receives +500 points.
$name, $author
$team
$pic
$shield, $laymine, $cloak
$bumped, $found
$score, $burn
$fuel, $max_fuel
$ammo, $max_ammo
$life, $max_life
$x, $y, $h
$enemy_x, $enemy_y, $enemy_h
$friend_x, $friend _y, $friend_h
$snode_x, $snode_y
$id, $botcount
$lastcmd
$state, $line
scan front, scan left, scan right;
scan perimeter;
scan cross, scan corner;
scan longrange;
scan position [1..9];
scan relative [1..9];
scan gps $x, $y; Moving
move forward, move backward;
turn left, turn right;
fire energy;
fire laser;
fire bazooka;
fire grenade, fire grenade $d;
enable/disable shield;
enable/disable laymine;
enable/disable cloak;
attempt repair;
attempt destruct;
beam fuel/ammo/command;
&nearst("friend"|"enemy")
&inperim("friend"|"enemy")
&headto("friend"|"enemy")
&found("$obj1|$obj2|...")
&bumped("$obj1|$obj2|...")
&damaged()
&ready($weapon)
&onnode()
&turnto(2|4|6|8)
&distance($x, $y)
&toggle()
if ($condition) {...}
unless($condition) {...}
elsif ($condition) {...}
else {...}
... if/unless ($condition)
LABEL: {...}
redo;
goto LABEL;
call LABEL;
return;
=background Background image =bot[1..9] Default Bots =sound Opening Sound =snode x, y Strategy Node location
Autrijus Tang <autrijus@autrijus.org>
Copyright 2001, 2002 by Autrijus Tang <autrijus@autrijus.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install Games::AIBots, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::AIBots
CPAN shell
perl -MCPAN -e shell install Games::AIBots
For more information on module installation, please visit the detailed CPAN module installation guide.