Archived

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

Nazrix

Annotated Objects (Again)

Recommended Posts

Nazrix    307
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]

Share this post


Link to post
Share on other sites
Nazrix    307
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

Share this post


Link to post
Share on other sites
Apoztel    122
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...

Share this post


Link to post
Share on other sites
Diodor    517
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.

Share this post


Link to post
Share on other sites
bishop_pass    109
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.

Share this post


Link to post
Share on other sites
coldacid    755
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]

Share this post


Link to post
Share on other sites
Nazrix    307
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]

Share this post


Link to post
Share on other sites
superpig    1825
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

Share this post


Link to post
Share on other sites
coldacid    755
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
superpig    1825
quote:
Original post by coldacid
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?



eek!

Uhm.. I''ll think about it.

No, seriously... I''ve got the ''portal engine from scratch'' articles to do, and the vague efforts to build a chrome-based forum viewer... maybe once I''ve done those, I''ll look into working on that thread. Of course, I have to understand it first.

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

Share this post


Link to post
Share on other sites
Impossible    134
The Sims uses a system exactly like this one. Instead of characters actively searching for items, items broadcast different signals to the characters. It''s definitely a viable system and I think it would scale nicely to a large RPG.

Share this post


Link to post
Share on other sites