Skip to content

Smooth AI movement

inkoalawetrust edited this page May 4, 2023 · 1 revision

One of the biggest differences you'll notice between normal Doom monsters and monsters made using the KAI library is the movement. Movement in vanilla Doom and ZDoom is done by making the monster move in one of 8 cardinal directions, which is mostly fine for Dooms' monsters, but still a bit odd. But when it comes to the movement of larger NPCs, like large creatures or vehicles, the stock Doom movement is particularly egregious, with results like making huge monsters take near instant 180 degree turns.

Vanilla.movement.mp4

But the KAI library handles movement differently, instead of 8 cardinal directions, KAI monsters are free to walk around in whichever angle they want, allowing them to move more organically, in addition, the amount by which they can turn around is limited by default, which makes the movement even more logical and "realistic", no more giant monsters taking abrupt 180 degree turns !

KAI.movement.mp4

KAI NPCs have more thought and purpose behind their movement than vanilla monsters even when it comes to wandering around aimlessly !

Wandering.mp4

The movement of KAI monsters is primarily handled through KAI_MoveTowards() and a handful of movement functions that can be found here:

Clone this wiki locally