You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the scripting in this game, and indeed in the original games, is very basic. Most items simply have no logic except for the action they perform when picked up. Most enemies, except for bosses, do things like the following:
Walk forward until a wall or obstacle is hit, then turn around (Peterchy [kind of])
I think this gives a nice balance to the "scripting", where reusable parts can be turned in to nodes on the behavior tree, and shared across all object behaviors.
The components that truly do unique things are few, and are used often by several objects, especially enemies. For example, facing the player is a common thing that several enemies do, but at different times in their update logic. By creating a FACE-PLAYER node, it can be inserted into the behavior tree of an enemy at any point.
Here are some more examples:
Wait, put down shield, and then jump toward player (Bikky)
(REPEAT
(SEQUENCE
(CHANGE-ANIMATION "idle")
(SET-VELOCITY X 0)
(ENABLE-SHIELD)
(PLAY-SAMPLE "Bikky (Landing)")
(WAIT 1.0)
(DISABLE-SHIELD)
(WAIT 0.1333)
(FACE-PLAYER)
(CHANGE-ANIMATION "jumping")
(SET-VELOCITY Y -5.0)
(IF-FACING-DIRECTION "left"
(SET-VELOCITY X -1.3)
(SET-VELOCITY X 1.3)
)
(PARALLEL
(REPEAT
(IF-FACING-DIRECTION "left"
(SET-VELOCITY X -1.3)
(SET-VELOCITY X 1.3)
)
)
(UNTIL
(IF-COLLIDED-VERTICAL WALL BOTTOM)
)
)
)
)
It may be possible to represent the behavior tree in JSON by using arrays instead of a Lisp-like pseudocode:
Most of the scripting in this game, and indeed in the original games, is very basic. Most items simply have no logic except for the action they perform when picked up. Most enemies, except for bosses, do things like the following:
Or more simply:
Where
MOVE-ON-GREATER-AXIS-TO-PLAYER
was implemented in Squirrel like:I think this gives a nice balance to the "scripting", where reusable parts can be turned in to nodes on the behavior tree, and shared across all object behaviors.
The components that truly do unique things are few, and are used often by several objects, especially enemies. For example, facing the player is a common thing that several enemies do, but at different times in their update logic. By creating a
FACE-PLAYER
node, it can be inserted into the behavior tree of an enemy at any point.Here are some more examples:
It may be possible to represent the behavior tree in JSON by using arrays instead of a
Lisp
-like pseudocode:In the above example, each node is represented by an array. The first element of the array is the type of node.
The text was updated successfully, but these errors were encountered: