-
Notifications
You must be signed in to change notification settings - Fork 0
The Legend of Xenon uses roguelike geometry, in which space is rigidly quantised into square cells, and the distance from a cell A to another cell B, joined to it at either an edge or a corner, is exactly 1. The distance from cell A to a distant cell C is the minimum number of edges and vertices which one must traverse to get from cell A to cell C. The "cardinal directions" of roguespace are the directions in which one can move from one cell to an adjacent cell.
There are five movement selection algorithms used in Legend of Xenon, as follows:
The "native" AI is used by "stupid" monsters without ranged attacks who have line of sight to the player. The monster tries, for each of the three adjacent squares which are closer to the player, to get closer to the player.
The "missile" AI is used by any monster with a ranged attack (either shooting or black magic) requiring cardinal alignment which has line of sight to the player. The monster tries to close with the player, preferring to do so along a cardinal if already on one, and to get onto the cardinal if it isn't already on it.
The "smart" AI is used by "smart" monsters without ranged attacks who have line of sight to the player. The monster tries, for each of the three adjacent squares which are closer to the player, to get closer to the player, preferring to find a square which is not on cardinals relative to the player unless that square is also adjacent to the player.
The "drunk" AI is used by "stupid" monsters which lack line of sight to the player. The monster tries three randomly selected adjacent squares.
The seeking AI tries to get closer to the player. It's not sophisticated enough yet, but I think it should work at least some of the time.
- Ai - Monsters AI algorithm descriptions.
- Black Magics - How black magic works.
- Monsters Classes - Some notes about monsters properties.