Go to the first, previous, next, last section, table of contents.

Writing New AIs

You can add new types of AIs to Xconq. You would do this to add different strategies as well as to add AIs that are programmed specifically for a single game or class of games. (This is useful because the generic AI does not always understand the appropriate strategy for each game.)

You have to design the object that is the AI's "mental state". If your AI need only react to the immediate situation, then this object can be very simple, but in general you will need to design a fairly elaborate structure with a number of substructures. Since there may be several AIs in a single game, you should be careful about using globals, and since Xconq games may often run for a long time, you should be careful not to consume memory recklessly.

Note that these functions have very few constraints, so you can write them to work together in various ways. For instance, an AI can decide whether to resign once/turn, once/action, or once for each 4 units it moves, every other turn.

[describe default AI as illustrative example]


Go to the first, previous, next, last section, table of contents.