[GemCraft Labyrinth] Numbercraft (the math behind GCL)

65 posts

Flag Post

Since actually playing the game has become a bit too easy until things get patched up, I decided to get started on running through some of the numbers for GCL. Because it’s easier to manage, I’ll focus on pure gems for the moment. I’ll mainly be looking at scaling, in particular: what powers get broken and what powers get useless past about grade 12?

For this first post, I’m taking a look at the effectiveness of specials for gems. Basically all you need to know is in the graph below

About this graph
- This graph uses a log(2) scale for the vertical axis. This means every time you go up one step, the power of the special doubles. For example, the orange power at grade 20 is about 100 times higher than the red one.
- Purple and yellow look a bit weird because they almost overlap in terms of strength. Looking at either line will give you a feel for the other though.
- If pictures give you a headache, the numbers are included below.

About the results
What does this actually tell us about the power of our gem types? Let’s look at them one by one:

lime: becomes insanely powerful at higher levels. Your damage potential is actually dozens of times higher as long as there are multiple enemies to hit. And we’re not even talking about double gems here.

yellow: The second sick gem. Once again, your damage potential is dozens of times higher, as long as you have big beefy targets, instead of lots of swarming monsters that die in one hit regardless. When you make a dual gem with lime, you have a gem that hits dozens of targets for dozens of times base damage, giving hundred of times the damage output of a base gem: you are now a God!

orange: looks really fancy as the top contender in the graph, but looks can be deceiving. For remember: the cost of a higher grade gem almost doubles every grade. So for orange to keep up, it would have to go up a factor of two (one line in the graph) per grade. However, it only averages about a doubling in mana drain for every two grades.
That doesn’t make it useless though, for there are two extra factors to consider. First, your gems firing speed increases. More firing speed means more hits per second, means more mana drained per second. Second, your mana pool will be getting larger, so your mana gain multiplier will go up too.

So what we want to look at is: take the cost of building a tower (let’s say 200 mana on average) and add the cost of your gem. That’s the amount you need to spend to get your gem set up.
Then you take the mana gain per hit and multiply it by the firing speed: this is your mana gained per second.
Compare the two, and you’ll see how fast you need to increases your mana gain multiplier to keep the gem scaling well.

If we do all this, we get the following base effectiveness (shown in both a linear and a log graph):

formula used: 60 * [mana gain per hit] * [firing speed] / {[gem cost] + 200}
Note: I didn’t actually have the firing speed for orange on hand, so I cheated and used the one for yellow gems. A fair approximation because yellow is around 10% faster, but it scales roughly the same.

So what we see is, to keep this gem gaining the same amount of mana per minute, you need to double the mana pool multiplier going from grade 4-8, double it again by grade 12 (to 4X), get it to 8X by grade 15 and to 16X by grade 18.

Overall, an orange gem scales acceptably, but it won’t make you rich without some serious investment in mana pool (and if you can invest in that, what do you need the gem for?)
It doesn’t get really interesting until you throw it in a trap combined with a lime gem and get a chance to multiply your mana gain by the number of chains as well!

red: this is one of the weirdest scaling gems. It’s sucky early on, because your kill count is still a lot lower than the base damage of the gem (it starts at 0 after all). But after a few waves, when you’ve racked up maybe 100-200 kills, it really starts adding up. By end game though, it is a useless piece of junk.

Let me explain that last one: As you can see in the graph, the base multiplier scales fairly poorly. Starting at 36% it isn’t doubled to 72% until grade 9 and you’ll have to wait until grade 14 to hit 3X the multiplier you started with (110%).
You’ll be racking up more kills though, doesn’t that mean the gem keeps getting stronger and stronger? Sure it will, but not fast enough.
If monsters kept giving the same amount of mana per kill, that meant by the time you had collected double the mana (needed to upgrade your gem one rank), you’d also have doubled your kill count. So every time you upgraded your gem, you’d have doubled your damage bonus too. A pretty sweet deal. In that case the increasing damage multiplier would just be icing on the cake.
However, the mana you get per kill does go up, by a lot! Not only does the base mana you get per monster you kill increase (easily by a factor of 10 throughout longer levels), but so does your mana pool multiplier. Pretty soon you’ll be raking in dozens of times as much mana per kill, but still only be getting a percentage of 1 damage added to your total. That’s where the increased special multiplier should kick in to keep the gem worthwhile, but it doesn’t. At that point, the red gem starts to suck.

Now don’t get me wrong, this gem can serve you well easily into grade 10 – even grade 12 when boosted in a trap – but you’ll see it become useless soon after that.

Purple: This gem scales fairly well, as you can see in the graph. The interesting part though is how fast the armor decreases as a function of your damage per hit. If you do twice as much damage with each hit, the armor had better go down twice as fast to keep things worthwhile as well. This gives us the purple effectiveness:

formula used: 60 * [armor drain per hit] * [firing speed] / [damage per hit]
Note: once again, I cheated and used my yellow data for both firing speed and damage per hit.

As you can see, purple scales well. With a good base scaling and higher firing speeds to stack up the armor drain, you actually cut through armor a bit faster compared to your damage as you level up.
In other words, purple would be a good choice if armor went up as fast as gem damage. It doesn’t though. Armor scaling is pathetic in the game right now, not even going over 100 until your gem is doing thousands of damage easily. That doesn’t just means you’ll cut through the armor with a single hit, it also means cutting through the armor will never give you a boost of more than a few % of base damage at most.
The purple mechanic is solid, but monster armor scaling is broken at higher levels to the point of making it useless.

Blue: Peter has told us slowing actually works as speed = 100% / (100% + slowing %). Plugging this in gives:

The problem is it’s hard to measure how you scale this, but the basic idea is: slowing doesn’t become ‘less useful’ as monsters get tougher, so an increase in slow % is an increase in effectiveness. In that sense, a higher grade slowing gem is more worthwhile than a lower grade one. How good it is compared to others though, depends completely on your style and strategy.

Cyan: Cyan works different from slowing. Every time it hits an enemy, they have a chance of being stunned (for 3 seconds). However, they also have an ever increasing ‘stun immunity’, going up by a random amount ranging from around 5% to 11% each stun, for an average of about 8%. Especially at higher grades, your attack rate is so high you can expect to have a guaranteed stun at some point even with a fairly small chance to stun. That means we can calculate the expected time a monster can be stunned by your gem at each level, overestimating it a bit for lower levels, but becoming pretty accurate at higher levels.

formula used: {3 * [stun %] / 0.08} – 10/[gem speed]
Note: the last term you subtract is an approximation of the lower level tendency to not get the max stun values. Because of their low firing speed, they don’t get enough hits in for guaranteed stun on low stun chances per hit.

Those times go pretty high. Does it actually work like that? Oh yes

Add to this the fact you can spread the stun to multiple targets, as long as you get back to each one every 3 seconds, and you have a pretty sweet alternative to blue gems. Once again, usefulness of slow/stun is situational, but if you have to pick, blue is not the only option.

Green: Green looks pretty underwhelming in terms of scaling, and it is. The percentage of base damage you do over 5 seconds stays pretty much the same (around 80%) regardless of level. Now it can be argued with higher firing speeds and larger range, you can apply it to more targets. This is actually not as silly as it sounds. With the ‘random’ targeting option, you can actually apply the poison to lots of targets.
Sound good? By grade 6, you’re already making 33.5 attacks in 5 seconds. Factor in the 80% and you need to have 42 targets poisoned at all times for the poison damage to break even with the normal gem damage. By grade 12, you’re looking at over 100 targets to break even.

Now putting it in a trap seems like a good option, with it being one of the specials that doesn’t become less useful from reduced base damage like yellow and lime do. But at that point your target pool goes way down, with your tiny range, meaning a lot less mobs can stay poisoned. So while this may work at lower levels – when your range and firing speed are too low to get lots of targets poisoned anyway, it really drops off in effectiveness at higher grades.

Overall, green can be a decent starter in a trap, and doesn’t even totally suck outside one for a while, but it can’t hold up at higher levels.

NEXT UP: Gem scaling. Do I want one grade 9 gem, or eight grade 6s?

Flag Post

Geometric Regression for…

Regression for Orange – SQRT (2)^(grade-4)
Regression for Purple, Lime, and Yellow – SQRT (2)^(grade-5.5)
Regression for Cyan and Blue – Fourth Root (2) ^ (grade-7)
Regression for Red – Eighth Root (2) ^ (grade-13)

So for orange to keep up, it would have to go up a factor of two (one line in the graph) per grade.

But seeing as Lime increases by SQRT (2) hits, orange becomes better as the grade increases (because the firing speed will increase).

But quite honestly, this “Numbercraft” isn’t worth anything, as the game can be beat without this Number sense of GCL. You should have been there when we were calculating the best way to spend resources in GC0 to maximize the score.

Flag Post

2^(1/8)*grade for red? Yep, really pitiful as it looks. What’s the reason of giving it +1 damage per target destroyed, if those targets are in dozens, and waves’ HP increase is already in thousands? A really good analysis as I can say, and it looks like the single R/O/L gem, providing squared benefit per grade in both mana and damage, is growing faster than monsters do regardless of anything else. This means, however, that it’s perfectly possible to “complete” a pylon level without premium benefit – the only difference will be the gem’s placement (or there would have to be 2 gems, one in a trap to get mana, and one in a tower to do damage).

Flag Post

Actually vesperbot,

You can’t have a gem in a tower at higher levels, unless you’re really careful. After all, with full-screen range, if it has even a moment where there are no mobs on screen, it would instantly charge the pylon and win the game for you.

And einfach, yeah, GCL is not worth theorycrafting too much right now, but I’m expecting Peter to re-balance at some point and it’s nice to have a baseline then.

Flag Post

well, then I’ll have to be careful, and build several trap spaces to dish out enough damage so the monsters won’t survive. After all, having no skill Deadly Traps requires one to have roughly 3 equal traps to do damage that one trap does with maxed skill. Still thanks for explaining. (I haven’t yet reached the first pylon level, I don’t have 4 hours a day to play this gem of crafting…)

Flag Post

I’ve noticed red gems are quite good at early levels, when your wizard level is low, and you don’t have access to wild gems. The 18% initial value (36% fully talented), is really good for carrying through a lot of of the mid level maps, up to around the second or third pylon stage. It works quite well in amplifiers since amplifiers apply 18% of their special to target gems, but red scaling is pretty pitiful.

As for the data, frostlion, I really like what you did, and I did a bit of analysis of myself, and did some regression too, but came up with different values than what einfach did, but they were similar.

For untalented skills (for maxed skills, multiply by whatever the skills give):
Regression for orange: 0.26 * 1.38^(grade -1)
Purple, Lime, Yellow: c * 1.38 ^ (grade – 1), where c is 0.18 for purple, 15 for lime, and 14 for yellow.
Blue, Cyan: c * 1.25 ^ (grade – 1), with c being 18 for blue, and 17 for cyan.
Red: 18 * 1.09 ^ (grade – 1); and 1.09 is pretty close to the eighth root of 2.
Green: 8 * 1.58 ^ (grade – 1);

Firing speed seems to scale at 1.18^(grade -1) * initial

As einfach pointed out, since scaling from orange + lime + firing speed is > 2, it makes the game too easy, for endurance, which is the place tog et all the points.

Also, I probably could’ve cleared a pylon stage without premium benefit, but didn’t want to sit through all the stages. I had a G20 O/L getting mana (fills up 2m mana in 1 frame), and two G20 O/Y killing all the waves with 0 leaks, at wave 120. It would just take time to make all the higher level gems for the rest of the waves. Deadly traps is only worth, I think, about 2.5x your damage, which I think can be easily overcome by just one extra grade, because of all the scaling factors.

Flag Post

deadly traps are worth 2.5*(1.1/0.8)^2 because of Y and L scaling that increases damage, and since even if there’s only one monster, L still does full amount of hits, L scaling is full even in a trap. That’s 4.72, which is a lot more than 2.0, and equals more than 2 extra grades, this is 4x mana, therefore you have twice less time to build that much before the real threat starts to build.

Flag Post

PART 2: Gem Scaling

I’ll keep it a bit more brief this time and stick to the graphs.
I took a lime gem, with no upgrades in gem-related abilities, except for maxing out the special mastery (because it is essential for scaling).
This is how everything scales:

From the speed and damage, we get the base DPS. If we factor in the # chains, we get the real DPS:

If we want to see how the gem scales though, we need to know how cost effective it is. In other words, how high is the DPS per point of mana spent? If that goes down, it’s more mana efficient to have a lot of small gems, if it goes up, one super-gem is the way to go for maximum damage output. So let’s look at the base DPS per mana first, we get:

So from this it looks like lots of small gems are the way to go. After all, the base DPS goes down as the gem grade goes up.
But wait, the special also grows pretty quickly, so looking at the real DPS per mana might give us a different image. Let’s see, shall we:

And that graph is the closest you can get to a pure gem ‘effectiveness rating’. As you see, the growth is a little tricky there at the start, and in fact if you have towers already on the map, you’re better off with multiple lower grade gems until about grade 4. After that though, the gem power starts rising pretty quickly. Eventually, you roughly double your effectiveness every three gem grades. Remember, I’m not talking about damage here, I’m talking about damage per point of mana spent.

So the answer to this is pretty clear: if you have a ‘bland’ gem, like green for poison, you’re better off sticking with a bunch of low grade gems. If you have a gem with a special that scales well though (like lime or yellow), high grade gems win out almost from the start, and by grade 6, there’s no contest.

Finally, for those who were not convinced yet that Yellow/Lime dual gemming was broken, here is the LY dual gem effectiveness graph, with all non-premium skills boosted (including 66 points for +100% gem damage):

And yes, that fit does say at high levels the effectiveness triples every two grades…

NEXT UP: Angering. What gem grade do I want to anger with to maximize my mana gain? How is my angering score multiplier determined? And how do monster armor and HP scale up?

Flag Post

it looks like monsters scaling formula is roughly like the one that’s in GC0, at least about HP and armor, that is HP grow by 5% per grade, armor grows by 25% or 2, whatever is bigger, and formula for monsters’ number changed and is now plain 4 per grade. But, since there’s no reason of altering score anymore, we don’t need to anger with big gems, and in fact angering with grade 1 ONLY works the best, if you would add a L/P trap somewhere prior to the one that does main damage. And I think that L/B/P will do better than anything else for this purpose, we need to fully employ P power, since we’re looking into millions of armor.

Flag Post

Millions of armor would take a LOT of angering. The highest armor I’ve seen naturally occurring has been around 450, in waves 1300 or so.

Flag Post

1.25^X=1000000, X=61.91… ~62. I think one can anger a wave 62 times to get a million armor. But, this will raise HP of that wave at least 1000 times if with grade 1s, or the same million times if using grade 5 gems, or higher. Hmmmm. This means tho, that using grade 1 is in fact counter-productive, at least when it comes to extreme angering, but it’s acceptable when you anger a little, since you receive +8 monsters for 2/3 the mana spent contrary to angering with grade 2 and so on.

Flag Post

I think I saw G12 angering 75 new monsters instead of your expected 48, though, vesperbot?

Flag Post

I have read that more monsters get summoned if you have “Violent Explosions” skill, but they don’t count towards the final statistics (yet, as a result of a bug). I’m not playing premium so far, so maybe without the skill it’s 4 per grade, but with skill it gets bigger.

Flag Post

No, it’s not 4 per grade even without this skill. Grade 3 summons 13 monsters, grade 5 25. I believe every next grade starting from 3 gives one more monster than previous, but did not take notes here.
And yes, I anger a lot.

Flag Post

oh really? Then the things can be a lot trickier about angering. I’m sorry.

Flag Post

Angering table (grade vs number):

  1. 4
  2. 8
  3. 13
  4. 19
  5. 25
  6. 32
  7. 38
  8. 45
  9. 53
  10. 60
  11. 67
  12. 75
  13. 83
  14. 91
  15. 99
  16. 107
  17. 115
  18. 124
  19. 132
  20. 141
  21. 150
  22. 158
  23. 167
  24. 176

But I thought it was 4, 8, 12, too until i did a higher grade. HP grows at (7 + 3 * grade) %. Armor is the same (which is useless unless you anger a ton).

I’d answer frostlion’s questions, but I like his charts better.

Flag Post

7 plus 3 per grade? so, if given unlimited mana but limited firepower (there’s no limit here I think), it’s best to anger monsters with grade 12s as the first +8 monsters here, or with grade 8 if you are a lot lower on mana, it does not multiply HP by more than 1.5 per anger which still negates red entirely, but allows a lot more mana to be accumulated.

I have tried determining when the HP curve starts to overtake the monsters# curve, depending on the grade. At 4 monsters per wave (giants only mode, 4x monsters) grade 1 flattens out at 9 or 10, grade 2 at 8, grade 3 at 6, grades 4&5 at 5, grades 6-8 at 4, grades 9-13 at 3, grades 14-30 at 2. At 32 monsters (armored only, 2x), grade 1 started providing less benefit as soon as second anger, while grade 2 held profit longer up to 5 times. Every other grade pretty much retained positions.

In terms of getting more mana per anger, I think grade 1 is the best bet assumed you can withstand the angered waves, regardless of times angered and multiplier, but it’s useless to anger swarms unless they start providing more than 13/multiplier mana per kill. So one might not even decide to bother with many-monster waves in armored-only mode that give 9 or less mana per kill unless they have more than 1.5 multiplier.

Flag Post

Grade 1 angers are great for maximizing mana gain if you have the firepower to kill the waves. For later stages, HP is the problem with too many angers, for earlier stages a very high armor is annoying. The latter is way worse, when you do 0 damage if it doesn’t crit for 2x damage. But sometimes it’s much better to increase your firepower so you can anger the waves more.

Flag Post

Sorry all for not getting that angering update out. Been having way too much fun playing RIFT these past few weeks.
The one thing people need to know though that I haven’t seen documented yet.

If you go for a high summon multiplier NEVER anger with:
Grade 4
Grade 6
Grade 9
Grade 10
Grade 13
Grade 14

They are currently bugged so they count one of the monsters you summoned as a ‘base’ monster. Especially if you’re playing Giant levels, that can bring your multiplier way down.

I’m still hoping to post the full angering overview, but I’m afraid I don’t have an ETA. I guess it may depend on the next update after 1.10 and if it adresses any balance issues. (That would make this a lot more interesting again).

Flag Post

Right now i am triing to find out how the sumoning multiplier works (not endurance mode). Please help with your ideas

Firstly as i understood, the more waves in the field – less sumoning multiplier from each gem thrown on waves. Also, as i understood, no matter where your throw gems: in 1 wave a lot of gems or in several wave same amount of gems.
Please help with math behind sumoning multiplier.

Flag Post

The best fit I’ve gotten so far is:
#summoned monsters/#base monsters = -0.000936*(mulitplier-1)^3 + 0.729*(multiplier-1)^2 + 2.038*(multiplier-1).

Or a slightly more manageable version that works well until around 20x multiplier:
#summoned monsters/#base monsters = 0.72*(multiplier-1)^2 + 2.06*(multiplier-1)

Clearly, they don’t show the way the math works behind the screen, but they do give fairly accurate results and give you a feel for the way the multiplier works.

Hope that helps.

Flag Post

Now invert the equation and show us multiplier as a function of monsters summoned and killed :P

Flag Post

one should collect some data for this, and since there is a clear dependancy on 1/(monsters killed – monsters summoned) in the current formula, this might be the starting point. The dependancy should be two-factored, one is “base monsters” (monsters killed minus monsters summoned) and another is monsters killed. So far there is one extreme point with “base monsters” as 1 and monsters killed as 21661, and the result is 198.57, and some set of data is here, though not in numbers and not in terms of monsters killed and monsters summoned.

Flag Post

here’s a datapoint.
1008 monsters summoned, 1009 killed, 39.09 summoning multiplier.

Flag Post

The summon formula (edit: at least for pylon levels) is as follows:

Multiplier = e^(-0.53 * ln(U/S))

S = Summoned (as reported at the end of battle)
U = Unsummoned (Killed – Summoned, both as reported at the end of battle)

This fits all my datapoints to the two decimals of precision that are displayed, including my highest of 70,277 summoned, 70,288 killed, 370.52 multiplier, along with fractalman’s datapoint above.

Other expressions of the formula are probably possible, but note that the constant of -0.53 in the above formula is reasonably exact (I got my best fit at -0.529999443), which makes me think that this is the specific calculation logic used in the app.

Edit: This doesn’t seem to fit some of my older datapoints for non-pylon levels, so it’s possible that the logic is slightly (or significantly) different for non-pylon levels. Or maybe my old data is bad. In any case, it doesn’t matter much, because it’s impossible to rack up really high multipliers on non-pylon levels.