• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

dwarfsoft

NPC AI in RPG's

59 posts in this topic

Now there were a few acronyms eh? Personally I have been disappointed with RPG style games and the AI they use for NPC''s. Diablo (as a CPG) was shrouded with NPC''s that Just stood there! What is the deal with that? NPC''s are supposed to represent people and this means that they would wander around and interact (even if just look like it) with each other. I have played a game where I think NPC''s at least attempt to mimic the behavior that they should. Might and Magic 7 had townsfolk that would turn around and move in the opposite direction if they saw you coming and you had a neutral or bad reputation. If you had a good reputation then they would at least not attempt to run away from you. This was a good implementation, but the rest of the NPC AI was pathetic. A downfall of MM7 was that every guard says "Don''t cause trouble" and the townsfolk use the old Sierra Menu Conversation system. I am not saying that MM7 was a bad game, but I am using it as an example to point out that AI was not pushed to it''s extremes. One idea I have been pondering is an inverse parser, which basically recieves the players input and then gives out possible solutions (like that word completion feature in M$ Word). I have yet to see an inverse parser work in a game but I beleive that it would prove most useful for something more than a point and click conversation. At least then the player is actually interacting. An inverse parser may not give the player full interactive ability (the way that a normal conversation would) but it would give the ability to be more flexible with NPC''s. An NPC should have the ability to learn new information. If an NPC interacts with another NPC that has information on a quest, then the first NPC should then know at least some information about the quest. Misinformation may be a good implementation too. That way the player will be left guessing as to whether or not to trust the information, even from a trustworthy source. Sure, this is all speculative, but I think NPC''s need to have a little more control on their own life instead of being under a PC dictatorship. No NPC should ever be waiting around for a PC (unless they were employed by the PC or some other such scenario). Hope that is enough food for thought. -Chris Bennett ("Insanity" of Dwarfsoft) Check our site: http://www.crosswinds.net/~dwarfsoft/ and our eGroup: http://www.egroups.com/group/dwarfsoft
0

Share this post


Link to post
Share on other sites
I agree that AI should be more developed, but its the sort of thing where you either do it really well (You can''t tell NPCs from humans) or you do just some simple scripting.
The reason for this is something like this: If you are designing a game and to solve a puzzle, the player must get a password to open a door. The NPC is the only one who knows the password so you go to them and ask: "What is the password?". If the AI is mostly scripted, then they would most probably say, "Sure it is ''swordfish''" (Simple example, bear with me). If the AI is really sophisticated, the reply may be "Why should I tell you" and the player must explain that they are doing it for the good of others and then they will tell.
But if the AI is in between:
"What is the password?"
"Why should I tell you? You killed a goblin"
"It attacked me"
"Well I''m not telling. End goblin genocide "
And so on

Sure, it''s nice and immersive, but what if the player killed the goblin right at the start of the game and now has been playing for 40 hours. How will it feel if just because of stubborn AI, they can''t finish the game.
You can put in lots of small checks to stop stalemates like that but in the end, you will forget something or something bad will happen

But don''t get me wrong about AI, I see that better AI is needed and I''m with you, just remember that it must add to the gameplay.

(Oh yeah, and it needs a bit more processor power which may not be available on some machines)

Just my little bit of nonsense

"Only a fool quotes himself"
Andy Owen

My Homepage (Non games related)
My Current Project (Games related... I think)
0

Share this post


Link to post
Share on other sites
Cool, responses this soon.

Anyway, what I am really talking about is NPC's being able to share information. What you say is that the NPC should just wait around for the PC to come along and ask for the password. What I suggest is that the NPC might know more than just information about the password. The NPC might know where to get the cheapest fish! (Bear with me.. this thread is getting a little fishy ).

What I think is tha NPC's should wander the countryside and bump into others. They can then "virtually" share information and then you could ask any of the NPC's that know this information about it.

This could be done with a little bit of advanced scripting. Just make the game able to pick bits out of one NPC's script and write it into the others.

Going back to the "Swordfish" and "Cheap fish" fishy subject, this could allow the NPC to THINK that there is CHEAP SWORDFISH AT THE MARKET and this could make for some interesting predicaments. Also, the NPC might know that the password has something to do with fish but is not quite sure what exactly. Then the NPC could say "Ask <thE NPC WHO TOLD HIM> " and then there could be a lot of fun trying to find the NPC who knows more.

Sure this sounds a little far-fetched, but just think of the fun you could have and the adventure it could make.



-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
and our eGroup:
http://www.egroups.com/group/dwarfsoft

Edited by - dwarfsoft on June 29, 2000 3:02:42 AM
0

Share this post


Link to post
Share on other sites
I see what you''re getting at (Actually I used swordfish because I was thinking of the game ''Return to Zork'') Information sharing would also be good, but here is the latest of my great little set ups:
You are in City A (great name, wait ''till you hear the next one) and need to go to City B (there it is to find out the password to get into a house in City A. In City B, there are a few puzzles and other stuff that the designer has planned, so when the player finds out they need a password, they ask the very next person they see:
"What''s the password for the house?"
"Well, a guy in City B told his postman who told a tourist who told me that it was ''swordfish''"

Now all of City Bs design and stuff has gone to waste and the player will have a really boring puzzle. (If you could even call it that)

So you would need to go another step, and decide what would be passed on and what wouldn''t.
Well I want to see what else has been said on this so I''ll end this post


"Only a fool quotes himself"
Andy Owen

My Homepage (Non games related)
My Current Project (Games related... I think)
0

Share this post


Link to post
Share on other sites
Putting FISHs in your text isn''t the best way to summon the (in)famous LandFish.

Please don''t call Diablo an RPG since Blizzard never said it was and nobody with a little clue will :p

Have you ever played ELITE?
If not check it out, you''ll see that game dev are on the descendant.
We don''t do half what this game (about ten years old) did.

today you''ll be able to store the entire game in your CPU cache...


ON TOPIC:
NPC need to be more human like.
They are plenty of possibility to achieve this effect.
The poins is devs are fighting each other for BEST GFX, while players are waiting for BEST GAMEPLAY.

It''s just a matter of time before players won''t buy the best looking but empty games to buy nice looking but nice gameplay ones.

AI are using calendar based activities and sharing their knowledge.
This is why your character reputation change not instantly, and is different form a location to another.
Economics are managed too.
Put a lot of money in a village and the goods will costs more money than before.

TODO:
Add more intereactivity by making people change of location/village if a hero establish somewhere, and tend to go where there''s a lot of money.



-* So many things to do, so few time to spend *-
0

Share this post


Link to post
Share on other sites
I think people are starting to get the idea, but this City A puzzle where the City A person says that the City B person originally said the password is a little muddled (and not just because I wrote it like that ).

The way it works is like Chinese Whispers, and the system continues until the information that was given to them originally is so distorted it is more likely to get them killed than to help them. Like I stated before; NPC 2 thinks that NPC 1 was talking about Cheap swordfish at the market instead of 1) Cheap fish at the market and 2) Password being swordfish. This could be done using simple word association.

NPC 1 Knows:
Cheap Fish at Market
Password is ''Swordfish''

NPC 2 "Hears" in the conversation:
Something about cheap fish, market, password, and swordfish
Associates fish and swordfish and then comes to the conclusion:
Cheap swordfish at market.
Has a remainder of ''Password'' and then comes to the conclusion:
Password must also be at the market.

Now the player is headed in possibly the wrong direction... Are you beginning to understand this now? Basically apply a filter to the information from the script and then see what happens. The furthur down the line it goes, the less likely it is to be correct.

The player may want to ask the NPC where they got their information from. In which case the player (who may not know how to get the password) can follow a trail of people back to the source (just to be sure) or can go back as far as they want, when they feel comfortable they know what the password is then they go back to the door.

This isn''t really an advanced topic, although this is probably because it is not an advanced example. Basically the concept of Chinese Whispers distorts the truth and can even probably end up with a completely wrong password (using word association swordfish -> fish -> food -> fruit -> orange.. the password isn''t orange, so the system is going to mislead the player).

Misleading the player isn''t really what we want to do, so we may want to put a filter in there to make the NPC "know" that this other NPC that it met knows something about a password, thereby shrugging off responsibility for it''s action, but leading the player back to the source.

Just some more stuff to ponder I guess



-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
and our eGroup:
http://www.egroups.com/group/dwarfsoft
0

Share this post


Link to post
Share on other sites
We are not here to summon fish.. it just so happened that the thread unraveled that way (no pun intended ).

I don''t know what else I would call Diablo... Slash''n''Hack?

This thread seems to have become a little bit popular.. cool... I tend to talk a lot about this subject at gamasutra.com and now xgames3d.com (area 51X).

Hope we get some more responses over here soon



-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
and our eGroup:
http://www.egroups.com/group/dwarfsoft
0

Share this post


Link to post
Share on other sites
Well, I would definitely want police forces to act intelligently, by patrolling, sending reinforcements, organizing hunts or protecting areas which have been threatened lately. Well, rich suburbs at least.

A second thing would be to ask NPCs to do something for you, even if you have to bribe them in order to do this.

And, of course, communication between NPCs. Not necessarely when they bump on each other - they might use cell phones, as far as we know.

Now, as how to do it : I''d not make any message circulate between NPCs. I''d just define some categories, which may or may not be interesting to NPC groups and which NPCs may or may not decide to give away. Friend mob-NPCs will probably warn each other if, let''s say, they have heard of increased police activity, corporations might share the description of known trouble makers, but passwords are secret.


Be reading you,
David

P.S. :
What do you mean by "inverse parser", dwarfsoft ?
0

Share this post


Link to post
Share on other sites
Well Altmann,

I shall answer the inverse parser idea:

Text Based adventure games had a parser, you entered a line of text, it figured out what you meant, it told you if you got the syntax wrong, it looked dumb by stating things like "I don't know what a 'dog' is. Syntax: 'Look at <OBJECT>'". This was a standard parser.

Sierra used a Menu based traversal, you clicked on the thing you wanted to say, and you got a list of new things that you could ask for or do. This was limited and it was quite easy to go through all the subjects incrementally, thereby destroying any fun.

An inverse parser is where you start to write a command, and the parser gives you a list of all the available finishes. It then limits you, but you are required to think about what you want. This is a simplistic way of stating it but there you are.

************** END INVERSE PARSER EXPLANATION **************

I notice in your RPG idea that you have limited it to this era. Cell phones would not really show up in a castle where plumbing hadn't even been invented (although telepathic magic may ).

Communication is a MUST! Bumping into one another is how you meet people right? Once there is an initial bump, then the following encounters can be arranged based on the fact that each NPC will know the other. They could arrange to meet, it doesn't matter.

You say that information sharing isn't the way to go, you put a limitation on what can be spread and to whom. This is how it should happen, and the original example shouldn't have happened (nobody is going to tell secret passwords to complete strangers are they?) but the fact remains that it was an example.

You try to limit NPC knowledge furthur by saying what might interest them. Take this a step furthur though and say that they can have knowledge that may not interest them, but they are more likely to get it mixed up or wrong. That way there is freedom of information, but still relatively realistic knowledge for NPC's. Otherwise you would end up with "Ask <thisNPC> about Password" and the NPC would answer "This topic doesn't interest me". How frustrating would that be? At least the NPC should give hints as to where information may be gleaned and who is likely to know such.

Information sharing is the basis to my theory. The theory states "NPC's are people too " and I will stand by that. NPC's need the ability to communicate with each other as well as players. This way they can get information off the players too. This allows the NPC to act like a human player and be able to carry out quests or such the same way a player would.

An interesting thought just occurred to me. If an NPC acted just like a PC in an RPG, that would eliminate PK's. No Player would specifically go around to kill other Humans because the NPC's are Players themselves. PK's would have an abundance of NPC's to slow them down and then they would have the fun of bashing the crap out of PC's (really NPC's) and the PC's are happy at being left alone... This doesn't matter in my implementation as PKing is frowned upon by GOD and the LAW. Capital punishment for all offending PK's I SAY!!!

Anyway, back On Topic
You could probably try to "handle" messages between (N)PC and (N)PC with a similar method used by Windows to post messages to an application. Just a thought, but this could mean that addons could post these messages to an event handler (like WndProc) so you could update your NPC AI as an external program. Just a thought...

I have a hankering for some coding now


<EDIT>

AAAAAAAHHH! Sorry for digging up this old grave, but I realised what the hell the problem was that stopped everyone from seeing this post... the <OBJECT> was using NORMAL "<>" so it was trying to insert an object! AAAAAHHH! Just thought I would fix this and put it to rest (RIP NPCAI/IOL)

</EDIT>

Edited by - dwarfsoft on April 26, 2001 11:49:01 AM
0

Share this post


Link to post
Share on other sites
Well, I begin to see where our distinctions come from : you''re something like a many-players Fantasy-Style RPG guy, whereas I''m more a few-players Cyberpunk-style RPG. A world of difference Also, it seems you are thinking message-based, whereas I''m going for deduction-based.

Now, how do we combine all of this to make the best NPCs ever ?
0

Share this post


Link to post
Share on other sites
Well, if we band together and churn out ideas, then surely we can come up with a compromise that SHOULD work for all RPG''s. Personally I would like to see as many ideas thrown around as possible, because the NPC''s in my game should be able to play the game the way a player would .

When you say deduction based, you are meaning what exactly? That the NPC has some kind of intuition where they "see" more than what is at face value? They understand more about what is going on?

Personally I would like to start off by just having NPC''s that act in a semi-intelligent kind of way. I haven''t seen this yet, but I think it would be quite rewarding .

I was thinking about this a lot last night and I would like for others to add their ideas to this... I think there is a lot that could be milked out of this discussion.



-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
and our eGroup:
http://www.egroups.com/group/dwarfsoft
0

Share this post


Link to post
Share on other sites
because the NPC''s in my game should be able to play the game the way a player would

Well, how does a human play a game ?

Archetypical multi-player fantasy CRPG

  • Enter one or several guilds
  • Take quests
  • Take missions
  • Search through dungeons
  • Search character
  • Kill character for a quest / a mission
  • Make friend with other characters
  • Organize expeditions
  • Search information about a particularely tough enemy
  • Search information about artifacts
  • Betray
  • Steal
  • Take revenge
  • If baddie, avoid the police
  • Flee
  • Call the police
  • Hunt for XPs


Achetypical cyber CRPG

  • Create a group
  • Find fixers
  • Find weapon, drugs, software, ... dealer
  • Meet contacts
  • Watch one''s back
  • Wait for a mission
  • Avoid police
  • Exfiltrate
  • Crack & Slash
  • Search information about corporation
  • Search information about person
  • Assassinate
  • Disappear
  • Bribe for protection


Elite-style :

  • Plan trade routes
  • Buy and sell
  • Hire escort
  • Smuggle
  • Carry passengers
  • Be hired as an escort
  • Hunt bounties
  • Escort ships
  • Outfit ship
  • Mine asteroids
  • Engage pirates/Thargoids so as to climb in Elite ranking
  • Do act of piracy
  • Bribe authorities
  • Hunt a ship
  • Take missions for persons / for authorities
  • Explore / go take pictures / ...
  • Change identity
  • Avoid authorities, if necessary
  • Uphold the law ?
  • Answer SOS
  • Emit false SOS


I probably forgot many situations, so let''s call this a beginning. Which ones of these situations can be imitated simply ?

--

As for deduction, I meant that a NPC should be able to infer some information without having explicitely been told it. A simple example would be trying "somebody wants to kill you", "X has been asking for you everywhere", "X has been seen with an enemy of yours" => "X is probably trying to kill you".

Be reading you,
David
0

Share this post


Link to post
Share on other sites
Just because it is not obvious does not make it not simple. I can think that a fair number of these could be answered with fairly simple scripting (my scripting language that is ).

Easy is not the the appropriate statement... it is whether or not the results will be what is expected. I will take searching for another NPC as an example here (because that way there is more than one NPC ).

Scripting you could simply have a "command" that states that if an NPC is looking for another NPC/PC then they follow these commands (note that I will not use scripting language, but an english derivative, for ease to understand):

Go to last place seen (if applicable)
Ask people around last place seen
Go to likely spots

If the NPC runs into the other, then the script has a break option.

Hunting for XP doesn''t even need to be covered. This should be built directly into the AI. No adventuring NPC should not do this (that is, if they are a skill based NPC and not a tradesman).

When you say hunting for XP I get the impression of click''n''kill there. I would prefer not to make the XP available only if they hack someone to death. How would a cleric benefit from slashing a few zombies instead of healing others? (This seems to be headed to the "Stop Goblin Genocide" side of things ).

Disappear would be a simple coding of "If you see someone within X area of you, then stick to the shadows and head in the opposite direction". That really isn''t going into much detail, but I can''t think that it would be too hard to code.

I don''t think it is necessary for me to go through each one of these and point out how it could be interpreted so that the NPC''s would behave in a set manner. I am going to get a copy of your list (as a basis) so that I can code in those things that you point out . What I am thinking is that there is a set method for each NPC to follow. You can link all of these actions into a script to follow.

ie.

  • Go search for X
  • If [baddie] Y is around then Evade Y
  • If attacked and Strength < Your strength then kill the bastard else Runnaway!
  • If X is here then greet X
  • If X attacks you then do something


The only thing that I can think of here that is not very explanatory is the "If attacked and str....". In my system, it allows banding of groups and it also allows you to be potentially banded with others, even if (according to the game) you are all just wandering around on the same screen. In this case, the NPC would go: "Strength (and numbers) of all the other Characters on screen against strength (and numbers) of all that I would consider to be friends". This could make for some seriously good betrayal stuff.

NPC''s may think that there are a lot of friends around and one enemy, but the person they trust most stabs them in the back and the rest take that NPC down no problem. The same could be done with PC''s. Just think, they fall in with the wrong croud, and they stumble across some other shady figures, PC attacks thinking that he has backup, NPC''s stab him in the back.... I love it! I am definitely going to have to implement that feature (as a payback for random acts of violence against baddies). If you kill without a reason then the baddies will probably band together to wipe you out. Even if you do have a reason this is likely

================================================

Now to that part about deduction.
How would the NPC know that X has been seen with your enemy?

  1. Has seen X with them (which could work fairly easily)
  2. Has been told that X was with them


It all goes back to Message based my friend . Even if there are more than just message based communications, there still has to be message based com in the game to get to any other advanced topic. Otherwise you can''t model communication amongst NPC''s and if you can''t do that then I would like to see what kind of conversations you would get (as a PC) trying to talk to an NPC!

Simply if there is news that X could be a baddie (from the deduction above) then put them on a "possibly bad" list. When they are approached by X then the NPC should be wary and should be ready for conflict. I can see that this would make game plot and decision making a lot more fun.

Does anybody else wish to add something to this? I am interested to hear more and I am planning on implementing as much of this as I can in MY game



-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
and our eGroup:
http://www.egroups.com/group/dwarfsoft
0

Share this post


Link to post
Share on other sites
I just thought I''d post this site if you wanted to see a conversation with a machine. A machine that can really learn what it is talking about .

The url is http://www.generation5.org/iqats.shtml and it shows some really cool language recognition stuff that is relevant to this thread.

This means that NPC''s can "converse" with each other using actual messages and they can understand what each other is saying. I think that this is a little way off for use in games, but it is nice to know that there are people out there who are working on AI that could be implemented in games.

I am sure that this technology runs pathetically slow if implemented in games, but I think there is room for compromise. The game could implement a baby model of the tech and use that.
Some food for thought anyway



-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
and our eGroup:
http://www.egroups.com/group/dwarfsoft
0

Share this post


Link to post
Share on other sites
dwarfsoft, finally someone is thinking upon the same lines as I

I couldn''t agree w/ you more about the fact that NPCs should move around, and have an agenda.
In the RPG I''m currently making, I have it so that each NPC has a schedule of where they''re supposed to be at different hours of the day. Plus, that schedule can be changed dynamically as the game progresses.

So, instead of quests and encounters happening at fixed points (like in Baulder''s Gate) they happen more by coincidence as in real life. You may be just walking along and an NPC happens to walk by, and some sort of quest could arise.

I like the idea of NPCs sharing information. That would add a lot of realism.

"The road of excess leads to the palace of wisdom." --William Blake
0

Share this post


Link to post
Share on other sites
quote:
Original post by dwarfsoft

We are not here to summon fish.. it just so happened that the thread unraveled that way (no pun intended ).

I don''t know what else I would call Diablo... Slash''n''Hack?
quote]

How about "Chop''em up" :-)





We are their,
"Children of the Free"
0

Share this post


Link to post
Share on other sites
Just returning to the topic of communication and information sharing between NPCs...

Take a step back for a moment and look at what will be going on behind the scences of your game. This will help identify key problems that must be addressed and then you can ask yourself, ''Do I have the method to solve this problem'' and ''Do I have the resources to solve this problem''.

First of all, if your agents are communicating and sharing their knowledge, then your society is diffusing information in exactly the same way that smoke diffuses in air, or heat diffuses in metal. What will happen is that if left unchecked, all of your agents will reach the same information state (a type of information equilibrium). Then, talking to one agent will be like talking to them all. Not very interesting.

Secondly, each agents database of knowledge would grow to the equilibrium size. Thats an awful lot of storage space!

You really need to prevent this uncontrolled information dissemination. What methods can you use to do so?

1) Limit the interactions between NPCs.

Unfortunately this simply slows down the rate of information diffusion. The system will still reach equilibrium.

2) Limit the amount of information shared between NPCs (ie only a portion of what they know they communicate during any given interaction).

Again, this only slows down the diffusion. Alternatively, if you prohibit NPC_1 from telling NPC_2 anything other than information_A then the equilibrium information state will contain all of the possible shared knowledge. The rest of the unshared knowledge is not accessible to other NPCs (and is therefore wasted).

3) Limit the memory of NPCs.

NPCs can obtain information but also forget information. By tuning the parameters of such a system you can retard diffusion sufficiently to prevent equilibrium. You must be careful though that your system doesn''t forget crucial information. You can also link the memory length of an NPC to the type of information, the NPCs (or games) current state and/or the sphere of interest of the NPC.

Okay, so here''s me letting out an idea I have been developing for about a year now with a friend. No serious implementation yet so I am happy to let others know. I would love to see this in a game some day and I don''t care if it''s not me that does it!

Rather than have NPCs with individual knowledge bases (data bases) hold all world information in a central database. Each NPC has limited access to this knowledge based on their classification within the world. So for instance a baker would know things about bread, money, buying, selling, food, etc., while a grave-robber knows about death, burial, coffins, digging, loot, etc. Players and NPCs can research information by gaining access to the database in areas they don''t already have access. This is done by interacting with others and swapping information (because they access different portions of the database) or by going to places like the library and reading books!

The benefit of this knowledge system is that it can be extended based on game play. Using standard techniques for knowledge bases, events within the world can be added as knowledge to the database. For instance, player_351 slays Dragon_6. This knowledge is added to the knowledge base and combines with other knowledge (like ''people that kill dragons are heroes'', implying that player_351 is a hero)!

You can then utilise some of the techniques I mentioned above to limit the way the knowledge base evolves. You do have to be very careful that you don''t generate too much information and overwhelm your storage capacity!

Ultimately, you have to ask yourself, ''Do I have the storage and computation resources for this size information project''? Most likely not presently. But that doesn''t mean you shouldn''t develop the idea further!

Cheers,

Tim
0

Share this post


Link to post
Share on other sites
Ahh.. It is great to revisit the old favourites

OK - I had an idea similar to this. You have all your world information stored in a single db and then you have variables on the NPCs that dictates what they know (pointers in the database), how well they know it (in a %age of total knowledge) and how quickly they are forgetting it (of the %age). You may also have a maximum and minimum so that they will still remember some after they have forgotten the rest for years

This idea has merrit. You needn''t have a large database to cover a lot of information for a small world. Even if it were going to be considered large, it wouldn''t be more than a few Mb (consider it... "Fish are found in river", "Flour is made from ground Wheat" etc, etc wouldn''t take up much room each ).

Information decay is one of the best things that I can think of for limiting the whole world finding out about everything, and I also think that there is another way to go in this whole issue. Imagine information getting told in a misleading way. An NPC might say something that is confused with something else that they know. It could then occur that a player crossreferences information.

I won''t bother going into the Fishing, Swordfish, Password thing again, but if somebody wants the thing reposted I can always do a search for it. Basically it was one NPC confusing the information that another NPC gave her about two different topics. One was regarding the price of fish at the market, and the other was about the secret password being fish or something like that. Word association and confusing the details is something that could really annoy players, so you would have to have only certain information that could be clouded in this way (a flag that allowed this or not )

Well, that is enough of this rant anyway

-Chris Bennett of Dwarfsoft - The future of RPGs Thanks to all the goblins in the GDCorner niche
0

Share this post


Link to post
Share on other sites
I came up with another idea last night while thinking on this topic further. Rather than apply a lifetime to information (implicit memory loss) just limit the db size for the agent, or in the case of a global database, the number of pointers into the db. This size could be different for different agents.

When new information is obtained, if the db or link set is full, then decide which piece of information is the least relevant (to that agent) and discard it or delete the link. This could be the new information just obtained. You could take care of persistant knowledge by flagging it as most relevant (ie never to be deleted).

With this knowledge model the information states of characters would evolve over time and should conceivably be linked to the game state as well!

Tim
0

Share this post


Link to post
Share on other sites
Some more ideas:

-Npc''s have a personality that will influence all decisions

-They need to have some sort of memory system (as you''ve been discussing...)

-They make decisions based on what they know

-They should NOT be predictable (i.e. there needs to be an element of randomness to the decision making process)

What I propose is to have a list of possible actions, and each action is given a weighted score based on personality and information. The actions that the npc would not perform (score below 0 or a similar method) would be dropped from the list. An action would then be chosen by a psuedo-random function where the scores act as a frequency factor. The actions with higher scores would be more likely to be chosen. I have to run...(I''m at work) I kept the details out just to provide a proposal for a general solution.
0

Share this post


Link to post
Share on other sites
quote:
-------------------------------------------
original post by _rpg_guy

-They make decisions based on what they know

-They should NOT be predictable (i.e. there needs to be an element of randomness to the decision making process)
solution.
-------------------------------------------

One would want an agent to make decisions based on their goals and what is happening around them. These are two distinct planning concepts and have very different methodologies for implementation.

What we DO want though is predictability in our game agents. Most gamers want NPCs to make decisions inline with the characterisation of the NPC. I.e., you don''t want to see a baker run off and try to forge armour with a loaf of bread. However, it wouldn''t be unreasonable to see that same baker try and slay a dragon with a bread stick if their daughter had just been eaten by said dragon.

In other words, we want our game agents to act as we would if we were in their position with their knowledge. That doesn''t mean that as players we can predict what they can do, but it means that when we find out what they know and their motivations, what they did makes sense. That is immersion!

Anyway, to get onto practicalities of how to choose actions for a character, you can use something called the Principle of Maximum Expected Utility. It''s a formal definition of rational action used in AI (and economics funnily enough!). It goes like this:

1) Assume you have a utility function over world states;
2) Given your current state and all possible actions;
3) Evaluate all possible next states;
4) Compute the expect utility (EU) for each state. This is the product of the likelihood of achieving that state with the utility of that state.
5) Choose the action that generates the Maximum Expected Utility.

You can assign probabilities to future states in many ways. If your game world is completely deterministic (ie there is no uncertainty/noise involved with its evolution) then you can apply a uniform probability distribution to all next states (so each are equally likely). Then, you are choosing the action that takes you to the highest utility state.

What is a utility function? It''s simply any function that can evaluate the relative ''goodness'' of any two world states. That is, given state_A and State_X, your function can return a number for each state with the better state of the two having the higher number. If you have a finite set of world states it may be possible to assign them all a unique number. For continuous domains an analytic function would be necessary.

Here''s a simple example that demonstrates the power of this method. Let''s say you have an agent and you want them to walk to the top of a hill. You could simply compute the location of that point and have them walk to it. But, you''d need to compute whether that path passed through objects and then work out how to avoid them. Here''s a different solution.

Assume agent is at bottom of hill and can move in a fininte number of different compass headings.
Compute all next positions that the agent could move to. For all positions that would result in a collision with a game object, assign that position a probability of zero. Assign all other positions a uniform probability. Use the height of each position as it''s utility value. Compute for each position the expected utility. Choose the action that leads to the maximum expected utility.

Okay, so we didn''t actually need utility in that example. We could have just performed reactive planning that had our agent try and increase it''s height on the hill with every step and testing for collisions at each step.

However, consider the problem of getting a vehicle to follow a road. Assume there may be obstacles on the road. Assign a utility function to the region around the road that is highest on the road and decreases the further you go from the road. Then apply the same iterative methodology above for incremental vehicle movements. You can see that the truck will do it''s best to stay on the road but will deviate a minimum distance when it has to avoid an obstacle.

There are plenty of other uses for rational action, particularly in NPC decision making. I''d be happy to discuss them further.

Tim
0

Share this post


Link to post
Share on other sites
You started to lose me once you started talking about the "Principle of Maximum Expected Utility." I have no idea what that is. (I''ll do a web search after I finish this post.) It all sounds very cool, but I have to understand all of it before I can program it. I''m still at least a month away from starting to code the AI portions of my game, but probably more. Gotta run. Keep the good ideas rolling!
0

Share this post


Link to post
Share on other sites
While you are on the subject of Web searches and discussing NPC AI in RPGs, why don't all of you bone up on the following topics. You'll be better prepared to tackle a subject such as this, you won't waste your time seeking solutions to things already solved, and you'll better understand the real problems that you can expect to encounter along the way. Here are the topics:

Belief Systems
An agent believes what it does about the world, and this is not necessarily reality. An agent should be able to model the beliefs of others, even if these beliefs contradict what the agent believes about the world.

Truth Maintenance
An agent should be able to effectively reject or accept new incoming knowledge. It is pointless and will cause problems for an agent if the agent integrates new knowledge into his beliefs if this new knowledge contradicts (not necessarily directly) what the agent already knows. An example might be an agent knowing that Terry is the father of Bill, and then learning later that Terry is the first woman ruler of Krodonia.

FOPC and situation calculus
FOPC stands for First Order Predicate Calculus. Essentially anything which can be said can be said in the formal language of predicate calculus.

For example:
Everyone is younger than their parents.
(A x y) (Parent(x y)->Younger(x y)).

Or:
A knife is a weapon.
Instance-of (knife, weapon).

Or:
There exists at least one sun in every solar system.
(A x) (E y) (Instance-of (x solar-system) & Instance-of (y sun)->Contains (y x))

Predicate calculus can maintain truth. If you have provided knowledge that there is a particular solar system that has no sun and then you try to make the above statement, it can be refuted.

Resolution Refutation and Natural Deduction
These are the two main methods of proving and disproving truth within a knowledge base.

The Twelve Dimensions of Context
As put forth by Douglas Lenat, builder of Cyc, among the twelve dimensions of context are time, belief, geographical location, hypothesis, etc.

Perception and Action
There is, or generally believed to be a basic cycle to any agent. This would be perception, analysis and elaboration of perception, planning, decision, and action.

Defeasible Reasoning
Unlike monotonic reasoning, defeasible reasoning enables one to reason effectively even when given new contradictory information about the world. It enables an update of one's beliefs even with this contradictory information.

So, there you have some food for thought. Ignore these concepts at your own peril. As you dig deeper, ultimately you will encounter some very deep and philosophical problems, many of which have been solved, or at least halfway decent solutions have been created.




Edited by - bishop_pass on May 3, 2001 2:14:31 AM
0

Share this post


Link to post
Share on other sites
Well, behavior, in my opinion, is the simplest problem to solve. Although I''ve given up hope of EXPLAINING my sytem, basically Its a bunch of abstract personality numbers/skills/linked lists & tree memory structures. (A bit more memory intensive than most systems, but...hey!) Basically, It''s adaptable and let''s the NPC do irrational things by factoring in abstract personality numbers as a weight in the logic. Which screws it up enough to not call it logic... Ahh, Humanity....
The only problem is COMMUNICATION. I don''t want a menu system, where everything needs to be scripted. And I don''t want the player to have to construct sentences with a bunch of list boxes...too tedious!

I''ve decided to combine them, sortof. I let the AI not only create a question using the "list-box system" but let the game''s logic determine responses as well. (In addition to NPC AI & conversation AI, I have Skill AI using the Skill Web(COMBAT)) And put a little "compose new sentence" button on the bottom, so if the player wants to change the subject he can. ("Did you steal the 300 gp?" "How about that battle outside town today?") I can''t think of anything else except some GIGANTIC super computer running a neural net ''reading'' program for each player...a bit expensive to run 5,000 supercomputers huh?
0

Share this post


Link to post
Share on other sites