Order of triggered actions

In the dragon example I would resolve all interrupts before the hit is resolved, which would cause both players to use and expand their power but kill the dragon before the hit is resolved. It would then attempt to resolve the hit, but be invalidated by the fact the dragon is dead and the action would end there.

What I am currently doing is compiling a list of unusual use cases as well as usual ones and coming up with a model which can solve them all. The basic flow is ok, but there is far more to it then just that.

Some example triggers are:
- move further away from the character
- start/end turn in range
- end turn closer than started
- take X type of damage
- an ally missed an attack and I grant a reroll

So I was thinking of something which tracks events, relative positions, results of event and allows an event to chain back onto itself. Something like this should handle everything I listed there except end turn closer than started.

Also that WC3 example shows how to display the data, but the underlying mechanics behind it are what is most complex.

I think your list is at the wrong level of abstraction. The events that should be reported would be the individual steps where the game state changes. So when a creature moves one square the game state receives a message describing the change. If say a power has created an effect which might be triggered by some kind of movement then a handler for move events would be hooked to the game state and invoked whenever anything moves. Once it has control it can perform tests like "X moved closer to Y" or anything else under the sun. When new elements are added to the game they can simply implement handlers that meet their needs.

As far as retroactive kinds of situations there are a couple things that can happen. First of all paying close attention to the way that events are processed by RAW will help. In the dragon case the rules state that all attack rolls happen, then damage and effects are applied. Strictly following this should work. In some cases there could be things that require rolling back game state to work, like the example of an interrupt triggering on applying damage of an AoE invalidating the attack. One answer would be to use a transactional style of state updates and providing a rollback to a checkpoint. Properly implemented at the core of the game state engine that would be feasible, though not trivial.

One of the key things that comes out of all this is there pretty much needs to be a single unitary game state engine through which all modifications happen in the form of granular events. Performance in that engine would be a critical factor.
 

log in or register to remove this ad

Well, it's a little more complicated than that. Basic attacks & OAs are almost trivial to implement, because they don't really do much of anything aside from damage, and they aren't going to trigger additional interrupts. The meat of the implementation is what happens when an event can trigger multiple immediate actions, each of which can (a) change the conditions of the initial event, and/or (b) trigger more immediate actions. And somewhere in the middle there one of the events gets invalidated by someone else's interrupt.

Speaking of which, and getting back to the OP, I have a rules question. I know how I would play this at the table, but I am unsure as to what the RAW say on the topic.

A dragon breathes on 3 PCs.

PC1 is about to be hit, but uses an encounter interrupt to boost his defenses, turning the hit into a miss.

PC2 gets hit and takes damage.

PC3 is hit and is about to take enough damage to drop, but uses an interrupt to make an attack against the dragon. PC3's attack kills the dragon, which invalidates the attack...

...invalidates it against PC3? Or against all three PCs?

The dragon is dead and PC3 took no damage from the breath.

Does PC1 still have his or her immediate action? Is the encounter power expended? Is PC2 still damaged by the attack? Would the PCs be better off if the attack vs PC3 was resolved first?

The killing attack does invalidate the dragon's attack, as interrupts occur before the attack or action that triggers it.

PC1 does not have their immediate action, because they have used it. They have higher defenses still. You don't have to announce all interrupts at once. You can see how one goes before doing the next.
 

Remove ads

Top