First Steps in Game AI: Your Own Bot
By ai-depot | June 30, 2002
Information Provided
No matter what approach you decide to use, your AI will receive a certain amount of information from the game server. How much information is available really depends on what approach you’re using. It can be split into two categories.
Entities
Entities can be pretty much anything: an item you can pick-up, a platform or lift, or even another player. In this last case, the entity is known as a client. Each of these entities has basic properties, which you can read (position, type…).
In a server-side approach, you can basically access all the entities stored in the server. This means that no matter where you are in the level, everything will be visible. It is your responsibility to discard invisible information if you desire to.
For client-side bots, you will only be sent entities that are potentially visible. I call this “subjective perception”, but you feel free to call it what you want! This improves the performance of the network protocol, but can be a bit awkward / challenging for the AI.
Level Structure
The level structure is basically the part of the environment that the bot can collide with. This is dealt with by the physics module of the engine, no matter how simple it is. This information can be extracted from polygonal data, given 3D collision detection primitives such as casting rays, tracing bounding boxes and getting the content of a point.
Accessing the level structure is only directly possible if you’re using a server-side approach. Indeed, the ray-tracing functions needed are provided by the engine interface, which isn’t available over a network connection. This is really awkward for client-side bots, as structural information is becoming essential for quality AI.
The only way of knowing about walls is to measure the amount of movement, and determine if something was hit along the way. This is very crude and error prone, not to mention the fact that the bot will need to run into every wall to learn the structure of the level.
Decision Making
How your bot takes into account all this information is what it’s all about! There are many fields of AI, some of which are better suited to solve some problems. Designing the artificial intelligence of your bot around this will help a great deal. You can also tackle the problem as a whole, but that will take more skill and technology to achieve successfully.
Tags: none
Category: tutorial |