Dominion Strategy Forum

Dominion => Dominion General Discussion => Dominion Online at Shuffle iT => Topic started by: silby on August 08, 2016, 12:03:09 pm

Title: Scripting Dominion
Post by: silby on August 08, 2016, 12:03:09 pm
I have some questions about the implementation of the Dominion game engine that might be unanswerable or boring and maybe Stef/SCSN are unlikely to respond to this far in advance, but I'm extremely curious, so here goes:

I would imagine that any reasonable implementation of a game like Dominion would be based around an "event loop" that handles the phases of the turn (start, action, buy, cleanup, interturn) and cards that are scripted to trigger various side-effects when they're eligible to be played. All well and good. Many Dominion cards are built out of primitive effects that are not very complicated to script, and interact in predictable ways. (+1 Card/action/buy/coin, look at a card, reveal a card, etc.) Other cards have (seemingly?) unique effects, most notably Possession, which in the rules for humans is heavily annotated and some cards have FAQs that clarify precisely how they interact with Possession.

So my initial questions about this for the developers are these, if they care to reveal their approach at all:

- Am I even imagining a design similar to what you're building for the game engine?
- How many "primitive" game-state operations are there? What about higher-order operations like predicates or alternates?
- How many cards have an operation only used for that card?
- Are there any card interactions that have a true corner-case implementation, where the engine produces the wrong effect when A and B interact, but there's no feasible way to correct the individual components to get the right effect?
- I sure would be delighted for card-creation tools to be made available to players with the full power of the engine. I know there's lots of reasons to not ever do this, which I accept. This isn't a question.
Title: Re: Scripting Dominion
Post by: -Stef- on August 09, 2016, 06:13:54 am
I am going to answer you a little bit. One of the cool things about two forum members making the new implementation should be a closer distance between the fans and the development. So far I've been very silent, but that is mostly due to time constraints. Also I don't really know where answering you leads to. One of the bad things that might happen is that it leads to a lot of other questions that people also want answered, and at that point I'm just going to say no, not now, now I'm actually going to continue making the game.

People often assume the difficult part about Dominion is in the cards, but so far it hasn't been. By far the most time consuming was setting up the Context. It isn't a lot of code, but I sort of had to figure out how Dominion actually works. The rules aren't always clear about this, and where they are they usually describe what should happen, not the things causing these consequences.

Anyway, as it turns out the Dominion Context has a Stack. Each element of the stack has a Map that assigns each Player a list of Abilities, and could have a cause (also an Ability). An Ability is basically just 'a piece of code' and apart from being executed it can also be cancelled, when one of its tracked cards get moved, covered up or shuffled due to something else.

The Stack is because if something is happening and it triggers something else, we first resolve something else before returning to the first thing.
The elements in the stack don't have just one list but a list for every player because of the turn-order resolution rule.
The cause is there because if something happens (say when-trash-a-card | when-your-turn-starts) and further down its stack some new trigger is set up (you draw a market square | your summoned hireling hits play) it has to still respond to the trigger-being-resolved.

- Are there any card interactions that have a true corner-case implementation, where the engine produces the wrong effect when A and B interact, but there's no feasible way to correct the individual components to get the right effect?
No. If this is the case, that simply means the engine is wrong. It has been, and maybe it still is, but if I find that out I will try to correct the engine (again), never start coding specific interactions.


I'll just give you the current implementation of two cards. One very simple, one a bit more complicated.
Code: [Select]
public class Margrave extends Card {

    public Margrave(int index, CardZone cardZone) {
        super(index, CardObjectName.MARGRAVE, cardZone);
    }

    public void onPlay(Context context, Player player, PlayCardAbility playCardAbility) throws SuspendExecution {
        player.drawCards(context, getCardObjectAssociation(), 3);
        player.addBuys(1);
        for (Player victim : playCardAbility.getVictims()) {
            victim.drawCards(context, getCardObjectAssociation(), 1);
            victim.discardDownTo(context, getCardObjectAssociation(), 3);
        }
    }

}

Code: [Select]
public class Beggar extends ReactionCard {

    private final List<CardMode> CARD_MODES = Arrays.asList (CardMode.BEGGAR_TOPDECK_FIRST, CardMode.BEGGAR_DISCARD_PILE_FIRST);


    public Beggar(int index, CardZone cardZone) {
        super(index, CardObjectName.BEGGAR, cardZone);
    }

    @Override
    public void onPlay(Context context, Player player, PlayCardAbility playCardAbility) throws SuspendExecution {
        for (int i = 0; i < 3; i++) {
            player.gain(context, getMe(), CardObjectName.COPPER, player.getHand());
        }
    }


    @Override
    protected boolean reactsTo(Event event, Context context) {
        boolean inHand = getZone().getZoneName() == ZoneName.HAND;
        boolean isWhen = event.getEventType() == EventType.WHEN;
        boolean isAttack = event.getAbility() instanceof PlayAttackAbility;
        if (!inHand || !isWhen || !isAttack) return false;
        PlayAttackAbility playAttackAbility = (PlayAttackAbility) event.getAbility();
        return playAttackAbility.getPlayer() != getPlayer();
    }

    @Override
    protected void createReaction(Event event, Context context, AbilityCollector abilityCollector) {
        abilityCollector.add(new BeggarAbility(getPlayer()));
    }


    private class BeggarAbility extends ReactionAbility {

        public BeggarAbility(Player player) {
            super(getMe(), player);
        }

        @Override
        public void resolve(Context context) throws SuspendExecution {
            player.discard(context, getCardObjectAssociation(), player.getHand(), getMe());
            NamedPile silverPile = context.getCommonPiles().getActualPile(CardObjectName.SILVER);
            CardMode cardMode = CardMode.BEGGAR_TOPDECK_FIRST;
            if (silverPile.size() == 1) {
                cardMode = context.ask(new WhatCardMode(CARD_MODES));
            }
            if (cardMode == CardMode.BEGGAR_TOPDECK_FIRST) {
                player.gain(context, getMe(), CardObjectName.SILVER, player.getDrawPile());
                player.gain(context, getMe(), CardObjectName.SILVER);
            } else {
                player.gain(context, getMe(), CardObjectName.SILVER);
                player.gain(context, getMe(), CardObjectName.SILVER, player.getDrawPile());
            }
        }
    }

}
Title: Re: Scripting Dominion
Post by: werothegreat on August 09, 2016, 08:44:52 am
I notice Margrave does not have an "Attack" tag anywhere (in contrast to Beggar, which extends ReactionCard) - I'm assuming the fact that it has a "victim" means you resolve Attack triggers when victims are involved?  Are Masquerade and Possession dealt with differently, then?

EDIT: Also, any particular reason why Beggar's onPlay method has an @Override tag, while Margrave's does not?
Title: Re: Scripting Dominion
Post by: -Stef- on August 09, 2016, 08:54:47 am
I notice Margrave does not have an "Attack" tag anywhere (in contrast to Beggar, which extends ReactionCard) - I'm assuming the fact that it has a "victim" means you resolve Attack triggers when victims are involved?  Are Masquerade and Possession dealt with differently, then?
We have the card types assigned to the card names. Margrave knows it's called CardObjectName.MARGRAVE, and it can deduce it's an attack that way.
If I would replace the name with CardObjectName.SMITHY, it would still function as a Margrave, except that nobody could defend against it (and the client would show you an image of smithy)

By the time we get to the 'victim' part it would be too late. You decide whether to reveal moat before the attacking player draws cards.
The whole possibly-removing-victims has already happened by the time Margraves onPlay is executed.
Title: Re: Scripting Dominion
Post by: Witherweaver on August 09, 2016, 10:09:49 am
I notice Margrave does not have an "Attack" tag anywhere (in contrast to Beggar, which extends ReactionCard) - I'm assuming the fact that it has a "victim" means you resolve Attack triggers when victims are involved?  Are Masquerade and Possession dealt with differently, then?
We have the card types assigned to the card names. Margrave knows it's called CardObjectName.MARGRAVE, and it can deduce it's an attack that way.
If I would replace the name with CardObjectName.SMITHY, it would still function as a Margrave, except that nobody could defend against it (and the client would show you an image of smithy)

By the time we get to the 'victim' part it would be too late. You decide whether to reveal moat before the attacking player draws cards.
The whole possibly-removing-victims has already happened by the time Margraves onPlay is executed.

Interesting; is the idea that Reaction is the only card type that really merits having its own (derived) class, since it has things like reaction trigger and reaction ability?  Or are there other derived classes for other cards; could there be a potential problem with trying to extend more than one class? (It looks like Java?  I guess you can get around it with interfaces; I don't really know Java.)
Title: Re: Scripting Dominion
Post by: PitzerMike on August 09, 2016, 10:53:48 am
Cool, i like it!
Title: Re: Scripting Dominion
Post by: silby on August 09, 2016, 04:05:13 pm
Thank you for the insightful peek behind the curtain! Per your concerns, I'll avoid peppering with follow-up questions, but any other "dev log" notes you might produce in the next few months/next year would be very interesting to me. (Maybe someday you'll tell us what all the parts of the context data structure are.)
Title: Re: Scripting Dominion
Post by: 2.71828..... on August 09, 2016, 08:48:34 pm
Thank you for the insightful peek behind the curtain! Per your concerns, I'll avoid peppering with follow-up questions, but any other "dev log" notes you might produce in the next few months/next year would be very interesting to me. (Maybe someday you'll tell us what all the parts of the context data structure are.)

"The Secret History of Dominion Online"
Title: Re: Scripting Dominion
Post by: -Stef- on August 12, 2016, 03:47:13 pm
Dear f.ds,


One of the cards I posted here is in conflict with the Dominion rules, even though it would have been fine pre Adventures.
Why o why haven't you complained about that yet?
Title: Re: Scripting Dominion
Post by: michaeljb on August 13, 2016, 04:08:23 am
Well, this isn't something broken by Adventures, but

Code: [Select]
if (silverPile.size() == 1) {
    cardMode = context.ask(new WhatCardMode(CARD_MODES));
}

seems to contradict this bit from Beggar's official FAQ:

"If there is only one Silver left, put it on your deck; if there are no Silvers left, you do not gain any."

The code looks to me like it only asks the user to pick an order when there is one Silver left, but the last Silver should just go on the deck.

I think you should always get to choose whether to topdeck the first or second Silver, and it looks like this code doesn't let you choose. But I'm struggling to find the case in Adventures where that matters.
You could have enough Duplicates on your Tavern mat to empty the Silver pile, and really don't want the trashing attack you're reacting to with the Beggar to kill one of your Silvers, so you gain to your discard pile first, Duplicate that Silver a bunch, and none are left to go on top?
Title: Re: Scripting Dominion
Post by: -Stef- on August 13, 2016, 08:55:43 am
...

Yup that would exactly be it. I would happily add you to the list of alpha-testers, except you were already on it.
We are currently aiming for a closed alpha at the start of September.
Hopefully it goes well and we can expand the list a bit halfway through September.
Title: Re: Scripting Dominion
Post by: gkrieg13 on August 13, 2016, 09:10:04 am
...

Yup that would exactly be it. I would happily add you to the list of alpha-testers, except you were already on it.
We are currently aiming for a closed alpha at the start of September.
Hopefully it goes well and we can expand the list a bit halfway through September.

Darn I knew I should've posted the solution!
Title: Re: Scripting Dominion
Post by: Watno on August 13, 2016, 10:34:32 am
...

Yup that would exactly be it. I would happily add you to the list of alpha-testers, except you were already on it.
We are currently aiming for a closed alpha at the start of September.
Hopefully it goes well and we can expand the list a bit halfway through September.
so why would it have been fine before adventures?
Title: Re: Scripting Dominion
Post by: Chris is me on August 13, 2016, 10:49:30 am
...

Yup that would exactly be it. I would happily add you to the list of alpha-testers, except you were already on it.
We are currently aiming for a closed alpha at the start of September.
Hopefully it goes well and we can expand the list a bit halfway through September.
so why would it have been fine before adventures?

Before Adventures, there was no mechanism to interrupt Beggar's Silver gaining with additional Silver gains. You get to choose where the first Silver goes when you can gain more than one, but not when you can gain only one - but after you gain the first Silver, Duplicate can be used to empty the rest of a low Silver pile before the second one is gained.

Two Silvers in pile -> React with Beggar -> choose to gain the non top decked Silver first -> Duplicate that Silver -> no Silvers on top of deck. The code doesn't seem to allow this option.
Title: Re: Scripting Dominion
Post by: Watno on August 13, 2016, 11:13:29 am
The FAQ michael quoted says
Quote
If there is only one Silver left, put it on your deck.

The code
Code: [Select]
            CardMode cardMode = CardMode.BEGGAR_TOPDECK_FIRST;
            if (silverPile.size() == 1) {
                cardMode = context.ask(new WhatCardMode(CARD_MODES));
            }
            if (cardMode == CardMode.BEGGAR_TOPDECK_FIRST) {
                player.gain(context, getMe(), CardObjectName.SILVER, player.getDrawPile());
                player.gain(context, getMe(), CardObjectName.SILVER);
            } else {
                player.gain(context, getMe(), CardObjectName.SILVER);
                player.gain(context, getMe(), CardObjectName.SILVER, player.getDrawPile());
            }

asks the player wether he wants the first or the second silver on top of his deck if there is only one Silver left, while the only option should be to have the first silver (the only one gained) on top of the deck.

I think the correct code should be simply

Code: [Select]
                player.gain(context, getMe(), CardObjectName.SILVER, player.getDrawPile());
                player.gain(context, getMe(), CardObjectName.SILVER);


Title: Re: Scripting Dominion
Post by: Watno on August 13, 2016, 11:22:21 am
Or to be honest, I'm not sure what should be happening. I would believe that you first gain the 2 silvers, and then put one of them on top of your deck (if you gained any), but that doesn't work due to the fact that Donald stated somewhere that topdecked gains don't visit the discard pile.

I'm not sure wether the following should be allowed:
Code: [Select]
Reveal Trader
   Gain Silver
      Gain something else somehow
           Topdeck that something with Watchtower
   Gain Silver to top of deck
I'd be inclined to believe it should be possible, but the code I suggested above doesn't allow it.

The problem is for the FAQ to be correct, you either decide which Silver to topdeck beforehand, but only if you will gain 2 (which isn't possible since you only know if you gain 2 after you have fully resolved all triggers for the first gain), or you always topdeck the first, which leads to the above not being possible, which doesn't feel right to me.

I think we need Donald to clarify.

EDIT: Actually, I noticed Charm (which was the "somehow" above) is on buy, so I don't think there is a way to gain something else in response to the Silver gain, but I guess we still need clarification to be forward-compatible.
Title: Re: Scripting Dominion
Post by: Donald X. on August 13, 2016, 01:24:21 pm
I think we need Donald to clarify.
You gain a Silver directly to the top of your deck, then you gain a Silver that has no special destination.
Title: Re: Scripting Dominion
Post by: Seprix on August 13, 2016, 03:13:34 pm
Wow, all of this code. I can kind of sort of understand it a little bit.
Title: Re: Scripting Dominion
Post by: drsteelhammer on August 13, 2016, 03:13:43 pm
anyone taking bets whether that is implemented correctly on the MF client? odds are 25 to 1
Title: Re: Scripting Dominion
Post by: Davio on August 14, 2016, 02:02:23 am
I notice Margrave does not have an "Attack" tag anywhere (in contrast to Beggar, which extends ReactionCard) - I'm assuming the fact that it has a "victim" means you resolve Attack triggers when victims are involved?  Are Masquerade and Possession dealt with differently, then?
We have the card types assigned to the card names. Margrave knows it's called CardObjectName.MARGRAVE, and it can deduce it's an attack that way.
If I would replace the name with CardObjectName.SMITHY, it would still function as a Margrave, except that nobody could defend against it (and the client would show you an image of smithy)

By the time we get to the 'victim' part it would be too late. You decide whether to reveal moat before the attacking player draws cards.
The whole possibly-removing-victims has already happened by the time Margraves onPlay is executed.
I would have gone with something like interfaces to specify card types, but then you get things like Band of Misfits and Inheritance and adding interfaces during runtime isn't going to work.

So a runtime lookup of the actual types (through card name, which might change for BoM?) is probably the more flexible option.
Title: Re: Scripting Dominion
Post by: michaeljb on August 14, 2016, 04:19:58 am
Yup that would exactly be it. I would happily add you to the list of alpha-testers, except you were already on it.

I think the correct code should be simply

Code: [Select]
player.gain(context, getMe(), CardObjectName.SILVER, player.getDrawPile());
player.gain(context, getMe(), CardObjectName.SILVER);

I think we need Donald to clarify.
You gain a Silver directly to the top of your deck, then you gain a Silver that has no special destination.

Sounds like my and Stef's interpretation of Beggar's text was a little off then.

Soooo....Watno for alpha testing?
Title: Re: Scripting Dominion
Post by: Watno on August 14, 2016, 09:25:25 am
anyone taking bets whether that is implemented correctly on the MF client? odds are 25 to 1
I guess the chances it's correctly implemented is pretty high, since the correct implementation is a lot simpler than the incorrect one.

The checking name to determine type thing is problematic I think, since it is possible that there are multiple cards that have the same name, but different types: in particular, some, but not all estates might be attacks (if someone inherited an attack)
Title: Re: Scripting Dominion
Post by: Watno on September 13, 2016, 05:47:35 am
...

Yup that would exactly be it. I would happily add you to the list of alpha-testers, except you were already on it.
We are currently aiming for a closed alpha at the start of September.
Hopefully it goes well and we can expand the list a bit halfway through September.

Any news about this?
Title: Re: Scripting Dominion
Post by: Chris is me on September 13, 2016, 07:55:01 am
...

Yup that would exactly be it. I would happily add you to the list of alpha-testers, except you were already on it.
We are currently aiming for a closed alpha at the start of September.
Hopefully it goes well and we can expand the list a bit halfway through September.

Any news about this?

Ha! Joke's on you! They never said which September they were opening up Alpha testing. :)
Title: Re: Scripting Dominion
Post by: Accatitippi on September 13, 2016, 08:03:41 am
...

Yup that would exactly be it. I would happily add you to the list of alpha-testers, except you were already on it.
We are currently aiming for a closed alpha at the start of September.
Hopefully it goes well and we can expand the list a bit halfway through September.

Any news about this?

Ha! Joke's on you! They never said which September they were opening up Alpha testing. :)

...and in an unexpected twist of events, they found out that SCSN had been Goko all along.
Title: Re: Scripting Dominion
Post by: -Stef- on September 14, 2016, 04:24:51 am
Any news about this?

No, not really any news. We did start alpha testing with a very small group. It will remain small for a while longer.
Title: Re: Scripting Dominion
Post by: Jeebus on September 29, 2016, 01:33:41 pm
Dear f.ds,


One of the cards I posted here is in conflict with the Dominion rules, even though it would have been fine pre Adventures.
Why o why haven't you complained about that yet?

Why o why didn't you read my rules document to find out how Beggar works? ;) It's the one place were all rulings and explanations are collected, so it should really be checked for all cards.
Title: Re: Scripting Dominion
Post by: Watno on September 29, 2016, 01:57:17 pm
The Wiki also has all the current rulings I think. However, ShIT knows about future rules (not anymore probably), so a document about current rules probably is of little value to them.

By the way, your document claims that the rulebook says "When you discard this as a Reaction, the first Silver is GAINED TO YOUR DECK. The second one is gained to your discard pile." The rulebooks says no such thing, it only states a consequence of this. As far as I'm aware, the first time tthis ruling was made was in this thread by Donald. (Also, the formulation "when you discard as a reaction" is misleading, you probably mean "when you discard Beggar due to its reaction ability".
Title: Re: Scripting Dominion
Post by: Jeebus on September 29, 2016, 05:03:55 pm
The Wiki also has all the current rulings I think.
It doesn't.

However, ShIT knows about future rules (not anymore probably), so a document about current rules probably is of little value to them.
The document has many rulings and clarifications that are not in any rulebook. Most of these will not be changed by future rules.

By the way, your document claims that the rulebook says "When you discard this as a Reaction, the first Silver is GAINED TO YOUR DECK. The second one is gained to your discard pile." The rulebooks says no such thing, it only states a consequence of this. As far as I'm aware, the first time tthis ruling was made was in this thread by Donald.
Oh ye of little faith. Donald stated it here (http://forum.dominionstrategy.com/index.php?topic=13812.msg520883#msg520883) more than a year ago. That was the basis for my explanation. He says there that the ruling follows from the statement in the rulebook FAQ, and I agree, that's why I phrased it as being from the rulebook and not really a "ruling".

(Also, the formulation "when you discard as a reaction" is misleading, you probably mean "when you discard Beggar due to its reaction ability".
Of course I mean that, but I tried to phrase it a little shorter. What can it be misunderstood to mean?
Title: Re: Scripting Dominion
Post by: werothegreat on September 30, 2016, 01:16:59 pm
The Wiki also has all the current rulings I think.
It doesn't.

What, exactly, doesn't it have?
Title: Re: Scripting Dominion
Post by: Jeebus on September 30, 2016, 03:58:51 pm
The Wiki also has all the current rulings I think.
It doesn't.

What, exactly, doesn't it have?

I'm sorry, but I just don't have it in me to go through it and check, and nothing springs to mind now.

When people started doing the wiki (unbeknownst to me), my BGG FAQ - which was the precursor to my rules document - already existed. When I discovered the wiki, I found it a bit odd that my FAQ was not consulted by the people writing the wiki, since that FAQ was the only text that aimed to have all current rulings and clarifications collected. I posted in this forum about it, after checking that indeed several things were missing in the wiki. Nobody responded as I remember - at least nothing was done. I hope you understand that I didn't see it as my job to update the wiki then. I had already done a lot of work. (If they had started adding stuff from my FAQ and asked me for some sort of help, og course I would cooperate, but that's different.) From then on it seemed the two documents would lead separate lives.

Since then for sure the wiki has been significantly improved, but I haven't seen any evidence that anybody uses my FAQ or now my document to update the wiki (or put in the work themselves to go through everything Donald has posted here and in all the BGG Dominion forums as I have done), and from time to time I discover some missing stuff there. The Beggar thing in this very thread is one example. A little while ago there was a thread and discussion about the "dividing line", which had been in my FAQ for ages but was not defined in the wiki. I guess it got added after that thread.

Now, as then, anybody is free to go through my rules document and add whatever they want to the wiki.
Title: Re: Scripting Dominion
Post by: werothegreat on September 30, 2016, 04:05:27 pm
The Wiki also has all the current rulings I think.
It doesn't.

What, exactly, doesn't it have?

I'm sorry, but I just don't have it in me to go through it and check, and nothing springs to mind now.

When people started doing the wiki (unbeknownst to me), my BGG FAQ - which was the precursor to my rules document - already existed. When I discovered the wiki, I found it a bit odd that my FAQ was not consulted by the people writing the wiki, since that FAQ was the only text that aimed to have all current rulings and clarifications collected. I posted in this forum about it, after checking that indeed several things were missing in the wiki. Nobody responded as I remember - at least nothing was done. I hope you understand that I didn't see it as my job to update the wiki then. I had already done a lot of work. (If they had started adding stuff from my FAQ and asked me for some sort of help, og course I would cooperate, but that's different.) From then on it seemed the two documents would lead separate lives.

Since then for sure the wiki has been significantly improved, but I haven't seen any evidence that anybody uses my FAQ or now my document to update the wiki (or put in the work themselves to go through everything Donald has posted here and in all the BGG Dominion forums as I have done), and from time to time I discover some missing stuff there. The Beggar thing in this very thread is one example. A little while ago there was a thread and discussion about the "dividing line", which had been in my FAQ for ages but was not defined in the wiki. I guess it got added after that thread.

Now, as then, anybody is free to go through my rules document and add whatever they want to the wiki.

Well, uh, see the wiki is a community project that the entire forum is welcome to participate in, rather than a single thing run by one guy.  I mean, I'm sure you put a lot of effort into it, but you seem kind of presumptuous/condescending about it, like yours is some holy text or something.  And I realize that may seem hypocritical to some on here, given my relationship with the wiki, but I've been trying to be a bit more hands off about stuff, or at least give valid reasons why things get changed.
Title: Re: Scripting Dominion
Post by: Witherweaver on September 30, 2016, 04:06:40 pm
Can we just have the actual document on the Wiki?
Title: Re: Scripting Dominion
Post by: Chris is me on September 30, 2016, 04:08:12 pm
Generally when someone asks "why doesn't a wiki have information I've collected on it", the answer is "because you haven't put it there yet". Who else is going to do it?
Title: Re: Scripting Dominion
Post by: Jeebus on September 30, 2016, 04:12:44 pm
Well, uh, see the wiki is a community project that the entire forum is welcome to participate in, rather than a single thing run by one guy.  I mean, I'm sure you put a lot of effort into it, but you seem kind of presumptuous/condescending about it, like yours is some holy text or something.  And I realize that may seem hypocritical to some on here, given my relationship with the wiki, but I've been trying to be a bit more hands off about stuff, or at least give valid reasons why things get changed.

I see that you find fault in how I seem as a person writing that post, but what is your actual disagreement about what I wrote? I tried to explain why I'm not going to do the work of consolidating my doc into the wiki. Anybody else can do, one or several people. As you say, it's a community project. Are you saying that I should have just done it way back then?

Btw, I found that post (http://forum.dominionstrategy.com/index.php?topic=5488.0). One person did reply.
Title: Re: Scripting Dominion
Post by: Witherweaver on September 30, 2016, 04:15:53 pm
I think I understand Jeebus' position.  I don't know the specific details, but it sounds like he spent a bunch of time compiling FAQs and rules and stuff, and then a separate Wiki project took place that overlapped in a lot of material.  So he's like, well why not just use what I already did? 
Title: Re: Scripting Dominion
Post by: werothegreat on September 30, 2016, 04:20:12 pm
I think I understand Jeebus' position.  I don't know the specific details, but it sounds like he spent a bunch of time compiling FAQs and rules and stuff, and then a separate Wiki project took place that overlapped in a lot of material.  So he's like, well why not just use what I already did?

Because we have the actual rules?  And Donald X's actual rulings compiled neatly in one place?  And community consensus about strategy and whatnot?  It just seems redundant, really.  Maybe the people who started the wiki didn't know about Jeebus' document?  Honestly, I hadn't even heard of it until he announced he was adding Empires to it.  I mean, there are a lot of "Dominion compendium"s out there.  Yours isn't the only one, Jeebus.
Title: Re: Scripting Dominion
Post by: Jeebus on September 30, 2016, 04:21:05 pm
Generally when someone asks "why doesn't a wiki have information I've collected on it", the answer is "because you haven't put it there yet". Who else is going to do it?

I see that I failed to communicate. I had already done it, as far as rules go. That was the FAQ. The role of the wiki of course was wider than that FAQ, but as far as rules clarifications go, it was exactly the same. It was a new version of an existing thing. Somehow people "forgot" the FAQ. Ok, no problem, I reminded them. I didn't actually ask, "why isn't it there?". Yes, I could have also just updated it myself. But I could have also just not done that. And that's what I chose. I was and am under no obligation to update the wiki. I had done enough work (according to me). Actually just by having compiled that FAQ, I had done a lot of work for the wiki - if people wanted to take advantage of it.
Title: Re: Scripting Dominion
Post by: Chris is me on September 30, 2016, 04:23:11 pm
I think I understand Jeebus' position.  I don't know the specific details, but it sounds like he spent a bunch of time compiling FAQs and rules and stuff, and then a separate Wiki project took place that overlapped in a lot of material.  So he's like, well why not just use what I already did?

Because we have the actual rules?  And Donald X's actual rulings compiled neatly in one place?  And community consensus about strategy and whatnot?  It just seems redundant, really.  Maybe the people who started the wiki didn't know about Jeebus' document?  Honestly, I hadn't even heard of it until he announced he was adding Empires to it.  I mean, there are a lot of "Dominion compendium"s out there.  Yours isn't the only one, Jeebus.

In fairness, his is exhaustive and really, really good. I have a print copy for real games.
Title: Re: Scripting Dominion
Post by: Witherweaver on September 30, 2016, 04:25:52 pm
I think I understand Jeebus' position.  I don't know the specific details, but it sounds like he spent a bunch of time compiling FAQs and rules and stuff, and then a separate Wiki project took place that overlapped in a lot of material.  So he's like, well why not just use what I already did?

Because we have the actual rules?  And Donald X's actual rulings compiled neatly in one place?  And community consensus about strategy and whatnot?  It just seems redundant, really.  Maybe the people who started the wiki didn't know about Jeebus' document?  Honestly, I hadn't even heard of it until he announced he was adding Empires to it.  I mean, there are a lot of "Dominion compendium"s out there.  Yours isn't the only one, Jeebus.

I don't mean that those answers aren't valid (I don't actually know), I just mean I'd probably feel similar in his position.  Ive had similar things happen on projects where I've gone and done something and then someone else went and did different overlapping things.  Nobody necessarily in the wrong, but you still kind of feel "well I already bdid all this stuff...."
Title: Re: Scripting Dominion
Post by: Jeebus on September 30, 2016, 04:28:21 pm
Because we have the actual rules?  And Donald X's actual rulings compiled neatly in one place?  And community consensus about strategy and whatnot?  It just seems redundant, really.  Maybe the people who started the wiki didn't know about Jeebus' document?  Honestly, I hadn't even heard of it until he announced he was adding Empires to it.  I mean, there are a lot of "Dominion compendium"s out there.  Yours isn't the only one, Jeebus.

With that post I think you have me beat by a mile in the "condescending" category.

Ok, I think you're just not reading anything of what I wrote. "Donald X's actual rulings compiled neatly in one place" was exactly what I had before the wiki even started. (And it's still more complete than the wiki in that regard.) What you haven't heard about is totally on you and irrelevant. Also, if you read the post I linked to, they did know about it. (Also, when you start a wiki for a boardgame that's going to include rulings, the first place you should look is any FAQ on BGG.)

There is only one other "Dominion compendium", by Whaleyland on BGG, and he wanted it to have rulings too, so I gave him permission to use mine. I'm not entirely satisfied with how he's been using them, suffice it to say it creates a bit of confusion, and after I upgraded my BGG FAQ into an actual PDF document I think he's phasing out rulings now and refocusing his document on published stuff. So really there is only my document and the wiki.
Title: Re: Scripting Dominion
Post by: Witherweaver on September 30, 2016, 04:38:29 pm
Can we just have the actual document on the Wiki?

To clarify what I mean, I mean: I've never seen Jeebus' rule document.  This is because I clicked on the link in his sig and it took me to some BGG site, and I didn't see a pdf and I'm like, I don't want to be on that site.  Then I see that you can access a pdf, but you have to create an account and log in, and that's way too much of a commitment.  Ain't nobody got time for that.  On the other hand, if the entire thing were viewable through this site, through the wiki, I would have seen this document.
Title: Re: Scripting Dominion
Post by: werothegreat on September 30, 2016, 05:03:44 pm
Because we have the actual rules?  And Donald X's actual rulings compiled neatly in one place?  And community consensus about strategy and whatnot?  It just seems redundant, really.  Maybe the people who started the wiki didn't know about Jeebus' document?  Honestly, I hadn't even heard of it until he announced he was adding Empires to it.  I mean, there are a lot of "Dominion compendium"s out there.  Yours isn't the only one, Jeebus.

With that post I think you have me beat by a mile in the "condescending" category.

I mean, if you say so.  *shrug*

Ok, I think you're just not reading anything of what I wrote. "Donald X's actual rulings compiled neatly in one place" was exactly what I had before the wiki even started. (And it's still more complete than the wiki in that regard.)

You keep saying that, but you don't provide any examples.

What you haven't heard about is totally on you and irrelevant.

Uh, how exactly is it my fault that I hadn't heard about something?  Bear in mind I didn't start the wiki - I came in a couple years ago, once it was already up and running.

Also, if you read the post I linked to, they did know about it. (Also, when you start a wiki for a boardgame that's going to include rulings, the first place you should look is any FAQ on BGG.)

I mean, if you say so?  I really only look at BGG when the forum is down, so...

There is only one other "Dominion compendium", by Whaleyland on BGG, and he wanted it to have rulings too, so I gave him permission to use mine. I'm not entirely satisfied with how he's been using them, suffice it to say it creates a bit of confusion, and after I upgraded my BGG FAQ into an actual PDF document I think he's phasing out rulings now and refocusing his document on published stuff. So really there is only my document and the wiki.

Fair point.
Title: Re: Scripting Dominion
Post by: Jeebus on September 30, 2016, 06:06:24 pm
You keep saying that, but you don't provide any examples.

I did give you two. But I'm not trying to convince you with examples, no. I'm just stating how it is.

Uh, how exactly is it my fault that I hadn't heard about something?  Bear in mind I didn't start the wiki - I came in a couple years ago, once it was already up and running.

I was not blaming you for how the wiki started. And I was not blaming you for not having heard of my FAQ/doc. I just said that it was irrelevant to whatever point you were making about it. My main point was just to explain how it came to be that my doc has other stuff than the wiki, that's it.

Also, if you read the post I linked to, they did know about it. (Also, when you start a wiki for a boardgame that's going to include rulings, the first place you should look is any FAQ on BGG.)

I mean, if you say so?  I really only look at BGG when the forum is down, so...

Do you know other boardgame resources you would go to for that kind of thing? Or maybe you only play Dominion. If so, your ignorance of the significance of BGG is understandable.
Title: Re: Scripting Dominion
Post by: Witherweaver on September 30, 2016, 06:10:37 pm
This site is the only board game information source I use, or really know of.  I mean, I know what BGG is, but I only go there when things are linked there from this site.  If I ever need to look up something about Dominion, this is the site I think of.
Title: Re: Scripting Dominion
Post by: werothegreat on October 01, 2016, 01:35:16 am
You keep saying that, but you don't provide any examples.

I did give you two. But I'm not trying to convince you with examples, no. I'm just stating how it is.

The Beggar thing, and dividing lines?  I mean, that you put the Silver onto your deck first would seem to be implied by the official FAQ, but I guess it could be explicitly stated in a clarification, though I don't really think that's necessary.  And does the wiki really need an article for dividing lines?  I mean, maybe.

Look, I feel like this is either becoming or might soon become antagonistic, and that's not really what I want to happen.
Title: Re: Scripting Dominion
Post by: werothegreat on October 01, 2016, 01:45:18 am
I just realized we don't have an article for "Card" in the gameplay sense (rather than the piece-of-thin-cardboard sense).  Maybe we could put something similar to your "reading a card" section there.
Title: Re: Scripting Dominion
Post by: Jeebus on October 01, 2016, 10:16:33 am
The Beggar thing, and dividing lines?  I mean, that you put the Silver onto your deck first would seem to be implied by the official FAQ, but I guess it could be explicitly stated in a clarification, though I don't really think that's necessary.  And does the wiki really need an article for dividing lines?  I mean, maybe.

Yes, those two.

Beggar: I refer you to this thread. As I said, I also think it's implied. That didn't stop ShuffleIT and other people from misunderstanding it. Actually, most things in the actual FAQs are implied by the actual card texts, and as such strictly unneeded, but they are of course helpful and often needed after all (and are all included in the wiki).

Dividing line: I'm surprised you would say that, since it has been explained that it has an actual functional purpose and as such rules that come with it. Donald has said that it should've been in the rulebook - and has now put it in. If you're asking whether the wiki needs an actual article solely for the dividing line, I have no idea or opinion. Maybe it belongs in another article. I was just saying that it should be included.
Title: Re: Scripting Dominion
Post by: -Stef- on October 01, 2016, 11:16:19 am
Dear f.ds,


One of the cards I posted here is in conflict with the Dominion rules, even though it would have been fine pre Adventures.
Why o why haven't you complained about that yet?

Why o why didn't you read my rules document to find out how Beggar works? ;) It's the one place were all rulings and explanations are collected, so it should really be checked for all cards.

My problem here was that I assumed I knew how beggar worked. Therefore I wasn't looking for any additional information. Not in your rules document, not on the wiki.
I would like to say "I learned from my mistake" but in reality it's quite unlikely it hasn't already happened for more cards, and it will probably also continue to happen.
Not making any assumptions simply isn't an option.

When I am in doubt, your rules document is certainly something I do consult. And I also check the wiki.
And when nothing else helps, PMs to Donald have been very helpful too. Unfortunately most of those questions had to be secret (2E) but I guess from here on I can ask them in de rules section of this forum again. The answers to those questions... I can imagine you'd want to add them to your document.
Title: Re: Scripting Dominion
Post by: Jeebus on October 01, 2016, 12:03:11 pm
And when nothing else helps, PMs to Donald have been very helpful too. Unfortunately most of those questions had to be secret (2E) but I guess from here on I can ask them in de rules section of this forum again. The answers to those questions... I can imagine you'd want to add them to your document.

Yes, please! Anything not already public would be very appreciated. I'm in the process of updating my doc now. I haven't actually found anything confusing, the cards are pretty simple, but I'm sure there's something.
Title: Re: Scripting Dominion
Post by: Polk5440 on October 05, 2016, 03:13:09 pm
What's your favorite RNG? With a name like Shuffle iT I suspect you think about that a lot.
Title: Re: Scripting Dominion
Post by: Witherweaver on October 05, 2016, 03:26:15 pm
I'm not playing unless they use quasirandom low-discrepancy sequences.
Title: Re: Scripting Dominion
Post by: SCSN on October 05, 2016, 04:28:22 pm
What's your favorite RNG? With a name like Shuffle iT I suspect you think about that a lot.

We started out with RANDU but soon discovered that pseudorandom number generators were fundamentally lacking, so we employed a physicist to measure the decay time of radioactive nuclei. If you ever find your game hanging when you shuffle, it's likely that this guy has died and needs replacing.
Title: Re: Scripting Dominion
Post by: -Stef- on October 05, 2016, 06:08:12 pm
And when nothing else helps, PMs to Donald have been very helpful too. Unfortunately most of those questions had to be secret (2E) but I guess from here on I can ask them in de rules section of this forum again. The answers to those questions... I can imagine you'd want to add them to your document.

Yes, please! Anything not already public would be very appreciated. I'm in the process of updating my doc now. I haven't actually found anything confusing, the cards are pretty simple, but I'm sure there's something.

Well, here you go. I made an effort to extract the parts of these PMs that were 100% about Dominion rules.
(which just means I get to conceal all the dumb questions I asked and Donald was also willing to answer)

Quote from: Donald X.
Quote from: Stef
Suppose I gain a Villa and then lose track of it (topdecking with Watchtower) obviously the putting into hand will fail.
I assume though the +1 action and the returning-to-action-phase are still happening?
Yes. Lose-track never stops anything except moving a card.

Quote from: Donald X.
Quote from: Stef
My question was about buying two expeditions and then playing outpost (using Villa). Now does the outpost "make the number of cards to draw equal to 3" (usually turning a 5 into a 3, but in this case turning a 9 into a 3, and thus nullifying the expeditions) or do the expeditions still do their work? (i.e. outpost only affects the "regular" draw, and the extra draw is unaffected by outpost).
Outpost makes the default number drawn 3; Expedition adds to that. If you buy 2 Expeditions, buy Villa, play Outpost, you get 7 cards.

Quote from: Donald X.
Quote from: Stef
Slightly less likely to happen, but does the same thing apply to Pilgrimage?
Suppose I start by gaining a copy of Ill Gotten Gains, do I get to know if my opponent responds with Watchtower before making the other decisions for Pilgrimage?
Given the phrasing of Pilgrimage I am going to say that here you choose the cards first, then gain them in any order. If you picked a full 3 cards to gain, you would gain one before having to decide which of the other two to gain next; but you picked them all at once.

So then, you could pick to gain Mandarin and Gold, gain Mandarin first putting Gold on top, then gain the Gold.

Quote from: Donald X.
Quote from: Stef
I had to code some priority of setup rules, and I was just wondering if you ever thought about this / perhaps already wrote some rules down for it.

Defiled Shrine: Landmark
When you gain an Action, move 1 VP from its pile to this.
When you buy a Curse, take the VP from this.
Setup: Put 2 VP on each non-Gathering Action Supply pile.

Young Witch: Action Attack
+2 Cards
Discard 2 cards. Each other player may reveal a Bane card from his hand. If he doesn't, he gains a Curse.
Setup: Add an extra Kingdom card pile costing Coin2.png or Coin3.png to the Supply. Cards from that pile are Bane cards

I would prefer using common sense (which would come down to just do young witch first, or retroactively apply the defiled shrine if you happened to start with that one).
Another interpretation would be to resolve them in the order of drawing the randomizer cards (but that could lead to weird results with future cards, if you need some setup rule that affects all piles to actually affect all piles but it doesn't?)
Ideally everything happens.

The two things that add cards are Young Witch and Black Market. So deal out everything without accounting for those; then if either is out, resolve one, then if the other is now out, resolve that one (meaning, add the card for Young Witch, or determine the contents of the Black Market deck). Obv. Young Witch can add Black Market and the Black Market deck might have Young Witch in it. If they are both out then I think currently ordering between them doesn't matter.


Quote from: Donald X.
Quote from: Stef
If a pile is double embargo'd and I have a haggler in play, do I have the option of resolving embargo-haggler-embargo?

i.e. does a double embargo'd pile spawn two gains of one curse each, or is it one gain of two curses?
Let's see. The new card phrasing is:

Embargo: Action, $2
+$2
Trash this. Add an Embargo token to a Supply pile. (For the rest of the game, when a player buys a card from that pile, they gain a Curse.)

And the new rulebook says: "This is cumulative; with three Embargo tokens on a pile, buying a card from that pile will give you three Curses."

Well it's a rule about the token, is how I would look at it in the most technical way. The card is pretending it isn't involved, it just places the token (because otherwise how do you make it cumulative the right way). The rulebook of course is not trying to cover every situation and be so clear as to be confusing, e.g. "buying a card from that pile will give you a Curse three times" would make people go "what huh."

Everywhere else in Dominion, these things are multiple triggers, and people must be used to that. Probably if it were one lump someone would eventually report it as a bug. Not for a long time, since it's a rare situation, but still. And they're separate no matter what for e.g. Trader. So let's go with, it's separate triggers, one per Curse.

Quote from: Donald X.
Quote from: Stef
My draw pile and discard are empty, my -1 card token is on there, I have 3 cards in hand and play Library (or watchtower).

Do I lose the -1 card token?
Yes. You lose the token when trying to draw a card, even if there weren't any. You don't make it as far as trying to draw the card; you instead lose the token. In the case of Library and Watchtower of course you then keep going. As you may have guessed, Library with 7 cards in hand would not remove the token.

However you only lose the -$1 token when making $1 or more $, not when making $0 (e.g. Harvest with an empty deck).

Quote from: Donald X.
Quote from: Stef
- If I Summon a Hireling, do I already get the extra card on my next turn?
You get the card.

Quote from: Donald X.
Quote from: Stef
Suppose you play a Rabble, and I reveal Copper, Estate, Duchy.
Do you get to know if I put the Estate or the Duchy on top?
Yes. They were revealed, and nothing ever said to conceal them. That would also apply to e.g. Oracle.

In practice no-one would show you irl, but there would have to be a general rule to fix that, and it would be a weird general rule. The card itself sure doesn't want to say, "then conceals them, then returns them in any order they choose."
Title: Re: Scripting Dominion
Post by: Jeebus on October 05, 2016, 08:27:49 pm
Thanks! I thought you were talking about questions about the new 14 cards, that's why I said they were pretty simple. But I see that it's mostly about Adventures. I have all of these covered already, except for the one about Pilgrimage. Also I have the oppsite ruling for double Embargo + Haggler.
Title: Re: Scripting Dominion
Post by: Jeebus on October 05, 2016, 08:36:22 pm
Quote from: Donald X.
Quote from: Stef
If a pile is double embargo'd and I have a haggler in play, do I have the option of resolving embargo-haggler-embargo?

i.e. does a double embargo'd pile spawn two gains of one curse each, or is it one gain of two curses?
Let's see. The new card phrasing is:

Embargo: Action, $2
+$2
Trash this. Add an Embargo token to a Supply pile. (For the rest of the game, when a player buys a card from that pile, they gain a Curse.)

And the new rulebook says: "This is cumulative; with three Embargo tokens on a pile, buying a card from that pile will give you three Curses."

Well it's a rule about the token, is how I would look at it in the most technical way. The card is pretending it isn't involved, it just places the token (because otherwise how do you make it cumulative the right way). The rulebook of course is not trying to cover every situation and be so clear as to be confusing, e.g. "buying a card from that pile will give you a Curse three times" would make people go "what huh."

Everywhere else in Dominion, these things are multiple triggers, and people must be used to that. Probably if it were one lump someone would eventually report it as a bug. Not for a long time, since it's a rare situation, but still. And they're separate no matter what for e.g. Trader. So let's go with, it's separate triggers, one per Curse.

This is the one I've had for some years as the opposite, based on this ruling (http://forum.dominionstrategy.com/index.php?topic=5990.msg155726#msg155726).
Donald, can you confirm that each token is a separate trigger? Does that mean that new Embargo is functionally different from the old one? Or is it just a rulings reversal?
Title: Re: Scripting Dominion
Post by: Donald X. on October 05, 2016, 11:57:19 pm
This is the one I've had for some years as the opposite, based on this ruling (http://forum.dominionstrategy.com/index.php?topic=5990.msg155726#msg155726).
Donald, can you confirm that each token is a separate trigger? Does that mean that new Embargo is functionally different from the old one? Or is it just a rulings reversal?
The ruling you have is correct for the published Embargo (which says, "a Curse per Embargo token"). And there is no new Embargo wording yet. It seems like a bad precedent to answer rules questions about the new wording just because someone LEAKED it.

And I mean. If you want your rules document to be up-to-date, that would mean not including rulings for new wordings until there are actual new wordings.
Title: Re: Scripting Dominion
Post by: Jeebus on October 06, 2016, 12:01:49 am
The ruling you have is correct for the published Embargo (which says, "a Curse per Embargo token"). And there is no new Embargo wording yet. It seems like a bad precedent to answer rules questions about the new wording just because someone LEAKED it.

And I mean. If you want your rules document to be up-to-date, that would mean not including rulings for new wordings until there are actual new wordings.

Fair enough. I asked if it was a rulings reversal, and you said it isn't and that the old ruling applies to the current Embargo, so that's all I need to know. Thanks.