Bots README DESCRIPTION ----------- Bots is a Blanket-compatible screensaver. It is a robot-fighting game where a number of robots try to destroy each other in an arena by executing programs written in a Bot "assembly" language. In the arena, Bots are depicted by a circle with the name of the Bot above it. There is a line from the center of the circle to the rim, which represents the direction the Bot's gun is aiming. There is also a bright spot on the rim designating the last direction the Bot scanned with it's scanner. Bots are destroyed by being shot, hitting a mine, hitting another bot, or being hit by an exploding bot's shrapnel. New in this version, the bot weapon has a limited range; shots fade dissapear eventually. Similarly, mines are less devastating and quickly fade away. Exploding bots have a limited destructive radius as well. Also new in this version is an additional CPU cycle "cost" for aiming, moving, firing, and dropping a mine. It takes 5 cycles to drop a mine, 5 to aim, 10 to fire and two to move. This has the effect of keeping brute force bots like berzerker from totally dominating. INSTALLATION ------------ The Bot programs go in the /boot/home/botsource directory. Anything in this directory is assumed to be a robot file by the saver module. Please move the ./botsource directory to /boot/home. It currently contains some sample bots. Make your own, it's geeky and fun! To install the saver, open blanket's setup dialog and drag the file ./bots into its Modules window. MODULE SETTINGS --------------- Toggling the "Debug Bots" check box causes the game to proceed very slowly and display the current instruction being executed next to the Bot's name in the arena. The "Path to Bots" text control allows temporary specification of a new bots directory. This is only partially implemented and the value is reset upon each activation of the screensaver to /boot/home/botsource. BOT SOURCE FILE SYNTAX ---------------------- Bot source files contain the name of the bot, followed by a bot "assembly" language program. Bots are relatively simple virtual machines, each containing an accumulator, 4 registers and a small instruction set. A Bot can basically do five things: Move, Scan for other bots, Aim it's gun, Fire it's gun, or drop a mine that another Bot may step on. The remaining opcodes are for math operations and program control. Anything not recognized as an opcode is considered a label. Labels may be used as jsr and jmp targets, see below. Registers: acc, r1, r2, r3, r4 (results of most operations are stored in acc) The entire instruction set is: opcode description arguments ----------------------------------------------------------------------- "nop" No Operation. Basically wait. none "add" Add numbers, putting results in acc two (most ops that return a value leave the value in the accumulator) "sub" Subtract numbers, puts results in acc two "mul" Multiply numbers, puts results in acc two "div" Divide numbers, puts results in acc two "gt" If arg1 > arg2, puts 1 in acc, 0 otherwise two "eq" If arg1 == arg2, puts 1 in acc, 0 otherwise two "lt" If arg1 < arg2, puts 1 in acc, 0 otherwise two "rand" puts a random number (mod by the arg) in acc one "store" Stores the second arg in the first arg("r1", etc) two (store r3 100 puts 100 in register 3; store r1 acc stores the accumulator's current value in r1) "clr" Clears the specified register (e.g. "clear r4") one "test" Skips the following instruction if acc == 0 none (In other words, if the accumulator contains a value, the next instruction IS executed, otherwise not) "jsr" Jump to label as subroutine one (omitting the label restarts the program) "rts" Return from subroutine none "jmp" Jump to label one (omitting the label restarts the program) "move" Move in specified direction (0-360). Uses 2 CPU cycles. one "scan" Scan in specified direction (0-360), range to target one (if any) left in acc, 0 otherwise "aim" Aim in specified direction (0-360). Uses 5 CPU cycles. one "fire" Fire gun. Uses 10 CPU cycles. none "mine" Drop mine. Uses 5 CPU cycles. none ----------------------------------------------------------------------- Several example programs are in the botsource subdirectory. This dir should be moved to /boot/home/. AUTHOR NOTES ------------ There was a game called RobotWar or something similar on the Atari 800 and Apple II that I loved and haven't seen in years that inspired this saver. I always liked games like this and CoreWar where coding was the primary competition. Special thanks to Mike Pelletier (mike@compar.com) and John S. Monaco (bishop@websurfer.net) for their excellent suggestions. John also gave me the idea to release a "botpack" in the future, so if anyone has bots they'd like to contribute, please drop me a line. Enjoy! Howard Berkey October/November 1997 hberkey@tenetwork.com