It is currently 25 Apr 2024, 00:16
   
Text Size

Clarification: DeckHints and DeckNeeds

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Clarification: DeckHints and DeckNeeds

Postby HarePaiR » 24 Dec 2014, 10:16

Having done a search, it looks like the only thread discussing these SVars is two years old, though some DGM cards use DeckNeeds and some scripts with DeckHints are still in the cardfolder. I find these particularly interesting for draft, and I have a few questions about them.

1) Are these still supported/do they do anything?
2) If so, is it useful to update cardscripts to use them?
3) The DeckHints section is potentially very open-ended. For example, Evil Presence could include a list of all creatures with Swampwalk...but this seems like an unclean implementation. Whereas a card like Plague Rats could clearly benefit from DeckHints:Named$ Plague Rats, without that list getting out of control. Is there a guideline for how to use this SVar?

One could imagine restricting the DeckHints section to cards within a draft environment. This would at least keep the list definitely below a few tens of cards (usually much less).

P.S. - I have similar questions about SVar:BuffedBy. For example, should Merfolk of the Pearl Trident have a list of all Merfolk lords? Should all white creatures have Crusade? Should all creatures have Glorious Anthem?
HarePaiR
 
Posts: 21
Joined: 02 Dec 2014, 11:13
Has thanked: 11 times
Been thanked: 2 times

Re: Clarification: DeckHints and DeckNeeds

Postby mcrawford620 » 07 Jul 2016, 05:48

Replying only 2 years too late...but maybe it will help someone else...

The DeckHints and DeckNeeds are still used by the LimitedDeckBuilder for building limited decks. If the builder puts in a card that has the DeckHints tag, it will try to find other cards that it has and put them in too. At the end, if it wasn't able to add anything that makes the card playable, it will remove it.

I think the tags didn't get used much because it's just one more thing to think about when scripting the cards, it was a bit complicated, and it only helps building limited decks, so it isn't vital. I'm sure it wasn't the best implementation. Still, I think I'll try to add a few more to some of the newer sets I've been fooling around with.

The logic probably needs to be added to the BoosterDraftAI so that it will actively draft those cards but I neglected to do that.

The old post's description is still correct as far as I can tell (reading over the code now after a few years away...)

mcrawford620 wrote:RemRandomDeck -- this is the baseline, since it's well established. Any card marked will be checked at the end of building the LimitedDeck, and will be removed unless it's also marked with a DeckNeeds or DeckHints.

DeckNeeds -- This only makes sense to use with RemRandomDeck:True. AI will put the card in. Then at the end if it's marked as RemRandomDeck, check to make sure a DeckNeeds card is in there. If not, it will remove the card. This is for cards that are only useful in combination with something else that is already in the deck. Farseek and Angel's Feather are good examples.

DeckHints -- AI will put the card in and then actively try to add the DeckHints cards. This makes sense to be used with or without RemRandomDeck. Cards that are useful by themselves can just use DeckHints, and will be left in even if no complementary cards are found. But if it's marked RemRandomDeck, it is subject to removal from the deck if nothing can be found.
mcrawford620
 
Posts: 112
Joined: 25 Jun 2012, 16:59
Has thanked: 55 times
Been thanked: 25 times

Re: Clarification: DeckHints and DeckNeeds

Postby mcrawford620 » 07 Jul 2016, 05:51

Also FWIW, if nothing else for my own reference:

There are 4 kinds of Hints that can be added to the card scripts:
Color, Keyword, Name (i.e., exact card name), and Type.
mcrawford620
 
Posts: 112
Joined: 25 Jun 2012, 16:59
Has thanked: 55 times
Been thanked: 25 times

Re: Clarification: DeckHints and DeckNeeds

Postby mcrawford620 » 07 Jul 2016, 05:58

Thinking a bit more about the BoosterDraftAI...

One problem is, how much would you boost a pick because it has synergy with a card you already have? It obviously varies widely by how much synergy you're getting, and there's no simple way to code that into the cards. Still, something is probably better than nothing, perhaps just a flat boost like is currently (negatively) done with AI Unplayable cards.
mcrawford620
 
Posts: 112
Joined: 25 Jun 2012, 16:59
Has thanked: 55 times
Been thanked: 25 times

Re: Clarification: DeckHints and DeckNeeds

Postby friarsol » 07 Jul 2016, 13:00

mcrawford620 wrote:One problem is, how much would you boost a pick because it has synergy with a card you already have? It obviously varies widely by how much synergy you're getting, and there's no simple way to code that into the cards. Still, something is probably better than nothing, perhaps just a flat boost like is currently (negatively) done with AI Unplayable cards.
I think the primary thing you want to boost it on is the draft score of the playable cards in your pool. So for example, if I draft mono red, and it's in the middle of the second pack, I already have a handful of cards that won't made that 22/23 of the draft pod. So not counting those, score each of the matching cards on a scale of how strong that card is. I don't think this will affect the first 5 cards you draft typically, but it can make a difference in the second 5 cards where values are much closer together. Other things that could be considered in a similar manner (although its a bit offtopic for deckhints) is mana curve. If the AI is almost building the deck on the fly for deck hints, cards with lots of slots already taken might be a small demerit.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Clarification: DeckHints and DeckNeeds

Postby mcrawford620 » 07 Jul 2016, 20:34

friarsol wrote:I think the primary thing you want to boost it on is the draft score of the playable cards in your pool. So for example, if I draft mono red, and it's in the middle of the second pack, I already have a handful of cards that won't made that 22/23 of the draft pod. So not counting those, score each of the matching cards on a scale of how strong that card is. I don't think this will affect the first 5 cards you draft typically, but it can make a difference in the second 5 cards where values are much closer together. Other things that could be considered in a similar manner (although its a bit offtopic for deckhints) is mana curve. If the AI is almost building the deck on the fly for deck hints, cards with lots of slots already taken might be a small demerit.
I think I understand the gist of what you're saying. I'm trying to think how it would work in the context of the draft-cards loop.

Right now it loops through the cards in the pack and assigns each one a score (and later picks one of the cards with the best score). So we can insert a clause there that will look through the cards it's already picked, and see if any of those match the card in the pack, and boost that card accordingly.

I think what you're saying is that the card in the pack should only be boosted if the matching card is actually going to make it into the 22/23 cards in the actual deck. That's makes sense. Now just have to figure out how to judge whether the matching already-picked card will be playable.
mcrawford620
 
Posts: 112
Joined: 25 Jun 2012, 16:59
Has thanked: 55 times
Been thanked: 25 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 79 guests


Who is online

In total there are 79 users online :: 0 registered, 0 hidden and 79 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 79 guests

Login Form