Advertisement

Annotated Objects (Disscussion on Implementation)

Started by August 04, 2002 11:33 AM
21 comments, last by Nazrix 22 years, 4 months ago
This is about some things we discussed many months ago about items that would broadcast their function similar to Sims. Here is the description of my version of it for a CRPG type of game. Basically, the NPC will internally check every so often what he/she needs based on rules that you can create via some functions. So after this, the NPC will have an updated list of the things he needs (hunger, thirst, sleep, etc). Then there will be items or objects in the world. Each one will have at least one need that it will be able to help and it will know what action the NPC would take to use its help. For instance a Food object would help the need HUNGER by using it with a EAT action. So every so often the item will broadcast what it can do (fix hunger, fix thirst, etc). If the NPC's need matches that of the item, the NPC can create what I called a Mission. A mission is basically a set of actions that has a goal. This could be EATING, etc. So in this case, a EAT mission is created and is processed every so many seconds or whatever until the mission has been completed. Although, some missions can have time limits like retrieving an item. I will eventually add some kind of priority system so that missions are processed in some kind of order of priority. I know there are some holes in this process. Any suggestions? I could post examples of how the fuctions are called too if anyone's curious. A CRPG in development... Need help? Well, go FAQ yourself. "I'm gay, please convert me." - Nes8bit [edited by - Nazrix on August 4, 2002 12:43:50 PM] [edited by - Nazrix on August 4, 2002 1:38:10 PM]
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
could this be applied to terrain sections?

For example, let''s say you have two ridgelines that run mostly parrallel until one ridgeline forms a gap. Could this "gap" broadcase that is a good "chokepoint", and would therefore be a good place for ambush?

I think the trick is that if items braodcast information, how is the information itself "digested"? In other words, should every playable object object in the game receive the information, and more importantly, will it know and understand how to use the object? I think the problem with a broadcast scheme is differentiating the intelligence of the active agents in the game.

Basically what I''m trying to say is, even if the agents in the game receive the information, how do they know how to best utilize this information? One example I can think of is a smart human agent might see two chicken. He''s hungry, but he might get the idea that he can use the chicken as livestock to further perpetuate more food for himself. A dumb orc on the other is just gonna eat the chicken. See what I mean? The agents themselves still need toms kind of internal heuristics programming and decision making skills.

Perhaps the best method would be a combination of the two? Annotated objects with some limited autonoums agent AI?
The world has achieved brilliance without wisdom, power without conscience. Ours is a world of nuclear giants and ethical infants. We know more about war than we know about peace, more about killing than we know about living. We have grasped the mystery of the atom and rejected the Sermon on the Mount." - General Omar Bradley
Advertisement
Very nice idea. I'd never thought of this in terms of things like terrain.

The way I did it is the object not only knows what it can do to help a need but it knows how it can help (at least in the abstract example I have).

So food not only knows that it can help hunger but it knows it can help hunger by someone EATING (which is an action in the game) it.

So the food will say "I see that you need to increase your hunger and I can help you. You have to use the action, EAT, for me to help you".

So the items could have many different possible combinations of things they help, and what the NPC has to do with the item to achieve that.

The goal for me is to be able to plug in new types of items and have the item be totally self-maintaining so I don't have to change the NPC's code. This way it's more object orientated.

A CRPG in development...

Need help? Well, go FAQ yourself.


[edited by - Nazrix on August 4, 2002 1:38:34 PM]
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
I do see what you mean that different NPCs may not be able to know of all the ways to use an item.

Perhaps the item could contain information on intelligence (and/or other requiremntes) for each way to use it?

So the item could say "if your intelligence is at least 60 you can use it this way" etc


[edited by - Nazrix on August 4, 2002 1:32:38 PM]
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
You might want to take a look at the sequel to No One Lives Forever (still in production, but I read a nice preview in the latest PC Gamer issue). I read that they will use somewhat of an annotated system in that NPC characters will make use of lots of objects. When they enter a dark room, they will switch the light on. When they hear a sound in a room, they will check the closet, then look under the bed. When they see a computer, they might sit down and use it.

Depending on the type of NPC (soldier, scientist) the AI will make a different decision. The objects even have ownership. If one scientist uses a computer desk, then goes to the bathroom, a second scientist wandering into the room is supposed to know that the computer is not his.
You either believe that within your society more individuals are good than evil, and that by protecting the freedom of individuals within that society you will end up with a society that is as fair as possible, or you believe that within your society more individuals are evil than good, and that by limiting the freedom of individuals within that society you will end up with a society that is as fair as possible.
So, basically, what you want is for items to exert control over NPC actions. This is a great idea, though it needs some thought over different ways in which the NPC is affected. Here''s some things I can think of:

-Items that provide a benefit, of which there are three kinds:

-Advantage through position(terrain features - things to hide behind, things that protect you or give better visibility, things that will take transport you)
-Advantage through immediate/appropriate usage.(weapons, food, etc.)
-Advantage through satisfying something required of the object(taking a valuable item, money, information, etc. to the appropriate place and recieving a reward, or doing labor to recieve wages.) This one could be used for making a large chunk of the high-level AI, causing NPCs to do jobs so that they gain the money for food, housing etc.

-Items that are dangerous, which I again can think of three kinds:

-Danger added to the user(a guy with a big gun is more dangerous-looking than an unarmed one)
-Danger to be avoided(traps, mean people etc.)
-Danger to be eliminated(bugs in their home?)

Danger is harder to evaluate, I think - the NPC has to know when the rewards are worth the risk and when running away is the better option.

And finally, perception of objects is an issue. NPCs may get a "vague idea" of where something is or whether it''s good or bad for them, and whether to investigate. There might be a "curiosity" trait that determines how far they will go into the unknown. Done well, you could get situations like the classic "There''s something out there and some armed men were sent out and they never returned!" Things like the feeling of danger "This place is creepy, let''s get out" without its existence would also have to be considered for the full effect.
Advertisement
quote: Original post by Silvermyst
You might want to take a look at the sequel to No One Lives Forever (still in production, but I read a nice preview in the latest PC Gamer issue). I read that they will use somewhat of an annotated system in that NPC characters will make use of lots of objects. When they enter a dark room, they will switch the light on. When they hear a sound in a room, they will check the closet, then look under the bed. When they see a computer, they might sit down and use it.


Nice. I like the sound of that.

quote:
Depending on the type of NPC (soldier, scientist) the AI will make a different decision. The objects even have ownership. If one scientist uses a computer desk, then goes to the bathroom, a second scientist wandering into the room is supposed to know that the computer is not his.


yeah I actually already implemented a system of ownership. Every object has a pointer to the NPC that is its owner

A CRPG in development...

Need help? Well, go FAQ yourself.

Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
quote: Original post by RTF
And finally, perception of objects is an issue. NPCs may get a "vague idea" of where something is or whether it''s good or bad for them, and whether to investigate. There might be a "curiosity" trait that determines how far they will go into the unknown. Done well, you could get situations like the classic "There''s something out there and some armed men were sent out and they never returned!" Things like the feeling of danger "This place is creepy, let''s get out" without its existence would also have to be considered for the full effect.


Yes you''re probably right. For the NPC to have a definite idea where and what any object is at any time is not quite realistic. That''s something to adjust.

A CRPG in development...

Need help? Well, go FAQ yourself.

Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
To create the illusion of an integrated dynamic world, that builds on NPC missions, you could add a global control structure. The global control structure would modify mission lists in accordance with environmental conditions or other variables.

A global control structure could be used in a number of ways. For example, it could be used to modify the behaviour of an entire town during raining weather so that everyone stays indoors. Politically, it could be used to trigger a state of anarchy when the king is captured, for example.

The global control structure could then be tied in with individual missions. Four successful thefts could trigger a police alert throughout the town. Four successful murders could trigger a town mob. And so on.

[...]

I have a couple of questions about the player and NPC in such a gameworld. Firstly, could the player query an npc about their current mission or previous missions? I imagine an npc log with a die-roll access mechanism would be useful for that. Secondly, would it be possible to create social hierarchies, with missions contingent on other missions? I imagine that this would make it possible to create arch-characters, such as the player''s nemesis.
quote: Original post by deClavier
To create the illusion of an integrated dynamic world, that builds on NPC missions, you could add a global control structure. The global control structure would modify mission lists in accordance with environmental conditions or other variables.

A global control structure could be used in a number of ways. For example, it could be used to modify the behaviour of an entire town during raining weather so that everyone stays indoors. Politically, it could be used to trigger a state of anarchy when the king is captured, for example.

The global control structure could then be tied in with individual missions. Four successful thefts could trigger a police alert throughout the town. Four successful murders could trigger a town mob. And so on.

[...]

I have a couple of questions about the player and NPC in such a gameworld. Firstly, could the player query an npc about their current mission or previous missions? I imagine an npc log with a die-roll access mechanism would be useful for that. Secondly, would it be possible to create social hierarchies, with missions contingent on other missions? I imagine that this would make it possible to create arch-characters, such as the player''s nemesis.



Yes, I''ve considered a central global control structure like that. That may be more effecient and/or more organized.

So that way, the annotated objects would broadcast to the central structure which would dispatch NPCs and trigger events.


A CRPG in development...

Need help? Well, go FAQ yourself.

Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi

This topic is closed to new replies.

Advertisement