It is currently 24 Apr 2024, 09:23
   
Text Size

Card AI (Improvements) Requests

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

Re: Card AI (Improvements) Requests

Postby lujo » 18 Oct 2014, 18:40

No, no, it's not that it keeps activation it's ability if it's on the stack, but it keeps using it's ability if it's in play because it has no idea what would happen, and the ability is free. Which then inevitably causes it to phase the efreet out or kill it in it's upkeep every time, and that deck (it's a famous torurney deck) very likely only runs that one creature. So it's 100% pointless XD
---

My Shandalar deck pack folder is avaliable here:Dropbox
Leave feedback on particular decks here: Google doc
Ask for instructions, give feedback and complaints here: Thread
User avatar
lujo
 
Posts: 557
Joined: 20 Nov 2013, 13:17
Has thanked: 224 times
Been thanked: 70 times

Re: Card AI (Improvements) Requests

Postby Sloth » 18 Oct 2014, 21:03

lujo wrote:Why does all this stuff need to be explained at all? I had a group of 9 15-20 year term magic vets looking at me and asking me this the other day, all in disbelief. I asked them would they still use Forge, and the answer was, well, if the draft worked it's be good, but as it is now we got cockoatrice (also named a few other things) if we want to play against each other.

Why does it have to be like that?
Like many open source projects Forge has gone through the hands of many developers who came and went. Most of them are only interested in and advance some of the features of the software.
For example the Gauntlet mode of Forge was broken for month (years?) and no one of the devs cared about it until one day someone came around and fixed it.

There is no developer who is currently working on the Draft mode and there hasn't been one for a long long time. As far as i can remember we never had anyone in our team who really felt like Draft mode was one of his most important areas. Quest mode has been and is still is getting all the attention.

The heart of the draft code - the picking function - is still very simple:
choose | Open
Code: Select all
    public PaperCard choose(final List<PaperCard> chooseFrom, final int player) {
        if (ForgePreferences.DEV_MODE) {
            System.out.println("Player[" + player + "] pack: " + chooseFrom.toString());
        }

        DeckColors deckCols = this.playerColors.get(player);
        ColorSet currentChoice = deckCols.getChosenColors();
        boolean canAddMoreColors = deckCols.canChoseMoreColors();
       
        List<Pair<PaperCard, Double>> rankedCards = rankCards(chooseFrom);
       
        for(Pair<PaperCard, Double> p : rankedCards) {
            double valueBoost = 0;

            // If a card is not ai playable, somewhat decrease its rating
            if( p.getKey().getRules().getAiHints().getRemAIDecks() )
                valueBoost = TAKE_BEST_THRESHOLD;

            // if I cannot choose more colors, and the card cannot be played with chosen colors, decrease its rating.
            if( !canAddMoreColors && !p.getKey().getRules().getManaCost().canBePaidWithAvaliable(currentChoice.getColor()))
                valueBoost = TAKE_BEST_THRESHOLD * 3;

            if (valueBoost > 0) {
                p.setValue(p.getValue() + valueBoost);
                //System.out.println(p.getKey() + " is now " + p.getValue());
            }
        }

        double bestRanking = Double.MAX_VALUE;
        PaperCard bestPick = null;
        final List<PaperCard> possiblePick = new ArrayList<PaperCard>();
        for(Pair<PaperCard, Double> p : rankedCards) {
            double rating = p.getValue();
            if( rating <= bestRanking + .01 ) {
                if (rating == bestRanking) {
                    possiblePick.clear();
                }
                bestRanking = rating;
                possiblePick.add(p.getKey());
            }
        }

        bestPick = Aggregates.random(possiblePick);

        if (canAddMoreColors)
            deckCols.addColorsOf(bestPick);
       
        System.out.println("Player[" + player + "] picked: " + bestPick + " ranking of " + bestRanking);
        this.deck.get(player).add(bestPick);
       
        return bestPick;
    }
Explanation:
There is a file called Rankings.txt (in the res/draft/ folder) where all sets have a picking order. Cards the AI can't play will be ranked 10% lower, hate draft picks 30% lower. That's it.

lujo wrote:In the Jamuraa world, there is at least one deck with Frenetic Efreet. The AI just keeps flipping the coin on it all the time.
This has been fixed now. But don't expect me to fix all the crap in the Jamuraa world. That world wasn't approved by me and apparently wasn't tested at all.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card AI (Improvements) Requests

Postby friarsol » 18 Oct 2014, 21:38

Sloth wrote:Explanation:
There is a file called Rankings.txt (in the res/draft/ folder) where all sets have a picking order. Cards the AI can't play will be ranked 10% lower, hate draft picks 30% lower. That's it.
Just to quickly add to this. The rankings.txt comes from http://draft.bestiaire.org/ so if we don't have good rankings its because noone cares about those formats on a pretty large website. And the "hate draft" logic I recently lowered the threshold on, it used to be much much higher (potentially almost unpickable).
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card AI (Improvements) Requests

Postby lujo » 19 Oct 2014, 00:14

Well, thanks for those answers guys, though it's still pretty strange that whoever went to the trouble of implementing it originally hadn't noticed this.

Here's something I do know, the interest in older sets goes way up if there's an option to play against the AI or potentially in the future against people in a program which has an engine with visual components. Bestiare could generate interest with people who'd use it to practice "goldfishing" drafts which they wanted to or could play in RL. Forge opens up the possibility to actually draft and play stuff that you'd never be able to play in RL so there's no point practicing on Bestiaire.

Since Forge simulates a MtG career through quest, and those old sets certainly contain cards someone would love to get, you can certainly expect interest for drafting those sets to rise. Drafting is, even in RL, the best way to gain new cards, and Quest drafts reward you with a pick of rares from the set - if you win. People who do quests will be very keen on learning the ins and outs of many drafts and will be playing many drafts. I've 0 interest in Zendikar in a vacuum, but I got a rare from Worldwake as a reward in a quest, liked it a lot, and the only way to get another one was to win a draft (or open it in a draft) - this led me to play something like 20 Zendikar drafts even though it wasn't what I set down to do. I was so fun I even forgot what I started drafting Zendikar for, had to remember what my original deck even was.

You want dual lands? Better learn how to win Ravnica drafts. You want the Urza block nonsense? Better learn how to draft Urza's Block. Wanna play a toolbox deck - better learn how to play Oddisey Block drafts. Want vintage combo pieces? Better learn Tempest and Ice Age. Want Fires or Rebels? Masques and Invasion! Want to relive the decks you couldn't put togather as a kid? Forge makes it an adventure!

EDIT: And one HUGE thing about interest in older drafts and sets is that many of their cards have crazy awesome and cool interactions with cards they were never in a playable format with. Forge quest means that I can mix, say Masques, Oddisey and Time Spiral cards in decks which don't compete against broken Vintage decks. The interest in those sets in RL might not be large because there's nowhere to play cards from them competitively - in Forge you don't have that problem. Which raises the appeal of a load of older cards (Masques block in particular is something else in Quest than it was in RL entirely.)

In fact, the cost of RL drafting and the trouble it takes to go through to organize them is something that's nonexistant in Forge, so in case it crossed noone's mind yet - well functioning drafts are basically the biggest possible draw the program could even have.

I'm not even sure I can adequately describe the ammount of stuff this allows. Whole sets and craptons of cards from them have fallen to obscurity for no good reason because they got stuck with reputations based on factors which don't exist in forge. "Fallen Empires are the worst set in magic." "Mercadian Masques were terrible", etc, etc, with Forge I can make actual videos of drafts (provided the drafting process works) that you can link to anyone asking about that stuff, you can actually go and check out formats where MtG stuff was happening that you couldn't even dream about today.

Oddisey draft? I've won constructed tournaments against people years later simply because I have played during that block and they haven't so they couldn't even believe some stuff was possible to do in Magic. Louis Scott Vargas says he and his buddies stockpile Invasion boosters just so they can keep drafting it - with Forge anyone can experience that, draft and see how what you drafted plays.

You couldn't even generate interest in those drafts with anything before, not on this scope.

Anywho, I'm cursing the fact that I didn't take up programming and so can't adequately be "the draft guy" for a while. Because I actually do have most of the data required (and an unhealthy amount of will), and I certainly have to experience and capability (and a crew of other cube builder vets) to get quite a number of these old sets at least drafting sensibly if not playing sensibly.

Thanks for the code, and I'll look into it. I understand that mindless hate drafting might've caused more problems for the AI than it solved, but there's absolute need to get certain picks (even if the AI has trouble playing them) happening with proper priority in most worlds. Sparksmiths and Wirewood Elves in onslaught, etc.

I'll see what I can do (or if I can find a programmer among my crew who can help me out with it). In the meantime I put up a bit of an analysis on a set which could be fixed quite a bit rather easily - Fallen Empires. It's a very tight, very small set that I know inns and outs of at any time of day or night. I'd love to try using it as a testing ground for what I could do (or assist someone willing to give it a shot in any way possible). It's probably either the best place to try to get a good drafting process working in since it could be really easy, or the worst which means highest value in experience trying.

And really sorry about the tone guys, you got your own interests and priorities and time and habits, but you're sitting on such a motherload of holy grails that I want to strangle myself for not being any good at coding more than anything.


Oh, and thanks for the Frenetic Efreet fix. It's not so much about fixing Jamuraa (I've played it before wasn't too terrible), but more about that particular card being hilariously bugged "in effect".
---

My Shandalar deck pack folder is avaliable here:Dropbox
Leave feedback on particular decks here: Google doc
Ask for instructions, give feedback and complaints here: Thread
User avatar
lujo
 
Posts: 557
Joined: 20 Nov 2013, 13:17
Has thanked: 224 times
Been thanked: 70 times

Re: Card AI (Improvements) Requests

Postby lujo » 19 Oct 2014, 00:54

On an (somewhat) unrelated note:

Is there a way for the AI to distinguish between "hard" and "soft" removal? What happened just now is that I cast Faith's Fetters on a facedown morph. The AI then unmorphed it on it's turn. It was a Treespring Lorian, pretty much 0 point in unmorphing it.

1) Was that a bug? Faith's Fetters say you cant use activated abilities, but with morph being weird, it could be that it's legal.

But more important for AI related stuff - does the game make a distinction between "removal" which kills a target (removes it from play entirely), removal which fully incapacitates the target (such as Faith's Fetters or arrest) and removal which partially disables but leaves ability use intact (such as Pacifism or Glimmerdust Nap)?

The reason I ask is that maybe if removal had proper, well, hidden attributes classifying it, the AI could be made to behave more intelligently with it. I know I've seen it use Muzzle on stuff which were high priority targets due to abilities so it did nothing, and I've seen it use buffs on stuff that's been immobilized (like enchant creatures which were hit by pacifism).

It's kinda possible to add proper "metatags" to removal to let the AI know what it's dealing with, I don't mind going through each and every set and rounding it all up if it hasn't been done already. It would certainly help any efforts to improve AI.
---

My Shandalar deck pack folder is avaliable here:Dropbox
Leave feedback on particular decks here: Google doc
Ask for instructions, give feedback and complaints here: Thread
User avatar
lujo
 
Posts: 557
Joined: 20 Nov 2013, 13:17
Has thanked: 224 times
Been thanked: 70 times

Re: Card AI (Improvements) Requests

Postby friarsol » 19 Oct 2014, 01:08

lujo wrote:1) Was that a bug? Faith's Fetters say you cant use activated abilities, but with morph being weird, it could be that it's legal.
Not illegal - Morph is a static ability. It means:

- You can cast that card as a facedown 2/2 creature by paying 3. This is a creature spell that can be countered.
- You can play a special action (paying the morph cost) to turn it face up. This doesn't use the stack, and so it cannot be targetted by cards such as Voidmage Husher or Stifle. (or in your case, prevented to be activated)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card AI (Improvements) Requests

Postby lujo » 19 Oct 2014, 01:52

Ok, was just checking it. However just now I've seen the AI leveling up a RoE leveler which has had pacifism put on it. I think I'll be running into this kind of situation more and more (I've been running into it a lot in drafts, but now I'm playing white in constructed).

I can, easily, round up each and every piece of removal in the game, it's easier than it sounds, and make a nice list of it sorted into categories. If something like that hasn't been done before, ofc. If it were applied appropriately it could help the AI play more intelligently.

(And if it's not applied, then the AI can't play well with or against 3/4 of white removal and most of blue removal which is quite a big hole. Especially if it can be fixed. Off to make that list.)
---

My Shandalar deck pack folder is avaliable here:Dropbox
Leave feedback on particular decks here: Google doc
Ask for instructions, give feedback and complaints here: Thread
User avatar
lujo
 
Posts: 557
Joined: 20 Nov 2013, 13:17
Has thanked: 224 times
Been thanked: 70 times

Re: Card AI (Improvements) Requests

Postby gecktrix » 19 Oct 2014, 04:48

The AI currently loots with Research Assistant when it has zero cards in hand. Is there a trigger for AI to save lands to loot away in the event of having a looter?
gecktrix
 
Posts: 36
Joined: 01 Oct 2014, 21:37
Has thanked: 7 times
Been thanked: 5 times

Re: Card AI (Improvements) Requests

Postby Sloth » 19 Oct 2014, 08:14

lujo wrote:Anywho, I'm cursing the fact that I didn't take up programming and so can't adequately be "the draft guy" for a while. Because I actually do have most of the data required (and an unhealthy amount of will), and I certainly have to experience and capability (and a crew of other cube builder vets) to get quite a number of these old sets at least drafting sensibly if not playing sensibly.

Thanks for the code, and I'll look into it. I understand that mindless hate drafting might've caused more problems for the AI than it solved, but there's absolute need to get certain picks (even if the AI has trouble playing them) happening with proper priority in most worlds. Sparksmiths and Wirewood Elves in onslaught, etc.

I'll see what I can do (or if I can find a programmer among my crew who can help me out with it). In the meantime I put up a bit of an analysis on a set which could be fixed quite a bit rather easily - Fallen Empires. It's a very tight, very small set that I know inns and outs of at any time of day or night. I'd love to try using it as a testing ground for what I could do (or assist someone willing to give it a shot in any way possible). It's probably either the best place to try to get a good drafting process working in since it could be really easy, or the worst which means highest value in experience trying.
You can help by improving the rankings.txt file (in the res/draft/ folder). Some of the old sets are obviously messed up.

Just post the updated file here and we will add it.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card AI (Improvements) Requests

Postby lujo » 19 Oct 2014, 14:21

Thank you so much! Working on Fallen Empires right now :)

And on that note - is it possible to get the card Merseine implemented? It's sort of important for blue in that set, and I think all the components are already there. It's like glimmerdust nap, but you can cast it on a non-tapped creature. It comes into play with 3 counters and has an activated ability which lets the controller remove counters by paying it's casting cost. Missing commons, and especially removal are bad for drafts, and blue has the least playables in the set, even more so with it missing.

And a second question, could Raiding Party be replaced with a basic land or something in boosters? Wouldn't want anyone wasting their time implementing it out of order as it's not too important for draft, but it's slot in boosters being taken by more important red cards is also not good for draft (makes red more consistent, possibly skews drafters towards red).
---

My Shandalar deck pack folder is avaliable here:Dropbox
Leave feedback on particular decks here: Google doc
Ask for instructions, give feedback and complaints here: Thread
User avatar
lujo
 
Posts: 557
Joined: 20 Nov 2013, 13:17
Has thanked: 224 times
Been thanked: 70 times

Re: Card AI (Improvements) Requests

Postby Marek14 » 19 Oct 2014, 15:02

lujo wrote:Thank you so much! Working on Fallen Empires right now :)

And on that note - is it possible to get the card Merseine implemented? It's sort of important for blue in that set, and I think all the components are already there. It's like glimmerdust nap, but you can cast it on a non-tapped creature. It comes into play with 3 counters and has an activated ability which lets the controller remove counters by paying it's casting cost. Missing commons, and especially removal are bad for drafts, and blue has the least playables in the set, even more so with it missing.

And a second question, could Raiding Party be replaced with a basic land or something in boosters? Wouldn't want anyone wasting their time implementing it out of order as it's not too important for draft, but it's slot in boosters being taken by more important red cards is also not good for draft (makes red more consistent, possibly skews drafters towards red).
In the Forge Remaining document, Merseine is mentioned as "Weird activation restriction"; the problem is presumably that it can be activated only by controller of the enchanted creature, regardless of who that is. But that could be presumably solved, it's similar to Personal Incarnation, and that is implemented.

And of course, some care must be taken in case of creatures with no mana cost (like most tokens or face-down creatures) -- Merseine can't be activated on those creatures since nonexistent cost can't be paid, and it needs to work correctly with hybrid or phyrexian mana.
Marek14
Tester
 
Posts: 2761
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 297 times

Re: Card AI (Improvements) Requests

Postby gecktrix » 19 Oct 2014, 20:17

friarsol wrote:
Sloth wrote:Explanation:
There is a file called Rankings.txt (in the res/draft/ folder) where all sets have a picking order. Cards the AI can't play will be ranked 10% lower, hate draft picks 30% lower. That's it.
Just to quickly add to this. The rankings.txt comes from http://draft.bestiaire.org/ so if we don't have good rankings its because noone cares about those formats on a pretty large website. And the "hate draft" logic I recently lowered the threshold on, it used to be much much higher (potentially almost unpickable).
Is this fully accurate? Because I just did an M15 draft and was passed Avacyn, Guardian Angel pack 1, pick 8. This card is ranked #17 on the rankings.txt file you mention. I'd say that'd be pretty impossible mathematically that there were 7 cards the AIs picked over this bomb.

I also noticed that in the rankings.txt that some of the card names have commas in them, and some don't. It is listed as "Avacyn Guardian Angel" in the rankings.txt. Some cards do have a comma like "Sorin, Lord of Innistrad" Does this have anything to do with why Avacyn was not picked?
gecktrix
 
Posts: 36
Joined: 01 Oct 2014, 21:37
Has thanked: 7 times
Been thanked: 5 times

Re: Card AI (Improvements) Requests

Postby Sloth » 19 Oct 2014, 21:36

gecktrix wrote:Is this fully accurate? Because I just did an M15 draft and was passed Avacyn, Guardian Angel pack 1, pick 8. This card is ranked #17 on the rankings.txt file you mention. I'd say that'd be pretty impossible mathematically that there were 7 cards the AIs picked over this bomb.

I also noticed that in the rankings.txt that some of the card names have commas in them, and some don't. It is listed as "Avacyn Guardian Angel" in the rankings.txt. Some cards do have a comma like "Sorin, Lord of Innistrad" Does this have anything to do with why Avacyn was not picked?
Avacyn Guardian Angel is ranked correctly, but it is marked as not playable by the AI.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card AI (Improvements) Requests

Postby lujo » 19 Oct 2014, 22:05

^ How can we locally edit that to experiment with it? I've tried some "not playable" cards and they seem to work well enough, I'd love to look into it in more depth for the work on FE pick orders.

It's making FE AI decklists godawful 4 color unplayable lists, and I see stuff the AI seems to be using fine enough in constructed in the sideboard.
---

My Shandalar deck pack folder is avaliable here:Dropbox
Leave feedback on particular decks here: Google doc
Ask for instructions, give feedback and complaints here: Thread
User avatar
lujo
 
Posts: 557
Joined: 20 Nov 2013, 13:17
Has thanked: 224 times
Been thanked: 70 times

Re: Card AI (Improvements) Requests

Postby gecktrix » 19 Oct 2014, 22:11

Another idea would be for cards like Avacyn, Guardian Angel, let them still be drafted and used in decks, but restrict the AI from using the activated abilities that give it problems. That way it will still have a 5/4 flier for 5, which is a bomb by itself.
gecktrix
 
Posts: 36
Joined: 01 Oct 2014, 21:37
Has thanked: 7 times
Been thanked: 5 times

PreviousNext

Return to Forge

Who is online

Users browsing this forum: No registered users and 85 guests


Who is online

In total there are 85 users online :: 0 registered, 0 hidden and 85 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 85 guests

Login Form