You must be logged in to post messages.
Please login or register

RoN General Discussion

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Units costs (formulae & stuff -- some math, beware)
posted 07-11-03 10:30 PM EDT (US)   
Okay, I'll finally post something on this, even though I don't understand it fully now that I understand it fully .

When you upgrade a unit to another unit who's base cost is the same (upgrading Light Horse to any of Light Cavalry/Elite Light Cavalry/Hussar is a good example), the cost to upgrade is static--the price is twice the base cost of the unit (Military technologies slightly modify this, but the intrinsic value is still there).

If the unit and its upgrade have different prices (but cost the same materials, e.g. upgrading Cataphracts/Knights to Heavy Knights/Cuirassiers), the cost to upgrade the unit is
Upgrade_Cost = [2 * Base_Cost_of_Upgraded_Unit] + [Number_of_Existing_Units_to_be_Upgraded * Difference_in_cost_between_the_2_units]


(I typed it like that so you could see exactly what numbers are involved.)

In the case of Cataphracts --> Cuirassiers:
Cataphracts have a base cost of 50 Wealth/60 Metal
Cuirassiers have a base cost of 60 Wealth/70 Metal.

Let's say you have 10 Cataphracts (whether already created or in queue) to Upgrade; using the above formula, the values are
Base_Cost_of_Upgraded_Unit = 60 W/70 M
Number_of_Existing_Units_to_be_Upgraded = 10
Difference_in_cost_between_the_2_units = 10 W/10 M

So our formula is:

Upgrade_Cost = [2 * (60 W/70 M)] + [10 * (10 W/10 M)
= 220 W/240 M]

Go ahead and try this with your units (don't forget this works only for units that cost the same materials before and after). If you find this isn't ALWAYS true, let me know and I'll see what I can find out.

As for the case in which the 2 units (upgradee/upgrader) cost different resources, I have a good idea on how it works now, after a little bit of detective work. When you upgrade a unit to one which has at least one resource different than its predecessor, the Difference_in_Cost_between_the_2_units value is half of the resource that of the unit to be upgraded to (rounded down to the nearest 10, if necessary). I think some examples are in order.

Cuirassier --> Light Tank:
Cuirassier base cost: 60 Wealth/70 Metal
Light Tank base cost: 60 Oil/80 Metal
We have 10 Cuirassiers in existence/in queue.

Then:
Base_Cost_of_Upgraded_Unit = 60 Oil/80 Metal.
Number_of_Existing_Units = 10
Difference_in_Cost_Between_the_2_Units = 30 Oil/10 Metal

Everything is pretty much like the second case, (you should easily see where the 10 Metal cost difference comes from) with one exception, the cost difference of 30 Oil. This value stems from the fact that the upgraded unit costs Oil; while the upgradee does not. Thus, the cost difference (of 30 Oil) is added in due to this difference--its value is half that of the cost of the upgraded unit (1/2 of 60 Oil is 30 Oil).

The total cost to upgrade:
Upgrade_Cost = [2 * (60 Oil/80 Metal)] + [10 * (30 Oil/10 Metal)]
= 420 Oil/260 Metal


Another example: Hussar --> Armored Car:
Hussar base cost: 60 Food/40 Timber
Armored Car base cost: 90 Food/40 Oil
Suppose we have 10 Hussars in existence/in queue.

Base_Cost = 90 Food/40 Oil
Number_to_Upgrade = 10
Cost_Difference = 30 Food/20 Oil

The 30 Food cost difference comes from the actual difference in costs between the two units (90 - 60 = 30). The 20 Oil cost difference is half the cost of the upgraded unit (40 / 2 = 20), since the two units cost different second resources.

So,
Upgrade_Cost = [2 * (90 Food/40 Oil)] + [10 * (30 Food/20 Oil)]
= 480 Food/280 Oil

One final example: Carabineer --> Armored Car:
Carabineer base cost: 60 Timber/40 Wealth
Armored Car base cost: 90 Food/40 Oil
We have 10 Carabineers in existence/in queue.

Base_Cost = 90 Food/40 Oil
Number_to_Upgrade = 10
Price_Difference = 40 Food/20 Oil

Okay, I need to explain the price difference (again). Since none of the resources match (Carabineer: Timber/Wealth; Armored Car: Food/Oil), we must use the "half rule" for this one. You can easily see the 20 Oil difference now (40 / 2 = 20), but the 40 Food seems weird. This is due to the rounding I mentioned earlier (if the difference in cost is not a multiple of 10, you must round it down to the nearest 10); so, 90 / 2 =45, rounded down to 40--that is, 40 Food.
(Technical Aside: this is probably due to the way that the game calculates unit costs; the cost for a unit might say 6f/4t; the game then multiplies this by 10 (rules.xml) to get the final unit cost: 60F/40T; thus, I suspect that when it divides the 9f cost by 2; it rounds it down to 4f, then applies the x10 multiplier)

Back on track now, the final upgrade cost:
Upgrade_Cost = [2 * (90 Food/40 Oil)] + [10 * (40 Food/20 Oil)]
=580 Food/280 Oil

So, remember:
Upgrade_Cost = [2 * Base_Cost] + [Number_to_Upgrade * Price_Difference]

The formula is easy except for the final case (different resources).

Hope this sheds some light (at least for some of you) on unit upgrades.

IMPORTANT NOTE: if your values you get from upgrading the units are lowe than what I stated, it is because you have more Military techs than is required to upgrade to that particular unit. In that case, each additional Military tech reduces the upgrade cost by 10% (of the value found out with the formula).

EDIT: Updated the upgrading units that cost different resources section


Gamespy nick: _AFO_Forsaken
All For One
All things considered, leaving the plunger in the toilet before going was probably a bad idea...
There are 2 kinds of people: those who try to install light bulbs, and those who make jokes about the people that try to install light bulbs.
If life throws you a lemon, make lemonade; if life throws you lemonade, make sure it doesn't throw it in your eyes.

[This message has been edited by Scot_free (edited 07-12-2003 @ 06:20 PM).]

Replies:
posted 07-11-03 11:52 PM EDT (US)     1 / 17  
*bump*

I edited some stuff (namely, the different resource cost stuff); so, I wanted to bump it to let you know, in case you've read it already.


Gamespy nick: _AFO_Forsaken
All For One
All things considered, leaving the plunger in the toilet before going was probably a bad idea...
There are 2 kinds of people: those who try to install light bulbs, and those who make jokes about the people that try to install light bulbs.
If life throws you a lemon, make lemonade; if life throws you lemonade, make sure it doesn't throw it in your eyes.
posted 07-12-03 00:46 AM EDT (US)     2 / 17  
eye r confoozded.

TuF_Kamikaze - Proud Member of TuF
The Unstoppable Forces - TuF
posted 07-12-03 00:53 AM EDT (US)     3 / 17  
That's nice Kami. I'm an Engineering student, so I tend to rattle on

Gamespy nick: _AFO_Forsaken
All For One
All things considered, leaving the plunger in the toilet before going was probably a bad idea...
There are 2 kinds of people: those who try to install light bulbs, and those who make jokes about the people that try to install light bulbs.
If life throws you a lemon, make lemonade; if life throws you lemonade, make sure it doesn't throw it in your eyes.
posted 07-12-03 00:59 AM EDT (US)     4 / 17  

Quote:

Let's say you have 10 Cuirassiers (whether already created or in queue) to Upgrade; using the above formula, the values are

That might confuse people, i think you mean you have 10 cataphrats that your UPGRADING to cuirassiers


Check out Tales of Legend, a Rise of Legends Community Show!
posted 07-12-03 02:33 AM EDT (US)     5 / 17  
Yeah, Bridger, I meant for that to be Cataphracts (a post that long always has something wrong with it ) Thanks for the heads-up.

Gamespy nick: _AFO_Forsaken
All For One
All things considered, leaving the plunger in the toilet before going was probably a bad idea...
There are 2 kinds of people: those who try to install light bulbs, and those who make jokes about the people that try to install light bulbs.
If life throws you a lemon, make lemonade; if life throws you lemonade, make sure it doesn't throw it in your eyes.
posted 07-12-03 04:27 AM EDT (US)     6 / 17  
Looks right to me, nice work. The strange thing I noticed is that similar logic applies to unit costs while the upgrade is in progress, but there is a difference. During the Cataphract to Cuirassier upgrade, a Cataphract will, of course, cost the same as a Cuirassier, but when the resources are different, eg. Cuirassier to Light Tank, instead of 30 oil, you pay double. There doesn't seem to be any advantage to queing a Cuirassier after the upgrade starts vs before, so maybe it is an error?
posted 07-12-03 10:38 AM EDT (US)     7 / 17  
Scot, you posted...

"In the case of Cataphracts --> Cuirassiers:
Cataphracts have a base cost of 50 Wealth/60 Metal
Cuirassiers have a base cost of 60 Wealth/70 Metal.

Let's say you have 10 Cataphracts (whether already created or in queue) to Upgrade; using the above formula, the values are
Base_Cost_of_Upgraded_Unit = 60 W/70 M
Number_of_Existing_Units_to_be_Upgraded = 10
Difference_in_cost_between_the_2_units = 10 W/10 M

So our formula is:

Upgrade_Cost = 2 * (60 W/70 M) + 10 * (10 W/10 M)
= 220 W/240 M "

So lets see for the timber...I take 2 times 60 which is 120 and then add the 10 (for the number of units in teh field) that gives me 130 then I multiply by 10 which gives me 1300 wood.

What you have listed is the correct answer but putting a few brackets in there might help the average person do the math in the right order instead of linear like my son just did.

Good work btw.

Hammer

posted 07-12-03 02:44 PM EDT (US)     8 / 17  
Judging from these formulae it appears to be always cheaper to wait to build units that cost oil, if you don't need them before Industrial. The upgrade price "cost difference" of half the base cost of the non-common resource seems like it would be typically higher than a cost difference of common resources.

Think I need to try some examples (this thread is giving me a headache, too !)

posted 07-12-03 06:32 PM EDT (US)     9 / 17  
I added some brackets to help with those who haven't taken a lot of math (as an engineer, I take Order of Operations for granted; I guess I should be more careful ).

Okay, now for a little more math (I'm just checking to see what the costs would be for build, then upgrade vs. upgrade, then build----for Cuirassiers --> Light Tank):

Build 10 Cuirassiers, then upgrade to Light Tank:


10 Cuirassiers: 765 Wealth/865 Metal
Upgrade_Cost = [2 * (60 Oil/80 Metal)] + [10 * (30 Oil/10 Metal)]
= 420 Oil/260 Metal

Total cost:
765 Wealth/1125 Metal/420 Oil
[/ind]
Upgrade to Light Tank, then build 10 Light Tanks:


Upgrade_Cost = [2 * (60 Oil/80 Metal)] + [0 * (30 Oil/10 Metal)]
[ind]= 120 Oil/160 Metal

10 Light Tanks: 765 Oil/965 Metal

Total cost:
765 Oil/1125 Metal

So, in terms of the total amount of resources spent, upgrading then building is cheaper; though, it does cost you more Oil. Even so, you probably could trade 765 Wealth for 345 Oil (if you're the first one to the Industrial Age).

I'll leave more testing up to you guys

BTW: I took into account ramping costs in the price of 10 Cuirassiers/Light Tanks.


Gamespy nick: _AFO_Forsaken
All For One
All things considered, leaving the plunger in the toilet before going was probably a bad idea...
There are 2 kinds of people: those who try to install light bulbs, and those who make jokes about the people that try to install light bulbs.
If life throws you a lemon, make lemonade; if life throws you lemonade, make sure it doesn't throw it in your eyes.
posted 07-12-03 09:13 PM EDT (US)     10 / 17  
Ive noticed with my games that building and then upgrading is cheaper, so I click on the upgrade, and then a bunch of units after it.
posted 07-13-03 09:00 AM EDT (US)     11 / 17  
What if you skip an age? Say upgrading Slingers to Elite Skirmishers. The second part of the equation would stay the same but you would only have to pay the upgrade cost once if the formula remains the same.
posted 07-13-03 09:31 AM EDT (US)     12 / 17  
I have another question (good post btw), lets say I'm playing on 20x resources and I queue up Science tech first and then Civic and then Military techs. The science Tech will research first but after it researchs will all techs currently being researched become cheaper??? Like at my temple and other currently researching library techs? Also when I research the military tech will units building and upgrades upgrading become cheaper? Please help me out here!
posted 07-13-03 12:03 PM EDT (US)     13 / 17  
Let me dumb this down a bit. What that forumla means is it's the same cost whether you build units first and then upgrade or upgrade first and then build units?

What happens if you jump over an upgrade?

posted 07-13-03 01:41 PM EDT (US)     14 / 17  
It is best if you upgrade first, then build more units.

If you have no units of the type you're upgrading, you pay no cost for the 2nd part of the equation. (Number_of_Existing_Units_to_be_Upgraded = 0)


It is also cheaper to skip upgrades when possible.

If you upgrade each time an upgrade is available, you pay the fixed cost of the upgrade (2 * Base_Cost_of_Upgraded_Unit) multiple times.

posted 07-13-03 02:55 PM EDT (US)     15 / 17  
It does not cost more to upgrade units first then build them.

Quoted from Scot_free:


In the case of Cataphracts --> Cuirassiers:
Cataphracts have a base cost of 50 Wealth/60 Metal
Cuirassiers have a base cost of 60 Wealth/70 Metal.

Let's say you have 10 Cataphracts (whether already created or in queue) to Upgrade; using the above formula, the values are
Base_Cost_of_Upgraded_Unit = 60 W/70 M
Number_of_Existing_Units_to_be_Upgraded = 10
Difference_in_cost_between_the_2_units = 10 W/10 M

So our formula is:

Upgrade_Cost = + [10 * (10 W/10 M)
= 220 W/240 M]

If you paid attention, you'd notice that the added cost to the regular upgrade price is just something that pays the difference between the base costs of the units. There's no price difference between upgrading 10 slinger to arquebusiers and upgrading arquebusiers then building 10 of them. It's probably a much better idea to have an actual standing army you can upgrade unless you were ridiculously booming uncontested. If you don't fight in medieval or earlier, skipping all those upgrades does save money. If you're defensive, you could probably get away with not upgrading until your enemy is getting prepared.

There is one exception like scot pointed out. It can be considered cheaper to have lots of units and then upgrade them when there are different resource costs between the unit you have and the unit you are upgrading to (i.e. heavy cavalry to tanks).

posted 07-13-03 03:34 PM EDT (US)     16 / 17  
Well, I am an engineering graduate. Took me abt 15 min to digest that post.

Oh yah Scot I posted the hotkey thing for which fireraft doesn't work. It is in the topic "Navy question"

But nobody seems to be using the hotkeys for docks, and I only had 1 reply thus far.

posted 07-13-03 03:40 PM EDT (US)     17 / 17  
If you were paying attention, you'd notice that I said it's best to upgrade first, not that it's cheapest.

If I'm building out an army at gunpowder, and had previously only built archers to defend my cities, I would upgrade first rather than build first then upgrade. By upgrading, I know that I'm going to be building Arquebussiers instead of queueing up a bunch of slingers, running out of resources for the upgrade, then having to dequeue some and queue the upgrade.


It *might* be cheaper to build first *if* the difference in units is gold vs some other resource, and *if* the market price of the resource would let you buy it cheaply with gold. As a general rule, though, when building new units, I'll upgrade first then build 'em.

If you're booming and your scouts reveal no threat, it's a waste of resources to have a standing army standing around picking their noses when you could be spending those resources on efficiency upgrades, allowing you to build the army more quickly and cheaper than you would have been able to in ancient times.

Rise of Nations Heaven » Forums » RoN General Discussion » Units costs (formulae & stuff -- some math, beware)
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Rise of Nations Heaven | HeavenGames