#106679 - sgeos - Sun Oct 22, 2006 3:57 pm
In the old school action games the monsters have pattern based AI. The AI has a initial state which is modified when certain events happen.
States:
Events:
Types of movement:
Is anything especially interesting or important missing?
Just for fun, some entities made from these properties (from simple to complex):
Missle
Lost critter
Jumping leaf-ish entity
Invisible stalker
Protector
States:
- Stop
Move/change direction
Follow/flee from
Self destruct
Transform
Hide/Appear
Clone/Spawn/Respawn
Teleport to/from
Game specific state change (armor up/regenerate/speed change)
Events:
- At random
After set amount of time
On collision
Before falling
When (not) lined up with something
When something else moves/stops
When distance to something else changes
When hit/killed
When health reaches a certain level
Terrain change (for wall trace, etc)
Scripted event (step on switch, own the key)
Types of movement:
- X
Y
45 degree XY
Free XY
Sine wave
Parabola
Circle
Other shape
Is anything especially interesting or important missing?
Just for fun, some entities made from these properties (from simple to complex):
Missle
- Initial: Move toward player X, -gravity Y (to hover)
On collision: Self destruct, spawn shrapnel
Lost critter
- Initial: Move random direction
After 1 ~ 10 seconds, on collison: Teleport to random location or move random direction
Jumping leaf-ish entity
- Initial: Move up
On fall: Sine wave X, fall Y
On collision (with ground): Move up
Invisible stalker
- Initial: Cloak, stop
When close to player: Move toward player
When very close to player: Appear, move toward player
When far from player: Cloak, stop
Protector
- Initial: Move toward boss
When boss hit: Move toward player
When hit: Clone in place, then teleport to random location
When killed: Teleport to boss, then respawn
When boss killed: Spawn random item, flee from player