Steering Behaviors with Multiple Ai on Uneven Terrain.

Would you like to see more "Epic Ralph" episodes/tutorials?

  • Yes
  • No

0 voters

The first of many to come, videos that I will be posting documenting my experience with Panda3D and PandAi.

Here is a YouTube link:

Currently I am working on an Ai system for an open source game that we, the Game Development Club at Dixie State College, are in the early stages of creating. I have posted a video demonstrating some basic Ai behavior, such as pursue, arrival, flock, wander, changing Ai walk speed, changing Ai animation play speed, and a very early simple version of a state machine (i.e. if Ralph is close chase him, if Self is too far from “home” return home, repeat, if Ai is idle for X amount of time Self.destroy())

Functionality Implemented:
-Hero Class containing all character/camera controls and attributes
-NPC class that creates an Ai character and holds all of its methods, data, and attributes. Holds primalInstincts() which is the logic controlling “if life is < critical level: break away from mob, flee, and survive” etc…
-Mob class that creates X amount (specified when called in main) NPC class instances and treats them as a “Mob” or flock. Holds groupLogic() which is the primary logic loop for control their behavior as a whole.
-Directional awareness (i.e. a compass. tracks which way a character is facing(North, South, etc…)

Psuedo “groupLogic()”:
-Spawn “Mob” or Ai characters when “Hero” or Ralph is within X distance of “spawn point”
-Mob’s default behavior is wander
-If Hero is X distance away from Mob, Mob pursues Hero (which sets run speed, activates arrival(), and… yes pursues)
-If Mob gets X distance away from “home” or spawn point, send Mob back home (generates a random point near “home” and seeks to that point, before setting “walk” speed and starting wander behavior)
-Repeat, repeat

Functionality not implemented:
-I have yet to implement any actual pathfinding (that is what I am currently working on)
-The NPCs are not collidable with each other (i.e. they can walk through each other.
-Attack/Life methods and functions
-Many many more… you get the picture

Keep in mind this is in the early, early stage of development, and I have thus far, basically been getting familiar with Panda3D and PandAi. I will be posting some more serious videos (tutorials, code snippets, how to, etc…) in the near future, as well as my code.

All of the code is object oriented and is easily reusable in other Panda3D projects (i.e. to create an Ai character requires only one line of code in the “main” or World class. Same thing for creating a mob, you just specify the type of behavior you would like, from a predetermined list of possible behaviors, and how many Ai characters you would like to be in the mob)

Here is a YouTube link: