Advertisement

Annotated Objects (Disscussion on Implementation)

Started by August 04, 2002 11:33 AM
21 comments, last by Nazrix 22 years, 4 months ago
Its sort of like state oriented programming as opposed to object oriented program. If I am right, your suggestion is that all objects would be encountered by the global state which then signals the NPCs with respect to their missions. This requires that NPC personalities are manifest to the global state that "does the thinking" for them (perhaps with probabilities involved). That has the advantage of simplicity.

There is an alternative conception, however; rather than objects broadcasting what they can do, npcs have a priority list of what they will do using an actionable template of stories that have a series of object equivalents, which is modified by their perception of what is possible given a particular global state. This requires that NPCs have self-assessment processes that has the potential to be grafted onto a communication system.

Perhaps a hybrid system is possible?
quote: Original post by deClavier
Its sort of like state oriented programming as opposed to object oriented program. If I am right, your suggestion is that all objects would be encountered by the global state which then signals the NPCs with respect to their missions. This requires that NPC personalities are manifest to the global state that "does the thinking" for them (perhaps with probabilities involved). That has the advantage of simplicity.


actually I meant that I was only considering using this type of system ...it's not the main idea, more of an extention of the original concept



A CRPG in development...

Need help? Well, go FAQ yourself.



[edited by - Nazrix on August 5, 2002 10:56:35 AM]
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
Advertisement
Does this system allow for planning? Do NPCS only react to received broadcasts? What if an NPC is hungry but is not receiving any "I satisfy hunger" messages? Does he sit there and starve or does he move about and search for an appropriate object? Of course, my question assumes that objects limit their broadcast of messages to a finite area, but if they do broadcast globally, doesn't that mean that NPCs will be nearly omniscient?

Sean

[edited by - Sean99 on August 5, 2002 3:43:40 PM]
"we need common-sense judges who understand that our rights were derived from God. And those are the kind of judges I intend to put on the bench." - GW Bush"no religious Test shall ever be required as a Qualification to any Office or public Trust under the United States." - Article VI of the US Constitution.
quote: Original post by Sean99
Does this system allow for planning? Do NPCS only react to received broadcasts? What if an NPC is hungry but is not receiving any "I satisfy hunger" messages? Does he sit there and starve or does he move about and search for an appropriate object?


Well I plan to have other influences besides the items broadcasting messages. There will be other means of stimulus for NPCs. I was just narrowing it down to the item broadcasting for this discussion. I should have mentioned that

quote:
Of course, my question assumes that objects limit their broadcast of messages to a finite area, but if they do broadcast globally, doesn''t that mean that NPCs will be nearly omniscient?


Yes I am thinking that the messages are limited to a finite area.



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
If NPCs are omniscient it fixes the nothing in range\planning problem, but you don''t necessarily want the NPC to magically know about things he shouldn''t know about. You could introduce a memory system. Once an object broadcasts something, it continues to do so, even if the NPC is technically out of range. You may want to create a list of objects (just a message and a location) per NPC, allowing broadcasts to become out of date. A guy could go to a place in the forest where there was food before because his object memory is still broadcasting the "satisfies hunger message" and find out that it''s no longer there when he gets in range to perceive the actual object (which is no longer broadcasting the message.) The memory could be at a lower level of detail than actual broadcasts, i.e. "there are satisfy hunger messages in this area." NPCs could start with some general knowlegde of the game world, and use this to stay alive, instead of having to randomly wander around and hope they receive the right message, or alternatively, having omniscience (which is fine in the Sims, where the gameworld consists of your house, but not so cool in a large RPG setting.)
quote: Original post by Nazrix
So every so often the item will broadcast what it can do (fix hunger, fix thirst, etc).

I was thinking that a more efficient system might be a ''radar'' method.

The NPC broadcasts a message to all objects within a certain range that it needs something. You could increase the broadcast range proportional to the degree of need, if you liked.

Any objects that fit the criteria will ''bounce back'' the message and report to the NPC that they match the need, along with the action needed as already mentioned. In answer to a broadcast request, the NPC is then given a list of objects that fit the bill.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files ]
Advertisement
It sounds like NPC hide and seek. If you modify the broadcast so that "interference" is recorded, ie. food object broadcasts as part of food-container-house-key hierarchy, the npc can begin to search in a generic way, ie. examining houses they have a key to for container objects, etc. If you add dummy broadcasts to this, the noise factor will hide what the NPC really "knows". Global state control, finally, would moderate NPC receptiveness to broadcasts (sort of like invisible "news broadcasts").
quote: Original post by deClavier
It sounds like NPC hide and seek. If you modify the broadcast so that "interference" is recorded, ie. food object broadcasts as part of food-container-house-key hierarchy, the npc can begin to search in a generic way, ie. examining houses they have a key to for container objects, etc. If you add dummy broadcasts to this, the noise factor will hide what the NPC really "knows". Global state control, finally, would moderate NPC receptiveness to broadcasts (sort of like invisible "news broadcasts").



are you saying that an item's signal would be sort of built from different info. For instance, imagine each item has information like a pointer to the NPC that owns it and a pointer to the object that it is contained in (like if the item is in a chest)

Let's assume that the container would have information contained in it's C++ class as to whether it's locked, what key it needs, etc.


So an item would say "I can help you with this. I am in [whatever object it is in like a chest for instance]"

Then the object that it's in (a chest or whatever) might say that you need a key for it or something.



So basically the idea is that messages are dynamically built and sent by the different components and items involved depending on the information involved. Each item/component/whatever will add it's relevant info to the message.


(I know that I'm ignoring optimizations and this may be inefficient but I'm just thinking in terms of abstraction of this sort of idea for now)

A CRPG in development...

Need help? Well, go FAQ yourself.


[edited by - Nazrix on August 7, 2002 4:37:16 PM]
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
quote: Original post by Kylotan
The NPC broadcasts a message to all objects within a certain range that it needs something. You could increase the broadcast range proportional to the degree of need, if you liked.

Any objects that fit the criteria will ''bounce back'' the message and report to the NPC that they match the need, along with the action needed as already mentioned. In answer to a broadcast request, the NPC is then given a list of objects that fit the bill.



Good idea. That probably would be more efficient.



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
I''ve been thinking heaps about this.

The conclusion I came to that a combination of global state change and individual states is best. What you do is
a) set up all objects as descendents of a global object (so that broadcasts contain general location information)
b) set up the global object to alter magnitude of broadcasts as proportional to object number and number of object broadcasts by object quality
c) give NPCs a priority mechanism that assesses goal selection by magnitude of broadcast and action-type by number of same-type broadcasts
d) create a global NPC that assesses goal selection by magnitude of NPC broadcasts and global state by number of NPC action-types

the global state could modify the broadcast calculations of the global object and the global object could modify the state of the global npc. (actually, you could decentralize the global object and global npc, so that you had towns instead)

basically, what this amounts to is a perceptually modified game reality that is navigated by subjective NPC assessments of personal need vs personal advantage.

added to this is the possibility of creating action sets, which take certain combinations of broadcast and action types in a defined area to trigger events, eg. dead-body broadcast + "searching" NPC type within hundred meters triggers discovery which calls policeman and actions policeman "search" (this would constitute the intuitive mechanism of NPC AI). a certain amount of "noise" (dummy broadcasts, random action types) in this system would result in a very lively gameworld, a certain amount of "information dropout" (probability of awareness, stupid npcs) would result in a very realistic gameworld.

the use of objects and states, if sufficiently complex, could also serve as a language system within the game.

This topic is closed to new replies.

Advertisement