Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


NPC AI in RPG's


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
59 replies to this topic

#41 Darkor   Members   -  Reputation: 133

Like
Likes
Like

Posted 08 June 2001 - 02:31 AM

From everything posted here, here's my take with both points from others as well as myself.

Most importantly, I'd have to say that such advanced AI would be too hard to make or not perceived by the players as it should have been by the designer (as always).

Firstly every message should be categorised and given properties.
Not just properties like their lifetime before being conveniently forgotten. And NPCs don't forget things that fast so let's not talk abuot limits of computers yet. Messages should have the follwing properties:

1) Sensitivity - Secret, Private and Public
2) Link (or thread) - some news are updates of others, therefore new information should overwrite their old ones and for this to happen, they'd have to have a thread.
3) Belief in information - how much the NPC supports this piece of information.

Secondly, each NPC must have a list of close friends, normal friends and the-guys-you-gossip-with. This determines the information that they exchange with each other. Being a close friends, they may exchange secrets with each other unless the game does not allow it so.

Thirdly, each NPC must have a list of favourite activities, or rather, regular activities. And a time frame shall be associated with each activity. The venue must also be included. Other things might affect it like the NPC does not have enough gold coins to order beer at the local pub.

Lastly, each piece of information must have a question. What I mean is that whatever the NPC knows, the player can ask. But the player may have other questions that the NPCs do not know of and thus they may have a default piece of information. It should say something like 'I do not know'. But when it learns more, it get overwrited and he might say something else.

Okay now that everything is said, I can then proceed to write how everything fits in together which none of you have been successful at. I will attempt nonetheless.

Since each NPC has regular activities like work, NPCs in their immediate area are public figures to them and all of them excahnge public information which they keep. They will compare their information and see how much belief they each have and thus it will determine whether new information overwrites the old and what information is passed around. Or it might transform it. Also, they take into consideration the honesty and charisma of the NPC giving them the information. Maybe, if everyone says so, then the NPC might submit to all and believe what they say. Again, this depends on their belief in their information.

Also the idea that each NPC draws their basic knowledge from a database is very good. But can the information in the database be altered? If it can then, how fast can the information be spread throughout the world.

And missing are other details. Information do not only be gathered from other people. They are gathered from events, posters and the internet (okay, maybe not in a fantasy world, but you get the idea). How do they get the information. The events themselve must store a "message" that is passed to the NPCs who witness it.

This is such an old post but it still is valid. But still, the limits of today's computer might still hinder such a game. There could be shortcuts and everything and simulating such a "interactive" would be costly to the CPU. Interactive indeed!

However, even if the game succeeds somewhat, there is still a chance that the player messes it all up and is obliviuos to the living and almost breathing world that his character is in. As mentioned earlier, the player almost always do not think like the designer and thus difficulty arises.

Also, this just came to me. No one has talked about how NPCs react to information passed to them. You might have talked about bread-wielding bakers attacking dragons but how does it work?

Edited by - Darkor on June 8, 2001 9:40:28 AM

Sponsor:

#42 Timkin   Members   -  Reputation: 864

Like
Likes
Like

Posted 12 June 2001 - 03:46 PM

quote:
Original post by Darkor

Also the idea that each NPC draws their basic knowledge from a database is very good. But can the information in the database be altered? If it can then, how fast can the information be spread throughout the world.



The concept is that the database is how the world state vector is stored at any time. Think of any current game. At any time there is a list of objects currently in the world and information regarding their individual states. The game update cycle includes information about how to update the state of each object (or at least each dynamic object). All of this can be stored in the same database. It is just that a part of that database is actually a knowledge base that contains a set of logical propositions relating to the objects in the world, the relationships between them and the way things change. A part of the game update cycle is to compute the affect on the knowledge base of any changes in the world during the last update and then any changes in the world that the knowledge base infers.

For instance, NPC_Baker_3 is passed information that his daughter has been eaten by a dragon. The knowledge base may have a particularly obvious proposition saying that "If X knows that X's_daughter was eaten by a dragon then X gets extremely angry and upset". If we add the information "NPC_Baker_3 knows that his_daughter was eaten by a dragon" (because this information was given to NPC_Baker_3 during the update cycle) then the logical conclusion is that NPC_Baker_3 undergoes a state transition to "angry" and "upset".

Our database can have other rules that govern the world. For instance, you could include Newton's first law, "Every object will continue to move at it's current speed and in it's current direction unless a force is applied to it". This wouldn't be the most efficient way to update those objects that do, or do not, have forces applied to them... but you get the picture (I hope)!

quote:
Original post by Darkor

Also, this just came to me. No one has talked about how NPCs react to information passed to them. You might have talked about bread-wielding bakers attacking dragons but how does it work?




See above. Basically motivations are hidden within logical propositions.

I hope this stimulates a few more ideas or comments.

Cheers,

Tim


Edited by - Timkin on June 12, 2001 10:50:38 PM

#43 bishop_pass   Members   -  Reputation: 108

Like
Likes
Like

Posted 12 June 2001 - 04:19 PM

quote:
Original post by Timkin

The concept is that the database is how the world state vector is stored at any time. Think of any current game. At any time there is a list of objects currently in the world and information regarding their individual states. The game update cycle includes information about how to update the state of each object (or at least each dynamic object). All of this can be stored in the same database. It is just that a part of that database is actually a knowledge base that contains a set of logical propositions relating to the objects in the world, the relationships between them and the way things change. A part of the game update cycle is to compute the affect on the knowledge base of any changes in the world during the last update and then any changes in the world that the knowledge base infers.

For instance, NPC_Baker_3 is passed information that his daughter has been eaten by a dragon. The knowledge base may have a particularly obvious proposition saying that "If X knows that X''s_daughter was eaten by a dragon then X gets extremely angry and upset". If we add the information "NPC_Baker_3 knows that his_daughter was eaten by a dragon" (because this information was given to NPC_Baker_3 during the update cycle) then the logical conclusion is that NPC_Baker_3 undergoes a state transition to "angry" and "upset".

Our database can have other rules that govern the world. For instance, you could include Newton''s first law, "Every object will continue to move at it''s current speed and in it''s current direction unless a force is applied to it". This wouldn''t be the most efficient way to update those objects that do, or do not, have forces applied to them... but you get the picture (I hope)!

See above. Basically motivations are hidden within logical propositions.

I hope this stimulates a few more ideas or comments.


Would Timkin, or anyone else here, for that matter, care to comment on this topic which is essentially an exploration of the mechanical details of such a logical system.

Despite some overly pessimistic individuals and uninitiated ones giving feedback on the topic, it is a pretty worthy discussion. And I believe I have devised a classification method to determine the nature of particular axioms (recursive, etc.) and construct optimized data structures for the axioms which enable the system to not fall into the trap of a recursive graph search.

The system being discussed is first order logic with functional unification, enabling event or situation calculus for planning, truth maintenance, logically consistent beliefs, and efficient inference.



#44 Impossible   Members   -  Reputation: 134

Like
Likes
Like

Posted 12 June 2001 - 04:31 PM

For those of you who haven''t read my article on Badcontent, check it out.
Here''s the link Next Level 2. This article pretty much sums up my stance on conversation systems, and I believe that it is completely implementable (well, at least I''ll find out when I try to implement it). It''s similar to previous posts (global information, memory, etc.) The actually interface would be a search engine similar to a "inverse parser", combined with the graphical interface I discuss in the article.

#45 Timkin   Members   -  Reputation: 864

Like
Likes
Like

Posted 13 June 2001 - 09:47 PM

quote:
Original post by bishop_pass

Would Timkin, or anyone else here, for that matter, care to comment on this topic which is essentially an exploration of the mechanical details of such a logical system.




Okay, I will first be honest and admit that formal logics are not something I know an awful lot about. I was an applied mathematician before coming into AI. (I was also heavily into physics and philosophy as an undergrad!).

However, I think I understand what you are asking. You want to solve the equivalent problem of determing whether or not there exists a path between two nodes in a bidirectional tree structure, that is not fully connected (i.e., it is not the case that all nodes in one tree map to nodes in the other). Correct?

This is out of my field however I might be able to run your solution by a couple of people (we have a great lunch time discussion group that meets each week. I know that one of the group members has some expertise in this area.) Would you mind if I discussed it with them?

Cheers,

Tim

#46 bishop_pass   Members   -  Reputation: 108

Like
Likes
Like

Posted 14 June 2001 - 05:13 PM

Timkin, yes, that is basically the problem: graph search. I believe this problem is considered NP complete, or whatever. NP stuff is NOT my field of expertise. Anyway, with heuristics, theoretically it can be fast *most* of the time.

Yeah, go ahead and ask your associates, that would be great. However, I am not looking for the type of answer which says: "Oh, that problem can''t be solved reasonably, give it up." I would prefer an answer worded more like: "Yeah, that is a tough problem, but some of the better results are being acheived by such and such methods..."





#47 JensB   Members   -  Reputation: 212

Like
Likes
Like

Posted 14 June 2001 - 11:57 PM

quote:
Original post by KaneBlackflame
Hey, I had to try it) but I hope to start a new community in a few weeks with some expanded morals I have been adding. Dynamic AI can be made. I hope the age of static NPC''s will be over soon.



I would love to see some more information on this, perhaps a demo or a web-page detailing what you did - keep us posted!


This sounds much like the necessary foundation for a "living" world

- However, what we probably need to do with todays technology is to "simplify" this into something that doesn''t acctually modell every small action/decision of every mobile (unless we are talking of a very small world) - Leaving us processor time to handle players, more important decissions, such as knowledge management, graphics (if single-player scenario) or connections (in multiplayer scenario)

- However, these "small" decissions usually impact the bigger events in the world in some way - so we probabbly don''t want to ignore them.

Any ideas on how to generalize these everyday things such as suppy and demand on food and other stuff and breeding etc?

cheers,

J

#48 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 16 June 2001 - 03:11 AM

Correct me if I''m wrong, but, didn''t Wizardry 4 have something similar ? If I remember correctly, the game allowed the player to type text into into a textbox while interacting with npcs and the program would then try to find ''meaning'' in what the player typed. This was of course, a very primitive form of what you are talking about. Also, I believe Wiz4''s npc interaction system was keyword based.

#49 KaneBlackflame   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 June 2001 - 05:37 AM

Ok, I kind of forgot those outside my circle do not know exactly what a Neural Web is. A Neural Web is my attempted improvment upon a NN. There are no "hidden" layers in webs, as I create them node by node by hand with a SDK I built. I can add trees of nodes and train them, but I never refer to them as hidden or outside my area of direct influence. All nodes or groups of nodes are named. i.e. "Sadness" or "Hunger" In many cases, end results are fired back at inputs to create a constant flow of life in a network. This ensures a kind of "for every action, there is A reaction" situation, keeping the entities active. Also, some nodes cause functions to be called, imitating a form of motor neuron. With many long nights of tedious node planting, weight calculating, and hours of testing, you can very successfully implement my design theories to create entities that will function and interact with each other in a strictly controled environment. As far as implementing this in a game or other application now that must function in real time, I think we are a ways off from that in computational power. The only thing I have come up with to semi solve this problem is a form of layer detail. Alow me to explain : A player is in a town. The player cannot see anything in the next town, so all movements and actions there can be approximated, i.e. assume that everyone successfully completes their daily routine. This way, we free up a lot of processor time when approximating the rest of the world, allowing more time to properly simulate the current area or town, as well as simulate any important events going on elsewhere, such a plot lines and feuds. I hope that came out as clearly as I had hoped.

I would love to post a site, but I don''t have the time, and the only content I can provide is thesis statements, technical notes, and LOT''s of logs. I would rather wait till I have my demo working again before I post a zip file of my stuff. I would love to hear your comments and thoughts for improvement.

#50 XtremImmortality   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 June 2001 - 12:47 PM

Hail and well met! Sorry for posting after so many others but I had an idea This may have been answered or mentioned already but I don''t have time right now to read all the replies and I''ll forget by later. What if you used your idea, the inverse parser. Example then I''ll explain:
You: How do I kill a goblin quickly?
***I realize this isn''t a normal question but *shrugs* oh well
The guard may have a few responses, such as:
1-To kill a monster enter attack mode and double click the victim
2-If you kill a goblin you may get a bounty
3-A sword will kill quickly whereas a mace will kill slowly
-----------------------------------------------------------------
Now the guard would be "confused" so he can say that he isn''t sure what you mean and will list all 3. The user will select what he wanted to hear. The game will remember that response. That is the key, ''specially if its a MMORPG. It will save all the responses to that question and the guard will begin to respond with the most common answer. It would seem like our virtual friend is learning

Hope that helps, or sparks somebody''s interest

Pinch me... See if I''''m still asleep... *pinch* Owe! Mother f*****... Yep, you were still asleep.

#51 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 21 June 2001 - 11:36 PM

Just out of curiosity, are we trying to create realistic AI or effective, intelligent AI that is still fast?

#52 Nutter2000   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 June 2001 - 11:58 PM

quote:
Original post by KaneBlackflame
A Neural Web is my attempted improvment upon a NN. There are no "hidden" layers in webs, as I create them node by node by hand with a SDK I built.....


hmmm....
so does each and every player/bot in the game have a seperate NWeb then?
or is it just a huge NWeb controling everything?
how do you handle each frame of AI?
do you compute the lot each frame or split over frames?

quote:
Original post by KaneBlackflame
I would love to post a site, but I don''t have the time, and the only content I can provide is thesis statements, technical notes, and LOT''s of logs. I would rather wait till I have my demo working again before I post a zip file of my stuff. I would love to hear your comments and thoughts for improvement.


hahaha
fair enough.
I know exactly what you mean about not having the time

Keep us informed about the status of your latest demo.
I''d be interested!



"Bad Day... F**K it!" -Stephen Baldwin (Usual Suspects)

#53 KaneBlackflame   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 June 2001 - 08:58 AM

Neural Webs are made for each AI and mine are made up of a few hundred nodes with each node making 1 to about 50 connections per node. Each NWeb must be run at intervals depending on the need for the applications...FPS''s would run the Web with each frame...large RPG''s would run local NWebs at a high interval while non-local Webs could be approximated, under normal circumstances, perhaps assuming they complete their daily routine with success. They are very flexible as I see it, but take more work to produce than a normal NN with hidden layers.

#54 Taharez   Members   -  Reputation: 184

Like
Likes
Like

Posted 28 June 2001 - 07:40 PM

HAPPY BIRTHDAY!
---------------

To you too, dwarf

------------------
It''s me again!

#55 BobyDimitrov   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 June 2001 - 10:47 PM

Best wishes from me too, Dwarf!
(better second than last)

Boby Dimitrov
boby@shararagames.com
Sharara Games Team

#56 Myrkrul   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 July 2001 - 01:51 PM

Just a thought,

How about having permanent death to NPC AI''s. Once killed, they are dead and thus clearing out the db in reference to them. The new character (hired guard for the city ect) would spawn with a random AI start-up and start the learning process all over again. Differnt name, graphic, AI. LVL(to prevent camping), ect.

Also, with an assigned personality factor, you could have likes and dislikes to determine if an NPC cares about any information they are subjected to. Thus, allowing them to disregard anything related to fish. Maybe he/she likes chicken.

Timing implementation should be added as well. As years go by information should definately be erased to prevent saturation in case other methods don''t hold up.

re-assignment and or npc leveling could be a benefit as well. After some time in service, guard Noci gets re-assigned to another outpost on the other side of the world. More chance of being killed there perhaps? maybe....or the great wizard Alysa firenight reaches a lvl too high for the area she''s in and decides to head to another, to continue her study of the arcane.

Making chars like this is no simple task, but it would indeed be a great addition to rpg computer based games. It would get us at least a little closer to pen and paper =)

Mykrul d''Agra
Necromancer




#57 Nutter2000   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 July 2001 - 10:57 PM

quote:
Original post by Myrkrul
How about having permanent death to NPC AI''s. Once killed, they are dead and thus clearing out the db in reference to them.


Trouble with completely purging the db of a dead character is when you want other characters to react to the death.

Admittedly there are work arounds for that, but in essense you''d want some sort of reaction, eg wives and children to remember that the Guard Noki was their husband/father and was killed by Darkmane the Thief etc. Which would give the AI more flexability and realism. That, however, means you''d still have some space used by other characters in terms of their "memories" of that character.

but, of course, if you did a purge of the db then you wouldhave a round robin method of keeping memory requirements to a strict limit, a bit like particle systems in gfx.



#58 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 03 July 2001 - 02:49 AM

Doesn''t anybody use Cognitive Modelling Language (CML) to do a lot of these operations?

#59 doomhunk   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 July 2001 - 02:54 AM

Hmm, I came out as anonymous so I''ll repost as me....

Doesn''t anybody use Cognitive Modeling Lamguage to do these operations that are being discussed on this forum?

Do a search for CML + Funge and you should uncover the papers etc by John Funge on the subject. See also his book "AI for Games and Animation" ISBN 1-56881-103-9 which I recommend as a starting point.

Paul

#60 Kwizatz   GDNet+   -  Reputation: 1206

Like
Likes
Like

Posted 03 July 2001 - 04:30 AM

Hello, I seem to have joined this conversation quite late
anyway as I was reading the first posts an Idea came to my mind, seems like it came to duarfsoft mind too (great minds think alike ) since he posted about this computer conversation thing.

anyway I remembered that Debian Linux came with an Artificial Inteligence Package that did that, talked with the user, and I thought it could be used for what we are discussing here, I did a search for it, I found it and I really believe it can do more that what we think for us, its name is MegaHAL check it out here it is open source, and it can be "taught" whatever you want, they have a demo were they taught it to be "bishop" in Aliens, the source package is about 180 kb, I think it may be posible to make changes to it so you can encapsulate it in a CBrain C++ object and add it to your CNPC object in your game, it may need changes so it will generate questions rather than only answers, so we could make it even able to interact with other NPC''s, this will surelly save us a lot of dev time making the exact same thing, why reinvent the wheel.

there is another problem I might have an idea on how to solve though, and that is, while PC is in city B, what happens in city A? certainly you wont be doing all the AI for chars in every city as the PC plays in only one city, so I thought, you can have a timer for each city, or a timestamp so when there is a global time, the time the PC will see in the GUI, when he enters a city characters start doing their AI in realtime, they talk to each other, learn, etc, then, when the PC goes out a timestamp of the moment he lefts is recoreded for that city, and the city frezzes in time, the same moment the player comes back current player time is checked agains the city timestamp like so (timeelapsed=currenttime-timestamp) then you run a loop (with nothing but data processing, no animation,) on the AI for the time elapsed on the city (I can see a status bar saying loading map . . . ), and then start the realtime AI,
tell me what you think, and if you have improvements, post!!!.

see ya




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS