Shuffle iT Forum

Dominion => General Discussion => Topic started by: Icehawk78 on 24 January 2017, 04:47:21 am

Title: [Mod] King's Courtier (Chrome Plugin)
Post by: Icehawk78 on 24 January 2017, 04:47:21 am
This is still very much a work in progress, but it was suggested that I post this here, since the other two mods are also here.

King's Courtier is a Chrome Plugin that adds some extra functionality to the Shuffle iT site. Currently there are only two features, but more are in progress:


Download from here:  https://github.com/Icehawk78/kings_courtier/releases

Configuration:

I'm working on a screen that will let you change which options are active, but in the meantime, you can change the options by opening your Javascript Console (on Windows, ctrl-shift-j) and running this:

Turn off the text-view kingdom:
Code: [Select]
KC.update_preference('kingdom_text', false);
Turn off the repeat kingdom button:
Code: [Select]
KC.update_preference('show_repeat', false);
Title: Re: [Mod] King's Courtier (Chrome Plugin)
Post by: Icehawk78 on 31 January 2017, 12:13:09 pm
Finally getting around to updating this post.

I now have the full Kingdom viewer working, which also now allows for naming of cards that are not in visible piles, including split pile cards, individual knights, shelters, and ruins.

Installation instructions:

This can be installed via the Chrome Web Store at King's Courtier (https://chrome.google.com/webstore/detail/kings-courtier/ldclbofdofipkpgnilkjaalbalnjacjk?hl=en-US&gl=US) or by downloading it directly from Github (https://github.com/Icehawk78/kings_courtier/releases).

To open the Kingdom viewer, simply click the "Kingdom" button on the left.

(http://i.imgur.com/XX6Bo40.jpg?1)

You will then be presented with this screen:

(http://i.imgur.com/6IeB6JD.jpg?1)

Some notes:

Title: Re: [Mod] King's Courtier (Chrome Plugin)
Post by: yed on 31 January 2017, 01:06:48 pm
I thought you don't have access to oponent hand client side. Same with Black Market, client don't need it so why is it possible to find by the extension?
Title: Re: [Mod] King's Courtier (Chrome Plugin)
Post by: Icehawk78 on 31 January 2017, 03:29:21 pm
I thought you don't have access to oponent hand client side. Same with Black Market, client don't need it so why is it possible to find by the extension?

Ironically, the issue is that in the client, the opponent's hand and the BM deck are the only two card piles which you *don't* have access to. This includes both players' deck and discard piles, provided a single shuffle has occurred.

As a result, for certain cards such as castles, knights, or anything bought from the Black Market, if I hid cards which I couldn't find in any public pile, which is currently the only way for me to positively identify whether a card is in the Black Market pile or not, then they would disappear from the Kingdom view when your opponent drew them into their hand.
Title: Re: [Mod] King's Courtier (Chrome Plugin)
Post by: allanfieldhouse on 31 January 2017, 11:23:13 pm
I thought you don't have access to oponent hand client side. Same with Black Market, client don't need it so why is it possible to find by the extension?

Ironically, the issue is that in the client, the opponent's hand and the BM deck are the only two card piles which you *don't* have access to. This includes both players' deck and discard piles, provided a single shuffle has occurred.

So the issue is that you don't have access to the PILE, but you still know the list of cards in the GAME, right? I think his question was more, "how do you even know what's in the BM deck?"
Title: Re: [Mod] King's Courtier (Chrome Plugin)
Post by: Icehawk78 on 01 February 2017, 12:07:34 am
So the issue is that you don't have access to the PILE, but you still know the list of cards in the GAME, right? I think his question was more, "how do you even know what's in the BM deck?"

Ah. Yes, that is exactly correct.

The client has a list of all of the different cards in the game, that I have access to and am using for building the screen, which includes the Black Market cards. The client also has a "black market pile" which does not contain a list of cards, just a count.
Title: Re: [Mod] King's Courtier (Chrome Plugin)
Post by: fett0001 on 01 February 2017, 03:16:32 am
Since we know what's been gained from BM/castles/etc. why not remove those cards from your display?
Title: Re: [Mod] King's Courtier (Chrome Plugin)
Post by: Icehawk78 on 01 February 2017, 03:39:04 am
Since we know what's been gained from BM/castles/etc. why not remove those cards from your display?

The issue is that while you may know that from reading the log, there isn't a clear place I've been able to find that stores that information in the client model.

What I currently have to work with is the following:

Full card list of the game (this contains every card name that exists in this game)
List of "zones"


Each of these zones contains a list of cards that they contain. However, some of those cards are literally just marked as "Card Back" (ie hidden from you/the client).

The issue is that if you look at the list above, the bold zones contain the actual names of the card contents. However, the italicized zones contain only a card count, with each card being listed as the generic "back".

As such, because I have only a full card list to start with, without being told what the contents of the black market deck are, I don't have a way of knowing whether a given card that is in the full card list but not visible in any of the other zones is "in the black market" or "in my opponent's hand". As such, if I simply didn't display any cards that I can't see in any given zone, then I might inadvertently reveal which cards are in your opponent's hand. Imagine a game being played with Knights, and I notice that "Dame Anna" is no longer visible in the kingdom view. It could be that that card is in the black market. However, it could also be in your hand.

As such, I judged that it was safer to not ever potentially reveal information about your opponent's hands, and instead to show the contents of the Black Market. If the client is updated to have the contents of the BM deck known, then I will remove it from my extension.
Title: Re: [Mod] King's Courtier (Chrome Plugin)
Post by: Martin plays Piano on 01 February 2017, 12:08:29 pm
Hi Icehawk,

has anybody told you, how great and helpful your features are? – many thx for your extensions, I really appreciate your service here.

Some thoughts for you to consider:
- the sort of the shown kingdom cards is the other way around than in the game
(yours starts top left with the cheapest card and ends bottom right with the most expensive one)
(in the game you know the cheapest is bottom left and ends up with the most expensive top right)
- Events and landmarks are currently not shown
- split cards are shown, but not as a corresponding couple – mostly the covered card is top left (like Avanto) and the Sauna card is somewhere
- perhaps you can reduce the size of your kingdom display to avoid the scrolling – so you can have 6 or 7 cards in one row and this will give the possibility to show even bigger kingdoms on one page then

And by the way, on a second computer I get the problem, that Chrome administrator blocks the installation of your plug-in, but I will figure it out somehow.
Title: Re: [Mod] King's Courtier (Chrome Plugin)
Post by: Icehawk78 on 01 February 2017, 02:26:10 pm
Kingdom sort: This was an intentional decision because it's quite difficult to draw from the bottom left and go up, so it's unlikely to change.

Landscape cards will require me to update the rendering code, so while I might get to it eventually, it's not currently a high priority.

I agree with your assessment of split cards and am still currently trying to find a good way to display them. Unfortunately, I don't currently know of a way to tie them together, but I'm looking into it.

Changing the size of the kingdom is definitely doable and will likely be a configuration option in the next version.

Thanks for your feedback!
Title: Re: [Mod] King's Courtier (Chrome Plugin)
Post by: fett0001 on 02 February 2017, 02:54:47 am
Knights can't be both in the kingdom and in the BM deck. Unless there's something strange about the implementation.
Title: Re: [Mod] King's Courtier (Chrome Plugin)
Post by: Icehawk78 on 02 February 2017, 03:17:17 am
Knights can't be both in the kingdom and in the BM deck. Unless there's something strange about the implementation.

True, but the issue is still that for any other card in the BM deck, I don't have a way of knowing whether it's not been bought or is just in an opponent's hand.

I would also not be terribly surprised if the same code that would hide the BM deck might also hide the knights pile contents, as well.