Annotated Objects (Again)

Started by
11 comments, last by Nazrix 21 years, 10 months ago
I'm working on something like what Bishop_Pass once discussed about objects that can send out signals to agents. This is kind of a little question but I want to make sure I design this right from the ground up. I have some basic objects like a food & a health-increasing object (like a potion or something). My question is a matter of design mostly. Basically should each object look at all NPCs nearby and figure out which ones might need its help, or should NPCs figure out what they need then when an object's services agree with what the NPC needs he'll use it. Example: Should an apple say: "Ok, NPC Bob's hunger is high so I'll send him a message of how urgently he needs me" ...or... Should the NPC say: "ok my hunger is getting high I'll remember that I need something that will help my hunger level (via storing it into a variable)" Then when an apple or some food says "I'll help your hunger" then the NPC goes to eat it [edited by - Nazrix on June 8, 2002 6:08:08 AM]
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
Advertisement
I am kind of leaning toward the 1st possibility cause it may be nice for adding new objects as I go but would that be giving the item too much power?

A CRPG in development...

Need help? Well, go FAQ yourself.


"I''m gay, please convert me." - Nes8bit
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
Wouldn''t that give everyone the same AI? And besides, if a human and an orc are the last two standing after an epic battle, and the orc is slightly more wounded while both are pretty bashed, how would it look if the orc could get that potion of *HEALING* and just swipe it uncontested because the potion decided the orc needed it the most? Such ungodly behaviour!

Perhaps it would be better to just alert the agents with an offer of say "Restore HP", so every agent knows the general functionality of the object and can use it. Many things could have the offer "Restore HP" property, like several types of vials, spells, staffs, fountains, clerics, etc

So in other words, I''d say go with option number 2.

/Apoztel
Discussing, Deciding and Dictating...
I think the second way is better. Not only is it more efficient, but it seeems more natural that NPC dependent code (checking for hunger, etc.) should stay with the NPC. This way, when you add a new kind of NPC you don''t have to change the code for all the objects.
NPCs have needs, goals, etc. These are cross matched to those needs and goals which the objects can provide.

I think it is best if you are very specific about what role an object can fill. And the object should annotate itself according to the way an NPC will perceive it. A certain NPC might perceive it one way, and another NPC might perceive it another way.
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
I haven't read past the first page of the original thread, so perhaps my question is already answered.

What about thinking ahead, like knowing to pack food when leaving home? Prior knowledge and best current practices (until a better way to do things is discovered)?

BTW, yeah, another vote for method 2. What does an apple know about it's ability to feed?


Chris 'coldacid' Charabaruk <ccharabaruk@meldstar.com> <http://www.meldstar.com/ccharabaruk/>
Meldstar Studios <http://www.meldstar.com/> - Creation, cubed.

This message double ROT-13 encrypted for additional security.


[edited by - coldacid on June 8, 2002 11:26:44 AM]

Chris 'coldacid' Charabaruk – Programmer, game designer, writer | twitter

yeah you are all right...That makes much more sense

thanks


This concept seems very powerful. I was also thinking of the fact that even abstract things could be considred "annotated objects". For anstance a sound like a footstep. Also maybe NPCS themselves could be inherited from my "annotated object" class.

About planning ahead, I think that option is there, but I'm not sure how to implement that.

[edited by - Nazrix on June 8, 2002 12:02:22 PM]
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
From what I remember of the annotated objects discussion, it was pretty immense.

Has anyone / is anyone considering writing it up into an article?

Superpig
- saving pigs from untimely fates
- sleeps in a ham-mock at www.thebinaryrefinery.cjb.net

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

superpig: I don''t think so. If you''re volunteering, yay!

If you do, could you see about distilling http://www.gamedev.net/community/forums/topic.asp?topic_id=67961 and adding it''s info to all of this?

Chris ''coldacid'' Charabaruk <ccharabaruk@meldstar.com> <http://www.meldstar.com/ccharabaruk/>
Meldstar Studios <http://www.meldstar.com/> - Creation, cubed.

This message double ROT-13 encrypted for additional security.

Chris 'coldacid' Charabaruk – Programmer, game designer, writer | twitter

quote:Original post by bishop_pass
NPCs have needs, goals, etc. These are cross matched to those needs and goals which the objects can provide.

I think it is best if you are very specific about what role an object can fill. And the object should annotate itself according to the way an NPC will perceive it. A certain NPC might perceive it one way, and another NPC might perceive it another way.


A hungry NPC will eat the apple. A desperate NPC under attack will throw the apple.

The object shouldn''t annotate itself, the perception should be left to the NPC. Diodor''s and Apoztel''s comments made sense to me. You can code the NPC to filter out the improper messages. It seems weird to have the static object thinking while the NPC, who, though not real, is supposed to act logically, not processing.
Although I think I understand bishop_pass, when a new NPC class is created, there may be more ways to interpret an object based on the NPC''s abilities, meaning the object''s code will have to be updated to include another message, but I still think there will be less updating by keeping all the code with the NPC.

This topic is closed to new replies.

Advertisement