Archived

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

superpig

Natural State

Recommended Posts

I don''t know if this is a common technique, something that''s been discussed before, an extension of annotated objects, or what... Playing a game, I can open a door into a room. That room has an enemy inside. He is in such a position that he can see the door open, but cannot see me. He does not act, because he cannot see me. In the facility which this door and room are a part of, that particular door is usually closed. You pick any given time on any given day, probability is 10:1 that the door will be closed. You could almost say that its ''normal'' or ''natural'' state is ''closed.'' So, shouldn''t this enemy react to the fact that the door is not in it''s natural state? I guess what I''m proposing is a sort of finite state machine, but for each and every object in the game. An object can define it''s own states. Some states are ''acceptable,'' some states are ''unacceptable,'' some states are ''threat,'' and some states are ''imminent danger.'' The AI strives towards putting each object into an acceptable state. A mounted gun turret, when turned on, is ''threat'' - so the AI wants to turn it off, reducing the state to an ''acceptable'' one. A hydrogen tank is about to rupture and explode. The state is ''imminent danger'' - the AI chooses to run away, and the state resolves itself into ''acceptable'' (i.e. once it''s exploded, it''s safe to go near). 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
quote:
Original post by superpig
I guess what I''m proposing is a sort of finite state machine, but for each and every object in the game. An object can define it''s own states. Some states are ''acceptable,'' some states are ''unacceptable,'' some states are ''threat,'' and some states are ''imminent danger.'' The AI strives towards putting each object into an acceptable state.

Well, with most objects, they already are finite state machines. What you need to add is a description of each state that your NPCs can query, and compare with a ''satisfactory'' value. Each item might return a current and a default state, and any difference between the two would make the NPC investigate. How the NPC goes about changing the state of the object if desired might be done in any number of ways, including the annotated object concept discussed before.


[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites