06 March 12: Update language problems on the site.
23 Nov 06: AI-TEM v04 (txt) released. Add info about running 2 instances.
AI-TEM for Visual Studio 2005 (src) released.
From now I will use VS05 version to develop AI-TEM.
Add Ryu's
Sprite with pane background, it can be used for many tasks.
These minor updates are available from Chulalongkorn University host only !!
http://zeus.cp.eng.chula.ac.th/~g48wth/aitem/download.htm
21 Aug 06: AI-TEM v02 released (src, bin, txt). Add feature to check python script before running.
18 Aug 06: Alternate link at SourcForge (see contact page).
07 Aug 06: New ver of aitem.txt, add new pic in AI-TEM page.
-------------------------------------------------------------------------------------------------
AI-TEM stands for Artificial Intelligence Testbed in Emulator. As its name suggests, it is a testbed for testing AI (Testbed is a term for an application that is used for testing something).
AI-TEM is coded from console/handheld
game emulator. The version that you can download is based
on Visualboy-Advance (Link), a Gameboy Advance emulator. Gameboy Advance is
a handheld game machine released by Nintendo in 2000 (use ARMs CPU). The
Gameboy Advance is not as powerful as PSP or NDS, but it has many interesting
games, such as Super Mario and Street Fighter. Visualboy Advance is a very
good open source emulator. It provides many tools that are useful for
AI-TEM. Visualboy-Advance link is another version of Visualboy Advance (made by
another team of programmer). It can play games in link mode, allowing 2 players
to play together on different machines.
As said, The core of this testbed is VBA (Link) emulator. It is used to run game ROM and simulate the game.
The Concept of AI-TEM is generally simple but there is some difficulty using it. Researcher’s AI may need to know game state data, such as object position or character animation. AI-TEM cannot access the source code of the game. The AI can only access the source code of the emulator. So we must get the game state data from memory data the emulator is emulating. We can see only a binary (hexadecimal) value of game data that changes in every cycle of a game execution. We must therefore find out which address stores the value that we are interested in, such as position, animation, etc. We will use values in those addresses as game state data for AI testing. When we know game states, AI can be written to react in each situation, by sending a controller input. Using this concept, we can use AI-TEM as an AI testing tool.
We added a menu to emulator as a way for programmers to control the working of AITEM, turn on/off AI module or switch between different AI modules.
A game state can be known by observing data on the memory address of the emulator and locating which address stores the data that we want to know. In Street Fighter Zero3, game states that we were interested in consist of position of a character, position of the character's bullet, the character’s health, and current animation of the character. We implemented this module by modifying the memory viewer tools of VBA. Users can identify address and size of data (8, 16, 32 bits) that they are interested in. When AI-TEM is running, in every frame, Game State Observer copies the value from those addresses to the data structure that an AI module can use.
Before Game State Observer sends game state data to AI module’s data structure, the game state data must be normalized or interpreted, depending on the game and format of data that we got from the memory. The Game State Normalizer takes care of this task. This normalization process is not necessary if researchers do not care about the format of raw data from emulator’s memory.
In every cycle of emulation, the emulator executes AI module . This module evaluates the game data and decides what controller input it must send to the controller module.
We modified the emulator to have an ability to use python script language, providing interface functions for a script writer to obtain game state data and to control the game via any AI. A script writer can write their python script separately without running the emulator, and can change script without recompiling AI-TEM.
Finally, AI-TEM captures signals from AI module and sends them as inputs to a game, with Input Controller module.
1. Researchers must identify
all game states data that their AI module needs to
know. In normal AI method, such as scripting, it needs
to know only current situations of the game. But for some technique such
as Reinforcement Learning, it needs to know a complete set
of actions that the agent can perform in every situation.
2.
After that, they must find the address of game state data that
their AI needs to know. This step can
be difficult for some games.
3. After the addresses are found, they must collect the data
from those addresses and translate the data into a form
that the AI can understand.
4. Implement their AI.
Finding each address that stores those game state data is difficult if done manually. Some values can be found easily, while some are rather hard to find. User should have some knowledge about programming in order to be able to identify address more successfully. Some examples of how to find the address of game data are demonstrated below.
Example : Finding address of character health. Starting by identifying all the values used in the game. Then the game is played and the character health is forced to decrease. The value that represents the character’s health should in fact decrease too. All game values are then searched and compared with values before the health decrease. It is common to find many values decreasing. The process should be repeated, with different health, until one address is identified. More information and example can be seen in AI-TEM.txt file in download section.