*Author

Offline rosutosefiTopic starter

  • Sr. Member
  • ****
  • Posts: 727
  • Reputation Power: 10
  • rosutosefi is taking their first peeks out of the Antlion's burrow.rosutosefi is taking their first peeks out of the Antlion's burrow.
  • Dead.
  • Awards: Slice of Elements 2nd Birthday Cake
Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg423287#msg423287
« on: November 10, 2011, 04:16:04 pm »
Spoiler for Silly joke:
Yo dawg! I heard you made a game simulator and placed it in USEMulator and placed it in a QI simulator so you could simulate multiple simulations of muliple game simulations so that you could get a perfect QI!
QI, or quantum index, is a common basis for the quanta efficiency of decks. The problem is, what is the optimal QI for your deck?
To do this test, I looked at a potential factor: number of non-pillar cards. But how should I test this? To measure things easily, I used an all out creature rush. Obviously, the attack of creatures are dependent on the cost. But one interesting fact is that the relation is not linear, but quadratic (or close to something like that), so I used graphical analysis on the current viable attacking creatures to get the correlation. The result:
Code: [Select]
att = -0.0186*(cost.^2) + 1.078*cost + 0.4738And that will be the basis for all the creatures I will use for the test. Now, the standard creatures are ready. Now I need the simluator. I made something not so long ago: the USEMulator (http://elementscommunity.org/forum/index.php?topic=30432.0). I did a massive overhaul on the code to make it suitable for the standard creatures that I will use for the test. Now everything is ready.
The parameter I used is the number of creature cards. The QI simulator I built will test creatures from the equation, ranging from 0 to 29 cost, with pillars to make a 30-card deck, on a farm and count the average turns to win taken. The lesser the number of turns, the better. The best result will be selected and the QI will be computed from this. This will be the basis for the optimal QI for the deck.
The quest for optimal QI with QI simulator
In case you didn't read that huge thing in the spoiler, here's what it does:
QI has been used as the basis for a good deck. After some in-game testing, 5 was said to be the best QI for normal decks. But is 5 really the best QI?
This simulator does tests to confirm that. Since I haz n00b AI skills, I made it simple: test things with a creature rush. The faster the deck does what it's supposed to do, the better, so TTW is the basis I used for this. The parameter I used is the number of creatures, and tested it's effects on the optimal QI. As a side project, this also aims to determine the effect of QI: Is the mark really equal to 1 pillar? My guess is no. And my aim is to disprove that.

Code: [Select]
%QI test simulator for theoretical unupgraded creature rushes
function [optQI] = qsau(numcr, matches, accuracy)
numcr = floor(numcr);
if accuracy == 0
    accuracy = 1;
elseif accuracy < 0
    accuracy = -accuracy;
end
ccost = accuracy:accuracy:29;
catt = -0.0186*(ccost.^2) + 1.078*ccost + 0.4738;
averagettw = zeros(1,(29/accuracy));
if numcr > 30 || numcr <= 0
    numcr = 30;
end
for tnum = 1:(29/accuracy)
    addedttw = 0;
    ttwtable = zeros(1,24);
    for match = 1:matches
        attack = 0;
        automulligan = 0;
        quanta = 0;
        ehp = 100;
        tplay = 1;
        turn = 0;
        th = 0;
        ch = 0;
        while automulligan~=2 && th == 0
            tow = 30 - numcr;
            cr = numcr;
            for draw=1:7
                deck = tow+cr;
                if rand(1)*deck<tow && tow ~= 0
                    tow = tow-1;
                    th = th+1;
                elseif rand(1)*deck<tow+cr && cr ~= 0
                    cr = cr-1;
                    ch = ch+1;
                end
            end
            automulligan = automulligan+1;
        end
        if rand(1)<0.5
            deck = tow+cr;
            if rand(1)*deck<tow && tow ~= 0
                tow = tow-1;
                th = th+1;
            elseif rand(1)*deck<tow+cr && cr ~= 0
                cr = cr-1;
                ch = ch+1;
            end
        end
        while ehp > 0 %the game
            while th ~=0
                th = th-1;
                tplay = tplay + 1;
            end
            while quanta >= ccost(tnum) && ch > 0
                ch = ch-1;
                attack = attack + catt(tnum);
                quanta = quanta - ccost(tnum);
            end
            turn = turn+1;
            if ch == 8
                ch = ch-1;
            end
            ehp = ehp-attack;
            quanta = quanta + tplay;
            deck = tow+cr;
            if deck == 0
                ehp = 0;
            end
            if rand(1)*deck<tow && tow ~= 0
                tow = tow-1;
                th = th+1;
            elseif rand(1)*deck<tow+cr && cr ~= 0
                cr = cr-1;
                ch = ch+1;
            end
        end
        ttwtable(turn) = ttwtable(turn) + 1;
    end
    for add = 1:24
        addedttw =  addedttw + add*ttwtable(add);
    end
    averagettw(tnum) = addedttw/matches;
end
in = 1;
for inse = 1:29/accuracy
    if averagettw(inse) < averagettw(in)
        in = inse;
    end
end
optQI = numcr*ccost(in)/(30-numcr);


And the data dump for now:
Code: [Select]
Optimal QI for 6 creatures is 3.25
Optimal QI for 7 creatures is 3.31739
Optimal QI for 8 creatures is 4
Optimal QI for 9 creatures is 4.71429
Optimal QI for 10 creatures is 4.8
Optimal QI for 11 creatures is 3.76316
Optimal QI for 12 creatures is 4.33333
Optimal QI for 13 creatures is 4.97059
Optimal QI for 14 creatures is 5.6875
Optimal QI for 15 creatures is 6.5
Optimal QI for 16 creatures is 4.91429
Optimal QI for 17 creatures is 5.62308
Optimal QI for 18 creatures is 6
Optimal QI for 19 creatures is 5.52727
Optimal QI for 20 creatures is 5.6
Optimal QI for 21 creatures is 6.53333
Optimal QI for 22 creatures is 5.5
Optimal QI for 23 creatures is 6.57143
Optimal QI for 24 creatures is 8
Okay, that's 100000 tests each, total of 551,000,000 games. It already shows a correlation between the number of creatures and optimal QI. Gonna do more tests and post tasty results and discussion later.  :D
« Last Edit: May 31, 2012, 09:39:17 am by rosutosefi »
Not so active.

Offline rosutosefiTopic starter

  • Sr. Member
  • ****
  • Posts: 727
  • Reputation Power: 10
  • rosutosefi is taking their first peeks out of the Antlion's burrow.rosutosefi is taking their first peeks out of the Antlion's burrow.
  • Dead.
  • Awards: Slice of Elements 2nd Birthday Cake
Re: Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg423288#msg423288
« Reply #1 on: November 10, 2011, 04:22:02 pm »
*reserved for tests on upgraded cards*
Not so active.

Scaredgirl

  • Guest
Re: Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg424313#msg424313
« Reply #2 on: November 12, 2011, 04:12:08 pm »
Interesting stuff.

If you are talking about the QI of 5 I mentioned in the original QI topic, that was just a hypothesis based on a couple of decks and the fact that I hoped the optimal number would be a round number. However it was clear after a couple of tests that the better QI for a rush deck was less than that, usually somewhere between 5 and 4. I've been using something like 4.5 as the "optimal" during initial deckbuilding, but it's the field test that ultimately shows how many pillars you need.

As for mark being equal to one pillar.. it's pretty clear that it is not. The fact that you start the game with the Mark, and your opponent cannot remove it, makes a mark much more powerful than a pillar in generating quanta no matter what the circumstances are. But how much more powerful it is, that should of course be calculated somehow.

I read the whole thing once and I have to say that half of it was too much for me. Maybe I'll read it again after I've drank more coffee. :)

Offline jmdt

  • Legendary Member
  • ******
  • Posts: 2782
  • Reputation Power: 33
  • jmdt is a Ghost, obsessed with their Elemental pursuits.jmdt is a Ghost, obsessed with their Elemental pursuits.jmdt is a Ghost, obsessed with their Elemental pursuits.jmdt is a Ghost, obsessed with their Elemental pursuits.jmdt is a Ghost, obsessed with their Elemental pursuits.jmdt is a Ghost, obsessed with their Elemental pursuits.
  • New to Elements
  • Awards: Slice of Elements 10th Birthday Cake
Re: Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg424399#msg424399
« Reply #3 on: November 12, 2011, 07:00:10 pm »
After my first pass reading I do have a few comments.  a LONG time ago when I first started deck building, I used to build all my decks off of a spreadsheet.  I set it up to give stats such as QI, draw probability, etc.  I used to start with everything at 5, but as an engineer I'd always run say 10-20 tests versus the AI and watch how the deck launches versus how much quanta is available late in the game.  Ultimately the ideal QI is the position were over a medium sample size you A.) generally always have the quanta to play cards as you get them and B.) Generally don't have ton of quanta of that element built up by the time of win.  Unfortunately, a hard QI number generally does not take this into account.

The next thing you look at is the overall speed of the deck.  For a rush you want to play your hand faster so you need more pillars early to dump everything.  Generally you win in 5-8 turns so with a low QI, you do not have the time to generate excess levels of quanta unless something goes wrong.  Speaking of something going wrong, in the real world, a pure rush is generally not the preferred option as CC can take a heavy toll on the deck and you will have tons of quanta and nothing to play it on.  When I used to experiemt with :life rushes, one thing I studied was the effect of adding the 9 hp powerhouse Jade dragon to bolster the fact that the faster frogs are easy to kill.  I learned that with 2-3 dragons that the ttw was not too much lower, maybe 0.2-0.4, but the deck was able to deal with adversity 100x better as Jade played the role of the late game finisher versus heavy CC decks.  The ideal of using 1-3 big creatures with the rest of the deck is the idea of the 'quanta sink'.  With a quanta sink you do not necessicarily have the fastest possible deck, but the deck will launch fast and be able to keep quanta balanced over a short and long game.

Along the same principle, even for rush decks, The QI and hence number if pillars depends on the size of the critters you need to get out for USEM since all the cards cost 1-3, the deck gets a QI of 4 with 10 pillars.  I never actually run less than 10 pillars as the probibilities of drawing them gets too low.  For a deck such as the shrieker rush, you run like 17 pillars to power the bulky cards on there way out.  The same way 10 pillars leaves you with 1 or no pillar starts a small % of the time, 17 pillars will give 6 or 7 pillar starts.  I always like 12-14 pillars based on probabilities to have the most optimal draws, but again, this depends on the what other critters and toys you roll in the deck.

My last general consideration for QI is the damage and stalling potential of the deck.  USEM has a total combined damage of 72.  Its a 'weenie rush'  it will either flood the field fast for damage or it does not have the big hitters to catch up late game (ignoring heal obviously).  A shrieker rush has a total damage potential of 126 so over time it can ramp oout a ton more damage.  Against healing and/or CC sometimes bulk damage becomes very important and must be taken into consideration.  With stalls, one must look at the immediacy of quanta need.  Yeah 6 phase shields cost a ton, but you don't have to play them all at the same time either.  With a mere 2 pillars, you can chain phase shields indefinitely.  With 1 pillar on the field, you can chain wings out almost the entire game.  So in cases of chaining cards or wanting to save cards instead of playing them immediately a much higher QI number can be effectively used.

That's my quick random unorganized thoughts on QI on a Saturday afternoon.  Hopefully that helps you a bit to understand QI in a variety of decks.

Offline rosutosefiTopic starter

  • Sr. Member
  • ****
  • Posts: 727
  • Reputation Power: 10
  • rosutosefi is taking their first peeks out of the Antlion's burrow.rosutosefi is taking their first peeks out of the Antlion's burrow.
  • Dead.
  • Awards: Slice of Elements 2nd Birthday Cake
Re: Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg424545#msg424545
« Reply #4 on: November 13, 2011, 12:30:20 am »
So this QI quest has been boggling my mind. The bias from the fact that I did not use CC is inevitable, unless I'll make an actual AI which would be a horrible task. Because of that, I have changed my focus to finding the effect of marks on the QI, and I will go back to this later. One problem still exists:

So why do those jumps exist? My theory is that ttw itself is the one that caused it. It it important to note that when a specific number of creatures "fit" to an integral amount of quanta, the game will generally go faster. The small change from 2.5 to 2.6 will have a huge effect, because you can only summon 1 creature at 2.6 instead of 2 from 2.5. More problems...
Well, I tried to ignore that, and go on using the optQI stuff, which I changed to an average of consecutive ten instead of using only the minimum. Suddenly:

Now this is silly. Too inconsistent. BTW, the values there were the total of the creature costs for the lowest average ttw set.
More problems. Time to leave this for a while and enjoy the weekend.
Problem solved! Grew tired of testing and solved using math instead.  :D
I realized that around 50% of that post didn't make much sense, including the "total used quanta" where I should have taken total produced quanta instead.

The effect of mark on QI is dependent on TTW, and the equation is:
k =   2(decksize) 
       (ttw + 6.5)

where k is the equivalent amount of pillars for each mark. For example, if k is 3, your arena deck has 2x mark and it has 16 pillars, it virtually has 22 pillars in the deck. For a deckouter, ttw will approach decksize - 7.5 which means k will be more than 2. As decksize approaches infinity (just to prove it), k will approach 2, which means a mark is worth at least 2 pillars.
I will use this data to change the QI stuffs in the simulator, and hopefully, I will get better results.

Did it while I was in math class.  :))


Sorry for the shard I used: the Shard of Extreme Unreadability
That's "ave. pillar quanta prod.", "per pillar", and "if mark = k # of pillars". ds = decksize
Not so active.

Re: Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg424557#msg424557
« Reply #5 on: November 13, 2011, 01:16:53 am »
Is this... are you actually bruteforcing your way to perfect QI?  Holy crap.  *waits at edge of seat, preparing to give sefi the world's largest cookie*

Offline rosutosefiTopic starter

  • Sr. Member
  • ****
  • Posts: 727
  • Reputation Power: 10
  • rosutosefi is taking their first peeks out of the Antlion's burrow.rosutosefi is taking their first peeks out of the Antlion's burrow.
  • Dead.
  • Awards: Slice of Elements 2nd Birthday Cake
Re: Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg424570#msg424570
« Reply #6 on: November 13, 2011, 02:15:25 am »
Is this... are you actually bruteforcing your way to perfect QI?  Holy crap.  *waits at edge of seat, preparing to give sefi the world's largest cookie*
:D
Yes I am.
Not so active.

Offline Zeru

  • Hero Member
  • *****
  • Posts: 1424
  • Reputation Power: 16
  • Zeru is a Blue Crawler starting to think about his first run.Zeru is a Blue Crawler starting to think about his first run.Zeru is a Blue Crawler starting to think about his first run.
  • The meaning of life is to give life meaning.
Re: Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg424783#msg424783
« Reply #7 on: November 13, 2011, 03:54:33 pm »
How do you define QI in this thread? I was always sure that it was total cost/number of pillars.

The conclusion in the OP is weird. The more creatures you have, the more expensive they should be? How does that even make sense?

Ekki

  • Guest
Re: Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg424837#msg424837
« Reply #8 on: November 13, 2011, 06:08:40 pm »
OMG, you're... Just wow... This is like a *titanload* of maths, but I'll follow this just waiting for the perfect QI to pop up, so as to save it before the RNG god goes troll and delete this topic ;D

Offline teffy

  • Hero Member
  • *****
  • Posts: 1689
  • Country: de
  • Reputation Power: 20
  • teffy is a Mummy waiting to discover the path to glory.teffy is a Mummy waiting to discover the path to glory.teffy is a Mummy waiting to discover the path to glory.teffy is a Mummy waiting to discover the path to glory.
  • May the oracle be with you
  • Awards: Slice of Elements 15th Birthday CakeSlice of Elements 14th Birthday CakeSlice of Elements 4th Birthday CakeSlice of Elements 3rd Birthday CakeWeekly Tournament WinnerSlice of Elements 2nd Birthday Cake
Re: Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg424899#msg424899
« Reply #9 on: November 13, 2011, 08:52:17 pm »
What is "accuracy" in your program ? Would be nice, if you could comment your source code.
I`m teffy, here - and Ringat on Kongregate

Offline oblivion1212

  • Full Member
  • ***
  • Posts: 355
  • Country: ph
  • Reputation Power: 5
  • oblivion1212 is a Spark waiting for a buff.
  • Shard Farm
Re: Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg425093#msg425093
« Reply #10 on: November 14, 2011, 02:24:15 am »
damn mr. ledah.. i mean sir light_sefi

this is pretty deep shi[r]t you have :o :o :o

bumpity bumpy bump...


Offline darkrobe

  • Sr. Member
  • ****
  • Posts: 825
  • Reputation Power: 12
  • darkrobe is taking their first peeks out of the Antlion's burrow.darkrobe is taking their first peeks out of the Antlion's burrow.
Re: Optimal QI for creature rushes https://elementscommunity.org/forum/index.php?topic=33556.msg425338#msg425338
« Reply #11 on: November 14, 2011, 06:25:30 pm »
Curious and want to follow. ill probably have comments in a bit.

 

blarg: