AbdulAlhazred
Legend
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.