gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Game Design > Side scroller - old school pattern based AI

#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:
    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
-Brendan

#106709 - poslundc - Sun Oct 22, 2006 9:17 pm

Idle? Wander? Patrol? Hunt? Stalk? Flank?

It seems to me there could be any number, depending on the kind of game and the granularity at which you are looking at the AI system.

Dan.

#106741 - sgeos - Mon Oct 23, 2006 4:06 am

poslundc wrote:
It seems to me there could be any number, depending on the kind of game and the granularity at which you are looking at the AI system.

I'm looking for simple low level actions and events. "Protect the queen" is too abstract. It would amount to doing many things.

poslundc wrote:
Idle? Wander? Patrol? Hunt? Stalk? Flank?

These are more abstract than mine. Flank is interesting.

-Brendan