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
bluebottle
Engineer
Engineer
Posts: 29
Joined: 21 Sep 2009 03:23

Re: Cargo Distribution

Post by bluebottle »

Looks like this thread could do with an updated Ubuntu build.

This is a build of r20016 for Ubuntu 10.04 (Lucid Lynx), with 'vanilla' cargodist (thanks to fonso :bow: ).
  • As with the distro OpenTTD package, you need to have the data files in /usr/share/games/openttd/data/.
  • This build is unstripped to provide better (i.e. useful) core dumps/backtraces. This is similar to including the .pdb file for MSVC builds.
Download: openttd_cargodist-r20016M-no_debug-unstripped-i386.deb

Report bugs/crashes to this thread first.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Cargo Distribution

Post by Kogut »

Destroyed station connected to linkgraph is in minimap showed in topcorner. I think it may be better to show it in old place or completely disable showing (it is data from r19964M cargodist with sprinkles build).
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2867
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

Kogut wrote: Destroyed station connected to linkgraph is in minimap showed in topcorner.
Confirmed. Nice spotting.
I think it may be better to show it in old place ...
If a station is no longer there a linkgraph cannot connect to it so it connects to the invalid tile. Which is what you see in the smallmap gui.
Remembering where destroyed stations were would require Cargodist to remember where all stations are and checking over and over again if they are still there.
IMHO to resource demanding thus bad idea. (Think big games like coop)
... or completely disable showing.
The (bad) linkgraph disappears when the order to go there turns invalid in the order list.
At the same time the station sign is removed from the main gui.
Also the station sign is not removed upon removal of the station to give players the chance to replace a station without having to check/redo all the vehicle orders. (eg. player has by accident removed a station.)
When you rebuild the station near a sign of a destroyed station the name of the station is reused and orders remain valid. See attachment.
This makes me think that it is not a Cargodist problem perse.


A possible solution would be drawing the linkgraphs from station_a sign position to station_b sign position.
fonso?
Attachments
Not_edited_station_name.png
Not_edited_station_name.png (13.03 KiB) Viewed 3948 times
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

I think it'll be safe and easy to just not show any links to the invalid tile. Links to nonexisting stations are useless anyway. I'll do that in the next version, along with white instead of black text for the link graph "text" mode.
The guy on the picture is not me, it's Alonso.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Cargo Distribution

Post by Kogut »

Is it possible to allow setting cargodist relations separetely for every cargo?
I want to use cargodist for passengers, mail, goods and food. With standard industries I can do it thanks to EXPRESS cargo class. Unfortunately it is impossible with FIRS (there are other EXPRESS cargos, other than goods and food). So I have to set all cargos except mail/passengers to manual, or chaoose all EXPRESS cargos to cargodist processing.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Cargo Distribution

Post by Eddi »

IMHO, it makes a lot of sense to have also the "supplies" cargos with destinations, as these are difficult to distribute properly.

It's not feasible to add an option for each cargo type, especially since the advanced settings menu must be independent from newgrfs.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Cargo Distribution

Post by Kogut »

It can be done. For example: menu available after click of RBM on cargo in linkgraph minimap cargo list.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Creat
Traffic Manager
Traffic Manager
Posts: 141
Joined: 26 Oct 2009 16:33

Re: Cargo Distribution

Post by Creat »

Kogut wrote:It can be done. For example: menu available after click of RBM on cargo in linkgraph minimap cargo list.
That would be a very unintuitive solution. I wouldn't ever look in the minimap for options weather or not a cargo type will be handled by cargodist.
Also this creates the problem, that settings can't be saved except in the current savegame (as you may have different NewGRFs loaded in different sessions). So you'd have to make the changes over and over for every game. The only clean solution would be to create a new window for managing this, which still wouldn't solve the saving-problem...
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Cargo Distribution

Post by Kogut »

Or other solution
- set cargo with ID 1 to foo
- set cargo with ID 2 to foo
etc
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

The problem is the fixed structure of the settings menu. You cannot easily add or remove things and always displaying 32 cargo entries most of which are unneeded is somewhat ugly. This is why I went for the current solution.
The guy on the picture is not me, it's Alonso.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Cargo Distribution

Post by Kogut »

Or maybe from command line?
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
keoz
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 16 Jul 2009 10:04

Re: Cargo Distribution

Post by keoz »

Hi.

I've a little issue with cargodist. The problem comes when i'm using conditional orders, like this one:
New Swiss Railways, 19-02-1934.png
New Swiss Railways, 19-02-1934.png (92.96 KiB) Viewed 3303 times
The train number #5 follows that route: Arosa - St.Gallen - Wohlen - St.Gallen. I use conditional orders in order to send the train to a depot when its reliability is under 50%. In this case, the train arrives at the terminus, unloads without loading, goes to the depot, goes back to the terminus, loads, and take back its route.

I've read in the wiki that conditional orders aren't an issue (= nondeterministic orders) when it is not possible to evaluate at least two different stations as alternative, which is the case here. But routing falls back to traditional behaviour:
1) In St.-Gallen, all cargos of the arriving train are unloaded (which is weird, at least a part should go to Wohlen).
2) More important, all cargos in St.-Gallen are loaded, though they shouldn't (the are scheduled for Arosa, not Wohlen), as you can see:
New Swiss Railways, 21-02-1934.png
New Swiss Railways, 21-02-1934.png (85.94 KiB) Viewed 3303 times
New Swiss Railways, 23-02-1934.png
New Swiss Railways, 23-02-1934.png (73.79 KiB) Viewed 3303 times
What did I miss ? I'm pretty sure that this kind of orders were working before (or in some other cases ?), using cargodist.

Regards
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Creat
Traffic Manager
Traffic Manager
Posts: 141
Joined: 26 Oct 2009 16:33

Re: Cargo Distribution

Post by Creat »

Just out of curiosity, why don't you use the provided mechanism to perform conditional maintenance? You do know you can add a maintenance order, right? In those cases the train only goes to the depot for maintenance if the reliability is below a threshold (can be set in advanced preferences I think). It does almost exactly the same as your conditional orders with the exception that the train won't be empty when maintained. That shouldn't make any noticeable difference as far as income etc. is concerned (unless the depot is half a map away), only if you do this for realism...
User avatar
keoz
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 16 Jul 2009 10:04

Re: Cargo Distribution

Post by keoz »

Creat wrote:Just out of curiosity, why don't you use the provided mechanism to perform conditional maintenance? You do know you can add a maintenance order, right? In those cases the train only goes to the depot for maintenance if the reliability is below a threshold (can be set in advanced preferences I think).
I noticed it already, some time ago, but never really used it. Until one hour ago :). That's the solution i just switched to.
Creat wrote:It does almost exactly the same as your conditional orders with the exception that the train won't be empty when maintained. That shouldn't make any noticeable difference as far as income etc. is concerned (unless the depot is half a map away), only if you do this for realism...
Yes, it was for realism, and also because I didn't explore so much the other depot-orders. Anyway it works for me like this now. But I'd still be interested in understanding what did I miss.
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

keoz' original solution should work. There was a bug in some past version where it didn't but I've fixed that (at least I think so). Which version are you using? Can I get a save game?
The guy on the picture is not me, it's Alonso.
User avatar
keoz
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 16 Jul 2009 10:04

Re: Cargo Distribution

Post by keoz »

fonso wrote:keoz' original solution should work. There was a bug in some past version where it didn't but I've fixed that (at least I think so). Which version are you using?
Version and compile date:

Code: Select all

keikoz@kgentoo ~/openttd/openttd-cargodist $ ./findversion.sh 
g0e2b4fba       20160   0       g0e2b4fba
keikoz@kgentoo ~/openttd/openttd-cargodist $ ls -l bin/openttd 
-rwxr-xr-x 1 keikoz users 5169212 2010-07-18 21:20 bin/openttd
fonso wrote:Can I get a save game?
Unfortunately I removed it. But I made a test right now, with a clean game, a standard openttd.cfg and free of NewGRF: the problem is still present. The 1st savegame uses classical orders, and the cargodist scheduling works. In the 2nd savegame, I used the conditional orders, and the pax dispatching doesn't work anymore.
Chiasso Transport, 14th Jul 1951.sav
(405.93 KiB) Downloaded 118 times
Chiasso Transport, 15th Sep 1951.sav
(406.89 KiB) Downloaded 113 times
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
erikvanvelzen
Engineer
Engineer
Posts: 5
Joined: 05 Sep 2006 23:56

Re: Cargo Distribution

Post by erikvanvelzen »

From http://wiki.openttd.org/Passenger_and_c ... stribution
min_rating_cap is a new setting in "Advanced settings" -> "Economy".
I can't find this setting.

I compiled it myself and i got a binary from here but in both versions it's not there. Where do i look?
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Cargo Distribution

Post by Kogut »

erikvanvelzen wrote:From http://wiki.openttd.org/Passenger_and_c ... stribution
min_rating_cap is a new setting in "Advanced settings" -> "Economy".
I can't find this setting.

I compiled it myself and i got a binary from here but in both versions it's not there. Where do i look?
I am not sure but that option was removed.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

yes, "supply scaling" has been replaced by "external station ratings". The Wiki was outdated.
The guy on the picture is not me, it's Alonso.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

The issue with conditional orders is fixed now. I was comparing orders, not their destination stations for equality to find out about determinism. So if you had several orders for the same station it didn't work.
The guy on the picture is not me, it's Alonso.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 13 guests