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

Post Reply
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by fonso »

FooBar wrote:
Tafidis wrote:It can make sense both ways
Yes, it does. Therefore I think it would be great to have both options (+ no destinations at all, i.e. what we have now) at the player's choice. Now I don't think Michi_cc is particularly interested in implementing both at the same time, it might be useful to 'leave room' for the other implementation, so that it's possible to add it later without having to rewrite the whole thing.
I have already written a "distribution mode" for yacd. Just try my branch "distyacd". It behaves similar to cargodist but is based on yacd.
The guy on the picture is not me, it's Alonso.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Michi_cc »

FooBar wrote:
Tafidis wrote:In any case, target for cargo should be an industry as a whole, not an industry tile...
Yes, that would make more sense.
Yes, it would. Which is why YACD is already working like this.

-- Michael Lutz
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by FooBar »

Please consider me outdated :)

Keep up the good work, both of you!
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Zuu »

FooBar wrote:When looking at public transport: At home people decide whether to use the car or public transport, based on various reasons. One of those reasons is if they actually can use public transport to get to their destination. If they can't, they won't use it.
Most trips are done for a purpose and not just for fun. If the purpose is to go to grocery store, there are usually more than one store to choose from. Thus the destination is not always fixed and can depend on the available transport systems (both public and private). The ability of individuals to pick a different destination of course varies with the purpose of the trip. Compare going to a different job or visiting another shop.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by FooBar »

Yes, I think that adds to the difference between cargo and passengers.
Cargo needs to go from a fixed point A to a fixed point B because factory B ordered products from factory A. And then some form of transportation needs to be conceived.
With people it's different: they take the availability of transport modes into account in their destination choice. If indeed person P has the choice between supermarkets C, D and E and there is no means of transport from P to D or E, that person will choose C as it's destination. Only after a route between P and D is built, it will consider D as a viable destination as well.
The destination choice of people is hard to model in real life, so it's even harder to model such a model in a game. But then I don't think real life should be modeled in the game, just something that vaguely resembles it and is fun to play should be the goal here I guess.
User avatar
Tafidis
Traffic Manager
Traffic Manager
Posts: 157
Joined: 19 Oct 2010 19:49

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Tafidis »

Michi_cc wrote:Yes, it would. Which is why YACD is already working like this.
Ooops! Sorry for uninformed comment then (embarrassed smiley here)

@Foobar: Yes, in real life what you say makes sense. But in the game context, we need to define a simpler concept. I think YACD achieves this:
Before a passenger appears at a station it (is an object actually, not a a person) has already its destination fixed. It will try to get there using whatever means possible. This is much better than what we have now, of course. My only comment on this that I made a couple of posts above is it should try to get as close as possible if it can't actually get there.

I have come to totally agree with you on cargo. Industries have their FIXED contracts, and a set portion of the total monthly production is supposed to go to any given destination. [ I am worried about how / how many destinations are assigned though. Too few means you will never connect cargo from the other side of the map (many people like this as an achievement), while too many will require a crazy network on larger maps with hundreds of industries ].

To conclude, YACD is conceptually simpler for both pax and cargo.

Cargodist behaviour is less intuitive but closer to the original game: cargo only goes to destinations YOU (the player) connect. Perhaps we could have both? I mean, both patches are a lot of work and cargodist has been around for a good while already.
Citizens Celebrate! First train arrives in <insert your favourite town/station name here>!
TERdON
Engineer
Engineer
Posts: 90
Joined: 09 Nov 2010 15:30

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by TERdON »

It would make sense to have a bit of each, since IRL some cargo will have an ultimate destination, but some may just take any destination (planning a weekend trip? Check where it is cheap to go!)...
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations (v2.0 released)

Post by Michi_cc »

The feature and bugfix double release 2.0 and 1.2 is out. The git repo was rebased as well. Use git fetch --tags to get the 1.2 tag as well (otherwise you'll only get the 2.0 one on updating).

Both releases have the same features, only the way the enable/disable setting is stored was changed. This means that 2.0 can't load old save games. Use 2.0 for new games and 1.2 only if you want to continue an existing game. There will be no 1.3 release for possible bugs fixes though, so updating is definitely recommended.

Notable changes:
  • Route link overlay for the smallmap.
  • Ctrl+Click in the station view window to jump to the shown destination. (Not supported for the source view, as that would require some rewriting.) Newly opened station windows will show the dest mode of the last window.
  • Subsidies are generated only for destinations with demand.
  • Better distribution of industry cargo over the demand destinations.
  • Invalidation of next hop info was sometimes faulty. If you have vehicles that never unload their cargo, temporarily change one of their orders to an unload order.
  • Improved route link pre-filling. Route links are also not expired when there's still a vehicle loading.
  • Fixed a problem with cargo routing and selective servicing of stations that lead to the first journey to a station to not get paid.
  • The cargo amounts of the "other destinations" link were not properly updated and shown.
  • Changed settings: economy.cargodest.min_weight_ind to 10, economy.cargodest.weight_scale_ind to "20,50", economy.cargodest.max_route_age to 730, pf.yapf.route_travel_time_factor to 32, pf.yapf.route_station_waiting_factor to 128. Deleting (or at least removing those entries from) your openttd.cfg is recommended. Except for economy.cargodest.weight_scale_ind all values can also be changed in-game.
New route map display:
New route links view in the smallmap.
New route links view in the smallmap.
smallmap.png (18.86 KiB) Viewed 3548 times
Line width is based on the aggregate cargo waiting for transport between the two linked stations. Size of the station symbols is based on total amount of the selected cargoes. I know that the waiting cargo is not always a good measure for congestions, but that's the only readily-available statistic.

Next up are some more GUI improvements and bug fixes if necessary. After that, I'll look at distribution and possible performance improvements.

EDIT: Info about v2.0.
EDIT 2: v2.0 updated because of a gcc compilation problem.
EDIT 2: And the same fix for v1.2.

-- Michael Lutz
Attachments
yacd_v2_0_r22435.patch
v2.0 git patch, apply with -p1. Use this for new games!
(299.72 KiB) Downloaded 97 times
yacd_v1_2_r22435.patch
v1.2 git patch, apply with -p1. Only use for existing games.
(298.4 KiB) Downloaded 102 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: YACD - Yet Another CargoDestinations (v2.0 released)

Post by Zuu »

Windows binary

- Win32
- YACD 2.0
- now labeled as "22435M" in the program title instead of the hg version as before.
openttd-r22435M-win32-YACD-2.0.zip
(4.35 MiB) Downloaded 122 times

I don't plan to build a Windows YACD 1.2 binary. If someone on windows wants it, feel free to build yourself and post it. Thus, be aware this binary can't load your existing YACD games.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Progman
Engineer
Engineer
Posts: 76
Joined: 15 Jul 2006 12:55
Contact:

Re: YACD - Yet Another CargoDestinations (v2.0 released)

Post by Progman »

There might be a problem with cargo which cannot reach their destination. When you have a big network and split it in two networks then you have cargo from one network (inside the vehicles) which want to the other network but cannot reach it. This results in blocking the cargo slots in the vehicles. The only way to get rid of them (if I don't want to reconnect the two networks again) is to delete the vehicle or wagon holding the cargo. IMO it would be better to drop the cargo at the next station for later pickup. This (1) release the slots in the vehicle/wagon again and (2) let the cargo die/vanish at the station in the same way like a station produce cargo but don't get picked up immediately. When (and if) the networks are reconnected the next vehicle can still pickup the cargo (but might be vanished already a little).
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: YACD - Yet Another CargoDestinations (v2.0 released)

Post by bokkie »

I've started a new game with 2.0. I forgot to set cargo destinations on and switched in later on while I was already transporting oil. Then the 'new' oil got destinations, but the 'old' oil was kept in the vehicles so it couldn't load oil-with-destinations. Ofcourse this is my bad but it would be nice if this would solve itself automagically.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations (v2.1 released)

Post by Michi_cc »

Progman wrote:There might be a problem with cargo which cannot reach their destination.
If that was with 1.1, you've probably been hit with the invalidation bug. Cargo that can't reach its destination any more will be dropped, but in 1.1 the next unload station was not always properly invalidated so the cargo stayed on the vehicle.
bokkie wrote:Then the 'new' oil got destinations, but the 'old' oil was kept in the vehicles so it couldn't load oil-with-destinations.
Cargo without destinations will be unloaded at accepting stations. If you want to unload it at a non-accepting stations as well, use a unload order.


And for something new, here's the quick bug fix release 2.1. Same deal as always with the git repo.

And thanks to the guys at #openttdcoop and the OTTD compile farm, there will be binaries at http://bundles.openttdcoop.org/yacd/ from now on. Build is done at 07:00 CET if something changed.

Notable changes:
  • Small bug fix with route link pre-fill when adding wagons to en existing train.
  • Small bug fix to the smallmap display.
  • Some compilation warnings fixed.


EDIT: Tiny screw up with the patch file, please re-apply if you'd already downloaded it.
EDIT: Apply patch to r22439 or later for a trunk bug fix regarding the minimap.

-- Michael Lutz
Attachments
yacd_v2_1_r22435.patch
v2.1 git patch, apply with -p1 to r22439 or later.
(302.28 KiB) Downloaded 105 times
Last edited by Michi_cc on 08 May 2011 18:29, edited 1 time in total.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: YACD - Yet Another CargoDestinations (v2.1 released)

Post by Zuu »

I've added a "Last YACD" release target to OpenTTD Auto Update, so users of this Windows-program can get updates of YACD through the same interface as they use to update last nightly, stable etc.

As for information, the program does display the changlog (eg. http://bundles.openttdcoop.org/yacd/yac ... ngelog.txt) in raw format before update. I hope most users come here and read as well to follow the development discussions, but if they don't they will at least see the changelog.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: YACD - Yet Another CargoDestinations (v2.1 released)

Post by bokkie »

[quote="Michi_cc
bokkie wrote:Then the 'new' oil got destinations, but the 'old' oil was kept in the vehicles so it couldn't load oil-with-destinations.
Cargo without destinations will be unloaded at accepting stations. If you want to unload it at a non-accepting stations as well, use a unload order.
I did try transfer orders (and leave cargo) but that didn't work. I ended up selling/rebuying all vehicles. New version already, thumbs up for your work!
User avatar
Dimme
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 30 Jul 2008 12:42
Location: Trondheim, Norway

Re: YACD - Yet Another CargoDestinations (v2.1 released)

Post by Dimme »

Great patch! I play a large map with lots of towns, and sometimes passengers want to go to nearby towns, sometimes to some random town on the other side of the map. Great for a mix of buses, trains, aircraft and ferries!

Unfortunately, OpenTTD freezes when I open the linkgraph view (sometimes instantly, sometimes later)

Savegame attached
Attachments
autosave10.sav
(742.53 KiB) Downloaded 108 times
Try my modular airports minigame!

Image
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: YACD - Yet Another CargoDestinations (v2.1 released)

Post by Wasila »

Firstly, congrats on another (seemingly - haven't tried it) fine cargodest patch!

In regards to the CargoDist/YACD issue and which is more realistic, perhaps the best solution would be a blend of the two. So of course there are journeys which people want to make to specific destinations (usually short-distance, such as to the shops or whatever), but there are also journeys where people will go to a destination depending on the choice available (most long-distance journeys; holidays). As a result, perhaps each town could generate a set amount of passengers demanding specific destinations, and a set amount willing to go wherever.

Too processor intensive/difficult to code?
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations (v2.1 released)

Post by Michi_cc »

Dimme wrote:Unfortunately, OpenTTD freezes when I open the linkgraph view (sometimes instantly, sometimes later)
That actually turned out as a trunk bug, which frosch fixed in r22439. Apply the patch/update your checkout to at least that rev. I've rebased the tag in the git repo accordingly.

-- Michael Lutz
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations (v2.2 released)

Post by Michi_cc »

Well, seems like that I didn't fix the order invalidation bug properly. Here's YACD 2.2 that has the bug hopefully finally squished out. Thanks to Alberth for the test case. Git repo <insert what I always write here>.

No other notable changes.

-- Michael Lutz
Attachments
yacd_v2_2_r22439.patch
YACD version 2.2. Use patch -p1 to apply.
(302.75 KiB) Downloaded 100 times
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: YACD - Yet Another CargoDestinations (v2.2 released)

Post by Leanden »

I like how this means I don't need to use transfer orders for my cargo to find where it wants to go, I don't however like that I don't have control over where my cargo goes. If I could have the cargo routing without the destinations chosen for me, that'd be better imo. But the implementation is fantastic, so kudos on that.
Image
User avatar
lawton27
Tycoon
Tycoon
Posts: 1418
Joined: 03 Aug 2009 14:29
Location: Manchester

Re: YACD - Yet Another CargoDestinations (v2.1 released)

Post by lawton27 »

Dimme wrote:Great patch! I play a large map with lots of towns, and sometimes passengers want to go to nearby towns, sometimes to some random town on the other side of the map. Great for a mix of buses, trains, aircraft and ferries!

Unfortunately, OpenTTD freezes when I open the linkgraph view (sometimes instantly, sometimes later)

Savegame attached
I've also had this issue, but non the less great patch. Very nicely done. :wink:
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 20 guests