The information in this manual and the associated software are provided "as is". There are no guarantees, explicit or implied, that the software and the manual are accurate.
Gun Tactics II is the successor of GUN-TACTYX - read it like Gun Tactics - that was a "CROBOTS-like game with QuakeIII-style graphics". It belongs to the genre of Programming Games like Tom Poindexter's CROBOTS, an old 1985 DOS game, where some robots fight in an arena, firing missiles and avoiding enemies' projectiles. Such kind of games is involving, but it is not interactive, in fact the player must develop the AI algorithms of his own robot using a programming language and then can follow its fights against other robots, possibly written by other players.
A great deal of these kind of games is available for download, most of them for free. An on-line example was my JROBOTS that dates back to the year 2000. It is a clone of CROBOTS with interesting features. While a player of CROBOTS had to use a subset of C to program his robot (using only integer math because of the limitations of 1985 PCs), a player of JROBOTS uses the Java language and the robot consists of a single Java class. For almost ten years, players could upload the corresponding file to the on-line arena to compete in monthly tournaments against robots developed by other players. One of the most appealing characteristics of JROBOTS was the cooperative play. In fact, while the original CROBOTS had only one-against-all kind of matches, JROBOTS supported matches among team of robots, from doubles to four teams of eight robots each at a time.
During tournaments, since April 2000, a large number of interesting jrobots were uploaded online and featured several different strategies that evolved with time.
Even if JROBOTS was a great game in its genre, it had some limitations and, since the beginning, I wished to develop another game with the strongest points of JROBOTS, but at the same time graphically appealing, with an easy to control execution environment and a more realistic simulator. After a long list of failed attempts, the answer to my wishes appeared in 2003 and its name was GUN-TACTYX.
This game was developed using my proprietary 3D engine (Apocalyx 3D Engine http://apocalyx.sourceforge.net) and the SMALL scripting language. The graphics was more appealing for the time and the bots' code was executed in a controlled environment. There were different kind of play (the traditional gun fight, but also a soccer mode) and for a couple of years a small community of players programmed interesting AI behaviors. A few researchers wrote papers that made use of GUN-TACTYX to develop concepts in particular fields of AI.
After so many years, it's time to revive the concept: it's time for Gun Tactics II. No more based on a proprietary 3D engine (that is difficult for me to upgrade because of so fast paced technological improvements) but based on the freely available up-to-date Unity. No more programming with an almost unknown scripting language (the SMALL language has evolved years ago in PAWN), but programming with the well known and simple to master Lua language.
In Gun Tactics II, the player must develop the AI algorithms of his team of bots using the Lua scripting language. This document describes the use of Lua to create scripts that control the bots' behavior. The Lua language is a powerful scripting language easily extendable and embeddable in other applications. It is often a scripting language of choice in the game industry. Here the description of Lua is limited to the features that are useful to create Gun Tactics II scripts, but plenty of other possibilities are available. To know more about Lua visit the site http://www.lua.org.
A Lua interpreter can run instruction by instruction the scripts and provides a fine control of the execution. It is very easy to execute the code for any amount of ticks of (virtual) CPU clock, suspend the execution starting the run of other code and resume it. As a consequence, all the bots of the game use the same amount of time to perform the same actions, saving the reliability of the simulation. The Lua language is very easy to learn for people who already knows a programming language such as Java, C#, Phyton, C++ or others, and may introduce unexperienced people to procedural programming.
Keys assignments: A, S, D, W and mouse control the camera movement; U, I, O, P control the simulation speed (U doubles, I normal rate, O halves and P pauses). ESC is used to change from menu to game mode or to quit the application.
The game consists in a fight among 4 teams of 8 warriors.
The warriors move in a complex environment with walls.
A warrior can walk, run or sprint (run faster), but it suddenly stops when hits a wall or another warrior.
Warriors have a brain that consists in a CPU with a virtual clock frequency of 2500Hz (the simulation runs at a rate of 1/50 of second and 50 instructions are executed at each step). They are equipped with one gun that fires bullets (that run at a speed of 30 m/s). The number of bullets loaded at the beginning is 50. Recharges are provided on the battlefield. A bot can't fire when sprints and the fire rate is 1 shot every 2 seconds.
Every warrior has an initial amount of health, energy and armor. Health starts from the maximum, 100, and decreases when a buttel hits a warrior, 50 units per hit. When a warrior reach zero or less health, it is disabled (and falls to the ground). Energy starts from 100. It decreases 5 units per second when the warrior sprints, 3.5 units per second when it runs, increases 1 unit per second when the warrior is standing and keep its current value when the bot walks. When the energy reaches zero, the warrior can't run or sprint, but can still walk. The Armor value starts from 0, while the maximum is 100. Armor gives protection from hits, but every hit reduces the armor by 50 units. Powerups for health (medikits), energy and armor are available on the battlefield. When a powerup is hit by a bot, it disappears from the battlefield but is respawned after a certain amount of time.
Warriors may rotate their forward direction around their vertical axis and rotate the torso up to specific values. The gun, its aim device and other sensors are linked to the torso and follow its movement.
Among the others described in Part III, some of the main functions (the types 'float', 'int' or 'bool' are just placeholders to make clear arguments and return values of each function: in this version of Lua, variables are declared with 'local' and are numerical in a general way) available to warriors to interact with each other and with the environment are:
This is only a brief overview of the game. Other details appear in the list of the functions that control the bot's behavior available in Part III.
If you have any question, contact me at email@example.com.
Wrokdam Von Gadmoore was a legendary arena gladiator in his time. He had no greater love than the glory of combat and spent his entire life shaping his body and mind into the perfect weapon. Tragically, a warrior's prime fades quickly.
Wrokdam could feel the years catching up and it infuriated him. He swore he would never allow weakness to prevail even if his body betrayed him. He decided to combat death itself through the use of cybernetics and began replacing parts of his body he felt had grown too weak to be useful in battle. He thought he had found true immortality. He was terribly mistaken.
As time passed, Wrokdam slowly slipped into madness. His mind could not endure the time his new body could and he soon lost himself to the machine.
Now the monster known as Wrokdam wanders the world in search of combat and no one knows if any part of his soul still lives.
In a few decades people lost memory of Wrokdam and his past glory faded away. The cyber-gladiator's story became a legend known only by the oldest arena warriors, until Wrokdam was found still fighting in a provincial arena on a far planet at the border of the Empire.
A young researcher of ZYX Corporation apprehended the military application of a body so highly trained for combat, so the mad warrior was captured and transferred to a gun-fight training area known as GUN-TACTYX.
The researcher discovered that Wrokdam's body could become the perfect combat machine, but his brain was too weak, slow and mad to drive effectively his powerful devices. A hard decision was taken and an artificial brain was installed in place of Wrokdam's carbon-based one. Then his body was cloned hundreds of time to form teams of clones fighting each other to pick out the perfect warrior through natural selection.
Only one thing lacks to make Wrokdam the strongest arena gladiator of every time: The best gun-fighting algorithm for his artificial brain!
GUN-TACTYX: Then it was your play!
Gun Tactics II: Now your play is back!
The reader may ask where Wrokdam's original brain is now, but the answer is obvious if you know that ZYX Corporation's philosophy is: "Throw Away Nothing".
Wrokdam's brain is now employed as a consultant at ZYX Corporation and mainly keeps up running commentary of the fights among the clones taking place in the arenas of the GUN-TACTYX area. His deep experience in gun tactics is very useful to the developers that tune up the fighting algorithms.
I don't know if he is really dissatisfied with his new condition, but I'm sure that he is a little envious of those artificially brained fighters that resemble the aspect of a warrior once know as Wrokdam: A legendary arena gladiator in his time.
The warriors in the Gun Tactics II arena are controlled by Lua scripts. The interface
to the surrounding environment is given by the following set of functions. The value
assigned to some arguments and returned values are specific to the current implementation of the game and may change in future releases, but the API and its specifications are
very likely fixed once for all.
A player writes the source code of his bot in a text file (for example "rookie.lua"). A function called "main()" is called when the script is executed.
Local scripts are stored in the "/_MyBots" folder of the game, while scripts downloaded from the repository are stored in "/_OtherBots".
Here follows the complete list of functions with some explanation that
specifies also the parameters of the warriors and some characteristic of the environment in the current implementation.
Note: In the following list, the types "float" or "int" are used to mark numerical arguments and return values, but that types are there only for clarity and it is an error to use them in Lua scripts, in fact Lua is not a typed language. Remember that the simulator of Gun Tactics II uses meters and seconds as units of space and time respectively and radians for angles.
Any question? Contact Leonardo Boselli at firstname.lastname@example.org
Find Gun Tactics II at https://www.youdev.it/gt2