It is currently 19 Apr 2024, 07:45
   
Text Size

RFC: Adding planeswalkers by generalizing redirection rule

Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins

RFC: Adding planeswalkers by generalizing redirection rule

Postby melvin » 18 Feb 2013, 12:54

Planeswalkers are an interesting card type, for the longest time we've avoided adding them to Magarena because of the increased complexity in combat due to having to declare which planeswalker a creature is attacking.

While reading the comprehensive rules for planeswalkers, I realized we could generalize the redirection rule to use it for combat damage as well. This pushes the decision to the combat damage step and does not require any UI changes in the declare attackers step or additional AI logic. Since the redirection rule has to be implemented anyway, using it for combat damage as well seems to be simple a change that can fit in the current design of the engine.

Would folks be interested in having planeswalkers in Magarena under a modified damage redirection rule?

The modified rule is as follows:
306.7 (modified). If noncombat damage would be dealt to a player by a source controlled by an opponent, that opponent may have that source deal that damage to a planeswalker the first player controls instead.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby Aswan jaguar » 18 Feb 2013, 14:53

If I understand correctly the problem is that only when damage is resolved defending player will know which creatures are attacking player or planeswalker but then it would be too late to change something so it will change the strategy a lot and when the attacking creatures could be making a lethal attack you will be obliged to block while AI is attacking to a planeswalker that is considered a great threat.If that is the case unfortunately I really can't tell if I will like this modified damage redirection rule before I can try it out although I don't mind other important Magarena's rules alteration.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby jeffwadsworth » 18 Feb 2013, 16:37

Perhaps you could add a test Planeswalker for us to test out. If this pans out, it would be fantastic.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby melvin » 25 Feb 2013, 01:43

Had a great 4 hours of working on Magarena yesterday and manage to implement support for planeswalkers. The current daily build for the upcoming 1.36 now includes two planeswalkers, Garruk, Primal Hunter and Elspeth, Knight-Errant.

You can download the daily build from https://buildhive.cloudbees.com/job/mel ... a-1.36.zip I'd appreciate any comments or feedback on how planeswalkers are implemented with the modified rule.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby melvin » 25 Feb 2013, 14:09

Was randomly reading articles on Planeswalkers, when I came across https://www.wizards.com/magic/magazine/ ... aily/mr304

Imagine my surprise when I read the letter by Matt Cavotta to the Design Team
Matt Cavotta wrote:Potential Planeswalker Card Type Rules

1) Whenever an attacking creature deals damage to a player, that creature's controller may have it deal its damage to a Planeswalker instead.

2) Planeswalkers may be targeted as if they were players.

3) When a Planeswalker takes damage put [Damage] counters on it equal to the number of damage it has taken. If a Planeswalker has a number of [Damage] counters equal to or greater than its [Walk number] remove it from the game.

4) Planeswalker cards are not "under a player's control"

5) Planeswalker cards are legal in all formats (a long shot, but our best way of indicating the ability to travel between blocks/planes.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby jeffwadsworth » 25 Feb 2013, 17:18

AI played Elspeth and immediately removed 8 charge counters to use its Ultimate.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby melvin » 26 Feb 2013, 02:17

jeffwadsworth wrote:AI played Elspeth and immediately removed 8 charge counters to use its Ultimate.
Thanks for catching that. I was twiddling around with the starting number of counters to test some of the abilities and I forgot to set it back to 4.

Fixed now, the corrected script is at https://magarena.googlecode.com/hg-hist ... Errant.txt (download it and overwrite the script in Magarena/scripts folder)
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby Aswan jaguar » 26 Feb 2013, 04:53

One time while testing Garruk on my side and AI attacked with Miri Cat and I couldn't block AI did not damage(no info of redirection either)me or the plainswalker it happened just once but I thought I would mention it as I saw well the board and there was nothing preventing the damage,I undo it and repeated 3,4 times the result was the same each time.Other time Miri did damage the plainswalker.At first I thought that maybe there is a problem with first strike and plainswalker.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby melvin » 26 Feb 2013, 06:14

Aswan jaguar wrote:One time while testing Garruk on my side and AI attacked with Miri Cat and I couldn't block AI did not damage(no info of redirection either)me or the plainswalker it happened just once but I thought I would mention it as I saw well the board and there was nothing preventing the damage,I undo it and repeated 3,4 times the result was the same each time.Other time Miri did damage the plainswalker.At first I thought that maybe there is a problem with first strike and plainswalker.
Thanks for play testing and the report, I'll test more with first strikers and planeswalkers to see if I can replicate the problem.

Just implemented Gideon, Champion of Justice from Gatecrash. To try it out, replace your Magarena.exe with https://buildhive.cloudbees.com/job/mel ... garena.exe and add the scripts for Gideon[1] to Magarena/scripts

[1]
https://magarena.googlecode.com/hg/rele ... ustice.txt
https://magarena.googlecode.com/hg/rele ... ice.groovy
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby melvin » 26 Feb 2013, 13:26

@Aswan jaguar I can't seem to replicate the missing damage for creatures with first strike. Do attach a copy of your game.log file here if you manage to come across the bug again. Thanks!
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby Aswan jaguar » 26 Feb 2013, 15:40

1st case: There you go for the no damage from creature neither to plainswalker nor to player.AI attacked with Baneslayer Angel and White Knight and I block the knight with Blight Mamba and I regenerate it if I use regeneration effect then the unblocked Baneslayer Angel will do no damage.If I don't use regenerate ability then damage to plainswalker is applied.see game.log

- Bad redirection decisions as AI will always use all of it's creatures to attack to plainswalker.(for example for 3 loyal counters AI spends 5 creatures X2=10 damage points) instead of choosing only as much as needed to destroy the plainswalker.
- Also can't you code it so that redirection can only happen if attacking creature isn't blocked?as it should be.(unless you have but it's not perfect yet)

2nd case: EDIT in the 1st picture below you can see that 3 creatures of AI are unblocked only one redirects damage to the plainswalker (the messages said so,too) but as you can see from pic.2 I have not lost any life points from White Knight that didn't redirect damage and none from the token soldier and the plainswalker has lost only 4 loyalty counters from Student of Warfare so the creatures that were decided not to redirect damage never did damage to me.
(the fact that AI can choose some to redirect damage and some not is certainly a + :D )

EDIT- There is also something fishy with life gain as AI attacked with Baneslayer Angel redirected damage to plainswalker and gained 30 life points!
Attachments
after the attack.png
pic2
attack before redirection.png
pic1
game.rar
(8.34 KiB) Downloaded 332 times
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby melvin » 28 Feb 2013, 12:33

Thanks for the game.log and screenshots they were extremely helpful. Turns out the AI part was completed borked, I got the functionality working but the way I implemented it doesn't work for the AI. The damage was not registering in the AI's game at all, hence when considering the redirection of damage both options were equally good to the AI, when that happens it picks the first one, which happens to be "yes" redirect damage. That explains why it always redirected damage even when it was overkill.

Knowing the problem it was easy to fix it. The Magarena.exe with the fix can be downloaded from https://buildhive.cloudbees.com/job/mel ... garena.exe
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby Aswan jaguar » 28 Feb 2013, 14:36

There is something wrong with the fixed Magarena.exe as it doesn't load game just showing starting screen and then crashing.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: RFC: Adding planeswalkers by generalizing redirection ru

Postby melvin » 01 Mar 2013, 01:45

Arrgh, I forgot that I made some backward incompatible changes to the groovy script component. The new exe requires updated groovy scripts. Please use the full zip package from https://buildhive.cloudbees.com/job/mel ... a-1.36.zip instead. Sorry for the inconvenience.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times


Return to Magarena

Who is online

Users browsing this forum: No registered users and 24 guests


Who is online

In total there are 24 users online :: 0 registered, 0 hidden and 24 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 24 guests

Login Form