Author Topic: Triggers  (Read 9911 times)

zatikon

  • Administrator
  • Full Member
  • *****
  • Posts: 55
    • View Profile
Triggers
« on: May 30, 2009, 12:29:45 PM »
The present triggering system is too arcane, and we've been playing around with ideas to make it more intuitive.

A new system would be a long term project, and as part of the design process I'd love some feedback and suggestions from you guys.

One idea we've had is to implement a stack style system, similar to what Magic the Gathering uses. In that system, all triggers that can trigger will trigger, building a stack of effects to resolve on a Last-in-First-out basis. This way, effects that don't explicitly cancel other actions won't. For example, a Lancer shot down by a Tower would still resolve his Joust trigger.

Cancellations would occur by targeting specific actions on the stack. If you attack a rogue, you would place his Dodge trigger on the stack. When Dodge resolves, it would flag the Attack action (which resolves later) as being canceled.

As this model develops, I'll keep modifying this first post with an updated proposal.

Thanks in advance!
Gabe

glunkr

  • Jr. Member
  • **
  • Posts: 36
    • View Profile
Re: Triggers
« Reply #1 on: May 30, 2009, 01:22:28 PM »
Yes, this is the best idea. It makes everything easier to predict. For instance:

Shield Maiden is next to the unit it is protecting and a fireball hits both of them. The Shield Maiden's shield ability should protect the other unit even if the shield maiden dies from the fireball.

From your explanation, I'm pretty sure my example would be correct since the Shield Maiden's shield ability would go on the stack after the fireball, and therefore resolve before the fireball damage is triggered.

This would really make things clearer and I'm really looking forward to it.

Kran

  • Sr. Member
  • ****
  • Posts: 397
    • View Profile
Re: Triggers
« Reply #2 on: May 30, 2009, 05:37:01 PM »
Very good. But then what going to happen if a rider captures a castle defended by a tower? Somethings would still cause confusion. But anyway its very better than the actual system.

Jezebeau

  • Full Member
  • ***
  • Posts: 84
    • View Profile
Re: Triggers
« Reply #3 on: May 30, 2009, 06:21:35 PM »
Stack is a good idea if done properly.  My major concern with it is that you'd need to be very clear with players about triggering order of competing passive effects, such as whether it's attacker's or defender's attacks first, or if there's a spell/skill/non-type priority.

@Kran: Capture would go first on the stack, anything that would then target the unit landing on that space would be resolved before capturing would, and the castle would only be captured if there was a valid alive on the castle after everything resolved.  As zatikon said, it's a long-term project and we'll be involved in finding any problems.

(As an afterthought, if your pikeman/bowman/tower kills a unit landing on the castle and you have a dracolich in play, do you get a non-gate-guard unit on the castle?)

Kran

  • Sr. Member
  • ****
  • Posts: 397
    • View Profile
Re: Triggers
« Reply #4 on: May 30, 2009, 07:46:21 PM »
@Jezebeau yes. Also if ballista push ally to castle. Anyway, you cant transform magus to spirit while in castle or make templar indestructible.

zatikon

  • Administrator
  • Full Member
  • *****
  • Posts: 55
    • View Profile
Re: Triggers
« Reply #5 on: May 31, 2009, 04:05:51 PM »
How about this sequence:

As soon as a trigger begins (and everything will be a trigger, using a unit action is just a deliberate trigger) the effect stack opens. Once all the effects resolve and the stack is empty, the game checks for unit deaths, and then victory condition.

Unit deaths are also a source of triggers. I'm not sure how to integrate that.

Jezebeau

  • Full Member
  • ***
  • Posts: 84
    • View Profile
Re: Triggers
« Reply #6 on: May 31, 2009, 04:55:30 PM »
A unit death is a separate trigger.  It starts a new stack.

For an effects stack to work, it'll need to check for unit deaths as each effect resolves, so that effects don't target dead units.

glunkr

  • Jr. Member
  • **
  • Posts: 36
    • View Profile
Re: Triggers
« Reply #7 on: May 31, 2009, 07:10:31 PM »
I agree with Jezebeau. For clarification:

1. Actions go on stack, then resolve FILO.
2. When stack is empty check for unit deaths, and add their triggers to the stack.
3. Iterate steps 1 and 2 until no more units die.
4. Check for victory condition.

Jezebeau

  • Full Member
  • ***
  • Posts: 84
    • View Profile
Re: Triggers
« Reply #8 on: May 31, 2009, 07:34:09 PM »
For further clarification, each time a new effect is triggered, it is added to the stack immediately after the trigger resolves, effectively at the level of the trigger.  This may prompt further triggers that would add to that stack.

zatikon

  • Administrator
  • Full Member
  • *****
  • Posts: 55
    • View Profile
Re: Triggers
« Reply #9 on: May 31, 2009, 07:45:15 PM »
Quote
For an effects stack to work, it'll need to check for unit deaths as each effect resolves, so that effects don't target dead units.

Wouldn't that cause cancellations?

Should costs for the action be paid at trigger time or during resolution?

Jezebeau

  • Full Member
  • ***
  • Posts: 84
    • View Profile
Re: Triggers
« Reply #10 on: May 31, 2009, 08:24:32 PM »
Yes, it could cause cancellations, but that's important since setting the triggers up right is the only tool we have to cancel them.  Trigger costs should be paid at trigger-time to increase tactical options.  At the very least, they need to be committed at trigger-time so you don't get defenses going off more than once in a stack.

glunkr

  • Jr. Member
  • **
  • Posts: 36
    • View Profile
Re: Triggers
« Reply #11 on: May 31, 2009, 08:41:11 PM »
For further clarification, each time a new effect is triggered, it is added to the stack immediately after the trigger resolves, effectively at the level of the trigger.  This may prompt further triggers that would add to that stack.

This didn't clarify anything for me. Can you maybe give an example of what you mean?

zatikon

  • Administrator
  • Full Member
  • *****
  • Posts: 55
    • View Profile
Re: Triggers
« Reply #12 on: May 31, 2009, 09:51:01 PM »
One of the goals of the new system is to prevent non-explicit cancellations. I don't think death should prevent that unit from triggering, or being a trigger target.

An effect against a dead unit would still be valid because its not dead until the empty-stack resolution.

Lunaraia

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
Re: Triggers
« Reply #13 on: May 31, 2009, 10:07:30 PM »
OK here is an example abut the stack thingy they talk about: Let's use a Tower with only 1 hp left, a Lancer and the old sergant to make the explenation, new sergant can't drag, so to make this workable I had to use the old one

1st stack, sergant rallies lancer
2nd stack, sergant moves into tower range, trigger attack, trigger rally, lancer moves, cancel attack from tower since it is lower in the staack then the first attack, thus a second attack can't happen, lancer moves and joust attacks tower, killing it.

Providing they haven't changed the trigger prioerties of the lancer, this is what should happen

Current version: tower is destroyed, Lancer is not attacked.

New Version: Tower is destroyed, Lancer is attacked.

and that should be what happens, right?
Bad guys are no problem when you're an asshole yourself

Jezebeau

  • Full Member
  • ***
  • Posts: 84
    • View Profile
Re: Triggers
« Reply #14 on: May 31, 2009, 11:12:51 PM »
For further clarification, each time a new effect is triggered, it is added to the stack immediately after the trigger resolves, effectively at the level of the trigger.  This may prompt further triggers that would add to that stack.

This didn't clarify anything for me. Can you maybe give an example of what you mean?

The most explicit example I can think of would be:
>Warrior with 1 life attached to longbowman attacks heretic.
-->Warrior attack triggers longbowman attack.
-->Longbowman attack resolves, damaging heretic.
-->Heretic triggers, reducing life of all opposing organics by 1.
-->Warrior dies.
>Warrior is dead, attack is cancelled, heretic survives with 1 life.