NPC AI in RPG's

Started by
58 comments, last by dwarfsoft 22 years, 9 months ago
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
Advertisement
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)
Trying is the first step towards failure.
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
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)
Trying is the first step towards failure.
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 *-
-* So many things to do, so little time to spend. *-
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
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
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 ?
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
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 ?

This topic is closed to new replies.

Advertisement