Chronic Logic

Zatikon => Zatikon Discussion => Topic started by: zatikon on May 30, 2009, 06:29:45 PM

Title: Triggers
Post by: zatikon on May 30, 2009, 06: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
Title: Re: Triggers
Post by: glunkr on May 30, 2009, 07: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.
Title: Re: Triggers
Post by: Kran on May 30, 2009, 11: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.
Title: Re: Triggers
Post by: Jezebeau on May 31, 2009, 12:21:35 AM
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?)
Title: Re: Triggers
Post by: Kran on May 31, 2009, 01:46:21 AM
@Jezebeau yes. Also if ballista push ally to castle. Anyway, you cant transform magus to spirit while in castle or make templar indestructible.
Title: Re: Triggers
Post by: zatikon on May 31, 2009, 10: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.
Title: Re: Triggers
Post by: Jezebeau on May 31, 2009, 10: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.
Title: Re: Triggers
Post by: glunkr on June 01, 2009, 01:10:31 AM
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.
Title: Re: Triggers
Post by: Jezebeau on June 01, 2009, 01:34:09 AM
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.
Title: Re: Triggers
Post by: zatikon on June 01, 2009, 01:45:15 AM
QuoteFor 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?
Title: Re: Triggers
Post by: Jezebeau on June 01, 2009, 02:24:32 AM
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.
Title: Re: Triggers
Post by: glunkr on June 01, 2009, 02:41:11 AM
Quote from: Jezebeau on June 01, 2009, 01:34:09 AM
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?
Title: Re: Triggers
Post by: zatikon on June 01, 2009, 03:51:01 AM
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.
Title: Re: Triggers
Post by: Lunaraia on June 01, 2009, 04:07:30 AM
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?
Title: Re: Triggers
Post by: Jezebeau on June 01, 2009, 05:12:51 AM
Quote from: glunkr on June 01, 2009, 02:41:11 AM
Quote from: Jezebeau on June 01, 2009, 01:34:09 AM
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.
Title: Re: Triggers
Post by: Jezebeau on June 01, 2009, 05:25:32 AM
We have non-explicit trigger combinations.  Wouldn't preventing non-explicit cancellations add to RPS?  Army design would be significantly less interesting if everyone needed to have a rider, a shield-bearer, a catapult, a fanatic, et cetera to provide explicit counters to all the problem RPS units.
Title: Re: Triggers
Post by: zatikon on June 01, 2009, 10:38:01 AM
QuoteWe have non-explicit trigger combinations.  Wouldn't preventing non-explicit cancellations add to RPS?  Army design would be significantly less interesting if everyone needed to have a rider, a shield-bearer, a catapult, a fanatic, et cetera to provide explicit counters to all the problem RPS units.

I just mean that the only thing that can cancel an effect is another effect that directly states that it cancels effects. I don't see how this promotes RPS balance. It'll affect some in-game mechanics in unforeseen ways, but that's why we're discussing it. I imagine the biggest impact will be on units with Vigilance all striking a unit with damage beyond what's necessary to kill it.
Title: Re: Triggers
Post by: glunkr on June 01, 2009, 11:39:11 AM
Quote
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.

I would prefer it if the warrior attack still went through, even if the warrior died in the middle of it. I have a few reasons:

1. It makes more sense conceptually. How can a longbowman successfully attack when the warrior doesn't even hit?

2. It gives too much precedence to defensive units. Take for instance a new unit.... call it a Thorn Bush. Whenever you attack it from range 1, it deals you damage. Under your system if you don't have enough health to survive the counter-attack you die before dealing damage. I would prefer it that in all cases, you still damage the Thorn Bush, even if you die. That way, there is a difference in the Swordman's parry ability and the Thorn Bush.
Title: Re: Triggers
Post by: zatikon on June 01, 2009, 12:13:12 PM
I've run into some gotchas with the system.

Who killed my Martyr?
Two Pikemen strike a moving Martyr. The stack builds, both their attacks resolve, and the stack is empty. During death resolution, which Pikeman is the murderer?

Possible solutions:
They both did it. During death resolution, all units that damaged the deceased during the stack are flagged as its killer.
Pros: The player doesn't need to understand the arcane innerworkings of automatic sequencing to predict the outcome.
Cons: It would change the balance of triggered attacks and Martyrs

He did it. The unit that first inflicted lethal damage on the Martyr is flagged as its killer.
Pros and Cons: opposite of "They both did it"

Which attack was healed?
A player has a Warrior and Healer, and the Warrior takes a move that causes a Tower and a Pikeman to strike it. The Pikeman is power 4, and the Tower is power 3. How much life does the Warrior have now?

Possible solutions:
Temporary overhealing. All heal effects on a stack will add the unit's Max Life attribute to its current life. During Death Resolution, any Life above Max Life is lost.
Pros: The player will be able to predict the outcome of the action without having to know which effects happen in what order.
Cons: Triggered healing will become more powerful by creating an extra damage buffer. The mechanic is also somewhat counter-intuitive.

Dueling Dracolichs
Two players in a Cooperative game have a Dracolich. An enemy unit dies. Which player gets the risen enemy?

Possible Solutions:
Staggered sequence. The trigger priority for the failed Tomb Lord effect increases, so the Dracolichs will alternate which one gets the risen enemy.
Pros: One Dracolich doesn't cancel out the other.
Cons: It's difficult for the players to predict which one will go first.
Title: Re: Triggers
Post by: Kran on June 02, 2009, 07:49:12 PM
Krans Ideas about the tigger.

First. Attacks and conterattack, all are damaged, no matter if allready died. This include the longbowman, the swordman counterattack, vigilants.

Second. Things that tigger from damage. So, if survive until here, healer heal tiggers. Same aplyes to heretic, but this one dont need to stay living to tigger. Two attacks performed againt a heretic at once, counts as only 1 damage. (Units+longbow) Everything is tiggered now, but just happens truely at third. Everything over the maximum life is lost.
Same aplyes to martyr death too, all are tiggered in end.
Now units that fought bravely have to go or to the hell or to the heaven.FS make ally return and everything is performed at end of stack. Death triggers now trigger, but really just happen in third. Explosions caused by the new unit in development now tigger, and units will receive damage in Third. Now that mourners will give life to units that still alive now when unit died in first. Note that this give life to units that would die cuz of reckining, becouse that still going to happen. And maybe now they will not exactly die. (Third)

Third. Now things that was tiggered at second happen. Now the healer that performed the heal can die cuz of heretic, and if warrior hit swordsman and martyr, the healer will still loose the ability cuz of parry even if the warrior is going to loose anyway cuz of martyr. Now mourner still give life to allyes, even if he will die on reckoning too. Mourner lament and heretic reckoning would "cancel" each other now.

It is very easiest than actual tigger system. That looks complex cuz of i made all possible things to happen. Looks easyer if i simple say that: First attaks, later tiggers from attacks/damage/death. Then such effects happens.

Also, in 2 dracolichs i cant see a solution. Maybe remove ranking points from both, cuz of wasting 550$ with second dracolich :P. lol. Kidding. I like it alternated. Last dracolich to deploy would get the first risen one.

I dont think the healer thing could be counter-intuitive. With this system, healer would heal completely the ally if the survives after all attacks in stack. Also if 2 units affected by damage in same stack, they are all healed. If warrior attack swordsman and martyr, the healer ability is spent, no matter if the warrior dies anyway with martyr.

As my proposal tigger system, as much as things that happen once per turn (Healers, acolyte, shield maiden, archangel's aegis) happen to all units affected in a stack, martyrs should kill both of pikemans. Also if another unit that is not a martyr was killed by both, both will get in range of confessor.

Feathered serpents would make all units return to castle when all die in a fireball, warrior attack, lancer attack, etc.
Title: Re: Triggers
Post by: Kran on June 02, 2009, 08:05:18 PM
In my tigger system, Warrior and longbowman would attack the heretic, so, it will die. Heretic reckoning tiggers only once, cuz its would be tiggered by damace per stack. If people do not understand the tigger system it will simple make heretic get hurt by 5+3, longbowman life reduced by 1 and warrior dead. Thats exactly what people is talking about, i just writed everything formally. Hope I can get some opine about it.
Title: Re: Triggers
Post by: glunkr on June 02, 2009, 08:42:28 PM
I think Kran has a good point about lumping together damage that happens at the same time, such as unit+longbowman and spearman+tower. That makes sense.  I think it is fair for the martyr to kill two spearmen if they both attack it simultaneously. It also seems fair that the heretic only gets to lower life once for two simultaneous attacks. And I also don't mind if healing occurs after the simultaneous attacks. The Feathered Serpent might be slightly overpowering if it makes lots of units return... but who knows, it might be ok. In reality, it wouldn't return more than 1 unit very often.

If that isn't desirable, then it would be best to implement some kind of common-sense "tie-breaker." Perhaps you could break a tie by range. So if a tower hits a unit from range 3 and a spearman hits the unit from range 1, the spearman hits before the tower for tie-breaking purposes. I don't know how to break a tie between two spearmen that attack from identical range though.

For the dracolich, why not make the risen units go to the player who made the kill? So if my ally and I both have a draco, but my unit makes the kill I will get the risen unit.
Title: Re: Triggers
Post by: Kran on June 02, 2009, 09:15:46 PM
Man! How i did not thought about giving unit to who make the kill! About the FS, i think it would still be fine. We allmost dont see FS in constructed, so, this little boost will not cause overpowered.
The tie-broke is nice, but becouse of same range ties, that would get complicated. If closer units attack first, so, the unit that is far will attack later. That would cause 2 hits, and in a tie, what could happen? 1 hit only? What happens with the acolyte? Its underpowered now, just a bit. With this tigger system, the acolye could reduce all damage inflicted in the stack to 0. Thats a little, almost imperceptible boost. The greater change would be in pikeman, tower, martyr, lancer, warrior, longbowman, heretic, healer.
Title: Re: Triggers
Post by: zatikon on June 03, 2009, 04:03:53 AM
Damage/healing application could be a phase of empty-stack resolution, before the check for death phase.
Title: Re: Triggers
Post by: Kran on June 03, 2009, 09:32:50 AM
Quote from: glunkr on June 02, 2009, 08:42:28 PM
For the dracolich, why not make the risen units go to the player who made the kill? So if my ally and I both have a draco, but my unit makes the kill I will get the risen unit.

Thinking well, that cant be used. Who would take the risen unit if two pikemans one mine other ally kill the enemy? Maybe the best sollution be alternating anyay... Anyway i think that will be very rare.
Title: Re: Triggers
Post by: zatikon on June 03, 2009, 03:26:19 PM
The Dracolich puzzle exposes a deeper problem though: mutually exclusive triggers. The alternation solution is the only thing I can think of to solve it.
Title: Re: Triggers
Post by: Kran on June 05, 2009, 01:36:16 AM
The old dracolich could help resolving some problems. Else this unit means a complete loss in 1v1. Maybe 3 actions, maybe more life. With 550$ less points to spend, thats hard to cause trades, enemy will allways cause pressure and make you retreat... until you cant anymore. It need something enought good to cause pressure, something that would make allyes to support pressure and counter-attack.