Page 70 of 154
Re: Cargo Distribution
Posted: 24 Jan 2010 02:30
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
Re: Cargo Distribution
Posted: 24 Jan 2010 02:59
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
Re: Cargo Distribution
Posted: 24 Jan 2010 11:07
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

Re: Cargo Distribution
Posted: 24 Jan 2010 15:07
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.
Re: Cargo Distribution
Posted: 24 Jan 2010 15:13
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.
Re: Cargo Distribution
Posted: 24 Jan 2010 15:59
by fonso
You cannot load savegames the latest version of cargodist itself has generated. There is a problem in the saveload code.
Re: Cargo Distribution
Posted: 25 Jan 2010 09:45
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!
Re: Cargo Distribution
Posted: 25 Jan 2010 13:16
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.
Re: Cargo Distribution
Posted: 25 Jan 2010 13:55
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.
Re: Cargo Distribution
Posted: 25 Jan 2010 14:03
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).
Re: Cargo Distribution
Posted: 25 Jan 2010 14:09
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.
Re: Cargo Distribution
Posted: 25 Jan 2010 18:44
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.
Re: Cargo Distribution
Posted: 25 Jan 2010 20:47
by Wasila
Would it be possible to make the cap adjustable?
Re: Cargo Distribution
Posted: 25 Jan 2010 20:57
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.
Re: Cargo Distribution
Posted: 25 Jan 2010 21:45
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
Re: Cargo Distribution
Posted: 26 Jan 2010 08:18
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.
Re: Cargo Distribution
Posted: 26 Jan 2010 09:02
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!

Re: Cargo Distribution
Posted: 26 Jan 2010 10:11
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.
Re: Cargo Distribution
Posted: 26 Jan 2010 10:32
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?
Re: Cargo Distribution
Posted: 26 Jan 2010 19:19
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.