zilfallon wrote:Bland, the more complicated this unit cost formula gets, the more i will say "WTF" when trying to create a faction. I study an unnecessary amount of maths in school, and having to do long calculations when playing a game just makes me feel lazy

Don't mind me, i'm just whining

Heh, don't worry. So far the trend appears to be simplification. Right now, the formula I'll be using for my next calculations is
Hits*Move*0.5 + (Defense/(8-Defense))*Hits*0.25 + k_a*Attack + Specialwhere k_a is "some constant" in the Attack term and is to be defined. The formula is easier as there's no Hits^2/3 anymore (but, Hits^2/3 still appears in the Attack Cap).
Anyway, rant time. Today's rant is about
false starts, more balancing catastrophies and sketching a new direction.
Here's what I tried first: Flier beats Infantry, Infantry beats Range, Range beats Flier. And it may have worked too, if Erfworld didn't have the AutoHeal.
Say I have a stack of Fliers, and I want to do a hit and run on an Infantry stack. But, because of the AutoHeal, I'd better kill at least the top unit. So, if I want Fliers to cheaply hit-n-run Infantry, I need to make Fliers able to cheaply take out even the largest Infantry units. However, a Flier stack that can do hit and runs is effectively a more expensive Ranged stack, so it follows that
if Fliers beats Infantry, Ranged beats everything (it turns out that the comparisons I've been using are too harsh to be fulfilled by any unit, Range or no Range; that doesn't mean Range would not be better, by some other more meaningful metric).
So that didn't work. What now? Well, my Attack Cap suggests a way. Small units can do more damage, big units have more of their cost devoted to hitpoints. Because of the AutoHeal, it means that small units should be somehow balanced so as to be efficient at killing large units. Why make large units then? Because they are more resistent, again because of the AutoHeal, to Hit and Run attacks.
Therefore, the new trinity I'm playing with is Small, Large, and Raider. Hit and Run will need to change a bit though. For starters, it will only be invoked if the attacker starts in a different hex to the defender. This way, only units with at least 2 move can become Raiders. Further, I'd like my Small/Large/Raider trinity to be less sensitive to Range. Raiders should be efficient against Small Ranged units also, after all. So, probably a stack doing a Hit and Run will do some fraction of the listed damage (it moves, aiming is a bit hard, but hey the defender is standing still so it's a bit easier) while receiving at most only a smaller fraction of the defender's retaliation (shooting after moving targets is hard).
For example, if my stack could do 100 damage normally, it would only do 50 in a hit and run, and if it attacks a ranged stack that normally would have done 100 damage, (or, if my raiders are melee and the defender stack is either ranged or not, it doesn't matter) my stack would receive 25 damage in retaliation. Numbers only for illustrative purposes, as I won't get to tuning them tonight.
Anyway, so I have the Large, Small, Raider trinity (and later I'll consider mixes of these types). An analysis similar to the one below for the CGC(Large, Small) produced a disturbing conclusion: Attack should have negative cost in order for small units to be able to guarantee that a large unit is killed, while costing less than the large unit. This is absurd of course, and rendered a few assumptions in the analysis as contradictory. So this was a dead-end.
Ok, how about, I asked then, if I only want Small units to have a better than even chance of croaking the large unit, while costing less? Can be done, but Attack should now be weighed by a factor of 1/20. Which is again ridiculous: so, until a unit hits Attack 20, it pretty much gets free offense. Not good.
The conclusion from that work was that trying to ensure that CGC-wise attack is cheaper than hits will get nowhere. This is a consequence of Erfworld's AutoHeal rule and the fact that attacks can significantly miss (because of the random factor). Paradox?
After all, we've been killing units in these games just fine. What gives? Well, when we kill units, we invest a bit more in the killers than the victims cost; but that could be ok. At the end of the battle, the question to ask is who lost more? Whose
casualties are more expensive?
It turns out that in this case, it appears possible to balance the Attack term in a way that's not ridiculous, and that's what I'll do today.
In fact, here's a schedule for future rants:
Large Melee vs. Small Melee (right now),
Large Range vs. Small Range (hopefully today as well, in a next post),
Raider vs. Large, Raider vs. Small (tomorrow),
Mixed stacks: I already know that if the above (Raider>Small>Large>Raider) is true, then (Flier, Small: NOT stacked together) > {Large, Small: either stacked or not} is true, and would then need to make it so that (Flier, Large) (at least, while on the offensive) > (Flier, Small) while still keeping (Large, Small) > (Flier, Large), (sometime in the weekend but most likely after)
no-shotgun: make sure that no one unit type is more effective than all others (after that).
(Observation: any unit, ranged or not, would be useable as a Raider if it is on it's own turn and has a move of at least 2, under my new idea for the hit-and-run rule; this will be something to keep in mind when balancing Raider vs. Large and other things, but not today I won't delve into it).
So, back to the problem. The enemy has a "Large" unit, which means for my purposes any unit with 10Hits or more. I want to guarantee croaking this unit using "Small" units (9Hits or less), so I'll need to buy some. They'll cost more than the Large unit, which can't be helped, but I'm not comparing that anymore. Instead, I'll compare the cost of the Large unit to the cost of the Small units that it can, potentially, kill.
So, the Large unit will have perfect rolls, the Small units, the worst rolls. Should make for a conservative estimation.
Both Large and Small units will have Move 1. I'm not using maneuvering. Both are Melee and have no specials. The Small units have as much Attack as they can get. The attack of the Large unit I will leave as a free parameter for now. Then the units are:
Large: H_l, A_l, D_l, 1 (Hits, Attack, Defense, Move)
Small: H_s, A_s, D_s, 1.
The formula for the cost of the units is above. I'll call k_o the number of Small units that the Large unit can kill, and k_o, and subsequently the pop-trade of this battle (Cost(Large) - k_o*Cost(Small)) are, after some symbol wrangling:
k_o = (A_l/H_s)*(8 - D_s)/8
pt = 0.5*(H_l - A_l*(8 - D_s)/8) + 0.25*(D_l*H_l/(8-D_l) - A_l*D_s/8) + k_a*A_l*(1 - (8-D_s)/4)
pt looks quite ugly, because it has a gazillion parameters (H_l, A_l, D_l, D_s, k_a ...). But we can turn to calculus to get a feel for how pt varies when any one of these parameters changes.
It turns out that if I increase D_s, the defense of my units, pt will increase regardless of the (by rules-valid, meaning above 0 and no Defense above 5) values of the other parameters (which is in my favour). This seems intuitive, by increasing my units' survivability I reduce the number I lose.
If the enemy increases D_l, pt will increase regardless of the (by rules-valid) values of the other parameters. This seems a bit less intuitive, but the idea is that the enemy, by spending points on increasing his unit's survivability, is not spending points on killing my units. And this time what we're comparing is what's actually killed in the battle.
Now, things get a bit iffy. It turns out that if I derive the pt, as seen above, by H_l, I find that the more the enemy spends on H_l, the worse the trade is for them. This seems intuitive, since spending on Hits is again not spending on killing my units. OTOH, for reasonable values of k_a, if the enemy increases A_l, the trade becomes better for them. So when optimizing their Large unit to kill the most of my Small units, the enemy will feel a pressure to get Hits down, but at the same time get Attack up (and also, Hits, because Hits cap Attack).
Now both me and my enemy are optimizing our units for this battle. I beef up my Small units' defense as much as possible- it's now 5. The enemy reduces the defense of their own unit as much as possible- now it's 0. The enemy will beef up the Attack as much as the unit's Hits will allow; it remains to determine what the optimum number of Hits (H_l) is.
Right now, our units look like this:
Large: H_l, 4*H_l^(2/3), 0, 1 (Hits, Attack, Defense, Move)
Small: H_s, 2*H_s, 5, 1
This simplifies the expression for pt loads. It now looks like this:
0.5*H_l - H_l^(2/3)*(11-8*k_a)/8,
and its derivative by H_l is
0.5 - H^(-1/3)*(11-8*k_a)/12.
Both formulas are important. The derivative tells me where the optimal H_l for the enemy is, and this depends on the value k_a. As long as it is below 10 (so the optimal hits are no longer that of a Large unit, and we are in fact seeing an underpowered Small unit fighting against a fully armed and operational Small unit), it's ok. In fact, I can now use the simplified pt to tune k_a better.
The idea is that if the optimum trade for the enemy occurs at H_l, I dunno, 5, then as H_l increases the trade becomes worse for the enemy. At H_l = 10, the threshold for Large units, is the best trade they can get. And conversely, the worst trade I get. So, the bigger pt is if H_l is 10, the more efficient Small units are against Large ones.
Here's some examples: for k_a = 0.25, the optimum occurs below 0 (which means it can be ignored) but pt(H_l = 10) is -0.22. So I could lose 0.22 pop points more than the enemy lost in the battle.
For k_a = 0.5, the optimum H_l is again somewhere below 0 (ignore), but this time pt(H_l = 10) is 0.94. So, at the very worst, I'll only gain 0.94 pop points on the enemy in a small-vs-large battle.
For k_a = 1, I'd gain 3.26 at the worst.
Therefore,
I now know that in the formula, k_a will be somewhere above 0.5 (and may well be good enough to be 1).
However,
this is not comparing a unit with the cost of the units necessary to guarantee croaking it. That comparison is too harsh to be feasible in Erfworld. Instead, it appears that I am forced to compare the pop-cost of battle casualties and use this metric when balancing.Right, a break from typing, some scribbling then,
maybe Large Range vs. Small Melee (and Small Range) today.
The whole point of this is lost if you keep it a secret.