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

Pharaoh: Game Help
Moderated by VitruviusAIA, Gweilo

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: What Storage Yard is Chosen by a Docker or Trade Caravan?
posted 07-24-14 19:34 ET (US)   
When leaving the dock, a docker is either carrying an import or is expecting to pick up a specific export, and chooses a storage yard (SY) based on that trade good. A trade caravan also seems to choose an SY based on a specific trade good. Therefore, in this thread, I assume that a docker or caravan wants to trade a single good. Reply #2 assumes that a caravan trades a single good. Some aspects of caravans trading multiple goods are discussed in reply #9. Some aspects of ships importing multiple goods are discussed in reply #10.

I also assume that a building does not touch multiple unconnected roads.

All my tests were done with the patched Cleopatra. I'd guess (but could easily be wrong) that the only difference between versions is that with the unpatched non-Cleopatra Pharaoh, a trade caravan will check all SYs including those that it cannot reach.

The "access tile" of a building is the first road (which may be roadblocked) encountered when starting on the tile NE of the N tile and going clockwise around the building on tiles that are adjacent to a side (not a corner) of the building. The "access distance" is the shortest distance from the entry point to the access tile, going only through passable tiles and only moving NE, SE, SW, or NW. (These were defined by Trium in the Caesar III Game Help forum thread Cartpushers, traders, etc. - which building is nearest?, although he did not use the term "access distance".)

The "crow-flies-distance" to an SY is the shortest distance from the position of the caravan or docker to the N tile of the SY, going over any tiles in any direction (NE, E, SE, S, SW, W, NW, or N). Dockers waiting beside the dock are invisible but can be detected by clicking on the road.

A "bay" is a 1-tile section of an SY, excluding the N tile, which will either be empty or hold a single good. A completely filled bay will hold 4 stones, 4 weapons, 4 chariots, or 400 of another good.

A "selection value" is calculated for each SY which might trade the good. The docker or caravan goes to the SY with the lowest selection value. If multiple SYs have the same lowest selection value, the docker or caravan goes to the first one in the building list (which will often, but not always, be the first one that was built).

Dockers and caravans are described in my next two replies.

[Edited to mention that caravans trading multiple goods are discussed in reply #9.]
[Edited to mention that ships importing multiple goods are discussed in reply #10.]

[This message has been edited by Brugle (edited 02-29-2016 @ 08:21 PM).]

Replies:
posted 07-24-14 19:37 ET (US)     1 / 10  
Dockers

A docker delivering an import will always start at the dock. (If the import is not delivered at the chosen SY, the docker will return to the dock.) SYs which might trade an import are those which are connected to the dock, have room for any of the import, and which would have room for a full bay of the import if other goods in the SY were removed. (Watch out for the City might overpay when docker delivers to almost-full storage yard with multiple goods bug.)

For a docker delivering an import, the selection value for an SY is (the crow-flies-distance) plus (the absolute value of the difference between the access distances of the dock and the SY) minus (8 times the number of empty bays) minus (4 times the number of bays that are partially filled with the import).

A docker collecting an export may start at the dock or at an SY if it earlier delivered an import or tried but failed to pick up an export. (When choosing where to pick up an export, a docker at an SY does not have a particular preference for that SY.) SYs which might trade an export are those which are connected to the dock and have at least 1/4 of a bay of the export.

For a docker collecting an export, the selection value for an SY is (the crow-flies-distance) plus (the absolute value of the difference between the access distances of the dock and the SY) minus (the number of bays containing the export).

A docker going to an SY will go to the access tile if it is not roadblocked or if there is a non-roadblocked road NW of the N tile. Otherwise, it will go to the first non-roadblocked road encountered when starting on the tile NE of the N tile and going clockwise around the SY on tiles that are adjacent to a side (not a corner) of the SY. (This was described by Cantique in Storage Yard (destination walker's) start, finish, and 'entry' squares.)

[Changed "plus (8 times the number of empty bays) plus (4 times the number of bays that are partially filled with the import)" to "minus (8 times the number of empty bays) minus (4 times the number of bays that are partially filled with the import)".]

[This message has been edited by Brugle (edited 07-27-2014 @ 06:24 PM).]

posted 07-24-14 19:40 ET (US)     2 / 10  
Trade Caravans

For a caravan, SYs which might trade an import are those which the caravan can reach (not crossing an unstaffed ferry terminal), have room for the import, and (usually) have an empty bay. In most of my tests (and games) an empty bay was required, but in a few tests an empty bay was not required--I don't have an explanation for this.

For a caravan at the entry point that wants to deliver an import, the selection value for an SY is (the crow-flies-distance) plus (the access distance) minus (16 times the number of empty bays).

For a caravan, SYs which might trade an export are those which the caravan can reach (not crossing an unstaffed ferry terminal) and have at least 1/4 of a bay of the export.

For a caravan at the entry point that wants to pick up an export, the selection value for an SY is (the crow-flies-distance) plus (the access distance) minus (4 times the number of bays containing the export).

A caravan at an SY will sell and/or buy any goods that it can. (Watch out for the bug when the SY is set to accept or get multiple goods that the caravan can sell, which can cause the caravan to sell something weird.) When a caravan is finished trading at an SY, if it could trade more then it will go to another SY. For such a caravan, the selection value for either importing or exporting is the same as for a caravan at the entry point except that (the access distance) is not used.

A caravan at the entry point going to an SY will go to the access tile. A caravan at an SY going to another SY will go to the same tile as a docker (as described in the last paragraph in reply #1).

[Changed "plus (16 times the number of empty bays)" to "minus (16 times the number of empty bays)".]

[This message has been edited by Brugle (edited 07-27-2014 @ 06:27 PM).]

posted 07-24-14 19:45 ET (US)     3 / 10  
How is this Useful?

To do a lot of trade, dockers should only go short distances and trade caravans should not deviate much from the shortest path from the entry point to the exit point. I accomplished this in some cities with careful design, SY special orders, and trade orders. However, it turns out that I was much too conservative in my guesses as to how dockers and caravans behave.

For example, in my last city, Bubastis, I made sure that an SY far from the dock had more beer than an SY near the dock. But that was unnecessary--even if the beer SY far from the dock was empty, beer would still have been delivered to the SY near the dock. I also took unnecessary care in setting up SYs for wood, pottery, and weapons exports.

In other words, it will be easier than I thought to design a large city with all roads connected and which imports and/or exports goods that are used in places that are far apart.
posted 07-25-14 06:26 ET (US)     4 / 10  
Thanks Brugle.

I'm interested to know how you realised that the "crow-flies-distance" and the "absolute value of the difference between the access distances of the dock and the SY" for dockers, and the "crow-flies-distance" and the "access distance" for caravans, were the relevant values to consider.
posted 07-25-14 07:41 ET (US)     5 / 10  
Someone finally did it. Very impressive. I think thats it, the game is over, well unless you are one of those weirdos who want to play the maps

Unless it now goes further to working out caravans trading multiple goods and buildings touching multiple unconnected roads, I cant think of any other large parts of this game that haven't been figured out. Maybe how masons arrive at monuments and the delivery patterns of stone pullers? But that's probably considered just a small issue like the dock traders being overpaid or the order by which ships at a dock queue up and get processed.

Eagles may soar, but weasels do not get sucked into jet engines
Two Eskimos sitting in a kayak were chilly, so they lit a fire in the craft. Unsurprisingly it sank, Proving once again that you can't have your kayak and heat it too
posted 07-25-14 09:55 ET (US)     6 / 10  
I'm interested to know how you realised that the "crow-flies-distance" and the "absolute value of the difference between the access distances of the dock and the SY" for dockers, and the "crow-flies-distance" and the "access distance" for caravans, were the relevant values to consider.
In some earlier C3 work by Trium and Pharaoh work by me, two distances mattered--one was the absolute value of the difference in access distances, and one was some sort of crow-flies distance. This worked for dockers, but there was only a single access distance for caravans (which turned out only to apply to caravans starting at the entry point).

As to the end points of the crow flies distance, only a few seemed obvious to me: the N tile or access tile of a building or the starting or ending position of a docker or caravan. I just ran tests to see which combinations of points mattered. (It was easy to determine that the starting position of a docker mattered--I set up a dock where the 3 dockers had different starting tiles, and they sometimes went to different storage yards when they were trading the same good.)
unless you are one of those weirdos who want to play the maps
This information would be useful if I ever get around to finishing the design and building Super Saqqara. But that probably won't be my next city--several other Pharaoh and C3 cities appeal more to me now.

[This message has been edited by Brugle (edited 07-25-2014 @ 09:57 AM).]

posted 07-27-14 18:31 ET (US)     7 / 10  
I corrected serious typos in the selection value formulas for imports in replies #1 and #2.
posted 08-11-14 14:37 ET (US)     8 / 10  
Did anyone wonder why a docker or trade caravan intending to deliver pottery imports would prefer to deliver to an empty SY set to "Fill up to 1/4 of Yard" of pottery than a SY with 100 pottery set to "Accept all" pottery (all else being equal)? The reason is that the effect of goods in SYs on a docker or caravan was copied from Caesar III, where a warehouse cannot be set to accept a certain amount of the good. (Except for a caravan at an SY, the effect of distances on dockers or caravans was changed from C3.)

Note that in C3, caravans intending to deliver imports sometimes do not go to the warehouse with the lowest selection value. While I didn't see that in Pharaoh, I might have missed it.
posted 02-24-16 17:29 ET (US)     9 / 10  
Unless it now goes further to working out caravans trading multiple goods
I finally (after 19 months) looked at caravans that are willing to buy multiple goods and/or sell multiple goods, although only one good could be traded at a specific SY.

A caravan finds the selection value for each SY where it might buy or sell any of its goods (as described in reply #2), and goes to the SY with the lowest selection value. If multiple SYs have the same lowest selection value, I would guess that the caravan would go to the first one in the building list, but I did not check.

This explains why a caravan that could both buy and sell will usually (but not always) go to an SY where it can sell. For example, say that an SY that could receive an import has 4 empty bays and that another SY has an export good in 4 of its bays--the caravan will go to the SY where it can sell unless that SY is quite a bit farther away (roughly 24 tiles farther from a caravan from the entry point or 48 tiles farther from a caravan at an SY).

Note that dockers do not behave this way.

[This message has been edited by Brugle (edited 02-24-2016 @ 05:40 PM).]

posted 02-29-16 20:19 ET (US)     10 / 10  
I have looked at a ship selling multiple goods in a restrictive case: a city with a single dock where no ships buy any goods. The goods are offered for sale in the order of the storage yard special orders, starting after the last good offered for sale at the dock.

For example, consider a city I am very slowly designing, Super Saqqara, which will have a single dock. The final city may export nothing (or maybe a tiny bit of papyrus), will import barley and beer and linen from Abedju ships, and will import clay and pottery and beer and reeds from Behdet ships. An Abedju ship docks and all 3 goods can be sold, and since the last good sold at the dock was beer, dockers take linen then barley then beer to storage yards, where 400 linen, 400 barley, and 100 beer are sold. When only 100 beer is sold, linen can be sold, so a docker takes more linen to a storage yard, but when he gets there no linen is sold (since weaver cart pushers deposited some linen), and no barley or beer can be sold either. None of the goods can be sold while the docker returns, so the Abedju ship leaves. A ship from Behdet docks, and all 4 goods can be sold at that time, and since the last good offered for sale was linen, dockers take reeds then clay then pottery to storage yards, when 400 of each is sold.
Caesar IV Heaven » Forums » Pharaoh: Game Help » What Storage Yard is Chosen by a Docker or Trade Caravan?
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Caesar IV Heaven | HeavenGames