Showing posts with label Sifting. Show all posts
Showing posts with label Sifting. Show all posts

Sunday, 24 May 2015

Engine Theory: Consistency and What You Need

Following on from these two posts, let's continue our look at engines. We know what the payoff is, and we know the difficulties of getting them set up reliably. So when do you go for them? Well, as with most questions about Dominion, this is going to vary a good bit based on what's available. You always have to ask yourself, for any strategy, "what's the alternative?". Nevertheless, there are some things we can cover in general, and as long as we know there are going to be exceptions, and remember that context is king, we can learn some things.


Ok, so the biggest problem we were left facing at the end of the reliability article is that it's difficult to get to the point where we're consistently drawing our deck. We have basically four main ways of dealing with this.
  1. Buy lots and lots of components for redundancy
    This one is tempting, because it's going to be possible every single time you have a draw engine that's at all possible, and getting stuff is what you want to do anyway. Unfortunately, if you check the math on things, it basically just doesn't work - to even get 3/4 reliable, you basically have to empty two stacks, and that's with pretty small payload. For sure this strategy is something you want to look to in order to complement the others, but in terms of getting it to work just on its own, you need to be gaining something like 3 components per turn every turn somehow, all while not emptying too many piles - and even then, it isn't great.
  2. Don't Care About Consistency
    This isn't really something you can do terribly often - you are just eschewing the big benefit of engine economies exploding in on themselves like breeder reactors. Nevertheless, it can really be a viable thing on some boards. Much as I think people tend to overestimate their chances of drawing their deck every turn when it's 75-90% (i.e. you SHOULD dud out every 4-10 turns on average), I think people feel cheated when the other person 'gets lucky' and strings things together. Well, if they're 25% to do so on any given turn and they have 5 shots... they're going to get there over 3/4 of the time. In order for this to be at all viable, of course, you need some REALLY powerful payload. Traditional Megaturns are the order of the day here - 7 Bridges or Horns of Plenty, and it won't really matter that you won't get them together again. And this can lean your engine a bit more towards a 'combo' feel.
  3. Thinning
    ...is, as my friend Adam Horton would tell you, whinning. =D Seriously, though, the consistency numbers get a LOT better when you have fewer dead cards to draw. Good thinning also speeds you up quite a bit, because it's just a lot faster to get rid of cards from your deck than to add cards to be able to draw it, considering that whilst adding cards, you have to draw all of those, too! Now, it might surprise a lot of you that I'm listing this here, and not last, because you would think this is the biggest solution to the consistency problem. But while it does give you a very good amount of speed, and it helps the consistency some, it doesn't really solve the problem. You're still going to want payload at some point, and it's almost always going to be more than the 5-6 cards for which you can be very confident to draw it all. That means you are going to be somewhat inconsistent unless you're significantly over-drawing. And well, you can usually just overdraw a bit, but that leads to inefficiency, which costs you time. And if the thinning isn't fast, you can have some real problems - even something pretty quick like Steward will take a couple of shuffles before you're reaping real benefits, and if it's slower like Trade Route? Yeah, good luck with that. So it turns out, even with trashing, you want something more....
  4. Sifting
    Really? I know that's what you're asking. Yes. Sifting is amazing. It doesn't help you get to the point where you can draw your deck - in fact, a lot of what is traditionally considered sifting hurts you there - but once you are there, it starts becoming very, very valuable. The thing is, how are you dudding out? You draw all of your dead cards together, without having the cards you need to kick off. Sifting cards let you see LOTS more cards to get to your key starters. And when you are engine building, to get your consistency up, you would otherwise need to buy lots of extra draw cards anyway, for redundancy (a la point 1). This would lead to you overdrawing anyway, at which point it's just much more efficient to get some sifters instead of pure draw-more. The big thing to note here is that we are traditionally thinking of cards like Warehouse, Cellar, and Dungeon, but something like Cartographer, Journeyman, or Catacombs can fill this role as well. It's just worth noting that for these, they don't really help you find that first village. Even more important, cards that let you mess with the random draw of 5 cards to start your hand work here, too - Scheme, Guide, and even top-deckers like Watchtower and Royal Seal.

Of course, the real thing that you need in an engine is a good payload and enough time to effectively deploy it. Consistency helps you here, because it speeds you up through the late game. Thinning also speeds you up through the early game. In general, though, this won't be enough. Gainers which are cost-limited (e.g. Workshop) are going to help you through the midgame, because they let you grab more components to get your draw going or stabilize it somewhat (a la point 1).

But in general, +buy is going to be superior, and quite necessary. Why? You will need to be able to string together multiple big things at once - usually victory cards, really, but frequently some more expensive economic bonuses and/or engine components as well. Let's look a little more in depth at this. Getting one Province per turn is going to be too slow might be your first thought. And that's generally true. But even when you can get to this point pretty quickly, you are still going to have a problem: if you are only buying one card a turn, your engine is going to be consistently degrading as you get that Province - and as we saw, this is actually even true if you can add a Smithy and a Village with the Province. So unless your deck will be inconsistent as you continue down that green path. And really, who is going to be duchy-dancing better, your engine, or the opponent's money deck? If you are doing this in a protracted fashion, it's the money deck; it just degrades a lot less. So, instead, you want to plan to have the game end before this breakdown happens. This leads to a guiding principle of engine play which I'll cover more in a later article: Don't green until you have a way to end the game in sight. There are a number of exceptions to this, of course, with the biggest one being (unless you need the points to not immediately lose).

The concept of time is the most important thing here. It's a shifting scale with multiple axes. In general, in a non-mirror, the Engine will be playing the role of Chaser, whilst its opponent will be the Pace-Setter. But that will be in another article!

Wednesday, 20 May 2015

Theory: Engine Draw Basics

I have written elsewhere about the benefits of Engine Economies (and I will probably port that over here at some point). But in order for all that to work, you actually need to draw your deck consistently. Given this, a good question to ask is, how consistent is it?

Fortunately, we have mathematics. The first thing to note are some very basic statistics. How many cards can your deck draw? Seriously, this is as easy as totaling up the number of +cards on all your cards, and adding five for your initial hand. Obviously you need to subtract out cards you discard (e.g. Embassy counts for 2, not 5), and cards like Journeyman which don't technically draw cards should still count for their obvious number (in this case, 3). Obviously variable-drawers like Scrying Pool will make things trickier, but for now I'm going to focus on your more basic engines. You can compare your total draw to the number of cards in your deck, and this will tell you whether it's even possible to draw your deck. Consistency, however, is another question, and it requires math that's a bit more advanced.

The specific math we're going to be leaning on here is a mainstay of card games, the Hypergeometric Distribution. There are a number of Hypergeometric Calculators available on line, such as this one. I do most of my work in Excel, which has this stuff built in, of course. The biggest reasons for this are that it's easy to generalize doing a lot of similar calculations across a spreadsheet, and I almost always have at least one Excel tab open anyways.

I'm not going to walk through all the mechanics here, but I will outline you through how to calculate the basics for the first scenario I'm looking at. That scenario is 12 "dead" cards (anything that doesn't draw, from Curse to Goons), which is going to be reasonably common, as you start with 10 and often have to add about 2 payload cards to get your economy going, along with 4 Villages and 4 Smithies. Ok, this means 20 cards in our deck total, and we start with 5. The Villages each draw a card, and the Smithies each draw 3, so 5 + 4*1 + 4*3 = 21, or actually one more card than we have in our deck. Great. So we should be able to draw our deck pretty reliably, right? Let's see.

The first thing we need to get going on our turn is a village. So we use our hypergeometric calculator to come up with the chance of getting zero of those out of 5 cards. You should come up with 28.17%. Then, we need a Smithy. Of course, we can play any number of Villages before that Smithy. So the way to model this is, we need to see the chance of drawing none of 4 Smithies in a hand of 5 cards, from a total of 16 cards, where the 16 is the size of our deck minus the Villages, since we can just cycle through those. We should come up with 18.13% here. Okay, so now we've hit at least one Village and a Smithy. To continue, we need another Village. The key thing here is that it doesn't actually matter whether we found one before the Smithy or after, the overall chances of getting at least one remain the same - we just need to check for having none in our hand, which is now 7 cards, from our deck, which now has 3 Villages left out of 18 total cards. We get a 20.22% chance of missing now. Same thing for hitting the next Smithy - 3 left out of a deck of effectively 15 cards, and a 7-card hand. That's a 12.31% chance to whiff.

Continue that pattern down the line until the deck is drawn. Remember that what we've been calculating are the chances to miss. To get from this to the chance to draw our deck, we first need to turn them into chances to succeed by subtracting them from 1 (=100%). This gets us the chance of e.g. drawing AT LEAST one Village. Then, because we need ALL of them to succeed, we need to multiply those chances together to get the chance we draw our deck. When we do that, for our example, we get... a whopping 20.08% chance to draw the deck on any given turn, starting from a fresh shuffle. It's worth noting that if we only hit 3 Smithies, we will have drawn all but 1 payload card - the chance of doing this with an action live is not much better, though, at only around 30%.

As we move to bigger decks and adding more cards, it's important to note that, as we get to the point we're over-drawing our decks, we don't necessarily need to hit EVERY village and smithy - at a certain point, the deck is drawn, and the superfluous drawing components do nothing (except, perhaps, give us enough actions to complete all our payload).



I'll wrap up this post by noting some general trends. With 12 dead cards, you don't reach a 50% chance of drawing your deck until you are at 6 Villages and 5 Smithies. Adding in even a single extra dead card starts hurting your chances pretty significantly. If we're limited to a single pile of Villages and Smithies to draw with, we can't do better than 77.64% to draw our deck with 12 dead cards, which we reach at 10 Village and 8 Smithies. After a point, adding extra superfluous Villages is the best way to get your deck drawn. Non-drawing Villages are way worse for our consistency, even if we compensate by making our drawing cards better - Festival + Hunting Grounds is quite a bit less consistent than Village + Smithy on the same number of each pair, generally leading to deck drawing itself between one-third and two-thirds as often as the traditional Village-Smithy roles. It's also worth noting that the "more villages after a point" advice from the Village-Smithy framework does NOT translate to the Festival-Hunting Grounds one - you want a balance here.


As for the strategic implications of what all this means, I'm going to leave that for a different post. For now, let's just say to not be too surprised or upset when you get those dud hands - they're most likely more common than you think.

Wednesday, 29 April 2015

Quick Game #1: Turn 8 Estate

Game Log

Setup:



Not much to comment on in the general case here. Apothecary engines are the obvious best thing, with Stonemason, Warehouse, and Mystic all as quite good support. We mirror, with me going second.

I want to join the game after the Apothecaries ran out, which happened on my opponents seventh(!) turn:

As we can see, I have a fairly small-looking, but quite significant advantage, based mostly on my two extra Apothecaries. This was more or less down to pure dumb luck in getting very nice connections of 4p to Stonemason into double Apothecary. It's also worth noting that I've Stonemasoned a Stonemason into a pair of Coppers. Copper is easier to draw in my deck of 6 Apothecaries, though of course this is going to be offset by having a higher number of non-drawing cards. So if we take the overall draw-ability as about a wash, the big advantage here is that I have just a little more money - and enough to buy a Province.

But at this point, I am already in Endgame mode. Apothecaries are an empty pile. Four Warehouses are gone, and Stonemasons are both lowered and very easy to run. The game can't end right away, but jockeying for position is something you already need to think about. On my next turn, I draw my deck (sans one estate). I turn my potion into a pair of Warehouses, for improved reliability (and the key thing here is to discard Coppers - later Apothecaries become AMAZING). And then I have 9 - I could buy a Province, and that's probably ok, but I feel like it doesn't position me well for a long game. And while I am already considering how piling out can happen here, it isn't going to happen just yet, so I do need to be prepared for a longer game. For this reason, I take Stonemason for a Festival and a Mystic. The Mystic is a significantly better card for the deck, as it's going to hit a huge percentage of the time, but the Festival gives me access to an extra buy, an extra Stonemason play, and TONS more pile control. It isn't terribly common that two different cards off a Stonemason overpay is the correct way to go, but I think it's definitely the right call here, as the festival is really needed right away, and the Mystic is a clear step better after that.

My opponent counters with an identical turn.

And then I have a complete dud, producing only $3. I buy an Estate. This is actually absolutely critical. The game can already end at any time. Overpaying for Stonemason to get Warehouses (only 2 left) and then again for Stonemasons themselves (4 left right now, down to 3 after the Warehouse overpay) will end the game. So the point is actually pretty important to hold off pressure from my opponent doing this (he could potentially still win this turn, but it would require a near-perfect draw to empty AND score 2+ points), as well as to be able to more easily threaten this myself. On turn 9, my opponent builds more, getting another Mystic and a Cellar. It's possible he should try to score some points, in order to block me, especially considering that my previous-turn dud means I'm pretty likely to go off this turn. He's in a very tough spot, though, because scoring points is going to continue to hurt his long-game chances.

In any case, I do have the monster hand I need, and finish it out.