By Kevsoft on Jun 12, 2021 at 5:09 PM
  1. Kevsoft

    Kevsoft XLiveless Dev
    Staff Member Administrator

    Joined:
    Oct 24, 2017
    Messages:
    369
    Likes Received:
    376
    Trophy Points:
    63
    pic1.png

    "Behind the BANG!" is a new irregular blog series that looks behind the scenes of the mechanics of the game engine. I don't know yet how often I will write such blogs, but I'll see how it goes down.

    Caravans are a great way to get gold quickly, especially when playing in co-op. However, many wonder how the yield is calculated. There have been many speculations, but today I want to reveal the secret.

    Caravan Gold Yield Formula
    =========================
    For those who do not know: AOEO is based on the same engine as AOE3 and AOM. Therefore it is also "purely coincidental" that the following calculations also apply to AOM. In other words, the logic in AOEO is nearly identical to that in AOM. Therefore, we can see what the AOM-wiki has to say about it:

    The Town Center 'gives' gold to the Caravan, which is added to the player's stockpile when the Caravan returns to the Market. The amount of gold generated by a single run of a Caravan is (approximately) directly proportional to the square of euclidean distance between the Market and the Town Center. Therefore, the total gold production of a straight line trade route is directly proportional to its length.

    Although it is possible for players to trade with their own Town Centers, trading with that of an ally will provide 50% more gold.

    In principle, the information is correct, but there are some factors that were not mentioned. The full formula is:

    pic2.png

    I was surprised that there are more factors at play than I thought. Therefore, let's go through all the variables.

    The most important variable here is "dist", which is the euclidean distance from the caravan unit to the marketplace. Heard correctly: from the caravan unit and not from the town center. This means that if the caravan unit theoretically hits the town center from another side, the yield can be higher. But of course this will not happen in practice. This distance value is multiplied by itself so that we have the square of this value. This means that the yield difference is much higher for long distances, or the possible yield increases quadratically with distance.

    The second most important factor here is the so-called "work rate". Basically just a number that is used as a factor for different units. Wherever there is "work", so to speak, be it converting/healing units, mining resources or trading with the town center. So also the caravan unit has a work rate, which can be changed by gear and advisors. By default, caravans in AOEO have a work rate of 0.8 (for Egypt it is 0.72). In AOM, the value is much lower.

    The town center factor is an unusual value, since it corresponds to the carry capacity of the town center. In my opinion, this value was misused to serve as a variable factor for trade, since it does not make sense that a building has a carry capacity. The town center has a factor (carry capacity) of 1.0 for gold and therefore this value can be ignored, but theoretically you could design a new building that has a higher carry capacity, which would lead to a higher income from the caravans.

    The last value is the bonus factor. When trading with an ally, this factor is x1.5. It makes no difference if this is a real player in co-op or an ally AI. At the same distance, a caravan would yield 100 gold at its own TC, while an ally would yield 150 gold. The bonus factor for trading with an enemy town center would even be x2, although this is a relic from back in AOM. I guess that it was planned to be able to trade with enemy town centers, but then it was not really implemented.

    Now the multiplied values are divided by the size of the map. This size corresponds to either the length or the width of the map, whichever is greater. For a size of 400x300, the value would be 400. This means for the full yield that caravans must travel for a longer distance if the map size is larger.

    Gold/Distance Chart
    ==================
    Let's consider an example: I want to get the maximum profit on a 400x400 map with the smallest possible distance (without gear and techs):

    Own TC: (dist2 * 0.8 * 1.0 * 1.0) / 400 = 150 gold → dist = 273.86 tiles (68% of the map size)
    Ally TC: (dist2 * 0.8 * 1.0 * 1.5) / 400 = 150 gold → dist = 223.60 tiles (56% of the map size)​

    If we plot a graph on this:
    pic3.png

    Of course, these are pessimistic values, since they do not include gears/techs/advisors. Roughly speaking, if you cover half the map length and have some techs and gears, that should get you to the full amount of 150 gold. The same formula can be applied to Docks, of course. The only difference is that the Merchant Transports can carry up to 300 gold (while taking 2 population slots, of course).

    Display Trade Preview
    ====================

    Market_Hotkey.png

    Finally, I would like to provide an update on the marketplace preview feature. More than two years ago I implemented a feature that displays the expected yield of caravans via the "Display Trade Preview" hotkey (default: Shift+Z). Unfortunately, the values were not always correct, because it didn't include the effects of gears/techs/advisors. This will change with the next patch.

    Here you can see how the values of the preview now correspond to those of the caravan:

    Preview_Correspondence_V2.png

    There are certainly still cases where there will be deviations of +/-2g, especially at longer distances, but I believe it is negligible.

    What do you think about the blog? Let us know in the comments below!

    All current and future content will stay 100% free and accessible to everyone.

    ========
    Thank you so much for reading, and we will see you all next time!

    Project Celeste Development Team

    ========
    The Romans are here! Watch the Overview Trailer.

    Project Celeste is completely free and always will be. However, we gladly accept donations for our overhead costs, which are larger than we have budgeted. If you want to support us, you can do so HERE.

    Read every Romans related blog HERE.

    Tell your friends! Join our Discord HERE.
    ========
     
  2. Loading...


Comments

Discussion in 'News' started by Kevsoft, Jun 12, 2021.

    1. frogs.poison

      frogs.poison Immortal

      Joined:
      May 19, 2020
      Messages:
      335
      Likes Received:
      186
      Trophy Points:
      43
      It's good to see the exact formula for caravan trading. I hadn't known about the map size itself affecting trade value.

      With a unit's speed, that's the number of tiles traveled per second, yes?

      And is +trade bonus from gear/tech/advisors treated as a seperate multiplier to the end result? It doesn't seem to be covered in the formula.
       
    2. Kevsoft

      Kevsoft XLiveless Dev
      Staff Member Administrator

      Joined:
      Oct 24, 2017
      Messages:
      369
      Likes Received:
      376
      Trophy Points:
      63
      Not quite sure, but I would expect so.

      Gear/tech/advisor will affect the work rate. So +10% would be 0.88 for the work rate.
       
      martinmine and Andy P XIII like this.
    3. purpleganja

      purpleganja Berserker

      Joined:
      Jul 29, 2019
      Messages:
      115
      Likes Received:
      84
      Trophy Points:
      28
      I had noticed that there was variation in gold per seconds in different maps. That MAX_MAP_LEN explains it! I was very close to the formula otherwise.

      It's mentioned in work rate. I guess it just multiplies it.
       
    4. Unknown Maniac

      Unknown Maniac Berserker

      Joined:
      Nov 9, 2019
      Messages:
      107
      Likes Received:
      62
      Trophy Points:
      28
      finally some nice formula clearly showing how the trade is calculated, I love to see it.
      Distance was obviously the most important factor, I think it was obvious that it could not be linear
      work rate is pretty much trade stat, it is interesting to see its actual value
      map size was quite noticable especially if you compare maps like Fright Club (small map) vs Mad Medians (big map)
      bonus is a known thing
      TC factor is something new and it seems something interesting could be done with it. Just a thought but could it be that this value was supposed to get affected by the priestess of ra blessing so their caravans get compensated for having 10% weaker work rate?

      Anyway, great blog, I think it is now clear how the calculation works.
       
    5. Taffetatree01

      Taffetatree01 Spearman

      Joined:
      May 31, 2021
      Messages:
      10
      Likes Received:
      19
      Trophy Points:
      3
      Nice post.. interesting read...learnt a few things along the way!
       
      Andy P XIII likes this.
    6. RASPUTINPRIME

      RASPUTINPRIME Champion

      Joined:
      May 27, 2019
      Messages:
      54
      Likes Received:
      85
      Trophy Points:
      18
      Very cool and appreciate the explanation. All under the hood.
       
    7. frogs.poison

      frogs.poison Immortal

      Joined:
      May 19, 2020
      Messages:
      335
      Likes Received:
      186
      Trophy Points:
      43
      Allright people, I have done MATHS, and bring to you my findings!

      First finding - The absolute BEST Merchant Gear for trading, for both Caravans and Merchant Transport, is the Merchant Log of the Nile! A very, VERY close second is the craftable Titan-Bound Gaff Stick!
      The previous favorite, the Light Camel Barding, is significantly weaker in terms of overall gold/second provided - At max favorable distance, the difference between Light Camel Barding and Merchant Log of the Nile is greater then 10% in terms of gold output, and that difference only increases as the distance becomes shorter (because of having to make safer caravan routes, because the area doesn't allow for longer caravan routes, ect). On the other hand, the difference between Titan-Bound Gaff Stick and Merchant Log of the Nile is roughly 1%

      Second Finding - In terms of using Merchant Transports vs Caravans when you can have both (Think Kourion, in which you have a small body of water the exact distance as a safe caravan route), it's better to use a Caravan line in terms of gold per second per population cost, unless, of course, the merchant transport ships can carry more gold then the Caravan (In which case it's normally a sea map).


      Third finding, more of a confirmation - Gold Generation via Caravans is, indeed, much higher then Villagers, outside of extremely short trips. In general, if you can get more then 56 gold on a trip, the caravan will produce more gold/second then villager. In co-op, this difference is even more noticable.

      Caravans are also especially powerful in PvP even without gear and with nerfed upgrades, due to the much smaller size of the PvP maps compared to most PvE maps.

      Edit: With Egypt caravans being normalized, removed refs to Egypt caravans
       
      #8 frogs.poison, Jun 12, 2021 at 9:34 PM
      Last edited: Nov 3, 2023
      Andy P XIII, MsMuffins and ByFstugan like this.
    8. frogs.poison

      frogs.poison Immortal

      Joined:
      May 19, 2020
      Messages:
      335
      Likes Received:
      186
      Trophy Points:
      43
      Kevsoft, making sure - Docks also have a town center factor of 1, yes? It seems that Merchant Transports have a naturally higher work rate, being at 1.5
       
    9. ByFstugan

      ByFstugan Immortal

      Joined:
      Nov 17, 2017
      Messages:
      278
      Likes Received:
      175
      Trophy Points:
      43
      I've noticed many (even really good players otherwise) use caravans in a far from optimal way, and few ever use the "Display Trade Preview" which I think is unwise. Many just put the markets up at furthest possible distance in safe area, and then get 150g far from the end of the route - hence they walk ALOT where it's just waste of time with no gain.

      This is how I do it. First off I've set my "build market" to "J" as well as my "Display Trade Preview" is set to "J", so if I spam it when building the first push "J" is "build market", and the next "J" automatically is the preview (as well as each "J" after that). So it's here I move the mouse to see where the numbers is right for my civ. With my gears I've noticed that a number of 116g ends up with me getting about 130g (due to gear) for the early rounds, which will be 149-150g with the Age 4 upgrade.

      I think that's the most optimal way to do it, otherwise one could always argue to skip the Age 4 upgrade and find the number for insta 149-150g. I'd say to get 149g when you're done is "best" in a way since then you know you're as close to perfect as can be. Even if 150 is optimal it's very much worse with alot of useless travel-distance/time (and you cannot see if or how much that is when you see 150g).
       
    10. frogs.poison

      frogs.poison Immortal

      Joined:
      May 19, 2020
      Messages:
      335
      Likes Received:
      186
      Trophy Points:
      43
      Yea, fortunately we will be able to see the "exact" number once the new preview changes is up, which I like.

      Now for Dock preview numbers next :D
       
    11. Kevsoft

      Kevsoft XLiveless Dev
      Staff Member Administrator

      Joined:
      Oct 24, 2017
      Messages:
      369
      Likes Received:
      376
      Trophy Points:
      63
      Yes, you're correct. I've missed that.

      I can look into that later, but first I want to see how the new preview plays out.
       
    12. MsMuffins

      MsMuffins Champion

      Joined:
      May 3, 2019
      Messages:
      57
      Likes Received:
      86
      Trophy Points:
      18
      Abit late, but very interesting blog, makes more sense now to see everything on deeper mechanical level, I personally would love to see more as I'm not too good withe pure deep mechanical stuff, leave that to froggy XD, But yes really interesting to see! Thanks Kevsoft!^^



      I actually use merchant log of nile on all civs, just seems to be best option, glad i was right :D

      Merchant ship trading on egypt is very interesting, perhaps poor perikles will be used more.

      Keep it up frog! :)
       
    13. Romaniac01

      Romaniac01 Champion

      Joined:
      Nov 1, 2019
      Messages:
      96
      Likes Received:
      49
      Trophy Points:
      18
      I might recommend if you want to play with the TC_factor for other civs then maybe we could have the huns having a better TC factor because they helped joined Europe and Asia and were well known for their trading.
       
    14. Aryzel

      Aryzel Immortal

      Joined:
      Feb 14, 2018
      Messages:
      213
      Likes Received:
      250
      Trophy Points:
      43
      Was playing around today testing advisors and put together some interesting numbers (to me at least) for caravans comparing them to Miner Kleon. So testing was on Village of Sais (lots of resources to start, left alone for ages and lots of space, so makes a good testing ground), not sure of the map size of that, so would need to test on some other map sizes too. So this information is just a piece of a larger picture, but thought i'd share it.

      Miner Kleon
      -Gets up to 1.42g/sec immediately, 1.59g/sec in age 2 tech, 1.78g/s in age 3 tech, and also has nice x1.89 conservation as Romans with SPQR

      Caravans
      (no advisors but near optimal gear)
      -Age2_125range prediction, 127g/84sec => 1.5g/sec
      -Age3_20%speed for 300w,300g -> 127g/74sec => 1.72g/sec
      -Age4_20%trade for 500f,500w -> 150g/74sec => 2.03g/sec
      Short ranges
      -Age2_50range, 50g/51sec => 1.0g/sec
      -Age3_20%speed -> 50g/43sec => 1.16g/sec
      -Age2_100range, 100g/73sec => 1.37g/sec
      -Age3_100range, 100g/60sec => 1.66g/sec

      (zeno)
      -Age2_125range, 125g/72sec => 1.73g/sec
      -Age2_50range, 52g/43sec => 1.2g/sec

      (Dumnorix - estimated) = 8% more gold/sec
      (Servilla - estimated) = 15% more gold/sec (prefer dumnorix for getting more caravans out earlier due to cost saving and so greater value in age 2/3)

      So I'm thinking that for maps where you play solo and can't do full caravan route or where you start with limited resources then Miner Kleon might be pretty solid option and then just transition to caravans later. Of course caravans have advantage of essentially giving you more eco production locations, but again this is just thinking of the case where you've limited starting resources or short caravan paths available.
       
      #15 Aryzel, Jun 22, 2022 at 9:48 PM
      Last edited: Jun 23, 2022
    15. Aryzel

      Aryzel Immortal

      Joined:
      Feb 14, 2018
      Messages:
      213
      Likes Received:
      250
      Trophy Points:
      43
      New Caravan stats sheet added to guide, I know other players have done this before but wanted to present info in a gold per second format, and will be using the info for guides for Legendary quest maps in future. Hope its helpful to people. https://docs.google.com/spreadsheet...o61pzQyDTPILsaH6f_XTx-fXo/edit#gid=1072424742

      Part of looking at this was wanted to see how good Miner Kleon is, and answer is pretty good in some scenarios, such as when quest forces a shorter market line or when you start with low resources and need to defend early and market would be a bit slow to repay itself.
      Also going full 150 gold market route in Age 2 is very effective (a 10% gold/sec gain over setting up a 125 gold route), and then just ignore the age 4 upgrade, for quests where you need to spend time and defend in age 2,3.
       
      #16 Aryzel, Jun 23, 2022 at 6:45 PM
      Last edited: Jun 23, 2022
    16. frogs.poison

      frogs.poison Immortal

      Joined:
      May 19, 2020
      Messages:
      335
      Likes Received:
      186
      Trophy Points:
      43
      Excellent spreadsheet Aryzel!

      With the A2/A4 portion, you can also just set up a closer market once you get the A4 tech and then delete the older market. At least half your caravan line will simply swap to using the new market with the more efficient trade line. The other half will generally go AFK to the selected TC.

      I wonder exactly how many 600x600 maps there are? I feel that Turanian Trouble is roughly 400x400 or so, whereas VoK seems even larger then 600x600 - Did you use the scout to estimate the map size, or were you able to find the map files and datamine it directly?

      At the same time, I don't think there are any 100x100 maps outside of Lots of Rogues and similar small maps. I think EMIC was roughly 250x250, and it's one of the smaller high star PvE maps there are.
       
      #17 frogs.poison, Jun 24, 2022 at 2:35 AM
      Last edited: Jun 24, 2022
    17. Aryzel

      Aryzel Immortal

      Joined:
      Feb 14, 2018
      Messages:
      213
      Likes Received:
      250
      Trophy Points:
      43
      Thanks frogs.poison!

      Quests sheet updated, now shows for Legendary quests, Start Age, Starting Resources , Map Size and typical Caravan gold/sec for the map based on a age 2 150g route https://docs.google.com/spreadsheet...o61pzQyDTPILsaH6f_XTx-fXo/edit#gid=1065947759

      Rhakotis has 5x600size maps and 2x500size maps, all other Legendary quests are in the 150-400 range, with majority in the 200-300 range. To measure sizes I use watch posts with 126-158 LOS mostly, took screenshot, then blew up in paint to have larger distances to measure. Sizes should be accurate to +-5 I think.
       
      frogs.poison likes this.
    18. frogs.poison

      frogs.poison Immortal

      Joined:
      May 19, 2020
      Messages:
      335
      Likes Received:
      186
      Trophy Points:
      43
      Damn, Rhakotis maps are huge, and pretty much all other maps are a lot smaller then I thought they would be.

      No offense, but when using Watch Posts, did you measure by diameter or radius? Pretty sure the LoS stat is the radius and not diameter - I don't remember Turanian Trouble being able to be revealed by just 2 130 LoS watch post.

      Additionally, keep in mind that for maps that aren't a perfect square - Kandy Kane Kourion being an excellent example - The map lein is the longest side, not the shortest side. I know that a 160 LoS watch post reveals almost the entirety of the short side, but you need a bit over 2 to reveal the rest of the map.
       
    19. Aryzel

      Aryzel Immortal

      Joined:
      Feb 14, 2018
      Messages:
      213
      Likes Received:
      250
      Trophy Points:
      43
      Yes LOS is radius, wait shit, i might have forgotten to double it on todays numbers. Ok, map sizes updated and gold/sec numbers deleted until I get 10min, probably monday.

      Alot more big maps now. Thanks for questioning it frogs.posion, good catch!
       
      #20 Aryzel, Jun 25, 2022 at 3:49 AM
      Last edited: Jun 25, 2022
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice