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

Shuriken ability removes all Shurikens at the same time. #426

Closed
lodici opened this issue Aug 18, 2015 · 4 comments
Closed

Shuriken ability removes all Shurikens at the same time. #426

lodici opened this issue Aug 18, 2015 · 4 comments

Comments

@lodici
Copy link
Member

lodici commented Aug 18, 2015

raised in forum by sponeta.

AI had attached two Shurikens to a creature. When the AI activated the ability given by Shuriken ability, both Shurikens were unattached at the same time.

@ShawnieBoy
Copy link
Member

Both Shurikens were unattached right after each other. The second one didn't do any damage, it wasn't targeted, and I didn't get control of it. The original equipped creature was still alive afterwards. It was like the first activation was looking for all cards named "Shuriken" and unattaching them.

Only effecting the AI, ability only refers to the source of the ability, no separate referencing.

@ShawnieBoy ShawnieBoy added the AI label Aug 22, 2015
@ShawnieBoy
Copy link
Member

Unable to duplicate due to #307 crash with TestShuriken and inability to pre-equip/attach permanents with test scenarios.

@melvinzhang
Copy link
Contributor

inability to pre-equip/attach permanents with test scenarios.

You can perform an AttachAction in a test. i.e.

MagicPermanent Kami = createPermanent(P,"Traproot Kami", 1);
MagicPermanent Shuriken = createPermanent(P, "Shuriken", 2); 
game.doAction(new AttachAction(Shuriken, Kami));

Unable to duplicate due to #307 crash with TestShurike

The script for Shuriken is very buggy.

  1. source is carried around by the MagicPermanentActivation and modified by it. This is likely the culprit for the bug mentioned in this thread. A source from the real game will be passed into the AI simulated games and any modifications from the AI simulation games will be reflected in the real game, i.e. AI simulates a future where Shuriken is activated and detached, this simulation leaks back to the real game via the source
  2. MagicPermanantActivation is created anew each time, this causes problems with ordering of choices and leads to Nondeterministic game tree during MCTS expansion #307 MCTS is very sensitive to changes to the order of options generated for each choice, it must be deterministic, i.e. each time a series of moves lead to a choice, the order of options must be the same. As MagicPermanantActivation is sorted by hashcode, creating MagicPermanantActivation fresh each time causes it to be sorted in a different way and lead to a different set of options.

I've been working on fixing the above two issues since yesterday. I don't think there is a really good way to do it. So far the best solution is to move the ability to the Shuriken instead of giving it to the equipped creature.

@melvinzhang
Copy link
Contributor

Fixed in bb40ee3

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

3 participants