Implementing Mob Memory

Post new topic   Reply to topic Forum Index -> Design
View previous topic :: View next topic  
Author Message

Joined: 19 Nov 2005
Posts: 31

PostPosted: Wed Jan 31, 2007 5:07 pm    Post subject: Implementing Mob Memory Reply with quote

I know I touched on this briefly in the Mob Combat AI thread from a year ago, but I wanted to foster some discussion on the issue, as I'm drawing a blank.

I am using a planning engine to give mobs semi-realistic behavior, as well as to generate quests. Each mob selects actions based upon their goals. The choice of which actions are selected are based upon their difficulty, the mob's personality, and the memory of the mob.

My dilemma is this: Short of recording every single thing the mob notices, how do I implement a semi-realistic memory for mobs without chewing through all my available computer memory?

I know that at least part of the problem is identifying what observations the mob should remember, and for how long. For instance, if the mob sees Bob head to the west, it should remember that for a short period of time, so if another player comes along and asks "Where did Bob go?" the mob could tell them. However, there is no need to store this memory more than a minute or two.

On the other hand, if a mob sees a PC kill it's best friend, it should remember that, probably for the rest of it's mob-life, and try to exact vengance upon the PC.
Back to top
View user's profile Send private message Send e-mail
Author Message

Joined: 08 Oct 2005
Posts: 23

PostPosted: Wed Jan 31, 2007 6:02 pm    Post subject: Reply with quote

Google "Behavior Based Robotics", and you'll find a wealth of information on modeling intelligence through a hierarchy of simple behaviors driven by external stimulus.

This is a simpler approach than a planning engine, and can achieve reasonably good results.
Back to top
View user's profile Send private message
Author Message

Joined: 19 Nov 2005
Posts: 31

PostPosted: Wed Jan 31, 2007 7:12 pm    Post subject: Reply with quote

I did some reading on Behavior Based AI. Although I was unfamiliar with the terminology, it seems I am already implementing this to some extent. It appears I am using a hybrid system combining Behavior Based AI and a Planning Engine.

Each mob has a set of goals. Each of these goals has a wieghted priority value. The priority value of each goal is adjusted on-the-fly based on the mob's observations. For example, a mob might have the goals "Go to Town" and "Avoid Getting Killed". Typically, the "Go To Town" goal will have the higher priority, and the mob will attempt to complete that goal. However, if a bear suddenly jumps out in front of them, the priority of the "Avoid Getting Killed" goal will be increased, and the mob will act on that goal instead. From my (limited) reading, this is how behavior based systems work.

The planning engine fills in the details of implementation by providing logical sub-steps to completing a goal. For example, "Avoid Getting Killed" is a pretty generic goal. The planning engine provides relevant sub-goals, such as "Run Away" or "Fight". Just like the primary goals, each of these sub-goals has a weighted priority based upon observation. So, if the Bear is five levels lower than the mob, the "Fight" sub-goal will have a higher priority than the "Run Away" sub-goal.

The problem I'm encountering, however, has to do with memory. It's easy to respond to immediate stimulus by adjusting goal-weights, but how do I respond to an event that occurred ten seconds ago? or ten hours ago?

One thought that crossed my mind after reading about Behavior Based AI was to generate new goals based upon stimuli. For example, if the mob watches a friend NPC get killed, it will generate a new goal to seek revenge upon the killer. This works fine for some situations, but it still does not simulate memory. If a player comes along later and talks to the mob, the mob can say "I want to kill Bob" but the mob doesn't know why it wants to kill Bob, so it's can't tell the player "I want to kill Bob because he murdered my brother"

Another thought I had was to use labels. When Bob kills a mob's brother, the mob could label Bob as a murderer. The mob's behavior toward Bob would then be influenced by the labels it has generated. The mob could "gossip" with other mobs, and share labels. However, this still doesn't solve the problem of cause and effect in a way that has any meaning to a live person. "My goal is to do X because Y".
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic Forum Index -> Design All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
BBTech Template by © 2003-04 MDesign