Yes, this is one of the threads that has a permanent bookmark in my folder. But anyways, if you insist, I'll quickly go over the main types of movement.
As I've said elsewhere, there's three main types of movement, with two of them having an additional variant. These are as following:
Direct: Used by Golems, Wubbas, Gel Babies and Fegundos.
Beeline (Normal): Default movement, used by Roaches and many other monsters.
Beeline (Smart): Used by Seep.
Flexible (Normal): Used by Guards.
Flexible (Flank): Used by Rock Giants and Aumtlich.
Note that Wraithwings and Roach Queens use the above movement types in different ways, and Goblins don't use any of the above at all. bibelot's already explained these three monsters in great detail.
Normal Movement AI
Beeline has already been explained by bibelot very well under Roach movement. Smart Beelining is a variant, however, that differs only when a diagonal movement is required but is blocked. Instead of preferring vertical movement, the monster will prefer to move in the direction that reduces the longest orthogonal distance. For example, if a Seep's target is 10 South and 3 East of it, and it cannot move SE, then it will prefer to move S because the vertical distance is greater than the horizontal distance. If both orthogonal distances are the same, then vertical preference wins out.
Direct decides which direction is best as usual - however, if that direction is blocked, then no movement is made. This prevents sliding along walls when the monster wishes to make a diagonal movement.
Flexible does everything that Smart Beeline does, but it differs when the monster wishes to make an orthogonal movement (non-diagonal) but is blocked. In this case, it checks the two diagonal squares adjacent to its required movement, and sees which of those is possible. If any is possible, then it will take that direction instead, effectively sidestepping the obstacle. For horizontal movement, the monster will prefer stepping to the North of obstacles rather than South, and for vertical movement, the monster will prefer stepping to the West of obstacles rather than East.
Finally, Flexible Flanking differs from normal Flexible movement when the monster is right next to its target. Normally, Flexible movement will not try to sidestep if it wishes to make an orthogonal movement onto the target but is blocked. However, a Flank will allow the monster to use the sidestepping rules even when directly next to the target. This allows it to sidestep things like Force Arrows and attempt to approach the target from a different direction. Note that the North and West preferences still matter here, so it'd be difficult for a monster to flank to the South, for example.
===
Brained Movement AI
Again, bibelot has explained brained movement excellently for Beelining. Flexible movement uses brained movement identically to Beelining.
Direct movement and Seep have exceptions, however. Direct movement will fail to move at all if the first path given to them via the brain sends them into a brain-invisible obstacle. They will not check any of the other alternative paths the brain might have for them.
And Seep were *supposed* to not move at all if all of the "
best"
paths the brain gave them were blocked by brain-invisible objects. However, this doesn't seem to work - instead, they'll go back to their Smart Beelining behaviour, even if it would technically take them farther from their target.
Also, Seep and Water Skippers have an additional feature with brains, in that they consider each movement over a square they shouldn't be able to move over worth 1001 moves, rather than be completely impassible. This means that they'll head for squares that minimize the distance over obstacles. Furthermore, they ignore routes over walls/water that are not connected to their segment, treating them as additional obstacles. The consequence of this is that they'll head for the squares within their connected segment that minimizes the distance between them and their target. I don't believe it's possible to create a non-obstacle path that has over 1001 squares in it, so there shouldn't be any problems there with them favoring a path through obstacles rather than a really long windy connected path.
===
Monster Movement Order
In general, monsters move in the order they were placed or spawned. However, there are tiers in which certain monster groups move before or after others. Here's the order:
Player
Mimics, Decoys and Clones
Fegundos
Stalwarts
Slayers
Guards
Default Monsters
(includes Halph)
Citizens
Characters
===
Potions
Only humans may move over potions. Goblins are not considered humans. Water Skippers and Seep may move on top of a potion when attacking a target.
===
Now for individual monster quirks from non-AE monsters.
Water Skipper: They may move onto any square that doesn't contain either a Wall or a Door *IF* there is a target on the square they wish to kill. They respect Force Arrows and Orthosquares while doing this... but they can still move onto Pits, Obstacles, Potions, Lights, etc, providing the target is also on said obstacle.
Water Skipper Nests: Every 10 turns, if there's a visible target in the room, they spawn a single Water Skipper on an empty Water square surrounding them. The square chosen must be water, and must not contain any standard obstacle or the player. The square chosen will be the one closest to the nearest target. If the Water Skipper Nest is brain-controlled, then it will use the brain's distance to decide. Otherwise, it uses the Pythagorean theorem. In the case of ties, priority is given in the order of NW, N, NE, W, E, SW, S, SE.
Rattlesnakes: Moves exactly like Serpents, except that it can also move over Scrolls and Force Arrows (providing the arrow does not block the direction). If their tail moves onto a sword after movement, then it is automatically stabbed. This only occurs once per Rattlesnake movement, but extra stabs are possible on sword-wielders' turns.
Adder: Moves exactly like Rattlesnakes. They do not consider small monsters to be obstacles and will eat them instead - the only exception there are NPCs with the Invulnerable imperative. They may also eat tarstuff providing it is a piece not vulnerable to stabbing. If they eat something, they grow by one square. An Adder moving onto a sword does not take damage - damage is only done on the sword-wielders' turns. Finally, an Adder that is trapped will shrink if one of the possible squares it could've moved to contains an Adder piece (either its own or another Adder).
Seep: Uses Smart Beelining and can move through walls and doors only. They can attack targets outside of walls but die immediately afterwards. Like Water Skippers, they only care about Force Arrows and Orthosquares blocking movement if they can attack a target next to them. Finally, if caught outside a wall, they die.
Fegundo: These don't move until a Power Token has been activated. At that point, they use Direct movement in the direction that the player is currently facing, providing they can either see or smell the player. If an obstacle is in the way and an Arrow or Orthosquare isn't preventing movement in that direction, then the Fegundo explodes in a 3x3 square, turning into Fegundo Ashes. Exceptions are the player and Stalwarts: they will instead just kill them without exploding. Fegundos killed by an explosion turn into ash as well. Fegundos are immune to swords.
Fegundo Ashes: After 5 turns, these revive into Fegundos. Fegundo Ashes are vulnerable to being killed in many ways, including swords, explosions and falling into water or pits.
Rock Giants: Use Flanking Flexible movement. They pick their target first, choosing whoever is closest to the exact center of the Rock Giant. After choosing a target, they are considered to occupy the square closest to their target using the Pythagorean theorem (for example, if their target is to the SE, then the front of the Rock Giant is now also to the SE). Ties between the four pieces aren't possible in this case. All movement the Giant makes must be possible for all four pieces it has.
Rock Golems, Wubba and Gel Babies: All these move using Direct movement, with no real quirks. Naturally, Rock Golems turn into rubble when stabbed, Wubbas are immune to swords, and Gel Babies have no extra exceptions.
Aumtlich: These use Flanking Flexible movement. They always wish to face their target. An Aumtlich will face orthogonally if the distance in one of the orthogonal directions is greater than twice the distance than the other orthogonal direction: for example, if the target is 5 North and 2 West from the Aumtlich, then the Aumtlich will face North (since it's over twice as large than the West distance), instead of Northwest. If they are not facing the direction they want, they will turn towards that direction, preferring to turn clockwise instead of anti-clockwise if both take the same amount of time. An Aumtlich will only freeze something at the end of every turn. An Aumtlich gaze will also damage Cracked Orbs and destroy Broken Orbs (both on Full Turns only) and light fuses (on half turns as well). If an Aumtlich gazes into a mirror, it will freeze itself.
Guard: If their sword is within 1 square of their target, they will make whatever possible move to get their sword on top of the target first, preferring to move rather than rotate if both are possible killing moves.
Otherwise, if they are not close to their target, they will advance. Guards use Flexible movement but do not Flank (they don't need to), but they are also always considered brained. Obviously, if they cannot find a path to the player via brained movement, they will default to Flexible movement. In the case of closer alternate targets, they obviously cannot use brained movement against them, and so will just use Flexible movement. Like Aumtlich, a Guard always want to face their target, but unlike Aumtlich, Guards will do killing moves if close enough as explained in the previous paragraph. Guards will do their utmost to not stab any other Guard, Slayer or Bomb, but they will not care about stabbing any other monsters. If the Guard has its sword sheathed, then it will automatically turn in the direction it moves.
On oremites, Guards will no longer wish to face their target, and will just take the path (brained or unbrained depending) to their target via the quickest means possible. Since they do not have an unsheathed sword on oremites, they will turn automatically when they move. They will also understand whether any move either onto or off of oremites may or may not stab something they don't wish to kill and adjust their moves accordingly.
The exception to the above understand of oremites is when they believe they can kill their target on the next move: at this close juncture, their repeated training kicks in and they attempt a killing move as if they had an unsheathed sword. On oremites, this move will invariably miss, and can be taken advantage of.
Stalwarts: Much too complex to explain in full here, so I'll just point at the relevant
topic. No, they're not *quite* "
just like Guards except Stalwarts move first"
. And also no, guards don't "
usually slaughter Stalwarts"
- Guards versus Stalwarts is usually a parity problem, so it generally falls down to how far the two began apart.
Slayer, Halph: Both of these are also very very complex, so I'll make a seperate topic for them if I get some time.
===
I think that's everything. Apologies if I missed something - if I have, mention it and I'll see what I can do.
[Last edited by TFMurphy at 08-08-2008 05:03 AM]