Archived

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

That gossip engine got me thinking...

This topic is 6081 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, the title anyway... Each NPC has Near and Far memory. The Near memory stores the information the NPC learns directly, and the Far memory stores what the NPC learns from talking to other NPCs. Now instead of duplicating that information, the NPCs Far memory points to the other NPC(s) Near memory, along with a size value (an easier timestamp) to access that other NPCs information, which he was likely told when they last talked. There could also be a decay value to simulate forgetfulness, and also keep memory (RAM) use down. Depending on the NPCs intelligence, he may also gain access to some of the other NPC''s Far memory, but only if his intellect supports it. There was something else I considered, but I can''t remember it right now (this was thought of while going to sleep). Comments?
"NPCs will be inherited from the basic Entity class. They will be fully independent, and carry out their own lives oblivious to the world around them ... that is, until you set them on fire ..."

Share this post


Link to post
Share on other sites
So let''s see:

NPC''s near memory is for inherent knowledge, like who am I, what''s my job, who''s my father?

And Far memory is what this NPC knows about other NPC''s near memory, right?

I was thinking, if that were the case, then wouldn''t all NPCs within a local area end up knowing the same thing? You''d just a homogenous glob of people that know the same thing, right? Unless there was some scheme where NPCs withheld some information in their near memory from other NPCs for one reason or another, right?

I like the idea of a decay factor though, but I''m hoping that doesn''t include near memory.

Wil

Share this post


Link to post
Share on other sites
that might could form a problem...

if one npc learns about another npc, then the other npc learns about another, and eventually they either wont grow cuz they arent exchanging anything new, and everyone would be a brainwashed globule of npc...

still, if they exchanged some of their near and far memory it would only be a little more diverse, and eventually it would degrade into everyone knowing the same thing. Both the near and far memory would end up filling up with the same information

Neo-Toshi - The City That Never Sleeps

Share this post


Link to post
Share on other sites
Okay, the Near memory won''t decay, I meant the Far.

Since each NPC can continue to learn without interaction, ie by observation and deduction, it shouldn''t get stale. Also, I assume that the NPCs are capable of travelling, so they don''t necessarily get stuck in the same location.

Some may hang around their town and talk about what they saw other NPCs doing, or what the PC did. Others may be more like Bards, who travel round and gather information that way.

Like I said, this was thought of while on the verge of unconsciousness, so it needs some filler.



"NPCs will be inherited from the basic Entity class. They will be fully independent, and carry out their own lives oblivious to the world around them ... that is, until you set them on fire ..."

Share this post


Link to post
Share on other sites
one way to deal with everyone knowing the same stuff could be by having the memories fall into categories (i.e. memories having to do with family; certain events; secrets; etc...) and then having each npc have attributes about which types of Near memory they are willing to share with other''s Far memories, and also which Near memories of others they assimilate into their Far memories. that way, most everybody knows basic gossip, but certain people know stuff that nobody else does, and they player would have to badger it out of them if they needed that info, or whatever... just my thoughts on the matter


_________________Gecko___
Gecko Design

Share this post


Link to post
Share on other sites
What I am doing is that when gossip gets old then it will get deleted from people. NPC''s can walk between inside of areas and the between areas and even worlds. All gossip will eventually decay also NPC''s can only remember a few things. But important people can remember more.

Minerjr

Share this post


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

one way to deal with everyone knowing the same stuff could be by having the memories fall into categories (i.e. memories having to do with family; certain events; secrets; etc...) and then having each npc have attributes about which types of Near memory they are willing to share with other''s Far memories, and also which Near memories of others they assimilate into their Far memories.



Ooh, I like that. Can you say Public & Private?




"NPCs will be inherited from the basic Entity class. They will be fully independent, and carry out their own lives oblivious to the world around them ... that is, until you set them on fire ..."

Share this post


Link to post
Share on other sites
I think this is a really intersting concept especially if you factor in trust and secrets. A character with a distrust of another may discount certain things that they talk about. A character could also be told something in secret that he may only exchange with friends or family, (or any restricted AI group).

The idea of decay is cool, but I think it would be more useful if the NPC’s memory was actually copied and attached as they talked to a new NPC. Imagine trying to preen information about the goals of a certain NPC that they hadn’t seen in a while… the NPC’s goals might have changed radically since they last talked, and it seems much more natural for a character recall what he knew “the last time they met”, not necessarily what he’s doing now.

Pointing to another game objects memory also leads to dangerous dependencies… What if the character’s “memory” you’re referring too needs to be destroyed because he’s been killed? You can’t actually destroy it as long as other characters in the game are using it.



---Strange

Share this post


Link to post
Share on other sites
quote:
Original post by strangebreed
Pointing to another game objects memory also leads to dangerous dependencies… What if the character’s “memory” you’re referring too needs to be destroyed because he’s been killed? You can’t actually destroy it as long as other characters in the game are using it.
---Strange



Good point. But the way I interpreted this thing was that everyone had their own near and far memories and if two people knew the same gossip, then it''s not that the far memory of one is pointing to the memory of another. It''s just that both have copies of the same stuff. I know, seems like a waste of space, but I figured that would avoid the problem you describe, and the fact that in the real world, we don''t have a collective knowledge, or that when one person dies, I forget when he told me.(that I know of anyway).

Could it be another solution where there''s a universal table or list of gossip that is generated, and the NPC''s memory just points to certain parts of the table for certain gossip. And when NPC''s share gossip, it''s basically telling the other NPC where to point his memory in the universal table. And decay would just mean the destruction of the pointer. And when no one''s memory points to a gossip, it''s written in the history book of that world and filed in the library(of the world) for other players to read(like old news).

I imagine pointer management would be a nightmare, and being just one table index off would mean the difference between an NPC knowing grandma''s cookie recipe and the location of a powerful weapon.

Wil

Share this post


Link to post
Share on other sites
Right along with the decay factor could be the telephone game syndrome, whereby the mutation of information happens more and more often the more people it passes through This could easily mean that by the time the gossip has made the rounds back to the originating NPC it might be entirely different gossip.

Share this post


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

Right along with the decay factor could be the telephone game syndrome, whereby the mutation of information happens more and more often the more people it passes through This could easily mean that by the time the gossip has made the rounds back to the originating NPC it might be entirely different gossip.

Chinese Whispers?

Share this post


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

Right along with the decay factor could be the telephone game syndrome, whereby the mutation of information happens more and more often the more people it passes through This could easily mean that by the time the gossip has made the rounds back to the originating NPC it might be entirely different gossip.


That might get really tough for the player though. The degree of truth is stronger the closer to the source you hear it from. However, if the mutation goes rampant, you might get lies all over the place. The player wouldn''t know who to trust, since most of us are use to RPGs where the NPC always tells the truth.

However, it would be a cool idea though. Rumors start to fly, and eventually, you might get rumors of giants that are 10 ft throwing people around, when in fact, a fat guy got drunk. Hehe.

Wil

Share this post


Link to post
Share on other sites
I love the idea of mutation as the information gets passed around. Each NPC knows a piece of information with a level of accuracy based on the level of accuracy known by the person telling them the information. Accuracy degrades with each telling and soon facts get stretched out of all proportion. Have each piece of information stored in a numeric way (i.e. the height of some drunk fat man) and the pointer to (or copy of) this information is associated with an accuracy multiplier i.e. 1.3 or 0.4 or 8.7 where 1.0 is perfect accuracy and anything smaller or larger is inaccurate. Then when information is passed around, the accuracy multiplier is adjusted for each retelling based on random factors (chinese whispers) or character traits (some guy likes beefing up stories about fights or whatever). The player gets to hear the multiplied version of the truth whenever he talks to the character in question.

I love it.

Mike

Share this post


Link to post
Share on other sites
The idea of mutations is interesting. I was actually thinking about something similar before I ran into that. I was thinking that NPCs might lie to each other intentionally based on their dislike for another NPC. Trust would be a really cool thing to try to implement. If a NPC found out that another player lied to them, their trust would be wounded with that person, and depending on the importance of the information, they might even start to dislike the other player. There would have to be some built in balance to make players build trust as well as destroy it. Maybe when an NPC has been told something and that gossip is verified by another trustworthy player, the original NPC's trustworthiness would go up. Mutations of information become extremely complex to implement, though. That's one downside to all of this mutation stuff. One would probably have to hard code all the possible mutations, lies and truths, then give each "gossip subject" some kind of ID to make sure NPCs knew that the original gossip and the mutation was about the same subject. Anyway, just some thoughts.

-Derek

Edited by - DerekDay on February 7, 2001 1:43:11 AM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
One possibility you have is to timestamp a few things. You''ve already mentioned the idea of decaying information over time. To me, that means you''d have to know when you actually learnt something (timestamp), and when time has elapsed, you remove it. Be useful to sort from oldest to newest as well.

My idea is that rather than store a pointer straight into the near memory of the NPC, you store a unique identifier for that NPC (serial for MMORPG type stuff), and a timestamp as to when you last got information. When you want to look at their near info, you do a lookup to get a pointer to the NPC from the serial. Get a pointer to the near memory, and iterate through that list and only examining information older than the time stamp. Something kinda like

struct FarMemoryEntry
{
SERIAL npcID;
long timestamp;
};

struct Information
{
string info;
long timeLearnt;
};

class NPC
{
private:
vector< Information > nearMemory;
vector< FarMemoryEntry > farMemory;
SERIAL myID;
public:
(vector< Information > *)GetMemory( void );
void CompareMemory( void );
SERIAL GetID( void );
};

then something like:

void NPC::CompareMemory( void )
{
for( long iNPC = 0; iNPC < farMemory.size(); iNPC++ )
{
NPC *targNPC = SomeFuncToGetPointer( farMemory[iNPC].npcID );
(vector< Information > *)otherMemory = targNPC->GetMemory();
for( long iCounter = 0; iCounter < otherMemory->size(); iCounter++ )
{
if( (*otherMemory)[iCounter].timeLearnt < farMemory[iNPC].timestamp ) // Facts we knew from prior contact
{
DoSomething();
}
else
{
cout << "New info, ignoring" << endl;
}
}
}
}

Something kinda like that. Sorry for the sheer amount of code but I find it easier to express my ideas that way. And I''m not sure about the (*otherMemory)[iCounter] syntax, but it looks good .

Anyway, this only allows access to info they knew since last contact. So it''s no longer a global memory of sorts. And it gets around storing pointers to potentially dead objects, as you''re only storing a serial. You''ll have to put some safety in of course, but that''s the general idea.

You''ll already be using timestamps most likely if you support idea decay. And you can optimize this by having sorted from oldest->newest. Once you hit an entry more recent than prior contact, you can return, knowing anything that follows is newer than you should know.

Share this post


Link to post
Share on other sites
@DerekDay: It''s an interesting idea that NPCs should tell lies to people they dislike. However, do you lie to somebody just because you don''t like them? In the end, this will only backfire on you, because people will hear that you lied, and begin to dislike you.
On the other hand, if the NPC expects some kind of indirect "reward" for the lie, (s)he would lie to an enemy, but not to a friend. For example, let''s say NPC #1 hates #2, and knows that #2 gets involved in lots of adventures etc... Now #1 might''ve heard of a cave with a huge dragon in it. She might tell #2 about the cave and loads of treasure, but leave out the dragon part, in the hope of getting #2 killed by the dragon. However, why would #1 lie to #2 about some neutral event (like there''s a famous person coming into town or whatever). #1 might want to keep information to his/herself though.
Intentional lies could be a great feature, but they''re probably very hard to implement so that it looks realistic.

cu,
Prefect

---
Sanity is the trademark of a weak mind.

Share this post


Link to post
Share on other sites
another thing to remember with the decay of memory is that not every memory decays like every other one. there are things that you remember for ever, and things you have a hard time remembering even if you hear it every day. you could find a way to rank memories in order of importance to that character and decay them accordingly, although this too is not an accurate model of human memory. then there''s stuff like snapshot memory, where a certain event or image or memory is flash-freezed into the mind by some odd circumstance... but this is all moot, i''mm sure, because this level of detail is way too complicated to replicate for the purposes of a game... for now, anyways ;-)


_________________Gecko___
Gecko Design

Share this post


Link to post
Share on other sites
Hi yall,

I haven''t read all the posts (3/4 of them tho and skimmed the rest) so correct me if I''m out of it.

Two things I thought of whilst reading through all of this were:

First Representation. Basically, how all this info would be stored and linked together. I think that only one copy of this information should logically be stored otherwise you are looking at massive storage issues in a game with potentially hundreds or thousands of NPCs (serious Database needed if you are thinking MMORPG). Basically each character would link to this and their link (an individual factor) would decay over time, or may not decay at all.

This decay would obviously depend on the event or information being first hand or second (or even third, fourth) hand. Skills and personal info are not generally going to decay (although you might forget who your family is in your old age for instance... that is a different topic though).

The second thing I thought of is actually quite important and that is of Interpretation by the character. Here''s the thing:

Assume two people view an event, depending on their alignment they will interpret it differently. For instance, a PC goes to a villiage and takes a local artifact from the church.

An NPC in the PCs party views it as the undoing of a cult that has been killing many people from his town. An NPC who is the priest of the local church sees it as the desecration of his religion....

The problem here is how to represent this interpretive step. Maybe over time the NPC priest becomes less angry as he saw his wrong.... maybe he creates a personal revenge goal to kill the PC??

Some more things to think about in what is otherwise an amazing idea to model information flow in a large or small world.

-- No matter what they do, how hard they are or cold they want to be, their mind will always give them away. That is the moment to strike and leverage their weakness --
The birth of Psychic Treason

Share this post


Link to post
Share on other sites
Prefect -
I see your point... There would have to be some logic behind when and why an NPC would lie. Seems like a better idea would be, like you said, to withhold good information from those the player doesn''t like, sharing it with friends. But would the NPCs be able to use the knowledge they receive from what others tell them? Hmm... then it gets really hard. Anyway... just a thought. I agree with you.

-Derek

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
All good ideas.
I was thinking... to complicate things more... Say one NPC heard something about someone they liked, depending on what this pice of information is, they may or may not tell them.

Another idea would be to for an NPC to gossip about someone when that someone isn''t arround, but act as if they are friends when that someone is around... like talking about someone behind their back and acting like ''best buds''.

If the someone being talked about learned of this, then they would immediately dislike them.

But also all this would depend on the personality of the NPC... evil, good, trustworthy, gossipper, non-gossipper. All things which could be randomly set.

All in all, this sounds like a very complicated programming task, but if anyone succeeds in doing something so complicated, it would be well worth the effort.

Share this post


Link to post
Share on other sites
i was reading over the posts here and came up with a few ideas
one-
an npc''s predisposition to tell another a certain piece of info should be based on a few things. first: the npc''s personality i.e. wiether or not he/she is the gosiping type second: wiether the info would harm or help this friend or foe.
example: npc1 is the gosiping type but does not disclose the info because of its potential affects on npc2 whom npc1 cares for deaply

two-
i love the idea of decay and it would be cool if each npc hade a set level of decay for a certain type of info so info of certain types would decay faster than others based on the importance of the info the the npc example: npc1 obtains two seperate pieces of info one about treasure the second about his nieghbor npc1 loves adventures and the idea of treasure hunting more than gosip of local events so the info of his neighbor would decay faster than the info of the treasure

just a few ideas =D great topic!

Share this post


Link to post
Share on other sites
Sure... all this will add to complexity and reality. In fact, that''s always the case, especially in AI. Good routines are hard to write and slow to execute. Fast routines have to be approximations..

Anyway, make sure that the rate of decay increases when the NPCs eat beef

cu,
Prefect

Resist Windows XP''s Invasive Production Activation Technology!
One line of sourcecode says more than a thousand words.

Share this post


Link to post
Share on other sites
All of this sounds like a more detailed version, and a lot more in depth of the NPC system in the game Daggerfall. You might want to check that out for some ideas....

"There is humor in everything depending on which prespective you look from."

Share this post


Link to post
Share on other sites
What if this was to be implimented on a Commercial scale, for a MMRPG. Would it make sense to have new Gossip and data become available as players retrieve legendary weapons, and slaughter other players. NPC''s gossiping about who killed who, how and when. Talk of which NPC''s/Players are in town, what they''ve been doing, spread word of new quests that are being hatched, ect.

And about storing the data, If it is a Commercial level game, that would be running on dedicated servers, would it then not make sense to storing NPC data In large databases, on an Oracle server or something, and instead of holding pointers to the data, hold specific parts of SQL statements that the game passes to the server to retrieve the data, if being sent to the player, otherwise, they can just pass the small, probably A couple long int values to the other NPC''s, (such as the composite key (MessageID,TruthLevel)) and completly remove the need for access to the database server amont the NPC''s except to write new data to the database. doing this would not only free up processing time to transfer all requests for data, just by passing a couple numeric values about like pointers, but it also eliminates the dependency problem that is recieved for when players die, ect.

Allot of data dependency issues, can be taken care of on an external database server. by dropping timestamps into each message, the problems with new and old data about anything go away, since they are each different messages. it also adds a degree of scaleability to the world. If the NPC''s just become rows in a table on a different server, it is completely theasable for memories and characteristics of long dead NPC''s to be brought back to life without using any more processing power on the level servers than for mere character initialization, and when they die, all their stats saved over their, for future queries. this would also allow for players to ask questions about the world from outside of the game such as from the web, and get the same results as if they where in the game. Just as long as its not vital information, which the Query statement can easily filter out.

Any other ideas

Sulgurth@hotmail.com

Share this post


Link to post
Share on other sites
Ok, I skimmed all of the above, and here''s the path I would take / am taking. It is detailed, would only work for a small world, or there would have to be judicious management of resources (i.e. instantiating NPCs for key areas and ''winging'' it for more distant NPCs).

The idea is to get realy intense with NPCs which interact with the player or nearby. Actually, all that aside, let me just discuss how people trade knowledge and how that can be implemented using belief systems and formation of hypothesis.

Assume an NPC''s memory is stored as a semantic net. Assume an NPC has basic facts which it just knows. The NPC can make inferences or elaborations based on these facts so the NPC knows more than just these basic facts. For example, if Bob knows that Jack is Robert''s father, then a rule instantly fires which records Jack as being male, Jack as being the parent of Robert, and that in turn fires a rule which says Jack is an ancestor of Robert, and that in turn fires a rule which says Jack is older than Robert. These rules fire only once and are stored. If any antecendent of any elaboration is retracted, all consequents are retracted also.

Now, Bob knows stuff about Jack, namely all the stuff list above. Now, let''s say Mary tells Bob that Jack is the daughter of Robert. Now, here''s where it gets interesting. Please follow along.

Bob also has rules which fire according to assertions related to someone being a daughter. Things like if x is the daugher of y, then x is female. Also, if x is the daugher of y, x is the child of y and if x is the child of y, then y is the parent of x. And that of course fires off rules about older than and younger than.

The point is, when Bob is told about Jack being the daughter of Robert, while that in itself does not conflict with what Jack knows, the inferences Jack makes from that fact WILL conflict wiht what Jack already knows. Therefore, Jack MUST refute and choose not to beleive this new fact, or reevaluate what he knows about the world.

Here''s how he does it. As described above, Bob knows things about Jack. Mary now tells Bob something else about Jack. Bob builds a hypothesis in his mind called "A hypothesis: the world according to Mary". Bob then runs all of his common sense rules on the fact told to Bob from Mary about Jack and sees if the inferences made conflict with what Bob already knows.

If "the world according to Mary" conflicts, Bob keeps this hypothesis around as beliefs according to Mary. If Mary tells him more things, Bob will continue to add these facts and inferences to his hypothesis about Mary. Bob will also make inferences that Mary either has unreliable information or is privy to information that might make Bob need to reevaluate his own beliefs. Also, if Mary came along and told another fact which conflicted with what Mary already apparently believes, then Bob could make the decision that not only does Mary have unreliable information, she is also illogical.

If "the world according to Mary" does not conflict with what Bob believes, then he can unlitmately add this fact into his own knowledge base and make all the eloborations and inferences on this fact that he was told. In this case, he was told that Jakc is the daugher of Robert. So, Bob will then know instantly that Jack is female, Robert is the parent of Jack, Robert is older than Jack, etc.


Share this post


Link to post
Share on other sites