Cargo Distribution

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

petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

Hi all,
Here is another binary, r18897 with MSVC.

Disclaimer:
If CargoDist crashes, do not report it to the OpenTTD developers. Report it to this thread. When making your post about the crash, please upload the crash.dmp, crash.log, crash.sav, and crash.png (only available as of r18184, so if you are using a build older than that, don't bother). These files are vital to finding what happened during the crash. For developers, you can find the PDB file and other files at this site: http://users.tt-forums.net/petert/dev/

Peter
Attachments
gdfba2bc4-cargodist_win32.rar
(3.07 MiB) Downloaded 186 times
Psistorm
Traffic Manager
Traffic Manager
Posts: 173
Joined: 05 Jun 2004 12:22

Re: Cargo Distribution

Post by Psistorm »

popewiz wrote:Sounds like a solid change. Will this effect station ratings though? The problem with long routes with few large trains was always that the station ratings would plummet between arrivals and there wouldn't be any waiting cargo.
thats quite an interesting question, Id like to hear that as well
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: Cargo Distribution

Post by bokkie »

Why would it? I guess it only affects which route people choose (previously, these long routes where chosen less than one would expect if I understand Fonso correctly), not whether they show up at the station. Changing station rating calculation would be another patch. It would be fun if there's a rating per destination, but that's probably not as easy as it sounds.

I'm not familiar with the inner working of the patch so I might be off though :)
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

There are some problems with the latest version of cargodist. You might not be able to load savegames. I'm working on a fix.
The guy on the picture is not me, it's Alonso.
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

fonso wrote:There are some problems with the latest version of cargodist. You might not be able to load savegames. I'm working on a fix.
Isn't that always the case? CargoDist save games weren't usually compatible.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

You cannot load savegames the latest version of cargodist itself has generated. There is a problem in the saveload code.
The guy on the picture is not me, it's Alonso.
jczech
Engineer
Engineer
Posts: 2
Joined: 25 Jan 2010 09:36

Re: Cargo Distribution

Post by jczech »

Hi,

Could someone please explain (or help me find an explanation of) how to run CargoDist on Windows Vista for an absolute beginner? I'm not a coder or anything beyond a basic user, but I'd like to have a play with CargoDist as it's what I've always wanted from OpenTTD - and I understand very little of anything that's posted in this thread...

Thank you!
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

new version:
  • fixed assertion from linkgraph and saveload code
  • implemented sort of supply scaling: Your station ratings are capped at 50% + (sum of acceptance in linkgraph component / global acceptance). This means in order to get station ratings of more than 50% you have to offer more destinations. A rating of 100% can only be achieved if you connect every possible destination on the map. This behaviour is optional. You can switch off "cap station ratings" in the economy settings to get the old behaviour. The system can be slightly cheated, though. If you have multiple stations connected to the same linkgraph component and all of them serving some house, the house's acceptance is counted multiple times for that component. We'll see how grave this problem will be.
  • cleaned up the smallmap code.
The guy on the picture is not me, it's Alonso.
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Cargo Distribution

Post by NekoMaster »

jczech wrote:Hi,

Could someone please explain (or help me find an explanation of) how to run CargoDist on Windows Vista for an absolute beginner? I'm not a coder or anything beyond a basic user, but I'd like to have a play with CargoDist as it's what I've always wanted from OpenTTD - and I understand very little of anything that's posted in this thread...

Thank you!
Dude, just download OpenTTD (I would suggest OpenTTD v1.0.0 if you havent already downloaded oepnttd) then download and extract one of the builds, though you might want to wait till petert makes a new build with the fixed code so you can save and load games.
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
jczech
Engineer
Engineer
Posts: 2
Joined: 25 Jan 2010 09:36

Re: Cargo Distribution

Post by jczech »

NekoMaster wrote:
jczech wrote:Hi,

Could someone please explain (or help me find an explanation of) how to run CargoDist on Windows Vista for an absolute beginner? I'm not a coder or anything beyond a basic user, but I'd like to have a play with CargoDist as it's what I've always wanted from OpenTTD - and I understand very little of anything that's posted in this thread...

Thank you!
Dude, just download OpenTTD (I would suggest OpenTTD v1.0.0 if you havent already downloaded oepnttd) then download and extract one of the builds, though you might want to wait till petert makes a new build with the fixed code so you can save and load games.
I've got OpenTTD (0.7.1) and ran the build that was posted here a few days ago (the one before last), but my passengers were still just behaving the usual way and travelling on the first vehicle for one stop. Then it crashed after about ten minutes (I can't remember what I was doing so I can't replicate it, but I'd rather work out how to get the main feature working first).
popewiz
Engineer
Engineer
Posts: 52
Joined: 16 Nov 2009 20:08

Re: Cargo Distribution

Post by popewiz »

fonso wrote:new version:
  • fixed assertion from linkgraph and saveload code
  • implemented sort of supply scaling: Your station ratings are capped at 50% + (sum of acceptance in linkgraph component / global acceptance). This means in order to get station ratings of more than 50% you have to offer more destinations. A rating of 100% can only be achieved if you connect every possible destination on the map. This behaviour is optional. You can switch off "cap station ratings" in the economy settings to get the old behaviour. The system can be slightly cheated, though. If you have multiple stations connected to the same linkgraph component and all of them serving some house, the house's acceptance is counted multiple times for that component. We'll see how grave this problem will be.
  • cleaned up the smallmap code.
I like it. Do you consider this a temporary solution for supply scaling, or will this system be tweaked? The only reason I ask is in regards to larger and larger maps. As the map size increases, and with it the number of available destinations, adding even 20 stations may only increase the supplied traffic by 2%. You have likely already planned this, but my suggestion would be to weight traffic increase based on both distance (similar to your "effect of distance on demands" setting) and size of destination. This way, connecting a local bus station (where you would assume people close by are more likely to want to go) would increase the supply more than connecting an airport across the map.

Anyway, excellent job so far, It's really amazing how much deeper this game is due to your patch. Thanks.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

popewiz wrote:
I like it. Do you consider this a temporary solution for supply scaling, or will this system be tweaked? The only reason I ask is in regards to larger and larger maps. As the map size increases, and with it the number of available destinations, adding even 20 stations may only increase the supplied traffic by 2%. You have likely already planned this, but my suggestion would be to weight traffic increase based on both distance (similar to your "effect of distance on demands" setting) and size of destination. This way, connecting a local bus station (where you would assume people close by are more likely to want to go) would increase the supply more than connecting an airport across the map.

Anyway, excellent job so far, It's really amazing how much deeper this game is due to your patch. Thanks.
If you play on a large map and already have some network there should always be an incentive to connect even more destinations until all are connected. As the available space for rewards is limited the reward generated for the first few stations is smaller than on small maps - regardless of other complicated factors you might add. I won't increase the overall amount of cargo generated, if that's what you're asking for. It would have too many nasty implications. So I can only decrease the amount of cargo delivered to your station. This is limited as there is a limited amount of cargo and the minimum amount delivered shouldn't be too low.

I also don't see why connecting a local bus station should be more beneficial to the supply than connecting an airport across the map. The rating cap is already weighed by size of destination. "Size of destination" in this case is the sum of acceptance numbers of houses and industries in the station's coverage area.

To sum it up: Yes, large maps are harder to play than small ones now. However, the minimum cap is 50%. You'll always get some cargo, even if you just connect two stations.
The guy on the picture is not me, it's Alonso.
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: Cargo Distribution

Post by Wasila »

Would it be possible to make the cap adjustable?
popewiz
Engineer
Engineer
Posts: 52
Joined: 16 Nov 2009 20:08

Re: Cargo Distribution

Post by popewiz »

fonso wrote:
popewiz wrote:
I like it. Do you consider this a temporary solution for supply scaling, or will this system be tweaked? The only reason I ask is in regards to larger and larger maps. As the map size increases, and with it the number of available destinations, adding even 20 stations may only increase the supplied traffic by 2%. You have likely already planned this, but my suggestion would be to weight traffic increase based on both distance (similar to your "effect of distance on demands" setting) and size of destination. This way, connecting a local bus station (where you would assume people close by are more likely to want to go) would increase the supply more than connecting an airport across the map.

Anyway, excellent job so far, It's really amazing how much deeper this game is due to your patch. Thanks.
If you play on a large map and already have some network there should always be an incentive to connect even more destinations until all are connected. As the available space for rewards is limited the reward generated for the first few stations is smaller than on small maps - regardless of other complicated factors you might add. I won't increase the overall amount of cargo generated, if that's what you're asking for. It would have too many nasty implications. So I can only decrease the amount of cargo delivered to your station. This is limited as there is a limited amount of cargo and the minimum amount delivered shouldn't be too low.

I also don't see why connecting a local bus station should be more beneficial to the supply than connecting an airport across the map. The rating cap is already weighed by size of destination. "Size of destination" in this case is the sum of acceptance numbers of houses and industries in the station's coverage area.

To sum it up: Yes, large maps are harder to play than small ones now. However, the minimum cap is 50%. You'll always get some cargo, even if you just connect two stations.
Fair enough, but let me explain my reasoning with the bus station/airport thing. If I live in Paris, and I have a bus stop close by, it's much more likely that I'll use that stop if there is another one in Paris, maybe close to work, the grocery store, etc. On the other hand, having an airport open in New York is only worthwhile to me if I have a reason to go to New York. I would assume that in general, cross-town trips would be much more common, and thus have higher supply. Now, if the New York airport begins to be connected by train to a lot of other cities in the US, the odds that I'll use the airport go up, but are still unlikely to surpass that of the cross-town bus route.

I hope that wasn't too rambling, and either way, I'm happy with what we have.
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Cargo Distribution

Post by NekoMaster »

jczech wrote:
NekoMaster wrote:
jczech wrote:Hi,

Could someone please explain (or help me find an explanation of) how to run CargoDist on Windows Vista for an absolute beginner? I'm not a coder or anything beyond a basic user, but I'd like to have a play with CargoDist as it's what I've always wanted from OpenTTD - and I understand very little of anything that's posted in this thread...

Thank you!
Dude, just download OpenTTD (I would suggest OpenTTD v1.0.0 if you havent already downloaded oepnttd) then download and extract one of the builds, though you might want to wait till petert makes a new build with the fixed code so you can save and load games.
I've got OpenTTD (0.7.1) and ran the build that was posted here a few days ago (the one before last), but my passengers were still just behaving the usual way and travelling on the first vehicle for one stop. Then it crashed after about ten minutes (I can't remember what I was doing so I can't replicate it, but I'd rather work out how to get the main feature working first).
Try a older build, or wait till a new build is released. I dont see why what you did would have failed, unless your on Linux or another OS
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Wasila: That can be done. Instead of a simple on/off switch I can let you set the minimum cap. So if you set it to 100% it's like switching it off.

popewiz: The weighing of distances is already done as part of the demand calculation. Of course I could limit the cargo generation based on the question if the available destinations match some pattern of distances. That would be very complicated to determine, though. And if you have some sort of special map where all possible destinations are packed in a small space (for example) you might not be able to reach that pattern.

The only problem I see is the possibility to cheat the system. However, the cheat might not be very practical, so I'll see if someone can come up with a way to put it to use. If you think you have successfully done so, please post a savegame.
The guy on the picture is not me, it's Alonso.
rbn2903
Engineer
Engineer
Posts: 122
Joined: 08 Dec 2007 18:04
Location: Aachen (Aken), Germany

Re: Cargo Distribution

Post by rbn2903 »

fonso wrote:That can be done. Instead of a simple on/off switch I can let you set the minimum cap. So if you set it to 100% it's like switching it off.
Even more settings? I'm sry fonso, I appreciate your work on this patch, but I really hope all those settings will vanish when it's finished. It's hard to unterstand what each setting does and "I" (yes, it's my opinion ;) ) don't want to stay half an hour switching between the advanced settings, the forums and the wiki before I can play at last! :cry:
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Cargo Distribution

Post by FooBar »

I think having some settings isn't a problem at all, just as long as the default is something that 'just works'. If that is true, then the settings can be retained for people wanting to tweak a few bits and pieces to their liking.
rbn2903
Engineer
Engineer
Posts: 122
Joined: 08 Dec 2007 18:04
Location: Aachen (Aken), Germany

Re: Cargo Distribution

Post by rbn2903 »

Hm, ok, I'm sry, maybe I have a bad day :/ But what about some presets like the difficulty-settings (easy, etc.) that are easy to unterstand like "focus on local service" or something like that?
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: Cargo Distribution

Post by Wasila »

The amount of settings added is a small fraction of the amount of settings already there. Perhaps the settings could be better worded:

I assume that the ARMOURED cargo class is just valuables - if so, put valuables instead. Same sort of thing for EXPRESS. Perhaps the accuracy could be converted into a percentage, although I'm not sure how that would work. The last three settings I don't see a better wording.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 12 guests