Dominion Strategy Forum

Dominion => Dominion Online at Shuffle iT => Dominion General Discussion => Goko Dominion Online => Topic started by: SCSN on April 09, 2013, 11:36:43 am

Title: An unfamiliar bane
Post by: SCSN on April 09, 2013, 11:36:43 am
(http://www.stichtingopen.nl/images/unfamiliar.JPG)
Title: Re: An unfamiliar bane
Post by: gman314 on April 09, 2013, 11:40:09 am
Wow. Another bug in Goko. Why am I not surprised?
Title: Re: An unfamiliar bane
Post by: SirPeebles on April 09, 2013, 12:11:30 pm
I would consider that a Familiar bane.
Title: Re: An unfamiliar bane
Post by: ftl on April 09, 2013, 12:30:30 pm
Ugh... this was apparently supposed to be fixed, but I guess not. I hope they didn't fix it by just manually listing the cards that couldn't be banes because they had P in their cost, and just forgot familiar.

Well, I reposted it on getsatisfaction at https://getsatisfaction.com/goko/topics/familiar_as_young_witch_bane?rfm=1 , hopefully they'll fix it eventually.
Title: Re: An unfamiliar bane
Post by: Squidd on April 09, 2013, 12:32:42 pm
I got P.Stone as a bane just yesterday, so it's not as simple as that.
Title: Re: An unfamiliar bane
Post by: blueblimp on April 09, 2013, 01:25:54 pm
Ugh... this was apparently supposed to be fixed, but I guess not. I hope they didn't fix it by just manually listing the cards that couldn't be banes because they had P in their cost, and just forgot familiar.
That's gotta be it, which is hilarious. Listing the cards manually sounds harder than just checking the cost properly...
Title: Re: An unfamiliar bane
Post by: GendoIkari on April 09, 2013, 01:31:08 pm
Ugh... this was apparently supposed to be fixed, but I guess not. I hope they didn't fix it by just manually listing the cards that couldn't be banes because they had P in their cost, and just forgot familiar.
That's gotta be it, which is hilarious. Listing the cards manually sounds harder than just checking the cost properly...

public class Cost
{
  private int Potions;
  private int Coins;

  bool operator < (Cost cost1, Cost cost2)
  {
    return cost1.Potions < cost2.Potions && cost1.Coins < cost2.Coins;
  }
}

Hey, look at that. I did their job for them.
Title: Re: An unfamiliar bane
Post by: qmech on April 09, 2013, 01:42:54 pm
Perhaps this is hard after all. ;)

Code: [Select]
return (cost1.Potions <= cost2.Potions && cost1.Coins < cost2.Coins) || (cost1.Potions < cost2.Potions && cost1.Coins <= cost2.Coins);
Title: Re: An unfamiliar bane
Post by: ftl on April 09, 2013, 01:44:49 pm
Ugh... this was apparently supposed to be fixed, but I guess not. I hope they didn't fix it by just manually listing the cards that couldn't be banes because they had P in their cost, and just forgot familiar.
That's gotta be it, which is hilarious. Listing the cards manually sounds harder than just checking the cost properly...

Well, the person just above your post said they got pstone as a bane, so that's not it.
Title: Re: An unfamiliar bane
Post by: GendoIkari on April 09, 2013, 01:46:53 pm
Perhaps this is hard after all. ;)

Code: [Select]
return (cost1.Potions <= cost2.Potions && cost1.Coins < cost2.Coins) || (cost1.Potions < cost2.Potions && cost1.Coins <= cost2.Coins);

 :-[

I did it quickly, without testing or QA!
Title: Re: An unfamiliar bane
Post by: rrenaud on April 09, 2013, 02:25:07 pm
From ACM practice, general strategy for implementing lexicographic comparison with fields ordered by f1, f2, f3, ...

Code: [Select]
if (a.f1 != b.f1) return a.f1 < b.f1;
if (a.f2 != b.f2) return a.f2 < b.f2;
if (a.f3 != b.f3) return a.f3 < b.f3;
...

It always works, it's obviously correct (okay, to be fair, maybe this takes getting familiar with the pattern), etc. you waste no time thinking about edge cases or demorgan's law.
Title: Re: An unfamiliar bane
Post by: Joseph2302 on April 09, 2013, 04:09:07 pm
Ugh... this was apparently supposed to be fixed, but I guess not.

I reported this about 2-3 months ago on getsatisfaction, was told last week that it was fixed.... clearly not... :(
Title: Re: An unfamiliar bane
Post by: qmech on April 09, 2013, 04:25:57 pm
Comparing costs lexicographically is how we got into this mess in the first place. ;)
Title: Re: An unfamiliar bane
Post by: DG on April 09, 2013, 04:58:06 pm
Are saboteurs and sages still finding vineyards?
Title: Re: An unfamiliar bane
Post by: Schneau on April 09, 2013, 04:58:51 pm
From ACM practice, general strategy for implementing lexicographic comparison with fields ordered by f1, f2, f3, ...

Code: [Select]
if (a.f1 != b.f1) return a.f1 < b.f1;
if (a.f2 != b.f2) return a.f2 < b.f2;
if (a.f3 != b.f3) return a.f3 < b.f3;
...

It always works, it's obviously correct (okay, to be fair, maybe this takes getting familiar with the pattern), etc. you waste no time thinking about edge cases or demorgan's law.

As qmech says, the problem is that Dominion card costs aren't lexicographic. Which costs more, Familiar or Witch?
Title: Re: An unfamiliar bane
Post by: rrenaud on April 09, 2013, 05:24:30 pm
Definitely familiar.  Potion > $2.
Title: Re: An unfamiliar bane
Post by: ftl on April 09, 2013, 05:49:26 pm
Neither. Potion is incomparable to $2. If you have enough money for a familiar, that doesn't mean you can buy witch instead, or vice versa.
Title: Re: An unfamiliar bane
Post by: Tables on April 09, 2013, 05:58:40 pm
Definitely familiar.  Potion > $2.

Not sure if trolling...

The thing is that potion costs form what mathematicians (and I presume computer scientists and others) call a partial order. While Possession most definitely costs more than Alchemist, and most definitely costs more than Gold, it costs neither the same, more or less than a Province.
Title: Re: An unfamiliar bane
Post by: Schneau on April 09, 2013, 06:00:57 pm
Neither. Potion is incomparable to $2. If you have enough money for a familiar, that doesn't mean you can buy witch instead, or vice versa.

Right! That was the point of my rhetorical question.
Title: Re: An unfamiliar bane
Post by: theory on April 09, 2013, 06:08:06 pm
A reminder for all of us:

I suppose another way to look at this is on a grid. It might not serve as an effective aid, so feel free to ignore this.

Before Alchemy, cost was on a one-dimensional number line. You could map cost from 0 to 8. An increase or decrease in cost was pretty easy to map out.

Now comes Alchemy. Look, a new cost. We no longer can measure cost on a number line. Now we get to use a Cartesian plane (the x-y coordinates you learned in algebra). On the x-axis, you have the cost in coins. On the y-axis, you have the cost in potions. The costs of most cards will still be a line where the coin cost is 0-8 (and soon 11) while the potion cost is 0-1. No card requires multiple potions, but there could be in theory. You can draw a rectangle to illustrate the cost of potion cards.

Cards like Bishop and Salvager only care about the cost on the x-axis. The y-axis does not matter. Apprentice specifically looks at the cost on the x-axis and then assigns a number based on the cost on the y-axis. If you're familiar with complex numbers, it'd be like saying that you get $2 for each multiple of i. If you're not, then you probably shouldn't be reading my unnecessarily complicated analysis anyway.

Cards like Remodel and Expand give you a wide range. You can Remodel into something that costs up to 2 more. So, take the cost on the x-axis and add 2 to it. It doesn't change the y-axis at all. You now have a slightly larger rectangle. You can gain a card which cost lies in that rectangle. If Potion=1 then the new cost can also include Potion=1. Saboteur does the same thing. Shrink the rectangle down by 2 and look for a cost that falls in that rectangle. If that rectangle is actually a line, then you cannot take something that costs a Potion.

Cards like Upgrade and Remake are more specific. They say exactly 1. The understood rule is that the number refers to the number of coins. So, you go up or down on the x-axis, but the y-axis does not change. If the card has no Potion cost, then you have a line illustrating the cost.  Add 1 to the right of the cost and mark it with a red dot. The new cost must be that dot. If the card has a Potion cost, you do the same thing. The problem is that you don't change the y-axis at all. So, the red dot is one higher on the x-axis, but the Potion cost does not change. If there were a card that says, "Gain a card costing exactly 1 more Potion," then you could go up on the y-axis.

I would love to add actual illustrations to this, but I don't really have to time to fidget with that. Sorry. Not really sure that my explanation is really any better. It's just a different way of approaching it.

Title: Re: An unfamiliar bane
Post by: SirPeebles on April 09, 2013, 06:47:26 pm
Oh hey, I never noticed before that Apprentice doesn't give +2 Cards per Potion in its cost.  Rather, it's just a flat +2 Cards bonus if there is at least one Potion.
Title: Re: An unfamiliar bane
Post by: itchiko on April 09, 2013, 07:41:05 pm
Ugh... this was apparently supposed to be fixed, but I guess not. I hope they didn't fix it by just manually listing the cards that couldn't be banes because they had P in their cost, and just forgot familiar.
That's gotta be it, which is hilarious. Listing the cards manually sounds harder than just checking the cost properly...

public class Cost
{
  private int Potions;
  private int Coins;

  bool operator < (Cost cost1, Cost cost2)
  {
    return cost1.Potions < cost2.Potions && cost1.Coins < cost2.Coins;
  }
}

Hey, look at that. I did their job for them.

Actually i would not recommend redefining the < method with a partial order operator that would probably screw your ordering algorithms. Much better to keep the lexicographical order (money first potion second) for the < operator and then do a Is_Cost_Inferior(cost a,cost b) function using the partial order.
So that you could separate kernel calls (like ordering cards by cost for GUI displays) and game calls (applying any game effect comparing cost like the YW setup effect).

And thinking about it they may have done exactly the same mistake since correcting a bug and then rolling back and forth the correction is usually the sign of regression caused by conflicting requirements.
Title: Re: An unfamiliar bane
Post by: eHalcyon on April 10, 2013, 01:06:00 am
It always works, it's obviously correct (okay, to be fair, maybe this takes getting familiar with the pattern), etc. you waste no time thinking about edge cases or demorgan's law.

I thought the point was to not get Familiar.
Title: Re: An unfamiliar bane
Post by: zahlman on April 11, 2013, 05:16:45 am
From ACM practice, general strategy for implementing lexicographic comparison with fields ordered by f1, f2, f3, ...

Code: [Select]
if (a.f1 != b.f1) return a.f1 < b.f1;
if (a.f2 != b.f2) return a.f2 < b.f2;
if (a.f3 != b.f3) return a.f3 < b.f3;
...

It always works, it's obviously correct (okay, to be fair, maybe this takes getting familiar with the pattern), etc. you waste no time thinking about edge cases or demorgan's law.

Two problems:

1. As pointed out by others, cost comparison isn't lexicographic. That would be the model we want if one potion were "worth more" than any number of coins, or vice-versa; e.g. if a card costing $9 could be purchased with $p. What we generally want to do, to get a "costing less than $X" condition, is compare each component (coins and potions) and make sure each is satisfied.

2. But YW doesn't even involve a "costing less than $X" condition. The card says that the bane is a card "costing $2 or $3". It can't be Poor House, for example.
Title: Re: An unfamiliar bane
Post by: Davio on April 11, 2013, 07:10:14 am
Well, the problem is that X+P > 3 for X >= 3, but for X < 3 it's incomparable. You can't say that 2P is greater than or smaller than 3. I mean, having three boxes of oranges and one box of apples beats having just three boxes of oranges (by one box of apples). If however you have two boxes of oranges and one box of apples we can't say that you have more than just three boxes of oranges.