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

General Discussions
Moderated by Maffia, LordKivlov, JimXIX

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Export Generation Calculations
posted 11-28-07 01:34 AM EDT (US)   
Can someone help me figure out how export generation is actually calculated? I thought I had a good grasp of how it works but after some in-game testing, I was surprised at the results. Up until now, all the resource collection was easy to figure out and in-game tests matched with predicted math models. I need some help to figure out what I am doing wrong...

The way I thought export works is you have a base rate that is activated if the villager is working (does not matter what resource they are tasked to). From the proto file the export rate for regular villagers is: <Rate type ='Trade'>0.030000</Rate>. I took this 0.03 value to mean export per second (same as 0.6 for mining means 0.6 coin per second).

This base value is this multiplied by the total villagers working granting an export per second value. If you have export rate configured to increase at the consulate by decreasing resource gathering rates, then this base value is multiplied by 35% granting 0.405 export per second (for 5% reduction) or 60% granting 0.480 export per second (for 10% reduction).

The first task was to create some predicted values. This is easy math if export generation is the same as resource generation.

For 25 villagers at a 0% Consulate Configuration, the export rate is:
[(25*0.03*(1+0%)] = 0.75 export per sec, 0.90 export per sec with Sumptuary
100 export can be gathered in [100 / 0.75] = 133.3 sec (111.1 sec with Sumptuary)

For 25 villagers at a 5% Consulate Configuration, the export rate is:
[(25*0.03*(1+35%)] = 1.01 export per sec, 1.16 export per sec with Sumptuary
100 export can be gathered in [100 / 0.75] = 98.8 sec (86.0 sec with Sumptuary)

For 25 villagers at a 10% Consulate Configuration, the export rate is:
[(25*0.03*(1+60%)] = 1.20 export per second, 1.35 export per second with Sumptuary
100 export can be gathered in [100 / 0.75] = 83.3 sec (74.1 sec with Sumptuary)

The method I used to test this was I created 25 villagers and tasked them onto a rice paddy (will not run out of resources creating idle villagers). Then I pressed pause, recorded the export value and time, collected exactly 100 additional export, pressed pause and recorded the time. I then used this time as the time it takes 25 villagers to collect 100 export. I then repeated this for each of the resource configurations at the consulate (0%, 5%, and 10%). I also repeated this test for Sumptuary Laws and Team Sumptuary Laws with no villagers gathering to learn if the base value granted by the HC shipment increases also with an export increase configuration. Increasing export generation at the consulate has no effect on the Sumptuary Law shipment (i.e. very little effect late game).

After I had my true values which were tested a few times to see if being in a different age made a difference (i.e. Colonial, Fortress, etc - it does not matter), I compared this to what I predicted mathematically and was significantly off. In all cases, the predicted values were slower than what was tested in game but not by a repeatable percentage. Here are the results:

25 villagers without Sumptuary HC Shipment
Consulate Configuration.....Time for 100 export (sec)
0%...................................115 (~13.8% faster than 133.3 predicted)
5%...................................88 (~10.9% faster than 98.8 predicted)
10%.................................76 (~8.8% faster than 83.3 predicted)

25 villagers with Sumptuary HC Shipment
Consulate Configuration.....Time for 100 export (sec)
0%...................................98 (~11.8% faster than 111.1 predicted)
5%...................................78 (~9.3% faster than 86.0 predicted)
10%.................................68 (~8.9% faster than 74.1 predicted)

I did all this again for 50, 75, & 99 villagers to see if the percentages were the same and they were very close in all cases (when testing without Sumptuary, testing with Sumptuary threw the percentages off as they should since increases to export generation at the consulate has no effect on Sumptuary shipments)..

So my question is, what am I doing wrong? I need someone good at looking at code to check it out and let me know if export generation bugged or if it is calculated differently. The values should not be that far off, 1 or 2 seconds is ok and I would contribute to round-off error, but this is a big difference.

Lead, Follow, or Get the Hell out of the way!................CYCLOHEXANE'S FREE GUIDES:

-TAD GUIDE: AOE3 TWC TAD Quick Reference -or view online: On-line
AOE3 TWC TAD UNIT COMPARISON SPREADSHEET: Unit Comparison Spreadsheet

See other guides, technological advancements, interviewing tips, and more at my website All Things Miscellaneous

[This message has been edited by Cyclohexane (edited 11-28-2007 @ 01:43 AM).]

Replies:
posted 11-28-07 06:47 PM EDT (US)     1 / 11  
I did some more tests to try to figure this thing out myself and discovered some interesting facts. For every 25 villagers, it appears you get the equivalent of 4 villagers generating export free.

I will try to briefly explain a complicated process:

To collect 100 export, each of these scenarios below were tested: Actual time was measured in game and predicted time used the formula above [100 export / (villagers*0.03)]:

25 villagers…..Actual time (sec)…..Predicted Time (sec)
0%...................115…………………133
5%...................88…………………..99
10%.................76…………………..83

Now if I use 29 (+4) villagers in the prediction:
29 villagers…..Predicted Time (sec)
0%...................115
5%...................85
10%.................72



50 villagers…..Actual time (sec)…..Predicted Time (sec)
0%...................58………………..…67
5%...................44…………………..49
10%.................38…………………..42

Now if I use 58 (+4+4 = +8) villagers in the prediction:
58 villagers…..Predicted Time (sec)
0%...................58
5%...................43
10%.................36



75 villagers…..Actual time (sec)…..Predicted Time (sec)
0%...................39………………..…44
5%...................29…………………..33
10%.................25…………………..28

Now if I use 87 (+4+4+4 = +12) villagers in the prediction:
87 villagers…..Predicted Time (sec)
0%...................38
5%...................28
10%.................24


99 villagers…..Actual time (sec)…..Predicted Time (sec)
0%...................29………………..…34
5%...................22…………………..25
10%.................19…………………..21

Now if I use 115 (+4+4+4+4 = +16) villagers in the prediction:
115 villagers…..Predicted Time (sec)
0%...................29
5%...................22
10%.................18


Notice how the predicted time matches up almost exactly with the actual time measured in game when you add an additional 4 villagers per 25 villagers working! These predicted values also work when played with Sumptuary and Team Sumptuary Laws but I did not feel like writing them all out. I need to go test with just 1 villager to see if it behaves like it should (but such a long test)…

Does anyone know the formula used derived from the code or is export just bugged?



.

Lead, Follow, or Get the Hell out of the way!................CYCLOHEXANE'S FREE GUIDES:

-TAD GUIDE: AOE3 TWC TAD Quick Reference -or view online: On-line
AOE3 TWC TAD UNIT COMPARISON SPREADSHEET: Unit Comparison Spreadsheet

See other guides, technological advancements, interviewing tips, and more at my website All Things Miscellaneous

[This message has been edited by Cyclohexane (edited 11-28-2007 @ 06:53 PM).]

posted 11-28-07 06:58 PM EDT (US)     2 / 11  
I always assumed it was simply 0.03*[resources gained per second]. I have no idea whether that fits your tests, however.

PROCRASTINATE NOT · JAMAIS ARRIERE
posted 11-30-07 01:42 AM EDT (US)     3 / 11  
I always assumed it was simply 0.03*[resources gained per second]. I have no idea whether that fits your tests, however.
I’m not sure why you feel compelled to reply to a thread when you obviously did not read the entire post. I know I have a tendency to write long posts with lots of information, but if you do not feel like reading, it’s probably best not to provide a solution. I'm not trying to be rude, I know your heart is in the right spot.

On that note, I derived a formula that works in all cases within about 5% accuracy (at worst case) It is usually only a second or two off, opposed to about 30 seconds with the obvious formula Drakontos enlightened me with. This is ok considering the round-off error involved (the UI does not show decimal places but are included).

Here is the formula that works:
[[(Villagers)+(Villagers*X)] * [0.03*(1 + Consulate Upgrade %)] + Trickle Bonus]

Where X is the villager factor added to each additional villager working. It is approximately 16% and I noticed it when each group of 25 villagers seemed to add an additional 4 villagers to production (4 / 25 = 8 / 50 = 12 / 75 = 0.16).

If anyone can find any code to back this up, that would be great. Otherwise, I am going to assume it is not a bug but a correction factor to speed things up. I think I am now done solving TAD puzzles, I will be posting my Quick Reference Guide for TAD soon…

Lead, Follow, or Get the Hell out of the way!................CYCLOHEXANE'S FREE GUIDES:

-TAD GUIDE: AOE3 TWC TAD Quick Reference -or view online: On-line
AOE3 TWC TAD UNIT COMPARISON SPREADSHEET: Unit Comparison Spreadsheet

See other guides, technological advancements, interviewing tips, and more at my website All Things Miscellaneous

[This message has been edited by Cyclohexane (edited 11-30-2007 @ 01:44 AM).]

posted 11-30-07 02:15 AM EDT (US)     4 / 11  
It could be a little trick ES put in to encourage people to make more vills (DOUBT IT!!!!!). Or they couldnt be bothered putting in ALL the decimals (could have just put the export rate to 0.03 or 3% of 1 every vill). Probably second one ES coulda made a screw up and been to lazy to fix it.
posted 11-30-07 02:25 AM EDT (US)     5 / 11  
Very...detailed :P But very good info. As far as export, I started playing aztec again, so export is out the window for me

Veni, Vidi, Vici
Trample the Weak - Hurdle the Dead!
"It's kind of a...persnickety magic." Atzy
End of Nations!
End of Nations Community Manager
posted 11-30-07 12:21 PM EDT (US)     6 / 11  
It could be a little trick ES put in to encourage people to make more vills (DOUBT IT!!!!!). Or they couldnt be bothered putting in ALL the decimals (could have just put the export rate to 0.03 or 3% of 1 every vill). Probably second one ES coulda made a screw up and been to lazy to fix it.
The proto file states 0.030000 so there are plenty of decimals! I think what happened is they put in a little correction factor to speed up export after finding out 0.03 is to slow. Perhaps they did not want to change the base value in the proto file because the consulate configuration (0%, 5% to 35%, 10% to 60%) is dependent on this base value as well. Adding in a smudge factor may have been easier from a programming stand point.

However, from a strategic view when you are developing a strategy based on the consulate, my opinion is the formula should be given to us. That is how I would do it but as you can tell, I am a detailed oriented person with way more knowledge of the game than actual skill (I like puzzles)...

Lead, Follow, or Get the Hell out of the way!................CYCLOHEXANE'S FREE GUIDES:

-TAD GUIDE: AOE3 TWC TAD Quick Reference -or view online: On-line
AOE3 TWC TAD UNIT COMPARISON SPREADSHEET: Unit Comparison Spreadsheet

See other guides, technological advancements, interviewing tips, and more at my website All Things Miscellaneous
posted 11-30-07 03:16 PM EDT (US)     7 / 11  
Woah.



I actually read the whole thing, and I must say that had to have taken several hours of work....Great job...

Maybe you included this in your first post, and I can't remember it, but what is the deduction on gather rates for villagers with the 5% & 10% on?

"That is how I would do it but as you can tell, I am a detailed oriented person with way more knowledge of the game than actual skill..."

Ha ha...it's like me and sports - you can play the game on paper, but when it comes to actually doing it...yikes...

"(I like puzzles)"
Pray tell: Do you play Myst?


Foy
posted 11-30-07 06:04 PM EDT (US)     8 / 11  
I found this in aaasianstartingtechs in techtreey file...

<Effect type ='Data' action ='AutoGatherTrade' amount ='1.16' subtype ='WorkRate' unittype ='Trade' relativity ='BasePercent'>
<Target type ='ProtoUnit'>AbstractVillager</Target></Effect>

so I think this translates instead of 0.03 trade / second / vill gathering to 0.0348 trade / second...

AKA

multiply 25 * 1.16 = 29 and wahlah



0.0348 is the magic number methinks, although the stat panel will only show to two decimal places anyways.
I actually liked AOM better for one reason in that we could display villager actual gathering rates on the UI mod I made which was kind of cool.
posted 11-30-07 06:25 PM EDT (US)     9 / 11  
I did actually read through the first two posts fully, but obviously I wasn't thinking particularly straight.

I apologise.

However, even I can see that xentelian's 1.16 corresponds to your 16% 'mystery factor', Cyclohexane.

How many hours did these tests take?

PROCRASTINATE NOT · JAMAIS ARRIERE
posted 11-30-07 06:31 PM EDT (US)     10 / 11  
I actually read the whole thing, and I must say that had to have taken several hours of work....Great job...

Maybe you included this in your first post, and I can't remember it, but what is the deduction on gather rates for villagers with the 5% & 10% on?

"That is how I would do it but as you can tell, I am a detailed oriented person with way more knowledge of the game than actual skill..."

Ha ha...it's like me and sports - you can play the game on paper, but when it comes to actually doing it...yikes...

"(I like puzzles)"
Pray tell: Do you play Myst?
The deduction on gather rates for villagers is 0%, 5%, & 10% and you receive a 16%, 51% (35%), or 76% (60%) bonus to export generation (i.e. for the 10% reduction in resource gathering: 0.03*1.6*1.16). I included the hidden 16% bonus.

I spent several hours at this alone. Take a look at my Quick Reference Guide in the signature. I only set aside a little time for gaming a day (kids, wife, work) so I had to stop playing to update it for TAD. Good news I am finished and I will be posting the Guide very soon. It will be on the front page here so it should be easy to find. Bad news is, I am traveling a lot for work and will be traveling for the holidays so I doubt I will get to play much until January…

I have played Myst but I really only have time for one game and that’s AOE3.
I found this in aaasianstartingtechs in techtreey file...

<Effect type ='Data' action ='AutoGatherTrade' amount ='1.16' subtype ='WorkRate' unittype ='Trade' relativity ='BasePercent'>
<Target type ='ProtoUnit'>AbstractVillager</Target></Effect>

so I think this translates instead of 0.03 trade / second / vill gathering to 0.0348 trade / second...

AKA

multiply 25 * 1.16 = 29 and wahlah
I was confident in my solution but I am happy to find out that there is some code out there to back it up. Since the 16% increase is multiplied, it does not matter if you multiply the 0.03 value or the villagers value. Due to the fact the proto states 0.03, I think it is a villager smudge factor but it really does not matter since the solution is the same.

Thanks!

Lead, Follow, or Get the Hell out of the way!................CYCLOHEXANE'S FREE GUIDES:

-TAD GUIDE: AOE3 TWC TAD Quick Reference -or view online: On-line
AOE3 TWC TAD UNIT COMPARISON SPREADSHEET: Unit Comparison Spreadsheet

See other guides, technological advancements, interviewing tips, and more at my website All Things Miscellaneous
posted 03-18-08 05:35 AM EDT (US)     11 / 11  
wait wait wait

i still dont see what is the relationship between multiple of 25 vils and 1.16 work rate.

anyone can explain where in the code it says at every 25 vils, you get this 1.16 factor?
Age of Empires III Heaven » Forums » General Discussions » Export Generation Calculations
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Empires III Heaven | HeavenGames