AI SDK Info This SDK contains everything you need to write your own computer AI for Lux and Vox. The SDK uses the Java programming language and is made up of a series of public API as well as example source code implementations.
The Agent Interfaces If you are unfamiliar with java interfaces, it is basically just a list of function prototypes. To write a class that implements the interface, you just fill in the code for all of the prototypes.
The Game API
Examples
To Compile
Installing
Debugging
Multiple Classes All method calls into AIs are inside try/catch statements. This means that errors within agents should not cause the game to crash. Whenever an exception is caught it is printed to standard out including a stacktrace. As well, a message is printed to standard out whenever an agent sends an improper command. (eg. it tries to attack a country that it owns) (Under MacOS X, standard out of all the running applications can be seen with the Console application, located in /Applications/Utilities/
For testing purposes it is sometimes useful to run game after game after game. Start Lux from the command line and pass it the -superfast option to get a mode that uses less graphics. You'll still have to start a game and turn on the Autoplay feature in the Preferences.
Lux AI Example Notes: The source code for all of the built-in agents come included with this SDK inside the 'src/com/sillysoft/lux/agent' directory. You are free to use this code for non-profit purposes. The example AIs aren't HTML formatted, so I won't link to them. They are all java classes with lots of comments. Meant to be viewed in your text editor of choice. I recommend that you look at Angry.java first for an example of a simple agent. That should give you a good idea of how agents interact with Lux's API. After that, you probably want to take a gander at SmartAgentBase.java which is a utility superclass used by all of my more advanced agents. Cluster.java is a good example of a subclass of SmartAgentBase. The general strategy of Cluster is to work on expanding a cluster of Countries. Subclasses improve on his behavior by limiting their attacks, or trying to focus them better. Subclasses of Cluster include: Shaft, Quo, Yakool, and Boscoe. Pixie.java is based on a totally different premise from the Cluster-family. She examines each continent seperately, and decides which ones she has a chance of taking over. Then she will place armies and attack in those continents. EvilPixie and BetterPixie use the same technique as Pixie, with BetterPixie being the most advanced. Killbot.java is an agent that uses the behaviour of Vulture.java to eliminate weak players. Killbot pairs up Vulture and BetterPixie behaviour.
Thank you very much for downloading this SDK. If you have any questions/comments please let me know.
Your friend in world domination, |