.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 2: The Ascension Wars (http://forum.shrapnelgames.com/forumdisplay.php?f=55)
-   -   Unit Cost Equation (http://forum.shrapnelgames.com/showthread.php?t=23200)

The_Tauren13 March 19th, 2005 09:01 PM

Unit Cost Equation
 
Im moving this to a new thread so I quit hogging Scott Heberts excellent thread on Commander costs...

Heres my current formula for caulculating the cost of a unit based on (and only on) its physical stats:
sqrt(((HP*(10.0+Prot)*Def*MR)/1000.0)*((Str*Att)/10.0))*((3.0+Move)/5.0)*((40.0+AP)/50.0)*(9.0/(6.0+Enc))*((Mor^log10(7))/7.0)
Comments, anyone? Suggestions? Flames? Donations? http://forum.shrapnelgames.com/images/smilies/wink.gif

So, back to the morale buisiness:
Perhaps just a chart is the way to go, then.
I hate making morale 0-5 cost exactly the same, because there is a change, however small and imperceptable http://forum.shrapnelgames.com/images/smilies/happy.gif
Besides, there arent any troops with under 7 morale, are there? Theyd be useless, and Illwinter knows it http://forum.shrapnelgames.com/image...es/biggrin.gif
<font class="small">Code:</font><hr /><pre>
Morale Cost
0 0.38
1 0.39
2 0.40
3 0.41
4 0.43
5 0.46
6 0.50
7 0.55
8 0.65
9 0.80
10 1.00
11 1.40
12 1.70
13 1.90
14 2.00
15 2.09
16 2.17
17 2.24
18 2.30
19 2.35
20 2.39
21 2.42
22 2.44
23 2.45
24 2.46
25 2.47
26 2.48
27 2.49
28 2.50
29 2.51
30 2.52
</pre><hr />
Now, the question is, if I do get this chart accurate, should it stay as just a multiplier to what the cost would be otherwise?

The_Tauren13 March 19th, 2005 09:40 PM

Re: Unit Cost Equation
 
1 Attachment(s)
Heres a quick graph of the data in the chart.

Saber Cherry March 19th, 2005 09:56 PM

Re: Unit Cost Equation
 
Quote:

The_Tauren13 said:
I hate making morale 0-5 cost exactly the same, because there is a change, however small and imperceptable http://forum.shrapnelgames.com/images/smilies/happy.gif
Besides, there arent any troops with under 7 morale, are there?

Just starving units http://forum.shrapnelgames.com/images/smilies/happy.gif

That looks pretty accurate. As far as multiplier-or-not goes...

On commanders, morale is (AFAIK) unimportant except for repel attempts. So it should not be applied to commanders.

On normal units, it sort of depends. High morale is worth more on cheap units than expensive units, because you get lots of them. Maybe it should have an additive AND multiplicative effect? In other words, if the unit's value (aside from morale) is "X", with morale ("MV", value of morale from the chart) it might be:

(X+X*MV+K*X^2*MV)

The first X considers units in huge groups, or boosted by a priest casting Sermon of Courage, or with "Berserkers" cast, or patrolling, or waiting as targets forn Fires from Afar, or as bodyguards where morale is not relevant, or as arrow targets / lance fodder where morale is meaningless.

The second term considers normal groups with no morale support, in normal melee battles.

The third term (with an unknown constant, K) is the usefulness of high-morale units in keeping low-morale groups from fleeing, preventing complete routs (so mages can do their business), when the enemy is using units with Fear or casting Terror and Panic, and other cases where high morale is crucial.



... then again, I never stop playing with a formula until it is so complex I can no longer understand it, so maybe you should ignore everything I just said. Probably, in fact. Actually, I order you to banish it from your mind http://forum.shrapnelgames.com/images/smilies/happy.gif. Your current formula seems fine; it looks good to me, anyway http://forum.shrapnelgames.com/images/smilies/happy.gif 2.5 seems a little high as an upper asymptote, though; 2.0 might be high enough for a purely multiplicative term. I wouldn't pay 2.5 times as much for units with infinite morale as for 10 morale - the max would be, maybe, 2.0 times, at which point I'd only buy a few of them.

The_Tauren13 March 19th, 2005 10:18 PM

Re: Unit Cost Equation
 
1 Attachment(s)
Ok, new chart http://forum.shrapnelgames.com/images/smilies/happy.gif
(can you tell I dont have a life)

<font class="small">Code:</font><hr /><pre>
Morale Cost
0 0.450
1 0.460
2 0.480
3 0.510
4 0.550
5 0.600
6 0.660
7 0.730
8 0.810
9 0.900
10 1.000
11 1.100
12 1.195
13 1.285
14 1.370
15 1.450
16 1.525
17 1.595
18 1.660
19 1.720
20 1.775
21 1.825
22 1.870
23 1.910
24 1.945
25 1.975
26 2.000
27 2.020
28 2.035
29 2.045
30 2.050
</pre><hr />

Attatched is another graph of the data.
Its a much smoother spread, too http://forum.shrapnelgames.com/images/smilies/happy.gif However, the change close to 10 is less severe...

Saber Cherry March 19th, 2005 10:23 PM

Re: Unit Cost Equation
 
Hmmm.......

Yeah, it has better endpoints. Is it possible to increase the slope around 10 while keeping the endpoints and the smoother line?

The_Tauren13 March 19th, 2005 10:29 PM

Re: Unit Cost Equation
 
Quote:

Saber Cherry said:Is it possible to increase the slope around 10 while keeping the endpoints and the smoother line?

Probably. Lemme give it a go...

And why is the spacing all wacked out in the 2nd chart?

Saber Cherry March 19th, 2005 10:31 PM

Re: Unit Cost Equation
 
Quote:

The_Tauren13 said:
Quote:

Saber Cherry said:Is it possible to increase the slope around 10 while keeping the endpoints and the smoother line?

Probably. Lemme give it a go...

And why is the spacing all wacked out in the 2nd chart?

Editing always messes up (code)(/code) sections. Forum bug.

The_Tauren13 March 19th, 2005 10:57 PM

Re: Unit Cost Equation
 
1 Attachment(s)
<font class="small">Code:</font><hr /><pre>
Morale Cost
0 0.500
1 0.510
2 0.523
3 0.541
4 0.564
5 0.596
6 0.638
7 0.694
8 0.768
9 0.868
10 1.000
11 1.251
12 1.439
13 1.580
14 1.686
15 1.765
16 1.824
17 1.869
18 1.903
19 1.928
20 1.947
21 1.961
22 1.971
23 1.979
24 1.985
25 1.990
26 1.993
27 1.995
28 1.997
29 1.999
30 2.000
</pre><hr />

Saber Cherry March 20th, 2005 01:11 AM

Re: Unit Cost Equation
 
Perfect!

sushiboat March 20th, 2005 05:29 AM

Re: Unit Cost Equation
 
Here is a quick and dirty formula based on a multiple linear regression that
included only units with morale below 30. (AFAIK, the 30 and 50 morale
numbers are only symbolic and represent a qualitatively different state.) I
didn't include movement because the spreadsheet I have needs work to
adjust those numbers into a useable format. (Plenty of other boring
qualifiers omitted.)

Cost = -386.0 + (11.9 * Size) + (2.3 * HP) + (-2.0 * Prot) + (11.0 * Morale) +
(21.8 * MagicRes) + (1.4 * Enc) + (-4.8 * Str) + (2.8 * Att) + (.7 * Def) +
(4.0 * Prec)

The adjusted multiple R-squared is .70, so about 70% of the variance in cost
is explained by the predictors. How does that compare to the formula in the
first post?

In case you are not familiar with multiple regression, don't be fooled by the
size of the coefficients. There is some collinearity -- some of the stats used
as predictors are correlated with each other, so their unique predictive
contribution is affected. For example, strength has a zero-order correlation
of .24 with cost, but in the multiple regression, its coefficient is negative.

Edit: Commander vs. non-commander makes a difference, so here are the
formulae after splitting the two groups.

Non-commander formula (adjusted R-squared = .81):

Cost = -60.1 + (12.3 * Size) + (2.9 * HP) + (.8 * Prot) + (5.3 * Morale) +
(4.1 * MagicRes) + (-1.9 * Encumb) + (-8.0 * Str) + (1.5 * Att) + (.5 * Def) +
(-1.9 * Prec)

Commander formula (adjusted R-squared = .71):

Cost = -459.7 + (16.8 * Size) + (.3 * HP) + (-2.5 * Prot) + (11.0 * Morale) +
(25.4 * MagicRes) + (5.0 * Encumb) + (.8 * Str) + (-1.1 * Att) + (6.2 * Def) +
(-.1 * Prec)

Saber Cherry March 20th, 2005 08:13 AM

Re: Unit Cost Equation
 
How on Earth did you come up with these? I assume you were using data compiled in Excel spreadsheets and some automated technique, but...

OK, I admit it, I'm
Quote:

not familiar with multiple regression

http://forum.shrapnelgames.com/images/smilies/happy.gif

I have to wonder how well a forumla with negative coefficients for strength, encumbrance, and precision will predict the value of future units... but since you out-math me, I'll gracefully bow before you http://forum.shrapnelgames.com/images/smilies/happy.gif

The_Tauren13 March 20th, 2005 01:46 PM

Re: Unit Cost Equation
 
1 Attachment(s)
50 morale is symbolic, but I think 30 morale is real...

As for your equation, while it may be perfect for all units already in the game, it doesnt do much for modding, which is what I was interested in; I ran the Size 1, 5 HP, 3 Prot, 10 Mor, 5 MR, 2 Enc, 5 Str, 11 Att, 10 Def unit Im including in my mod through your equations and he came out costing -133 from your combined euation, and 20 from the unit only one. So, it isnt really a global equation that can be applied to any unit a modder might come up with, which is what I was hoping to eventually get. Not that Im claiming any equation can fully encompass this complicated game http://forum.shrapnelgames.com/images/smilies/happy.gif I just want to make a stab at it...



Now, I have a couple questions: Can the same 'diminishing returns' idea be applied to attack and defence? That is, is the difference between 10 and 13 attack greater than between 20 and 23? How much attack or defense skill would be required to double the effectiveness of a 'normal' unit (that is, 10 HP, 0 Prot, 10 Att, 10 Def, etc.)? Is defense really worth more than attack? For some reason I have gotten that into my head, but then, Im a n00b at Dominions...

In my initial equation, should the magic resistance be pulled out of the square root? Should it be wieghted more? Does low magic resistance make an otherwise powerful unit worthless?

new equation: (thanks Saber Cherry http://forum.shrapnelgames.com/images/smilies/happy.gif)
sqrt( ( ( HP * ( 10 + Prot ) * Def * MR ) / 1000 ) * ( ( Str * Att ) / 10 ) ) * ( ( 3 + Move ) / 5 ) * ( ( 40 + AP ) / 50 ) * ( 9 / ( 6 + Enc ) ) * f( Mor )
f( x ) = 0.5 + ( ( 0.75 ) ^ ( 10 - x ) ) / 2 | x &lt; 10
f( x ) = 2 - ( ( 0.75 ) ^ ( x - 10 ) ) | x &gt;= 10


Heres another (crazy) idea:
sqrt( HP * ( 10 + Prot ) * f( Def ) * f( Str ) * f( Att ) ) * ( ( 3 + Move ) / 5 ) * ( ( 40 + AP ) / 50 ) * ( 9 / ( 6 + Enc ) ) * f( Mor ) * f( MR )
f( x ) = -sqrt( 10 - x ) / 3 + 1 | x &lt; 10
f( x ) = sqrt( x - 10 ) / 3 + 1 | x &gt;= 10

This is assuming that morale, magic resistance, attack, strength, and defense all follow the same cost distribution...
Attatched is a graph of this f(x).

sushiboat March 20th, 2005 04:47 PM

Re: Unit Cost Equation
 
How did I do it? Many statistics programs exist that can do a multiple
regression in a few seconds. The tricky part is recognizing problems and
interpreting the output.

What use is it to a modder? Use it as you will. It is an imperfect description of
the way that the unit stats are related to unit costs in the original game.

Below are some new formulae. I added some stats, and I removed stats post
hoc that didn't make a significant unique contribution. Something I might do
in the future is separate mages from non-mages.

Non-commander (adjusted R-squared = .81)

Cost = -51.7 + (11.2 * Size) + (3.1 * HP) + (.9 * Prot) + (5.9 * Morale) +
(4.5 * MagicRes) + (-1.6 * Encumb) + (-8.6 * Str) + (-1.8 * Prec) +
(.5 * TacMove)

Commander (adjusted R-squared = .82)

Cost = -269.6 + (1.6 * HP) + (-1.7 * Prot) + (8.9 * Morale) +
(12.4 * MagicRes) + (3.6 * Def) + (2.2 * TacMove) + (.6 * Ldr_Norm) +
(1.5 * Ldr_Undead) + (3.3 * Ldr_Magic)



Edit: OK, here are separate formulae for non-mage and mage commanders.

Non-mage Commander (adjusted R-squared = .77)

Cost = -125.6 + (9.2 * Size) + (1.4 * Prot) + (10.9 * Morale) +
(7.6 * MagicRes) + (-6.6 * Encumb) + (-3.5 * Str) + (-2.0 * Def) +
(2.3 * TacMove)

Mage Commander (adjusted R-squared = .79)

Cost = -233.0 + (7.7 * Morale) + (16.0 * MagicRes) + (4.1 * Str) +
(-10.7 * Att) + (11.5 * Def) + (-5.7 * Prec) + (.9 * Ldr_Norm) +
(1.1 * Ldr_Undead) + (3.5 * Ldr_Magic)

PDF March 21st, 2005 11:43 AM

Re: Unit Cost Equation
 
Sorry, but I'm pretty sure these regressions are mostly useless (and I've some stat background..). Namely because they do work *only* if the relationships between attributes and the attributes scales themselves are in the range of the sample studied.
So if I make yet another jav totting Lt Inf it will be ok, but if I make something unusual, for example a 1-hp Ethereal elephant, a 100-hp rock-hard militia or some nasty B3W3?3 mage (called "Ice Devils Factory" :lol ), they would be totally out.
Thay also don't take at all into account the equipment of the unit (the values are averaged, difference going to the error margin) : yet these are pretty important...

Verjigorm March 21st, 2005 12:57 PM

Re: Unit Cost Equation
 
Equipment is generally accounted for in the resource cost whereas skill is accounted for by the unit cost. The value of units such as mages is extraordinarily difficult to determine because their spells and combinations of spells (even if you leave out item bonuses and communion) is subjective and certain combinations of spells have greater "value" that the sum of the "values" of the spells alone (e.g. Body Ethereal combined with Bone Grinding &gt; Body Ethereal + Bone Grinding).

Unit cost should be a measure of their statistical efficacy versus the "average" unit whose cost could be arbitrarily assigned. The "average" unit's stats are not all 10's and his cost is not 10gp... Once you have a sample space of units, you can determine the most effective ones. The combat simulator is a good tool for this, but it doesn't produce excel-like results. Any unit whose effectiveness against "Average" is 50% should cost the same as the "Average" unit. I'm not sure how you'd scale up the value as the percentages vary....How much more should a unit with 95% effectiveness cost?

BigDaddy March 21st, 2005 01:54 PM

Re: Unit Cost Equation
 
Quote:

PDF said:
Sorry, but I'm pretty sure these regressions are mostly useless (and I've some stat background..). Namely because they do work *only* if the relationships between attributes and the attributes scales themselves are in the range of the sample studied. . .


With all due respect, in my profesional coursework, I was taught that linear regression could be used for forecasting. With a time constraint values will go beyond the range studied (ideally, your model should be updated with each new point). So, the model is a good one, HOWEVER, I'm pretty sure the nice linear lines aren't appropriate for exquisetly powerful or unusual units. Mainly, because A)I doubt that that is how the devs did it and B) power increases dramatically for higher skill values.

A better model for these powerful units might be to do a similar study of summonable units and convert from gems to gold (using ermor, 10-15 gems us ~equal to 200 gold). Unfortunately you can't use the same equation for commanders and regulars, but seperate units would be available.

An even better model would be to use best fit nonlinear equations for the summonable units, then convert to gold. Cheap regression software can only check your guesses for nonlinear equations.

Probably the best method would be to use an expert system (engineering term - artificial intelligence for programmers) to compute costs. Using this method, you could convert summonable unit cost to gold first (or use the system to do it accurately), then input ALL of the units. Then, by pumping your unit through the system you would get an accurate price. The system itself would be somewhat complex, with nodes for each aspect (sacred, etheareal, etc) of the unit. You can get a good quality student expert system program for "free," with the purchase of a US$100-150 expert system text. It MAY allow enough nodes for this system. You may be able to download one for free, but I haven't looked. It could take you a while to learn how to use it. . .

SUMMARY:
Use the linear model or 1gold per point model for units within normal "human" unit ranges (maybe up to 14 skill) with typical aspects (not ethereal). This is how devs appear to have done it. . .

For powerful units, make a model using summonable units and convert to gold, using ermor income to gold (10-15 gems per 200 gold). Use of linear lines here will cause barely powerful units to be too expensive and truly powerful units to be too cheap, but mid range guys should be right on. Models for extreme units should use a nonlinear or expert system model.

OR you could "just" shake the info out of the devs. . .

sushiboat March 21st, 2005 03:56 PM

Re: Unit Cost Equation
 
Prediction is not what you might think. Of course, I can't predict what a
modder is going to do. A modder could change Militia to be 10,000 gold. The
regression equations describe how stats are related to price for existing
units. To the extent that you generally like what Illwinter has done with
pricing units, the equations might give you a good starting point. If you want
to make drastic changes, you may be less interested.

My guess is that the Illwinter guys don't use equations. One of them probably
makes a unit and assigns a price based on an intuitive understanding of its
usefulness. After playtesting, the price is modified.

I can put things like magic paths and special abilities (e.g., ethereal) into the
mix. I already did so with flying, which turned out not to be uniquely
important enough to keep in. Keep in mind, however, that the equations
above are already explaining about 80% of the variance. That is the equivalent
of a correlation of .90. Whatever gains come in the future will be very modest
at best.

As for using nonlinear equations, I have looked at polynomial regressions for
some of the predictor variables. Morale, for example, is pretty much linear.
The squared term adds a little, and the cubed term is negligible. In other
contexts, I have played around with log, square root, and reciprocal
transformations. My experience has been that they are most useful when the
vanilla linear regression isn't working well. Here, vanilla works like
gangbusters, so the room for improvement is small.

Scott Hebert March 21st, 2005 04:01 PM

Re: Unit Cost Equation
 
Quote:

sushiboat said:
Cost = -386.0 + (11.9 * Size) + (2.3 * HP) + (-2.0 * Prot) + (11.0 * Morale) +
(21.8 * MagicRes) + (1.4 * Enc) + (-4.8 * Str) + (2.8 * Att) + (.7 * Def) +
(4.0 * Prec)

In case you are not familiar with multiple regression, don't be fooled by the
size of the coefficients. There is some collinearity -- some of the stats used
as predictors are correlated with each other, so their unique predictive
contribution is affected. For example, strength has a zero-order correlation
of .24 with cost, but in the multiple regression, its coefficient is negative.

Er, um, I don't doubt this, but may I ask why Size is a positive value? With the sole exception of Trampling, Size is almost invariably a negative in Dominions, isn't it?

Quote:

Cost = -459.7 + (16.8 * Size) + (.3 * HP) + (-2.5 * Prot) + (11.0 * Morale) +
(25.4 * MagicRes) + (5.0 * Encumb) + (.8 * Str) + (-1.1 * Att) + (6.2 * Def) +
(-.1 * Prec)

Do you mind if I use this to calculate values for the commanders? Also, is this ignoring other factors (magic, etc.)?

sushiboat March 21st, 2005 04:33 PM

Re: Unit Cost Equation
 
Why is size a positive value? I guess the ultimate answer would have to come
from Illwinter. If I remember correctly, size, HP, and strength are highly
correlated with each other, so having more than one in the equation makes
interpretation tricky.

You are welcome to use the equations in any way you like. At the moment,
they cover only national units, not independents. (Maybe next weekend I'll
add the indies.) I have not included magic paths for mages yet. The only
special ability I have looked at is flying. I would like to add other special
abilities and magic paths later. The three equations below are the ones to use
for now.

Non-commander

Cost = -51.7 + (11.2 * Size) + (3.1 * HP) + (.9 * Prot) + (5.9 * Morale) +
(4.5 * MagicRes) + (-1.6 * Encumb) + (-8.6 * Str) + (-1.8 * Prec) +
(.5 * TacMove)

Non-mage Commander

Cost = -125.6 + (9.2 * Size) + (1.4 * Prot) + (10.9 * Morale) +
(7.6 * MagicRes) + (-6.6 * Encumb) + (-3.5 * Str) + (-2.0 * Def) +
(2.3 * TacMove)

Mage Commander

Cost = -233.0 + (7.7 * Morale) + (16.0 * MagicRes) + (4.1 * Str) +
(-10.7 * Att) + (11.5 * Def) + (-5.7 * Prec) + (.9 * Ldr_Norm) +
(1.1 * Ldr_Undead) + (3.5 * Ldr_Magic)

Scott Hebert March 21st, 2005 04:48 PM

Re: Unit Cost Equation
 
Quote:

sushiboat said:
Why is size a positive value? I guess the ultimate answer would have to come
from Illwinter. If I remember correctly, size, HP, and strength are highly
correlated with each other, so having more than one in the equation makes
interpretation tricky.

Ah, that would answer it. Sort of like my idea to 'prorate' Strength and HP gains by the size of the unit?

Quote:

You are welcome to use the equations in any way you like. At the moment,
they cover only national units, not independents. (Maybe next weekend I'll
add the indies.) I have not included magic paths for mages yet. The only
special ability I have looked at is flying. I would like to add other special
abilities and magic paths later. The three equations below are the ones to use
for now.

Oh, well, that's good, since I don't have the independents in there either.

If I could give you values for commanders without any 'specials', could you calculate a regression formula based on that?

Scott Hebert March 21st, 2005 04:54 PM

Re: Unit Cost Equation
 
Also, why is the mage commander different from the non-mage commander?

BigDaddy March 21st, 2005 05:00 PM

Re: Unit Cost Equation
 
Sushiboat's equations don't answer "why" questions, they answer only "what" questions. Such as, what is the price correlation between this and that for mage commanders. . . The fact that mixing the commander types together decreased his significance showed him that he needed to seperate them.

In this case, he's reverse engineering the pricing method.

BigDaddy March 21st, 2005 05:13 PM

Re: Unit Cost Equation
 
Its quite nice to see regression analysis used this way. As I stated, I believed it would work quite well for "normal" units. I still have my doubts about its usefulness for powerful units, so in these cases, your use should be more reserved (higher prices).

Sushiboat, I think you'll see a significant changes to the pricing of mages when you add magic paths. I'm curious as to whether or not after testing all the magic paths really turned out "even" in terms of pricing. Don't worry, I appreciate the difficulty of your working in figuring that particular question out (are their combinations that are more expensive, do you need to put a variable in for lvl2 earth path, or just lvl2 path?). Happy hunting!

sushiboat March 21st, 2005 05:34 PM

Re: Unit Cost Equation
 
BigDaddy, I am toying with the idea of converting cost to percentile scores
and then giving a table for converting back from percentiles to gold cost for
someone who uses the formula. I think that would address nonlinearity more
efficiently than various curve fitting schemes. I bet that math professors
everywhere are feeling mysteriously uneasy that someone somewhere is
using linear modeling with percentile data, but I think that it should work
alright from a practical perspective. Of course, it's extra work, so who know
whether I will get around to it.

Saber Cherry March 21st, 2005 07:35 PM

Re: Unit Cost Equation
 
Quote:

sushiboat said:
Prediction is not what you might think.

... that is an absoultely awesome quote http://forum.shrapnelgames.com/images/smilies/happy.gif

BigDaddy March 21st, 2005 07:42 PM

Re: Unit Cost Equation
 
Nah, normalizing the data is a straightforward method of "tabling" it. I'm sure the practice is commonplace. It will also give people an idea of what the "upper-bound" of your study is; They would then know when they can no longer use your numbers to determine cost.

I think it might be just as easy though, to just type out a cumulative cost chart for each stat. Then you don't need to normalize, just plug and chug. Just dump the equation parts in a spread sheet and...

Oh, and by the way, you may want to remove outliers from the unit lists. Any units which break the mold by being too cheap (likely for nation balance purposes by the devs) where never meant to meet your "entrance criterea."

BigDaddy March 21st, 2005 07:56 PM

Re: Unit Cost Equation
 
Well, here's the ugly beta version for you to mess with sushi. Anyone else, use the higher numbers at your own risk!

See next post. . .

Scott Hebert March 21st, 2005 08:24 PM

Re: Unit Cost Equation
 
Quote:

BigDaddy said:
Sushiboat's equations don't answer "why" questions, they answer only "what" questions. Such as, what is the price correlation between this and that for mage commanders. . . The fact that mixing the commander types together decreased his significance showed him that he needed to seperate them.

In this case, he's reverse engineering the pricing method.

I understand. My question is if I can remove the specials and magic paths from the equation, so that only the stats matter.

Presumably, a stat is a stat, right?

BigDaddy March 21st, 2005 08:26 PM

Re: Unit Cost Equation
 
1 Attachment(s)
OK, so I felt guilty about dropping that crappy spreadsheet on you guys, so heres a more useful and straightforward version. . .

SushiUnitPriceCalcV02.xls

Hope you have Excel.

BigDaddy March 21st, 2005 08:30 PM

Re: Unit Cost Equation
 
Well. . .
I'd say that different stats make a mage commander better, like Defense and HP. So, the "a unit is a unit" priciple probably isn't the way it is. Anyway, without the path prices included the cost method is sketchy for mages at best. . .

Scott Hebert March 21st, 2005 08:35 PM

Re: Unit Cost Equation
 
@BigDaddy: Theoretically, since the path costs have been given by Illwinter, they really shouldn't be that hard to remove from the equation, right? Would you say that Sushiboat's split-off of Mage Commanders would mean that Mage Commanders have different priorities?

BigDaddy March 21st, 2005 09:03 PM

Re: Unit Cost Equation
 
Exactly.

Scott Hebert March 21st, 2005 09:04 PM

Re: Unit Cost Equation
 
What would happen if you subtracted the path cost for each mage, and then recalculated? Do you think you would find the same occurrence?

Also, were the calculations made with equipment/path bonuses, or with just the base stats?

BigDaddy March 21st, 2005 09:11 PM

Re: Unit Cost Equation
 
I assume he already took out the path cost, but I don't know. In any case, because the path costs may have differed from the standards of illwinter due to balancing the path cost need to be run in a model. I ASSUME he didn't count equipment (it costs resources). We need him to tell us.

On the spreadsheet... if you make an unusually strong or weak unit the cost will definetely be off. It's for "typical" units.

Sushiboat, can you use Absolute value on Str and HP to force Size to be negative(with your software)?

When you update I'll change the spreadsheet that bears your screen name.

sushiboat March 21st, 2005 09:13 PM

Re: Unit Cost Equation
 
I look forward to adding magic paths. However, it would not surprise me if they turn out to be correlated with the stats already in -- especially precision, magic resistance, and magic leadership. The number of total path levels should be highly correlated with magic leadership. Levels in death and blood paths will be highly correlated with undead leadership. Fire magic adds to attack skill, and so on. What may happen is that the path levels stay in the final equation, other stats come out, and overall variance explained is bumped up only a little. Chipping away at the last 20% of the variance will be tough, I bet.

BigDaddy March 21st, 2005 09:27 PM

Re: Unit Cost Equation
 
To repeat myself for your convenience:

-Remove outlier units that are artificially extra efficient to hire.

-Add magic paths to mage units.

These two will greatly increase your accuracy.

-I've updated the speadsheet to be NONCRAPPY.

-Look at your program options, and see if you can for HP and Str to be positive

sushiboat March 21st, 2005 09:33 PM

Re: Unit Cost Equation
 
Quote:

BigDaddy said:
I assume he already took out the path cost, but I don't know. In any case, because the path costs may have differed from the standards of illwinter due to balancing the path cost need to be run in a model. I ASSUME he didn't count equipment (it costs resources). We need him to tell us.

I didn't include equipment. I am not sure what you mean about path cost. I have not analyzed path levels (e.g., level 3 in death magic) yet. The spreadsheet info on magic paths still needs to be parsed and separated into different columns.

Quote:


Sushiboat, can you use Absolute value on Str and HP to force Size to be negative(with your software)?

I don't understand what you are requesting. I think that all units already have non-negative Strength and HP values, so running them through an absolute value function wouldn't change those numbers. Are you talking about the coefficients?

Evil Dave March 21st, 2005 11:31 PM

Re: Unit Cost Equation
 
Quote:

sushiboat said:
If I remember correctly, size, HP, and strength are highly correlated with each other, so having more than one in the equation makes interpretation tricky.


Highly-correlated inputs do bad things to regression models. You might try dropping one or two of them to see if it gives more sensible coefficients on the one or two left. Dropping them might even improve the R-squared, tho there's not much room to grow. http://forum.shrapnelgames.com/images/smilies/happy.gif

Out of curiosity, what do the p-values for the individual regressors look like?

Scott Hebert March 22nd, 2005 12:00 AM

Re: Unit Cost Equation
 
Quote:

sushiboat said:
I look forward to adding magic paths. However, it would not surprise me if they turn out to be correlated with the stats already in -- especially precision, magic resistance, and magic leadership. The number of total path levels should be highly correlated with magic leadership. Levels in death and blood paths will be highly correlated with undead leadership. Fire magic adds to attack skill, and so on. What may happen is that the path levels stay in the final equation, other stats come out, and overall variance explained is bumped up only a little. Chipping away at the last 20% of the variance will be tough, I bet.

Hmm. Well, here's the thing. If you look at total Magic leadership (including magic path additions), wouldn't that tend to overvalue Astral magic? Similar with Undead Leadership, etc.

I would think that, since we ostensibly have what the path costs should be for a given configuration (I've worked these all out, including full randoms, if you'd like it), shouldn't you remove that from consideration before running your analysis?

That done, wouldn't you gain a clearer picture of how to value the stats?

What I'm getting at is perhaps by working together (using my guesses and your regression analysis), we might be able to come up with a value for any given stat configuration, and then just 'plug in' the rest of the information.

Unfortunately, I don't very much at all about regression testing, so it's hard for me to grasp much of the jargon.

BigDaddy March 22nd, 2005 12:32 AM

Re: Unit Cost Equation
 
Quote:


Sushiboat, can you use Absolute value on Str and HP to force Size to be negative(with your software)?

I don't understand what you are requesting. I think that all units already have non-negative Strength and HP values, so running them through an absolute value function wouldn't change those numbers. Are you talking about the coefficients?

[/quote]

Yes, I'm talking about the coefficients. They really would do better as positives. I thought if you could force absolute value on them, then it would force Size to be negative. You also may get this result by changing the order. To some extent I agree with Evil Dave, except that we are talking about a correlation issue, even though Size and HP are very different. I would recommend making a model for human sized units IF you where going to cut size out. Otherwise, it is important enough to leave in. Besides, I assume it makes your model more accurate.

sushiboat March 22nd, 2005 01:31 AM

Re: Unit Cost Equation
 
The coefficients are derived from the data, so you can't just change the
positive/negative sign without hurting the equation's performance. I could
take out all but one of a set of highly correlated predictors. However, all
predictors in the equation are making a highly significant contribution.
Perhaps a better solution would be to create a composite variable. A new
variable called Bigness could be the sum of the standardized scores of Size,
HP, and Strength. A little information would be lost by not keeping them
separate, but not much.

Edit: EvilDave, I don't have the output in front of me. (It's a Mac Classic app,
and I don't want to fire up the Classic environment just now.) I do remember
the predictors I kept having p-values that were very low, less than .0001. I
removed the predictors with p-values of .10 and higher from the three most
recent regressions. It just happened that there was a huge gap between the
predictors that weren't statistically significant and the ones that were.

BigDaddy March 22nd, 2005 01:45 AM

Re: Unit Cost Equation
 
I DO realize that forcing the numbers will affect performance. But, building small strong units is trouble right now. . . SO, I would see if a Str and size composite (excluding HP) would be effective, it is a very good idea. I'd like to see HP remain alone, if possible. Then, little information would be lost.

Note to modders (who like this sort of thing), YES you can easily use this equation to min/max like never before and claim fairness. . .

Scott Hebert March 22nd, 2005 01:55 AM

Re: Unit Cost Equation
 
Claim, yes. Hide behind for long, probably not. http://forum.shrapnelgames.com/images/smilies/wink.gif

Evil Dave March 22nd, 2005 01:55 AM

Re: Unit Cost Equation
 
Quote:

Scott Hebert said:

Unfortunately, I don't very much at all about regression testing, so it's hard for me to grasp much of the jargon.

No problem. Say you wanted to model the damage the units do in Dom2. You'd probably guess it was some function of strength and weapon damage.

So, you'd make a model like:

damage = A * strength + B * weapon damage

"strength" and "weapon damage" are the regressors (or contributors). A and B are their coefficients. The regressors also each have p-values, which is the likelihood they're due to chance -- 1%, 5%, and 10% are typical cut-offs for scientific work. The whole model has an R-squared, which is the fraction of the variation of the data it explains. R-squareds range from 0 to 1.

So, in this toy example, strength and weapon damage would probably have very small p-values (probably less than 0.01), but the R-squared would probably be pretty low, because the 2d6oe tends to swamp out the effects of the regressors.

Hope that helps. http://forum.shrapnelgames.com/images/smilies/happy.gif

sushiboat March 22nd, 2005 02:08 AM

Re: Unit Cost Equation
 
Scott, I would be interested in seeing your figures for magic paths and cost.
Unless you are using the Unit Database spreadsheet and have numerical
entries for all mage units, I wouldn't be able to plug your numbers in directly
to my approach. As I said, I do plan to add magic paths to the analysis, but
no time for that today.

Scott Hebert March 22nd, 2005 10:55 AM

Re: Unit Cost Equation
 
Dave: So... the p-values are like that 95% value for confidence testing, and the R-squared value is how much of the sample that the equation explains.

It sounds like math modeling and differential equations to me. http://forum.shrapnelgames.com/images/smilies/wink.gif

Sushi: If I had the Unit Database, I could supply that for you. It would be easiest if it were in Excel. It uses the Illwinter cost method.

BigDaddy March 22nd, 2005 12:12 PM

Re: Unit Cost Equation
 
Scott,

Its here (and in Excel Format)

http://www.dominions-2.org/files.htm#docs

Under "Unit DB - by Edi"

Scott Hebert March 22nd, 2005 01:00 PM

Re: Unit Cost Equation
 
Downloaded. I hope to have the magic path costs entered sometime today... if my New Era Pangaea game doesn't suck any more time away...

mmmm... Dryad Hoplites....

Scott Hebert March 22nd, 2005 01:20 PM

Re: Unit Cost Equation
 
Oh, question. Where do you want me to put the Magic path cost, Sushi?

BigDaddy March 22nd, 2005 02:30 PM

Re: Unit Cost Equation
 
Hmmm. . . I think Ill work on a raw data Unit spreadsheet. . .


All times are GMT -4. The time now is 10:53 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.