time out for token triggers
There are a lot of posts stating that there is an issue when token doubling causes an exceptional amount of stack triggers.
I have a proposed solution in your coding:
You should treat any trigger that is
-a duplicate
-repeated more than 10 times in a row with no interceding trigger
-stacks on top of such a trigger
-the 250 token limit has been reached
Then, ask each player in succession of priority whether they want to break the "infinite loop triggers", acting as if they are infinite.
Give the players a "stop point" (i.e.- after how many triggers would you like to place a stop?) and each player gets ONE interaction to stop the loop if so desired.
during THIS interaction, keep the timers active as normal.
once each player has responded, pause the clocks and resolve the triggers (and skip the visuals before and after the "infinite loop" stop)
then, restart the clocks. This should reduce server lag, as I am sure that the visuals of tracking the triggers while also representing them visually becomes a bandwidth hog. If you could get both players to trigger an override once it has been determined that neither player wants a delay-of-game to end their next turn or force a concede to their opponent, and would opt to skip visuals in favor of a more interactive gameplay experience, you would not only fix the issue, but allow the players to have a say in the event that they wanted most, but not all of the triggers to resolve before an interaction (as, when a player can deal 10 damage if the opponent has exactly 10 life, but then waiting until "gain life" triggers got the opponents' life total to exactly 10 and then breaking the chain to interact).
You will also reduce server lag and improve the overall player experience.
I am proposing a solution because this interaction has lost me several ranked games where I should have won on my next turn (or later in the saem turn), but the timeouts have caused me to pass through the end of my turn and/or concede on my next one - WITHOUT ANY USER INPUTS.
so, I am penalized for allowing the game to do what it does within the rules, but the engine you have built can't run the game you have built.
Please address this issue - it also lost me games in the Historic Metagame Challenge, meaning decks that win are underrepresented because they don't win when played inside arena, but DO win elsewhere.
To reproduce this, play two lifegain decks against each other, then, have each player play a creature that scales with lifegain (ajani's pridemate, voice of the blessed, etc.) or one that scales with creatures that enter (skyknight squire) - or both (as is common with some of these decks). Then, give an ocelot pride or an exalted sunborn offspring and play them. If each side has a life-gainer out (soul warden, authority of the consul, Case of the uneaten feast, etc...) then when the token-double-double-double-double effects start to stack, the game will keep both timer clocks running.
BUT, whoever had priority when the triggers BEGIN STACKING loses the game...
...non-negotiably. Every time.
When over 1,000 triggers hit the stack, mainly because several permanents are reacting to the 250-token limit's triggers, your engine's protocols break down completely - likely due to the bandwidth surrounding accurately tracking and representing the triggers VISUALLY.
The only exploit you could have is if someone knew this to be true about your software (as I do), and chooses to let the triggers run... but if they set a stop point, you could skip to that point, ask that player again, and if they had no interaction, skip to the end.
and only the player who stopped the cycle of triggers would have their clock run - and only during the cycle's interruption.
otherwise, the "battle clock" that governs game time would not run for either player until the trigger cycle has resolved.
I welcome your feedback to my thoughts for how to solve this pervasive and persistent issue.