Modeling events that occur in a game world
- From: "Aaron J. M." <ajmacd@xxxxxxxxxxxxxxx>
- Date: 21 Apr 2007 10:24:32 -0700
I need a way of representing and tracking different events that occur
in a game
I'm working on. I have a world composed of one or more Maps. Each
Map location
(coordinate) may or may not have a Creature. A Creature is controlled
by an AI,
which may also be the player's UI, though the Creatures themselves are
not
necessarily aware of their AIs. Creatures may move to different
coordinates or
attack other Creatures.
Right now the two events I know I'll want to keep track of is when a
Creature
attacks another Creature and when a Creature dies, and I see myself
coming up
with new events as my game grows more intricate. Different parts of
my game
would be interested in different kinds of events. The graphical
display would
be interested in all events so that it may display an appropriate
animation.
More importantly, the different AIs would need to observe recent
events to
modify their behaviour. If a Creature is attacked, the AI controlling
it has a
vested interest in knowing about it.
I'm having trouble modeling this because the different kinds of events
would
keep potentially arbitrary information, making it hard to generalize.
An attack
event would know the attacking Creature, the target Creature, and the
amount of
damage done. A death event would just know the Creature that died. I
might
also implement Creatures grabbing and throwing other Creatures, so a
throw event
would need to know the throwing Creature, the thrown Creature, and
where the
thrown Creature landed. For this reason I can't really make them
subclasses of
a single Event class, since they hold such different information.
So how would I model these events and let my system handle and respond
to them?
Thanks
.
- Follow-Ups:
- Re: Modeling events that occur in a game world
- From: topmind
- Re: Modeling events that occur in a game world
- From: topmind
- Re: Modeling events that occur in a game world
- From: Alvin Ryder
- Re: Modeling events that occur in a game world
- From: H. S. Lahman
- Re: Modeling events that occur in a game world
- From: Dmitry A. Kazakov
- Re: Modeling events that occur in a game world
- From: Leslie Sanford
- Re: Modeling events that occur in a game world
- Prev by Date: Re: OO-Inquisition
- Next by Date: Re: Modeling events that occur in a game world
- Previous by thread: C Object System
- Next by thread: Re: Modeling events that occur in a game world
- Index(es):
Relevant Pages
|