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 develope AI-TEM
Add Ryu's Sprite with pane background, can use for many task...
These minor update are available in CU host only !!

21 Aug 06: AI-TEM v02 released (src, bin, txt). Add feature to check python script before run.
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 is stands for Artificial Intelligence Testbed in Emulator. As its name says it is testbed for test AI. (Testbed is term to call an application that use for testing something.) Then AI-TEM is an application for testing AI.

AI-TEM made from emulator of console/handheld game. Now,current version of AI-TEM that you can download is made by Visualboy-Advance (Link), an Gameboy Advance emulator. Gameboy Advance is handheld game machine of Nintendo, release on 2000 (use ARMs CPU). Even it is not a powerful machine as PSP or NDS but it stil have many classic game that is very interesting. Such as Super Mario, Street Fighter, Winning Eleven, Final Fantasy, etc. Visualboy Advance is a very good opensource emulator it porvide many tools that can adapt to use in AI-TEM. Visualboy-Advance link is another version of Visualboy Advance that made by another team. It has ability to play in link mode, multiplayer mode.

The Woriking of AI-TEM

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, but it 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 the game state, 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 add a menu into emulator to control the working of AITEM. To turn on/off AI module or switch between different AI modules. We can also activate other utilities that system may want to use.

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. (Ex: In Fighting game, Street Fighter Zero3, game states that we are interested in consist of position of a character, position of the character bullet, the characterís health, and current animation of the character.) We implemented this module by modifying the memory viewer tools of VBA. The user 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 will copy 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 memory of emulator, for user friendly. (This normalization process is not necessary if researchers do not care about the format of raw data from emulatorís memory.)

Now we come to the AI module. This module is where a user of AI-TEM will put his AI module in. In every cycle of emulation, the emulator will execute this module. This module evaluates the game data and decides what controller input it will send to the controller module. There is enough CPU power for calculating AI.

Python is an interpreted, interactive, objectoriented programming language. It is also usable as an extension language for applications that need a programmable interface. Python is portable: it runs on many OS such as Windows and Linux. It is one of the most famous script languages used in many applications.

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. There are more detail about this module in The AI module section.

Finally, original VBA will capture signals from joystick or keyboard and send them as input to a game. We modified the system so that our AI module can replace input signals from normal controller with its own signals.

Summary Outline steps of Using AI-TEM

1. Researchers must identify the 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 in some AI method such as some type of 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. Researchers may not have enough experience to identify the correct address.
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 Game state address

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.