YACD - Yet Another CargoDestinations (v2.3 released)

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: YACD - Yet Another CargoDestinations

Post by Eddi »

i kinda like the capacity information, it helps spotting the bottlenecks
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: YACD - Yet Another CargoDestinations

Post by andythenorth »

Some thoughts from early in my YACD game...

1. Don't forget to enable cargo destinations in your game:
yacd.png
yacd.png (14.11 KiB) Viewed 4468 times
2. The warning about bankruptcy in savegames is to be taken seriously :twisted:

3. YACD throws up some interesting questions for industry sets. Broadly it looks to make cargo transportation much more interesting. I've found one edge case so far. The fishing chain in FIRS is explicitly designed to cluster source (fishing ground) and destination (fishing harbour), giving players an easy moneymaker to start with. However YACD favours fishing harbours a long way from the fishing grounds, rather than those clustered nearby :) I'm not sure how this should be solved yet.

4. I haven't figured out how YACD handles transfers yet. Do I need explicit transfers, or does the cargo routing algorithm sort it out? I'm figuring the latter...
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: YACD - Yet Another CargoDestinations

Post by Eddi »

that's what i meant above with "local" cargo to be favoured. especially in very early game. (imagine eGRVTS with just horse carriages)
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: YACD - Yet Another CargoDestinations

Post by andythenorth »

Eddi wrote:that's what i meant above with "local" cargo to be favoured. especially in very early game. (imagine eGRVTS with just horse carriages)
My perception is that for industries based on land, local destinations are favoured. It appears to be water industries that favour distant destinations. (I have no science for this, just looking at industries in my game). Is this an issue of pathfinders + penalties?
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: YACD - Yet Another CargoDestinations

Post by Eddi »

Roujin wrote:Eddi: strangely I find it no harder to pronounce this than xkcd. :P (actually it's easier, "yay-ceedee" (which also carries our enthusiasm about the effort to implement cargo destinations into OpenTTD :mrgreen: ) or "yassidy", compared to "ex-kay-ceedee")
it's a matter of heuristics. my brain knows two modes to read an abbreviation: 1) individual letters, or 2) word. XKCD clearly falls into category 1: /iks-ka-tse-de/, while YACD initially falls into category 2, but after the first syllable /yak/ it stops, because the /d/ is not a full syllable. with /yak-dest/ it would be a two-syllable word.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations

Post by Michi_cc »

andythenorth wrote: 2. The warning about bankruptcy in savegames is to be taken seriously :twisted:
Yeah, absolutely. I've been testing with a well developed game (mainly pax) from the savegame forum section. Without YACD, it's making several 100 millions each year, but since I enabled destinations on that game, I've been constantly loosing money, even after completely reorganizing the cargo network so it's actually carrying cargo again. The network just isn't built to manage the transport flow, which means that cargo is piling up in stations and not making money.
andythenorth wrote: 3. YACD throws up some interesting questions for industry sets. Broadly it looks to make cargo transportation much more interesting. I've found one edge case so far. The fishing chain in FIRS is explicitly designed to cluster source (fishing ground) and destination (fishing harbour), giving players an easy moneymaker to start with. However YACD favours fishing harbours a long way from the fishing grounds, rather than those clustered nearby :) I'm not sure how this should be solved yet.
Change the setting economy.cargodest.ind_chances to something like "90,95,100" (you can't do this via the in-game console though, the console command doesn't handle lists unfortunately :( This settings specifies the cumulative chance which kind of industry is chosen for each destination. The default of "40,80,100" means for example 40% chance for a nearby industry (nearby is defined by economy.cargodest.ind_nearby_dist in tiles^2, this value might be too high as well), the next 40% for producing industries (i.e. not blackholes) and the remaining 20% chance for any accepting industry. Setting it to "100,100,100" would mean to always search a nearby industry first, and only try the next categories if no unserviced nearby industry is found. There's a second algorithm as well that makes sure that each industry will have at least one supplier for each cargo type, so even on "100,100,100" you power plants will still have at least one supplier.
andythenorth wrote: 4. I haven't figured out how YACD handles transfers yet. Do I need explicit transfers, or does the cargo routing algorithm sort it out? I'm figuring the latter...
Please read the first post 8) The Highlights list Automatic transfer handling at stations. Transfer orders are ignored and handled automatically. No (un)load/forced unloading is handled properly (even no loading/no unloading).

-- Michael Lutz
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: YACD - Yet Another CargoDestinations

Post by andythenorth »

I'll try adjusting the chances list and report back.

Other observations...

(1) it's very addictive so far. My game is only two years old, but it's fun. I figured I have to connect as many nodes connected as possible in a passenger network as fast as possible. There's a critical mass where there are enough PAX journeys for vehicles to get a reasonable profit. In a traditional game I'd pick off a couple of money makers, then join up complete industry chains, but not worry about the overall graph.

(2) I have a hotel industry (PAX in/out) in FIRS which seems to be disproportionately favoured as a destination for nearby towns. It is a good hotel, and does serve alcohol :D Might just be a random effect.

(3) EDIT - another early conclusion is that mail wants to travel to distant destinations? So starting with mail in a local network is not very money-making?
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: YACD - Yet Another CargoDestinations

Post by Roujin »

I reserved some time today for finally trying out this patch, but so far I've only set up and compiled the thing.

Small hint for any other windows users who are trying to apply the patch with gnu-win32 patch: you have to run the .patch file through a tool of your choosing first that converts the line endings to CRLF, or there will be cryptic errors. Took me a while to figure out :roll:
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations

Post by Michi_cc »

andythenorth wrote:(1) it's very addictive so far. My game is only two years old, but it's fun. I figured I have to connect as many nodes connected as possible in a passenger network as fast as possible. There's a critical mass where there are enough PAX journeys for vehicles to get a reasonable profit. In a traditional game I'd pick off a couple of money makers, then join up complete industry chains, but not worry about the overall graph.
If the map has two larger towns/cities that aren't too far away (if you play random maps, that's obviously not going to be the case every single time), there's a very good chance they will have each other as a destination with a good share of the total passengers. A good starting strategy then is to build a local network for each city (can be just a simple circle route as long as it covers most of the houses) and a connection between them. When you've made some money from that, start connection the towns surrounding both cities, starting with those that have demand to both cities if possible. Watch out for overload of your connector line though.
andythenorth wrote:(2) I have a hotel industry (PAX in/out) in FIRS which seems to be disproportionately favoured as a destination for nearby towns. It is a good hotel, and does serve alcohol :D Might just be a random effect.
The chance for a cargo with town effect (which pax should have as TE_PASSENGERS) is supposed to be 95% town, 5% industry. Maybe there's a bug somewhere, I'll have to check it.

-- Michael Lutz
fabca2
Transport Coordinator
Transport Coordinator
Posts: 312
Joined: 14 Apr 2004 15:18
Location: Fr

Re: YACD - Yet Another CargoDestinations

Post by fabca2 »

sorry, but I'll be the first one to request it.
can anyone provide a win32 build ?

yes, I know I could learn, I tried... but the fact is I don't use same tools : I never understood git (but I can do few stuff with svn), gnu tools for windows is unknown for me, and my compiler is unsupported (VC6)...
thank you.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: YACD - Yet Another CargoDestinations

Post by Zuu »

Windows release binary, built using Visual Studio 2008 Express. As far as I'm aware, It should contain DirectMusic support.
openttd-r22374M-win32.zip
(4.1 MiB) Downloaded 190 times
Bundle code: (needs cygwin/msys etc.)

Code: Select all

NAME=openttd-r22374M-win32

cp -Ra bin $NAME || exit
cp objs/win32/Release/openttd.exe $NAME
zip -r -q $NAME.zip $NAME

Edit: I've used hg instead of subversion to checkout the OpenTTD source code which is why it shows up as version hdf8e89c9M in-game instead of r22374M.

Edit2: The bundle code above is only provided for reference, you don't need execute when using the bundle attached above. It was merly included so that others can spot if I've forgoten anything critical.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: YACD - Yet Another CargoDestinations

Post by andythenorth »

...posting two games so you can see the development of the network.

Sligglesworth got it's trams and train before I provided ferry service to the rest of the network. PAX was low in the closed network, but I made a mistake there anyway - I should have checked the destinations, not many of them are in my main network :P
Attachments
Fallington Transport, 22nd Feb 1886.sav
(165.17 KiB) Downloaded 135 times
Fallington Transport, 21st May 1882.sav
(148.09 KiB) Downloaded 99 times
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: YACD - Yet Another CargoDestinations

Post by Roujin »

Heh, I'd've saved myself the trouble if I had foreseen someone posting a binary :lol:

---
Michi_cc: how to interpret the contents of the town window correctly? (see attached screenshot)
Tenningwell Transport, 1921-03-15.png
(525.55 KiB) Downloaded 1 time
Outgoing cargo:
x out of y to z

What does that mean exactly? Out of y passengers, x were actually spawned? Or were y spawned but x transported?

Also, "local destinations" is the biggest number, does that mean most passengers in this city wanted to go somewhere else in the city? Now, I've got one station covering most of the city (train station Ctrl-combined to bus station in the center of the city), what happens if a passenger wants to go from x to y in the city where both x and y are in the catchment area of the same station?

---
edit:
well I think I found out what happens...
I have some passengers waiting at Rabourne now, that want to go via Rabourne Central, to Rabourne, i.e. start = destination. That's a bug, I guess?
edit2: clarification: no special orders used anywhere, just normal go to (load if available, unload if accepted)
Tenningwell Transport, 1921-04-18.png
Tenningwell Transport, 1921-04-18.png (91.67 KiB) Viewed 934 times
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations

Post by Michi_cc »

Roujin wrote: Outgoing cargo:
x out of y to z
y passengers wanted to go to z last month, but only x found a suitable route and were actually transported. This means that ideally x is the same as y. To achieve that, you need to cover all houses at both ends and provide links between them that don't exceed the maximum path penalty (e.g. don't try to transport pax between two neighbouring towns via a complete loop around the map).
Roujin wrote:Also, "local destinations" is the biggest number, does that mean most passengers in this city wanted to go somewhere else in the city? Now, I've got one station covering most of the city (train station Ctrl-combined to bus station in the center of the city), what happens if a passenger wants to go from x to y in the city where both x and y are in the catchment area of the same station?
The passengers will "deliver" themselves to their destination without paying anything to you. YACD does favour transport though, so if the source and the destination are covered by the same station, but the destination is also covered by another station that has a sane link (i.e. fast enough for the short distance) to the source station, cargo will use the provided transport and not deliver itself.
Roujin wrote: I have some passengers waiting at Rabourne now, that want to go via Rabourne Central, to Rabourne, i.e. start = destination. That's a bug, I guess?
Nope, not a bug. The final destination shown in the GUI is the town, not the station. Check the "transferring at" lines in the station window, that's where the cargo gets off the vehicle (also if it's final delivery and not transfer).
fonso wrote:Another thing I'd like to know is how you get the load balancing into that setup. I never quite understood the inner workings of Yapf and I guess that's where I have to look. Maybe you can shed some light on this.
I forgot something regarding load balancing in the first answer: Cargo packets are also randomly assigned a "transport class", they can be flagged as normal, "prefer cheap", "prefer fast" or both. "Prefer cheap" means that vehicle cost is penalized more (with aircraft being the most expensive and ship the cheapest) and "prefer fast" means that travel time is penalized more. This way you'll have up to four different "flows" that spread out over the network. I implemented that so if there's for example both an air and a train link between two towns, both links are used (imagine business travellers and holiday makers),

-- Michael Lutz
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: YACD - Yet Another CargoDestinations

Post by Roujin »

Awesome, thanks for the answers :)

Rabourne here meaning "the town Rabourne" and not "the station Rabourne" clarifies a lot! Indeed, the "transfering at"-station is the other station in the town, "Rabourne Central".
The passengers will "deliver" themselves to their destination without paying anything to you. YACD does favour transport though, so if the source and the destination are covered by the same station, but the destination is also covered by another station that has a sane link (i.e. fast enough for the short distance) to the source station, cargo will use the provided transport and not deliver itself.
That means it makes sense to create some local bus/tram stations inside the catchment of the big train station, in order to max the amount of "local destination" pax that are paying me instead of walking? Awesome. :twisted:
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: YACD - Yet Another CargoDestinations

Post by Roujin »

Well, my endeavour to max out the "local destination" passengers in this town isn't really working out.. only a fraction of them seems to like my exceptional tram service :(
Is this normal?


edit: Also (for example), I have all but four houses covered in Robourne, and all but three in Trundstone Bay, so why do only two third of the people actually spawn? Shouldn't all passengers spawn if all houses are connected?
Attachments
Tenningwell Transport, 1927-05-16.png
(590.39 KiB) Downloaded 1 time
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: YACD - Yet Another CargoDestinations

Post by Eddi »

Roujin wrote:why do only two third of the people actually spawn? Shouldn't all passengers spawn if all houses are connected?
the number should still be modified by station rating, so if all your stations have around 67% station rating, then that are the passengers you are going to get.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: YACD - Yet Another CargoDestinations

Post by Roujin »

Eddi wrote:
Roujin wrote:why do only two third of the people actually spawn? Shouldn't all passengers spawn if all houses are connected?
the number should still be modified by station rating, so if all your stations have around 67% station rating, then that are the passengers you are going to get.
Aha! Well, I'm still in the steam era and haven't invested in statues and such, so naturally my rating is rather low ;)
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: YACD - Yet Another CargoDestinations

Post by planetmaker »

Right after game start (2nd January) I checked a random town. Seems the % calcuated are slightly off ;-)

Code: Select all

~>git show
commit d29e8fab891b03ac767942c91f7a97c5e78253e1
Attachments
yacd_01.png
yacd_01.png (95.18 KiB) Viewed 934 times
also later...
also later...
yacd_02.png (89.07 KiB) Viewed 934 times
inconsistent cargo transported...
inconsistent cargo transported...
yacd_03.png (48.35 KiB) Viewed 4265 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: YACD - Yet Another CargoDestinations

Post by planetmaker »

There seem to be issues with automatic orders, or maybe it's only that the cargo or routing cache has not being updated (yet); in any case it's a bit surprising:

see the attached savegame, train 4. I'd expect it to pickup at its next stop in Schwarzerhütte Woods all passengers except those heading for Lechsee. The train is was and will ;-) be their only means to reach that destination. But it will leave behind most of them.
Previously Schwarzerhütte Woods was not an automatic order but a regular order as it was the end of line which was extended to Lechsee later.

Mind, the savegame uses a couple of AIs and NewGRFs. All should be available via bananas except the 5 attached nightly versions of some NewGRFs.

Making money was not that difficult, but I was warned and got some hints what to do beforehand and I was cautious :-) And it's more difficult than normal game, but obviously the better AIs are also doing well, better than me ;-) And it's fun to actually build real networks for the passengers which actually then make sense :-), trying to satisfy their needs, first jumping on the obvious routes between metropolises after they got a local network in order to be able to supply also long-distance passengers :-). The real benefit is the implicit two-way transfer which avoids nasty two-station constructions with double stops for trains when such thing is planned in trunk.
Attachments
screenshot of train, orders and passengers.
screenshot of train, orders and passengers.
yacd_04_train04.png (120.24 KiB) Viewed 934 times
yacd-test.sav
savegame
(465.42 KiB) Downloaded 101 times
NewGRFNightlies.zip
Needed nightly versions of NewGRFs which are not on Bananas
(1.43 MiB) Downloaded 106 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 46 guests