Saturday, May 15, 2010

Turn Order, Events, and Such - Ramblings

So been working on my battle tracker javascript program. Ran into a technical difficulty caused y an architectural choice. I developed the notion of secret tracker entries that controlled timed effects. These tracking entries would automatically do things like increment conditions and so on. The problem comes up with delaying. When someone has several tracking actions these actions happen automatically when their turn comes up, but a person who is delaying should be able to act before these tracking events go off. For example, Controller A puts an effect on a target that lasts until the start of Controller A's next turn. Striker B wants to delay but also wants to take advantage of this effect. What will happen with my current design is the the effect will turn off because Controller A's turn will start and Striker B will not act while this effect is on. Currently entries do not actually remove entries and just increment them so there is no actual problem in running combats, but this prohibits automatic removal and corrupts the underlying data model.

One possible situation is to have tracking events go AFTER the event that inspires them. This might make sense.

Anyway, this made me start thinking about various conditions and effects and I wanted to oput my thoughts in text.

There are essentially four types of persisting effects that I can think of: a condition you can save against, a condition that lasts until the end of your next turn, a condition that lasts until the start of your next turn, and a condition that lasts for the rest of the encounter. Everything else is an effect confined to your turn or action.

So the question becomes how do these effects interact with delaying and readying. Okay, readying is simple since you basically resolve your turn.. But delaying is a little more complex and forces you to look at the structure of a turn. A turn basically consists of three phases: a start, an action section, and an end. The Start includes ongoing damage and regeneration. The Action section includes your three basic actions and their effects. The End includes saving throws and the end of sustained durations.

A Delay action happens after you Start. This has some interesting ramifications. You can not avoid the ongoing damage by Delaying, but the ongoing damage for the next turn is put off possibly allowing you to be healed in the meantime. It also slows down any regeneration. Although this effect is of note it doesn't really matter that much in terms of durations. If something ends at the Start of your turn Delaying will not stop it automatically turning off when your turn comes up. The End phase is more complex. Effects beneficial for you and sustained duration effects end. (Another interesting effect is that Delaying is really unattractive is you have sustainable powers.) Effects that are negative only end when you take your Delayed action. The book mentions an enemy stunning you as an example, but that is a bad example because you can't actually Delay when stunned. Let's generate an example that is almost as bad. Let's say an enemy Blinds you UENT. Your action comes up and you Delay. The enemy's turn comes up and you are no longer Blind. You can then take you Delayed action while not Blind. So the 'you can't Delay out of harmful effects" actually only applies to harmful effects you put on yourself. Let's take a slightly better example, Heedless Fury gives you a -5 on all your defenses. If you Delay you keep this penalty until you take your action. This is also kind of a crappy example so I will generate a goo, but hypothetical example. Suppose you have a power that causes you to go blind UENT. When your turn comes up you can Delay because you can take actions, but you can not use the Delay to escape the Blindness unlike in the example above where you were Blinded by an enemy. Frankly, I am not sure if there are examples like this in the game, but I expect that this rule is 'defensive' to prevent a hypothetical abuse.

So one question: Can you launch UENT or USNT actions from a free, immediate, or opportunity action? I will have to keep an eye out for that kind of effect since it will impact the program. Well, you can definitely launch such an effect from a Readied action which is technically immediate, but it is modeled as a whole action by the program and it resets initiative so this works nicely.

Okay, back to software. If I change the architecture of my little program to not have 'tracking entries' but instead have effects tied directly to the Start and End this reflects the game better. My notion of tracking entries actually fits with 3.5 and not 4.0 since in 3.5 you have effects that essentially get their own initiative since you Delay to be out of synch with them.

When your turn comes up naturally all your USNT effects should turn off. You then have 3 choices. If you take your turn or ready an action ALL your UENT effects should turn off. If you Delay your positive UENT effects should turn off. If you either take your delayed action or you delayed action is lost when you go to the top of the order all your negative UENT go off. So you can actually have your UENTs go off right before your USNT would go off. Course you probably wouldn't have any USNTs because you didn't act.

Note, you can not Delay in front of yourself. This would allow you to basically allow you to skip your Start phase if you Delayed the entire round.

So this leads to each entry having a list of effects that can be triggered by specific FSM transitions. Back to coding!

1 comment:

Will said...

Crap, this helps only marginally because you still have USNT events going off before you have the chance to Delay. You could query if the Delayer wants to take the action, but that would suck. So USNT removal has to be reversible. Also the question of whether you can Ready to act before someone goes comes up. I am going to say no.