Modeling events that occur in a game world



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

.



Relevant Pages

  • Re: Fitting CR to a party of 6 PCs
    ... creature I'd use in such a situation is going to have, ... that can comphortably grapple at -20 without fear of retaliation. ... in order to attack one. ... enough grapple check to fight effectively this way... ...
    (rec.games.frp.dnd)
  • Re: Modeling events that occur in a game world
    ... may or may not have a Creature. ... attack other Creatures. ... with new events as my game grows more intricate. ... have you considered using a database? ...
    (comp.object)
  • Re: Modeling events that occur in a game world
    ... cares what happened and has an appropriate response to it. ... For example, if a creature attacks another creature, any other ... who are friends with the target and are within range to see the attack ... how to encode any data packet and whoever receives the event will know ...
    (comp.object)
  • Re: Modeling events that occur in a game world
    ... may or may not have a Creature. ... attack other Creatures. ... with new events as my game grows more intricate. ... not an Event Message architecture. ...
    (comp.object)
  • Re: Architecture OOD
    ... >> on every creature it hits. ... > actors to take special steps just to attack with that sword. ... selecting the <usage> when you invoke those actions. ... in the interface to allow non-obvious things, ...
    (rec.games.roguelike.development)