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

User avatar
tsjook
Traffic Manager
Traffic Manager
Posts: 197
Joined: 22 Apr 2009 18:33

Re: Cargo Distribution

Post by tsjook »

reuptake wrote:Now I have problem with connections that generate huge losses despite being full (especially bus pax lines, it can generate -20K or more a year). Why is that?
Generally remember that generated income for any cargo including passengers is a factor of time and distance. In two situations (that I can think of) this can lead to negative income for a vehicle in cargodist.

First, most common, example:
abc1.PNG
abc1.PNG (551 Bytes) Viewed 3323 times
When there are two lines (1 & 2), passengers travelling from A to B (via C, there is no direct connection) will create a negative income for train/bus/boat/plane on connection 2 because pricing is based on global distance and B is closer to A than C, thus creating a negative income.

Second, less common, example:
abc2.PNG
abc2.PNG (488 Bytes) Viewed 3323 times
If 1 and 2 are separate connections, the transfer income earned on line 1 for passengers travelling from A to C might be too high if the connection from B to C (line 2) is slower, or if those passengers have to wait at B for a very long time. This might cause a lower, or even negative income for those passengers on line 2.

Keep in mind that negative income on well-filled vehicles is usually just a correction for too high transfer income earned elsewhere.
reuptake
Engineer
Engineer
Posts: 2
Joined: 29 Dec 2009 08:49

Re: Cargo Distribution

Post by reuptake »

Thanks for detailed information. I think hovever that it should be changed in a way that player could more easily distinguish between really unprofitable (eg. empty) nad "fake"-unprofitable line.

And Mac OS X build (Intel only) is here:

http://elou.pl/openttd-cargodist-mac-osx-20091228.zip

Have fun
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Cargo Distribution

Post by Kogut »

Maybe red/green numbers with profit for last train ("fake profit"), and lower - blue with real income?

-4241
12344

Or something like this
-4241 (12344)
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Dylock
Engineer
Engineer
Posts: 3
Joined: 01 Jun 2009 13:00

Re: Cargo Distribution

Post by Dylock »

I've been searching high and low and I cant seem to find the answer so forgive me if someone else asked before, but I've been playing CargoDist (as oppose to CargoDest which I used to play) and I love all the improvements.

There is, however, one thing I've been wondering. I usually use a feeder service to increase the production / transportation of a certain good into a nearby station from which long-haul train(s) move the goods over distances. The goods at the storage station, however, decrease in quantity over time...(why? does coal evaporate?) Has this strategy become redundant with CargoDist? and/or is there a way to still use this technique effectively in CargoDist.... Or has this been deliberately countered as part of the CargoDist goals.

I'm asking because I actually liked the setup of having smaller trains move back and forth between production facilities and a storage station and having long-haul trains move the goods to their (final) destination.
oberhümer
Tycoon
Tycoon
Posts: 1283
Joined: 23 Oct 2009 19:35
Location: Here and there, sometime or another

Re: Cargo Distribution

Post by oberhümer »

Then you´re just not picking it up fast enough.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---

--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
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 »

I know, it seems stupid that some goods would disappear at stations, but it happens, but usually when you dont have a train coming often enough, for things like food, it might be they would remove it cause it went bad.
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!
Dylock
Engineer
Engineer
Posts: 3
Joined: 01 Jun 2009 13:00

Re: Cargo Distribution

Post by Dylock »

I would understand food, but stuff like coal or iron? anyway, CargoDest didnt have that, I guess I'll have to dive into the code if I want it removed...
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Dylock wrote:I would understand food, but stuff like coal or iron? anyway, CargoDest didnt have that, I guess I'll have to dive into the code if I want it removed...
This behaviour is not specific to cargodist. It is present in trunk, too. I didn't change it (at least not on purpose). If you give me a savegame showing the flaw I might be able to find out more.
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 »

Fonsos right, even waaaaay back to 0.5.X days, it still happens. Though, its bad to let stuff just "disappear" cause that lets your ratings drop, thus making it hard to negotiate with the local town authorities when trying to build or demolish stuff
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
Vaulter
Traffic Manager
Traffic Manager
Posts: 185
Joined: 21 Dec 2004 05:35
Skype: andrey-zaharov
Location: St. Petersburg, Russia
Contact:

Re: Cargo Distribution

Post by Vaulter »

Just saw that in small map in links mode, columns has fixed rows
This is extremely important with ECS addon
see attach #1

Just replacing in smallmap_gui.cpp in DrawLegend

Code: Select all

uint number_of_rows = max(this->map_type == SMT_INDUSTRY ? (_smallmap_industry_count + columns - 1) / columns : 0, this->min_number_of_fixed_rows);
to the

Code: Select all

uint number_of_rows = max(this->map_type == SMT_INDUSTRY ?
                            (_smallmap_industry_count + columns - 1) / columns :
                            this->map_type == SMT_LINKSTATS ?
                                 (_smallmap_cargo_count + columns - 1) / columns  : 0, this->min_number_of_fixed_rows);

sorry for this fast ugly trick :) will create patch later if needs
result: see attach #2
clicks on labels works!
Attachments
without
without
ottd-cargo1.png (27.39 KiB) Viewed 2891 times
with
with
ottd-cargo2.png (56.39 KiB) Viewed 2891 times
Dylock
Engineer
Engineer
Posts: 3
Joined: 01 Jun 2009 13:00

Re: Cargo Distribution

Post by Dylock »

Yeah you're right, it is not a CargoDist thing, sorry about that. I never played trunk, just CargoDest, I'll go through the code and see if its something easily changed... Thanks though!
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

Here is a new updated build of CargoDist. I had some previous trouble with patching, but that's all worked out now. Built on MSVC against r18678. I may/will upload a new build of the CargoDist mini-pack if patching goes well, you can find that here: http://www.tt-forums.net/viewtopic.php?f=33&t=46399

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. Also note that the PDB file attached is not needed when testing CargoDist, it is mainly for developers.

Peter
Attachments
cargodist_win32_r18678.rar
(3.33 MiB) Downloaded 133 times
cargodist_PDB_win32_r18678.rar
(2.84 MiB) Downloaded 70 times
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Vaulter wrote:Just saw that in small map in links mode, columns has fixed rows
This is extremely important with ECS addon
The number of legend columns was also miscalculated. As you can see in your screenshot some legend entries disappear behind the buttons. I have tweaked the calculation of min/max numbers of rows and columns. Now everything looks nice as far as I can see. Thanks for the report.

And you have an interesting icon set there. Is that some newgrf? Could you share a link?
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:And you have an interesting icon set there. Is that some newgrf? Could you share a link?
It's the 32bpp GUI. You can download it on this page: http://wiki.openttd.org/List_of_downloadable_32bpp_tars. It's the second one, called "Main Toolbar" Just be sure to start OpenTTD.exe with "-b 32bpp-optimized". (No, you don't need extrazoom levels, it will work in regular nightly)
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: Cargo Distribution

Post by Wasila »

Sorry if this has been mentioned before, but the wiki page isn't very clear. 'Effect of distance on demands', I assume reduce demand if a station is far away? If so, what does an option greater than 100% do?
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Wasila wrote:Sorry if this has been mentioned before, but the wiki page isn't very clear. 'Effect of distance on demands', I assume reduce demand if a station is far away? If so, what does an option greater than 100% do?
The setting determines how much the demand is reduced if the station is far away. If you set it to 0 the demand isn't reduced at all. If you set it to 100% the demand is reduced by the amount I recommend. If you set it higher the demand is reduced even more.
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 »

If you set it to 100% what % will demand be reduced by? Surely the setting should be how much demand is actually reduced as opposed to your recommendations?
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

The reduction of demand depends on both the distance and the setting. If the setting is set to 100% the demand for a journey of one tile is not reduced and the demand for a journey from one corner of the map to the opposite corner - the longest possible journey - is 1. Everything else is scaled linearly.
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 »

Hmm... OK
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: Cargo Distribution

Post by bokkie »

'Negative income' in feeder services should be somewhat corrected: http://hg.openttd.org/openttd/trunk.hg/rev/03e6673d9fd5. So, less complaining in your thread Fonso ;)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 6 guests