🔒 Locked
Semantic Driven world
Advertisement
Original Post
I'm currently looking into creating a "game" based entirely around a world driven by a semantic net. Essentially the world is made up of facts and rules, which in turn create new facts based on those rules. This coupled with a random element will mimic a small simulated world. The game aspect comes into effect with the player being able to manipulate facts and thus reshape the world accordingly to accomplish objectives. I'm curious if anyone has attempted anything like this before, or that can point out potential pitfalls to consider.
Well I've always like semantic nets, but I don't think your idea can entirely work in this form. The idea I've liked is have a normal style RPG for the most part, but for AI have a large main semantic network with common knowledge (which can be used to spread rumors, etc.) and give each NPC a small one. Also make it so things are forgetten after time. That way, each NPC can know somethings, and can have common knowledge as well. Have some sort of continuous garbage collection too for when nodes are removed.
There is a very old thread on this if you search for it. It was interesting and had some very good ideas. Check it out when you have the time.
There is a very old thread on this if you search for it. It was interesting and had some very good ideas. Check it out when you have the time.
I've already done some prelimanary work on designing a rumor/knowledge system for NPCs, but I am curious to read the dicussion you mentioned, you don't happen to remember the name of the topic by any chance?
Hmmm, well search is down but I'll look through my post history and find the topic if you want.
Before rushing into using a Semantic Network to represent your world, you should hold in your mind the notion that a Semantic Network is provably equivalent to a knowledge base of predicates based on First Order Logic. This means that your representational power will suffer all of the negatives of such a system (high inference cost, high cost of including and propogating the effects of observations through your network, etc). For small systems this isn't usually a problem... but for a game world, you might really start to notice performance problems when you start populating your world with agents that affect the knowledge base.
This is, of course, not to mention the biggest drawback of FOL representations (which are, by definition, monotonic); your system wont be able to hold contradictions without it breaking (and you being able to prove anything is true, which isn't very useful)!
Is there an alternative? Yes, but they come at the cost of high computational costs as well. If you want to get a feel for the complexity of the task ahead of you, take a look at any of the Natural Language Processing (NLP) systems that rely on a logical representation of the world as a world model, for the purposes of conversation. Your problem is roughly equivalent to this (IMHO).
Of course, none of this is to say that you shouldn't attempt to model a game world with a Semantic Network. It's just to warn you that it's not going to be an easy task to build a complex, dynamic world with interesting information evolution.
Cheers,
Timkin
This is, of course, not to mention the biggest drawback of FOL representations (which are, by definition, monotonic); your system wont be able to hold contradictions without it breaking (and you being able to prove anything is true, which isn't very useful)!
Is there an alternative? Yes, but they come at the cost of high computational costs as well. If you want to get a feel for the complexity of the task ahead of you, take a look at any of the Natural Language Processing (NLP) systems that rely on a logical representation of the world as a world model, for the purposes of conversation. Your problem is roughly equivalent to this (IMHO).
Of course, none of this is to say that you shouldn't attempt to model a game world with a Semantic Network. It's just to warn you that it's not going to be an easy task to build a complex, dynamic world with interesting information evolution.
Cheers,
Timkin
Perhaps have truthfulness for each fact, along with rules creating membership.
Car | is | black t = 0.5
if x contains link black then
add another link warm with truthfulness (0.2 * black link's truthfulness)
end if
(you would add more)
When you try to add the link
Car | is not | black t = 0.1
Is not controdicts is so,
if link(is not|black).truth > link(is | Black) then
removelink is | black
for each rule used in link (is | black)
remove links added by rule
next rule
else
removelink is not|black
end if
That may help,
Inheritents may also come in handy,
if x is a y then
inheritbaseprops(y)
end if
Car | is | black t = 0.5
if x contains link black then
add another link warm with truthfulness (0.2 * black link's truthfulness)
end if
(you would add more)
When you try to add the link
Car | is not | black t = 0.1
Is not controdicts is so,
if link(is not|black).truth > link(is | Black) then
removelink is | black
for each rule used in link (is | black)
remove links added by rule
next rule
else
removelink is not|black
end if
That may help,
Inheritents may also come in handy,
if x is a y then
inheritbaseprops(y)
end if
Quote:
Original post by Timkin
Before rushing into using a Semantic Network to represent your world, you should hold in your mind the notion that a Semantic Network is provably equivalent to a knowledge base of predicates based on First Order Logic. This means that your representational power will suffer all of the negatives of such a system (high inference cost, high cost of including and propogating the effects of observations through your network, etc).
I realize that, and after further thought I begin to doubt that a Semantic Network is the correct way to go about things. I am currently thinking of revising things and using a network of frames to represent the world. That should overcome the limitiation of FOL and still allow me to have the world consist of facts and rules, as well as still allow the agents to utilize Event Calculus to perform actions.
But then you find the problems of frame based systems... knowing which things need to be updated and which things need to be kept constant... keeping track of everything using frames can be tedious and memory consuming... I know I'm sounding pessimistic, but unfortunately this sort of problem is REALLY tough... but more power to you for taking it on!
Good luck,
Timkin
Good luck,
Timkin
I think I have found a way to deal with frame updating for the most part. Basicly it I'm going to use smart slots that can contain either a value, a frame refrence or a list of frame refrences.
My main concern at the moment besides the complexity problem, is knowledge and truth.
Consider the case of Alice owns a car, which she drives to work, and then goes into work. While she is at work Bob steals her car. Now Alice shouldn't know this until she goes to leave work. Which means in this case the true values of the car are diffrent from what Alice belives them to be.
The only way I can think to solve this problem is to use mulitple virtual knowledge frames that corrispond to a single true frame. These virtual frames would be independent of each other and link a agent to the true frame. A virtual frame would contain what the knowledge and beliefs the agent has about the true frame, and the values in the slots maybe me unkown, diffrent or the same as those values in the true frame. However this leads to the problem of a massive increase in overhead and size due to the creation of virtual frames, and chains of virtual frames. Which means a roboust system for the creation, mangement and destruction of these virtual frames would be key. However they provid a great advantage in that agents act based on belief and knowledge instead of truth, which makes for more complex and emergent behaviour.
Thoughts or alternatives?
[Edited by - TechnoGoth on June 26, 2004 9:20:27 PM]
My main concern at the moment besides the complexity problem, is knowledge and truth.
Consider the case of Alice owns a car, which she drives to work, and then goes into work. While she is at work Bob steals her car. Now Alice shouldn't know this until she goes to leave work. Which means in this case the true values of the car are diffrent from what Alice belives them to be.
The only way I can think to solve this problem is to use mulitple virtual knowledge frames that corrispond to a single true frame. These virtual frames would be independent of each other and link a agent to the true frame. A virtual frame would contain what the knowledge and beliefs the agent has about the true frame, and the values in the slots maybe me unkown, diffrent or the same as those values in the true frame. However this leads to the problem of a massive increase in overhead and size due to the creation of virtual frames, and chains of virtual frames. Which means a roboust system for the creation, mangement and destruction of these virtual frames would be key. However they provid a great advantage in that agents act based on belief and knowledge instead of truth, which makes for more complex and emergent behaviour.
Thoughts or alternatives?
[Edited by - TechnoGoth on June 26, 2004 9:20:27 PM]
The virtual frames sound reasonable, but I agree that they are going to come at a high computation cost. I think you should definitely check out Dempster-Shafer theory, since this gives you the ability to combine degrees of belief with logical statements... and it has a simple calculus.
I had a thought about using time stamps on knowledge for each agent, but that doesn't really work in a frame based system without something like your virtual frames...
Admittedly I haven't looked at recent advances in frame-based representations... I discarded the thought of ever using them after learning the Situation Calculus... and the problems inherent in updating frames. If you find a viable solution I'd love to hear about it. Sorry I cannot be of more assistance.
Good luck,
Timkin
I had a thought about using time stamps on knowledge for each agent, but that doesn't really work in a frame based system without something like your virtual frames...
Admittedly I haven't looked at recent advances in frame-based representations... I discarded the thought of ever using them after learning the Situation Calculus... and the problems inherent in updating frames. If you find a viable solution I'd love to hear about it. Sorry I cannot be of more assistance.
Good luck,
Timkin
Quote:
Original post by Anonymous Poster
And could we have a little bit more information ? I'm really interested in AI, but I don't know how to do ; in what code it's better for programming, etc... Could you help a little ? And could you tell a bit more about the rumor system you developped ?
Thx in advance.
Sure, I haven't finished redesigning it for a frames implementation but I'll explain the original method. To begin with there are two types of knowledge bases used, a single global knowledge base and a local knowledge base for each area. There are also subsets of both types of knowledge bases that contain knowledge known only by certain groups of people. Knowledge is stored in the form of predicate relations that can be either atomic sentences or complex sentences, which I will call facts. Under this system all agents know everything they should know, the knowledge base is used primarily for agent, user interaction as well as generating ambient banter to make it appear that agents communicate.
Rumors are created by taking choosing a recently changed fact and a causal relation and then choosing another fact from the knowledge base that satisfy that relation and the agent’s personal bias. There is also a small tracking component that records the number of times a particular rumor is told, if it reaches a certain critical mass it becomes a fact in the knowledge base.
Let me give a little example to show how it works:
The knowledge base contains these facts:
rumor(planning(Terrorists, undermine(Government)));
increasedNumberOf(IllegalImmigrants);
increasedNumberOf(HeroinUsers);
lawChanged(reduced(GunControlLaws));
Then a new fact is added:
crime(riseIn(GunViolence));
Now all agents have a value in the following 4 biases:
Terrorists
Illegal Immigrants
Drugs
Government
And that each of those biases also represents a causal relation with crime, then if four agents are asked about rumors each with a different bias that has the highest value then you would get rumors something like this.
Rumor(crime(riseIn(GunViolence)), rumor(planning(Terrorists, undermine(Government))));
= The recent rise in Gun Violence is an attempt by Terrorists to undermine the Government.
Rumor(crime(riseIn(GunViolence)), increasedNumberOf(IllegalImmigrants));
= It is a fact that increased numbers of Illegal Immigrants leads to a rise in Gun Violence.
Rumor(crime(riseIn(GunViolence)), increasedNumberOf(HeroinUsers));
= The recent rise in Gun Violence is caused by the increased number of Heroin Users.
Rumor(crime(riseIn(GunViolence)), lawChanged(reduced(GunControlLaws)));
= It’s the Governments fault, they reduced the Gun Control Laws, and now there is a rise in Gun Violence.
So that’s basically how it works, a grammar program would be used to turn the facts into sentences using a fill in the blanks system.
Hope that answered your questions.
Quote:
Original post by Anonymous Poster
Can we "understand" it or "realize it", or do we really have to "hold in our minds"? Do you talk like that in face-to-face conversations?
Huh? I don't understand what you're asking.
What about storing when the value of a node changes, and when it changes.
Then each NPC would store 1. which nodes's value they know and 2. when they know it.
When a NPC relearnes the value from a node, 1. you find out if the old value is still in use, if not then you remove it. 2. you update the NPC last known value.
When you change the value of a node
it stores 1. the new value and
2. when it was changes
(i would store it in a list)
When seeing what a NPC knows, you do something like
for each node known to NPC
set x to curnode
set y to x in the Network
for each different value in y.changeval
if y.changeval > x.lookval then
set the NPC's knolage of node x to y.value
exit for
end if
next for
next for
Hope i can help
DENC
Then each NPC would store 1. which nodes's value they know and 2. when they know it.
When a NPC relearnes the value from a node, 1. you find out if the old value is still in use, if not then you remove it. 2. you update the NPC last known value.
When you change the value of a node
it stores 1. the new value and
2. when it was changes
(i would store it in a list)
When seeing what a NPC knows, you do something like
for each node known to NPC
set x to curnode
set y to x in the Network
for each different value in y.changeval
if y.changeval > x.lookval then
set the NPC's knolage of node x to y.value
exit for
end if
next for
next for
Hope i can help
DENC
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement