Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop detection #66

Open
kevinlul opened this issue Sep 19, 2019 · 5 comments
Open

Infinite loop detection #66

kevinlul opened this issue Sep 19, 2019 · 5 comments

Comments

@kevinlul
Copy link
Contributor

kevinlul commented Sep 19, 2019

The scripting engine needs to be able to "preview" upcoming actions to prevent voluntary infinite loops from being initiated. Abstractly, if playing through an action would result in returning to the exact game state but the game state is not resolved yet, that would be an infinite loop and is not allowed by game mechanics.

This may be prohibitively complex because some infinite loops are permitted to occur while there is net change and then the "offending card" is destroyed when there is no net change. Unbounded uncontrolled loops to increase LP are not allowed, but if there is an effect to convert that into burn damage, it is. Read more: https://yugipedia.com/wiki/Infinite_loop

Examples of such interactions below:

@kevinlul
Copy link
Contributor Author

First reported June 9: Jinzo and Snatch Steal

A illegal loop play that is currently allowed. Core related bug. Voluntary loop. To quote: "Player 1 controls a "Jinzo" which is owned by Player 2, but being controlled by Player 1 due to "Snatch Steal". "Jinzo" is equipped with "Amplifier".

If Player 1 attempts to activate "Imperial Order", the following would occur:

"Imperial Order" negates the effect of "Snatch Steal" ("Amplifier" cannot be negated).
Since "Snatch Steal" is now negated, control of "Jinzo" returns to its owner Player 2.
Since Player 2 now controls "Jinzo" (which is equipped with "Amplifier"), it negates the effect of Player 1's "Imperial Order".
Since "Imperial Order" is now negated, "Snatch Steal" is no longer negated, so Player 1 takes control of "Jinzo".
Since Player 1 now controls "Jinzo" (which is equipped with "Amplifier"), it no longer negates the effect of Player 1's "Imperial Order".
"Imperial Order" negates the effect of "Snatch Steal" ("Amplifier" cannot be negated).
The above sequence would repeat infinitely, with the player who controls "Jinzo" never settling.
Therefore, it is an illegal move for Player 1 to activate "Imperial Order"."

Puzzle to test

@kevinlul
Copy link
Contributor Author

First reported June 9: Jinzo, Royal Decree, and Skill Drain

A illegal loop play that is currently allowed. Core related bug. Voluntary loop. To quote: Player 1 controls "Skill Drain" and a "Jinzo" equipped with "Amplifier".

If Player 2 attempts to activate "Royal Decree", the following would occur:

"Royal Decree" negates the effect of "Skill Drain".
Since "Skill Drain" is no longer negating "Jinzo", "Jinzo" negates the effect of "Royal Decree".
Since "Royal Decree" is no longer negating "Skill Drain", "Skill Drain" negates the effect of "Jinzo".
Since "Jinzo" is no longer negating "Royal Decree", "Royal Decree" negates the effect of "Skill Drain".
The above sequence would repeat infinitely, with which effect is active never settling.
Therefore, it is an illegal move for Player 1 to activate "Royal Decree".

Puzzle to test

@kevinlul
Copy link
Contributor Author

First reported June 9: Pole Position, Snatch Steal, Morphtronic Videon

A illegal loop play that is currently allowed. Core related bug. Voluntary loop. Game will ether exit or crash on loop. 2 Videons on field getting swap around with snatch steal with pole on the field.

Puzzle to test

@kevinlul
Copy link
Contributor Author

First reported June 9: Hyper Hammerhead and Mist Valley Soldier

Q: I increased the level of "Hyper Hammerhead" to 7 and applied the effect of "Diffusion Wave-Motion" to it, using "DNA Surgery" to make it a Spellcaster-Type monster (can also use "Mist Valley Soldier" instead).

When "Hyper Hammerhead" attacked the opponent's "Mist Valley Thunderbird", the opponent activated "Waboku".

In this situation, an infinite loop is created:

  1. "Hyper Hammerhead" attacks "Mist Valley Thunderbird". Battle damage/destruction doesn't occur thanks to "Waboku".
  2. The effect of "Hyper Hammerhead" is activated, returning the opponent's "Mist Valley Thunderbird" to their hand.
  3. "Mist Valley Thunderbird" is Special Summoned from the opponent's hand due to its mandatory Trigger effect.
  4. "Hyper Hammerhead" must attack "Mist Valley Thunderbird" again.
  5. Return to 1.

A: In that case, enter the Battle Phase (you are forced to because of "Diffusion Wave-Motion"), then, you can enter the End Phase even without declaring an attack. It's a special measure to prevent infinite loops.

From JP wiki page for "Diffusion Wave-Motion"

Replay

@NaimSantos
Copy link
Contributor

If you take control of an opponent's monster with any Graydle monster, then use that monster to battle an opponent's Marincess Crystal Heart in the Extra Monster Zone, an infinite Loop is created, as demonstrated in this puzzle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants