Java API to easily create Unreal Tournament Gamebots.
Overview of the Project
Unreal Tournament is a three-dimensional
client/server based first person shooter game in which multiple players can
compete in either individual or team games. A group at CMU created the
Gamebots project which is a modification to Unreal Tournament that
allows characters in the game to be controlled via network sockets connected
to other programs. The game feeds sensory information for the character over
the network connection. Based on this information, the client program can
decide what actions the character should take and issues commands back over
the network to the game to have the character move, shoot, talk, etc.. This
sort of modification is perfect for use as an environment for AI research
in intelligent agents. The purpose of the JavaBot architecture and API is
to provide a higher level interface to the GameBots modification protocol
and make it easier for reasearch groups to develop agents/bots for this rich
domain. JavaBots can be created by extending java classes and working with
objects without having to worry about network protocols, message parsing,
etc.
Creating A New Bot
The first step in creating a new JavaBot is to extend the class edu.isi.gamebots.Bot
abstract class. This class contains methods already written to do things
like connect to a server and perform actions in the Unreal Tournament world.
There are two methods by all classes (i.e. bots) which override the
edu.isi.gamebots.Bot
abstract class.
public void handleSyncMessage(MessageBlock msgBlock);
This describes what to do when you get a syncronous message block. Refer
to Gamebot Network API for details into the synchronous messages that the
bot can expect to recieve from the world. This document is not entirely
correct; so I wouldn't take its word on blind faith - but it's accurate
enough to get an idea of how the Gamebots TCP protocol works.
public void handleASyncMessage(Message msg);
This describes what to do when you get as asynchronous message. Same rules
above apply here.
This is all you need to create your unreal tournament bot. Very easy...
Other methods that are not required to override, but are optional are:
public JComponent getView();
Returns a JComponent (usually a JPanel) that is added to the BotRunnerApp
as a tab as the interface. This allows the user to start new JavaBots and
view their execution via the BotRunnerInterfacee.
public void connected();
An event handling method. Defines what to do directly after the bot is connected
from the server.
public void disconnected();
An event handling method. Defines what to do directly after the bot is disconnected
from the server.
public void destroy();
Event Handler. Override this method to define what to do when the bot is
destroyed/disconnected by the user.
Current Bot Implementations
The following is a list of classes that you can currently type into BotRunnerApp
to get a sample bot and an interface:
edu.isi.gamebots.examples.ExampleBot
This is a simple bot that is mainly a proof of concept. This bot simply
moves from place to place and turns to map out a level.
edu.cmu.gamebots.CMU_JBot
This is another example bot that the folks at CMU put together that is mainly
a copy and modification of the ExampleBot class that does a few more things.
edu.tamu.gamebots.humanbot.HumanBot
This is a class that the folks at Texas A&M developed to learn the GameBot
protocol. It allows a human to view the messages sent from the server and
choose actions for the agent. Note that this bot is in no way autonomous and
that this is mainly a tool for learning the protocol of UT GameBots.