[fixed/closed]Jace, the Mind Sculptor
Moderators: BAgate, drool66, stassy, Aswan jaguar, gmzombie, CCGHQ Admins
[fixed/closed]Jace, the Mind Sculptor
by HarlequinCasts » 11 Nov 2013, 11:13
Describe the Bug:
Jace, the Mind Sculptor cannot put back any planeswalker card when you are using his Brainstorm ability. You receive the error "Illegal Target (Type)"
You can lock yourself out of the game if you were to draw 3 planeswalkers with no other cards in hand.
Which card did behave improperly ?
Jace, the Mind Sculptor
Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
OoAv2
What exactly should be the correct behavior/interaction ?
Brainstorm
Are any other cards possibly affected by this bug ?
NA
Jace, the Mind Sculptor cannot put back any planeswalker card when you are using his Brainstorm ability. You receive the error "Illegal Target (Type)"
You can lock yourself out of the game if you were to draw 3 planeswalkers with no other cards in hand.
Which card did behave improperly ?
Jace, the Mind Sculptor
Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
OoAv2
What exactly should be the correct behavior/interaction ?
Brainstorm
Are any other cards possibly affected by this bug ?
NA
- Attachments
-
jace ability.zip- (2.78 KiB) Downloaded 85 times
Last edited by BAgate on 31 Jan 2014, 02:37, edited 4 times in total.
Reason: closed
Reason: closed
-

HarlequinCasts - Posts: 917
- Joined: 07 May 2013, 14:33
- Has thanked: 68 times
- Been thanked: 30 times
Re: Jace, the Mind Sculptor
by Acra » 11 Nov 2013, 12:03
common bug with any "target" planeswalker card. you cannot discard them either.
Re: Jace, the Mind Sculptor
by Korath » 11 Nov 2013, 12:04
Even worse in dev - you can only put back sorceries and instants, and fourth ability is Θ(3n²). Not sure why it was rewritten or what else is broke.
The common bug I fixed some time ago, along with flash permanents (which mostly could count as instants, more so for the non-creature ones), except for a handful of asm cards. Verduran Enchantress and Mesa Enchantress are the only ones that see any use at all.
The common bug I fixed some time ago, along with flash permanents (which mostly could count as instants, more so for the non-creature ones), except for a handful of asm cards. Verduran Enchantress and Mesa Enchantress are the only ones that see any use at all.
-

Korath - DEVELOPER
- Posts: 3522
- Joined: 02 Jun 2013, 05:57
- Has thanked: 491 times
- Been thanked: 1037 times
Re: Jace, the Mind Sculptor
by Aswan jaguar » 11 Nov 2013, 15:04
This bug was already submitted:
viewtopic.php?f=110&t=12287&p=136108&hilit=Jace%2C+the+Mind+Sculptor#p136085
and
viewtopic.php?f=110&t=12287&p=136108&hilit=Jace%2C+the+Mind+Sculptor#p136085
and
In the version we have Jace, the Mind Sculptor has only this bug as I tested all abilities,if you say that in dev version brainstorm ability is even worse and 4th has a problem,too then this needs to be rolled back maybe? and try a different approach?Gargaroz said:
Oh, I see, it's a global bug related to the changes we made in the targeting function for avoiding AI using Disenchant on Planeswalkers. It's fixed as 16d1128
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-

Aswan jaguar - Super Tester Elite
- Posts: 7450
- Joined: 13 May 2010, 12:17
- Has thanked: 639 times
- Been thanked: 351 times
Re: Jace, the Mind Sculptor
by Gargaroz » 11 Nov 2013, 22:52
Fixed the first bug Korath reported in dev, however I could not understant the one about the ultimatum : you mean is displayed in that way ?
However, the code was rewritten as it was poorly coded in origin, for example the ultimatum didn't target.
However, the code was rewritten as it was poorly coded in origin, for example the ultimatum didn't target.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7095
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 593 times
Re: Jace, the Mind Sculptor
by Korath » 12 Nov 2013, 00:33
Hrm. There's a wikipedia article, but it's dense reading even for a native speaker who's familiar with the subject already. Schlemiel the Painter's algorithm is easier going: "Schlemiel has a job painting the dotted lines down the middle of a road. Each day, Schlemiel paints less than he painted the day before. When he is asked why, Schlemiel complains that it is because each day he gets farther away from the paint can."
(And it's actually n³ now that I look at it closer.)
What it boils down to is that this will seem to work ok when used against a "reasonably"-sized library with, say, 25 cards left in it - it'll take on the order of 25*25*25, or 15,625, instructions. If it gets used against a Battle of Wits deck or the Shandalar Arzakon deck or the challenge mode all-Mountain deck with 400 cards left, it'll take on the order of 64 million instructions (400*400*400), or 4096 times as long as the 25-card deck instead of just 8 times. Done properly, the first deck should take 25 constant-time operations and the second 400.
The problematic code is:
The loop in rfg_top_card_of_deck() calls count_deck() once for each card in the deck, and then count_rfg() once. So it takes on the order of (deck_size * deck_size) + rfg_size instructions to execute. (This is the easiest part to fix - just store count_deck() in a local var once before the loop, and compare against that in the loop condition instead.)
The loop in card_jace_the_mind_sculptor() calls count_deck() and rfg_top_card_of_deck() once for each card in the deck. So it in turn takes on the order of deck_size * (deck_size + (deck_size * deck_size) + rfg_size) instructions.
Since it doesn't matter what order the cards in the deck should be exiled, this shouldn't ever take more than 500 iterations even in the very worst case (500 total cards in the library and exile zone at start of execution), using something like
(And it's actually n³ now that I look at it closer.)
What it boils down to is that this will seem to work ok when used against a "reasonably"-sized library with, say, 25 cards left in it - it'll take on the order of 25*25*25, or 15,625, instructions. If it gets used against a Battle of Wits deck or the Shandalar Arzakon deck or the challenge mode all-Mountain deck with 400 cards left, it'll take on the order of 64 million instructions (400*400*400), or 4096 times as long as the 25-card deck instead of just 8 times. Done properly, the first deck should take 25 constant-time operations and the second 400.
The problematic code is:
- Code: Select all
while( count_deck(p) > 0 ){
rfg_top_card_of_deck(p);
}
- Code: Select all
for(i=0;i<count_deck(player);i++){
deck[i] = deck[i+1];
}
rfg[ count_rfg(player) ] = id;
The loop in rfg_top_card_of_deck() calls count_deck() once for each card in the deck, and then count_rfg() once. So it takes on the order of (deck_size * deck_size) + rfg_size instructions to execute. (This is the easiest part to fix - just store count_deck() in a local var once before the loop, and compare against that in the loop condition instead.)
The loop in card_jace_the_mind_sculptor() calls count_deck() and rfg_top_card_of_deck() once for each card in the deck. So it in turn takes on the order of deck_size * (deck_size + (deck_size * deck_size) + rfg_size) instructions.
Since it doesn't matter what order the cards in the deck should be exiled, this shouldn't ever take more than 500 iterations even in the very worst case (500 total cards in the library and exile zone at start of execution), using something like
- Code: Select all
void rfg_entire_deck(int player, int* deck){
// deck can be either a library or graveyard, but must be at the start of the array
int* rfg = rfg_ptr[player];
int deck_pos, rfg_pos = 0, any_exiled = 0;
for (deck_pos = 0; deck_pos < 500; ++deck_pos){
if (deck[deck_pos] != -1){
while (rfg[rfg_pos] != -1){
++rfg_pos;
}
rfg[rfg_pos] = deck[deck_pos];
deck[deck_pos] = -1;
any_exiled = 1;
}
}
if (any_exiled){
play_sound_effect(WAV_DESTROY); // The exile sound effect, despite its name
}
}
-

Korath - DEVELOPER
- Posts: 3522
- Joined: 02 Jun 2013, 05:57
- Has thanked: 491 times
- Been thanked: 1037 times
Re: Jace, the Mind Sculptor
by Gargaroz » 12 Nov 2013, 14:17
Thanx for the explanation, the actual code looks like this :
- Code: Select all
int exile_whole_library(int p){
int count = count_deck(p)-1;
int c2 = count_rfg(p);
int *deck = deck_ptr[p];
int *rfg = rfg_ptr[p];
int result = 0;
while( count > -1 ){
rfg[c2] = deck[count];
deck[count] = -1;
count--;
c2++;
result++;
}
if (result){
play_sound_effect(WAV_DESTROY); // The exile sound effect, despite its name
}
return result;
}
- Code: Select all
else if ( instance->targets[1].player == 3 && valid_target(&td1) ) {
int p = instance->targets[0].player;
exile_whole_library(p);
int i= active_cards_count[p]-1;
while( i > -1 ){
if( in_hand(p, i) ){
put_on_top_of_deck(p, i);
}
i--;
}
gain_life(p, 0);
shuffle(p);
}
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7095
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 593 times
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests
