NPC AI

Started by
46 comments, last by Nazrix 22 years, 3 months ago
mer, yes exactly

General desires would take much less intervention from me, the programmer and let the NPCs be more autonomous (that is, until I set them on fire )

A CRPG in development...

Need help? Well, go FAQ yourself.

Edited by - Nazrix on October 9, 2001 8:44:00 PM
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
Advertisement
Nazrix, here''s some thoughts for you to ponder.

Desires are motivators, not goals, so you cannot specify a plan that achieves a desire, only a goal that might satisfy a desire if achieved. If you want to implement a system of motivators (desires) for your agents that influences their planning decisions, then you also need to implement a full planning system. I don''t want to be daunting but this is a lot of work. If you are interested, then a first approximation can be achieved using the STRIPS planning language. This is not a very good planning language, but it will give you a heads-up with regards to the sorts of problems you face in implementing your desired system. An introduction to the strips language can be found in Russell & Norvig''s, "Artificial Intelligence: A Modern Approach", which I believe is listed in the Books & Software section of this site. Alternatively, there is a tonne of information about STRIPS online.

Good luck,

Timkin



quote:Original post by Timkin
Nazrix, here''s some thoughts for you to ponder.

Desires are motivators, not goals, so you cannot specify a plan that achieves a desire, only a goal that might satisfy a desire if achieved.


Well, I''m not sure there''s a difference when it comes to building an AI. The Sims uses an approach similar to this, in which the game''s Smart Terrain and objects "satisfy" various desires of the Sims themselves. That means tha the Sims choose amongst their various desires (which increase and decrease over time) while building lists of their potential courses of action. In effect, then, the satisfication of a Sim''s desire becomes part of the goal--in some cases I''d even make the case that it''s the goal.

quote:Original post by Timkin
If you want to implement a system of motivators (desires) for your agents that influences their planning decisions, then you also need to implement a full planning system. I don''t want to be daunting but this is a lot of work. If you are interested, then a first approximation can be achieved using the STRIPS planning language. This is not a very good planning language, but it will give you a heads-up with regards to the sorts of problems you face in implementing your desired system. An introduction to the strips language can be found in Russell & Norvig''s, "Artificial Intelligence: A Modern Approach", which I believe is listed in the Books & Software section of this site. Alternatively, there is a tonne of information about STRIPS online.


I don''t know anything about STRIPS but I can definitely recommend Will Wright''s writeups on how he implemented the AI in The Sims in addition to what Timkin has suggested above. It sounds as if you want to go that general direction and you might as well start with the work of giants--the view is better! There are a bunch of interviews and such with him on the Web where he talks about that game''s design; they''re worth tracking down if you haven''t read them already.

quote:Original post by Timkin
Good luck,


Yes, best of luck in this one. Will you post on how you''re proceeding?






Ferretman

ferretman@gameai.com
www.gameai.com

From the High Mountains of Colorado

Ferretman
ferretman@gameai.com
From the High Mountains of Colorado
GameAI.Com

quote:Original post by Ferretman

Well, I'm not sure there's a difference when it comes to building an AI. The Sims uses an approach similar to this, in which the game's Smart Terrain and objects "satisfy" various desires of the Sims themselves. That means tha the Sims choose amongst their various desires (which increase and decrease over time) while building lists of their potential courses of action. In effect, then, the satisfication of a Sim's desire becomes part of the goal--in some cases I'd even make the case that it's the goal.


Yes, I agree completely. AI is merely an imitation of reality and behaviors. The concept used in the sims is very similar to what I am persuing.

Furthermore, I believe the messaging system Merrick was speaking of can be very versatile and powerful. For instance, an NPC desires money so he decides to steal an object from someone's house. If he successfully steals it, the object would message the owner NPC who would then be able to find out who stole it. The object would also message any NPC in the visible/audible area who would be able to be witnesses that the owner could question. That's probably an oversimplified example but I think it gets the point across.

quote:
I don't know anything about STRIPS but I can definitely recommend Will Wright's writeups on how he implemented the AI in The Sims in addition to what Timkin has suggested above. It sounds as if you want to go that general direction and you might as well start with the work of giants--the view is better! There are a bunch of interviews and such with him on the Web where he talks about that game's design; they're worth tracking down if you haven't read them already.


I have read some information about the Sims but it wouldn't hurt for me to do some more reading...thanks.


quote:
Yes, best of luck in this one. Will you post on how you're proceeding?


Yes certainly. I will post as I make progress which may not be as rapid as I'd like because of lack of time. I know this won't be easy, but if it was it wouldn't be worth doing, right?



Edited by - Nazrix on October 13, 2001 5:34:06 PM
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
what you are doing is quite amitious, but dont believe he whole "months to make a line of sight detector. i have written one im many different languages nad it was pretty simple. basically i made some marks on my wall at home where i could no longer see past just looking normaly.

i then recreated the same situation in a 3d environment, and then made a poly come out of the location of the enemies eyes. if anything was located inside of the poly, the enemy would look closer, or goto alert others, depending on what, and how much he saw.

it was incredibly basic however, and was buggy as hell until i ran through it a couple of times. of course, the player was able to hide and stuff, because none of the enemies could hear.
"Luck is for people without skill."- Robert (I Want My Island)"Real men eat food that felt pain before it died."- Me
quote:Original post by black_mage_s
what you are doing is quite amitious, but dont believe he whole "months to make a line of sight detector. i have written one im many different languages nad it was pretty simple. basically i made some marks on my wall at home where i could no longer see past just looking normaly.



Thanks. Yes I''m not very worried about the LOS stuff. That will come in time. I''m much more interested in ways to portray the illusion of NPCs that make decisions to attain what they want.



A CRPG in development...

Need help? Well, go FAQ yourself.
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
My thoughts: Have a specified list of actions and results. Desires create goals, actions cause results, which may be the goal. Just have your AI people randomly create chains of such prespecified actions to get from "point A point B." Think of it as "random pathfinding," where, if a set of random instructions doesn''t do what you want, you generate another set until you find one that does what you want. This could create interesting bahavior, if you have a varied enough set of actions.
quote:Original post by TerranFury
My thoughts: Have a specified list of actions and results. Desires create goals, actions cause results, which may be the goal. Just have your AI people randomly create chains of such prespecified actions to get from "point A point B." Think of it as "random pathfinding," where, if a set of random instructions doesn't do what you want, you generate another set until you find one that does what you want.


That's what I am thinking as well. At first I started having these great delusions where I was thinking NPCs could learn new ways to attain a result or desire, but I think that anything too abstract would not be very possible for a real-time game.

quote:
This could create interesting bahavior, if you have a varied enough set of actions.


Yes that is precisely the idea...enough variations of actions to attain goals and things could be quite interesting



A CRPG in development...

Need help? Well, go FAQ yourself.

Edited by - Nazrix on October 17, 2001 7:30:48 PM
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
quote:Original post by Nazrix
AI is merely an imitation of reality and behaviors.


Egads! That would mean that the 27 years I spent in school and University receiving an education and the years of research I have done have been complete folly and that my PhD research is a waste of time! That sucks! Anyone got an opening for an over-educated dishwasher?

quote:Original post by Ferretman
Well, I'm not sure there's a difference when it comes to building an AI. The Sims uses an approach similar to this, in which the game's Smart Terrain and objects "satisfy" various desires of the Sims themselves. That means tha the Sims choose amongst their various desires (which increase and decrease over time) while building lists of their potential courses of action. In effect, then, the satisfication of a Sim's desire becomes part of the goal--in some cases I'd even make the case that it's the goal.


I don't profess to know exactly how The Sims AI was implemented, however going by your description, I would claim that the 'potential courses of action' that the Sims consider are the (probably precomputed) plans of action. Whether they are precomputed or not is irrelevant. What is happening is that the sim is choosing a plan to execute based on perhaps its most intensive desire, or perhaps based on an opportunistic strategy of satisfying a lower desire on the way to satisfying a higher one.

Whatever the case, the desires are simply driving the selection of the plan from the space (list in this game) of possible plans. There is most certainly a correlation between desires and plans in a limited plan database, implying a correlation between desires and goals. This doesn't mean that desires are goals of the plan; they are merely a 'utility function' allowing the preferencing of one plan over another.


Regards,

Timkin

Edited by - Timkin on October 18, 2001 1:37:20 AM
Im pretty sure that the sims AI wasnt even AI at all. If you look at the opening sim creation scene, you select your sims behavioral qualities. the game probably just runs those choices through a bunch of if ... then statements and the ambiant movement is random
"Luck is for people without skill."- Robert (I Want My Island)"Real men eat food that felt pain before it died."- Me

This topic is closed to new replies.

Advertisement