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

Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Cargo Distribution

Post by Eddi »

Anunnaki wrote: a) is there CargoDistribution SVN patch/diff file to OTTD SVN trunk ?
fonso wrote:[...] you can always download a patch against a recent trunk version here. The trunk version the patch applies to is always recorded here.
Mojhave
Engineer
Engineer
Posts: 10
Joined: 11 Dec 2010 17:44

Re: Cargo Distribution

Post by Mojhave »

Mojhave wrote:Hello, i am a huge Fan of Fonso's Project. Right now i am having a little Problem:

My Passenger Network is A - B - C. If i order a train to go from A - B - C - B he doesn't load any Passengers from A to C and they pile up in A. I tried all combination of orders and load/unload settings but i am not able to solve this. Can someone help me with this?

Thx

I found the problem, it doesn`t work if you set the order to full load ANY cargo in station A. Then the train only loads passengers from A - B.

If you set the order to full load ALL, then the train starts loading passengers from A - B and A - C.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Mojhave wrote: I found the problem, it doesn`t work if you set the order to full load ANY cargo in station A. Then the train only loads passengers from A - B.

If you set the order to full load ALL, then the train starts loading passengers from A - B and A - C.
This sounds very strange. Can I get a savegame, please?
The guy on the picture is not me, it's Alonso.
a.locritani
Engineer
Engineer
Posts: 111
Joined: 08 Feb 2007 11:59
Skype: a.locritani
Location: Italy

Re: Cargo Distribution

Post by a.locritani »

Hi,
I'm using your cargodist patch and I found it very nice.
I've only noticed something "strange".
In the attached savegame, if the factory do not produce anything for a month - ie: the info box of the factory says "production last month: 0 crates" - then the link between the factory itself and the station inside the town (the destination of goods) seems to vanish. Or better, the plan amount goes to 0 and all the waiting goods appears to be destinate "to any station". This happens after some days (a month, maybe) that the factory says "0 box produced".
Also, changing the link recalculation interval seems to change nothing regarding this behavior.
This also happens with refineries and I think it will happens for every "secondary" industries.

If you want I can try with a newer binary, to confirm this behavior.

note: In the attached file, production of factory should go to 0 around 1st of April, and by the end of April the planned window should not show crate items and at the same time the waiting window change all the goods' destination to "any station".

Thanks

edit: savegame version: g111126f1
Attachments
Colleleone Transport, 1952-01-14.sav
(9.64 KiB) Downloaded 57 times
Last edited by a.locritani on 15 Dec 2010 07:33, edited 1 time in total.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Cargo Distribution

Post by Eddi »

please always state the version that appears in the main menu (a string like "gXXXXXXXX-cd") when uploading savegames.
donchatryit
Transport Coordinator
Transport Coordinator
Posts: 259
Joined: 16 Mar 2009 21:00

Re: Cargo Distribution

Post by donchatryit »

The link to the compile farm seems to be broken. I eep getting an HTTP 405 error.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Cargo Distribution

Post by Rubidium »

donchatryit wrote:The link to the compile farm seems to be broken. I eep getting an HTTP 405 error.
The link isn't broken, just the server it points to is currently having some technical issues. Actually, the server it points to isn't the compile farm; it's just the place where the final binaries are placed.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

a.locritani wrote:In the attached savegame, if the factory do not produce anything for a month - ie: the info box of the factory says "production last month: 0 crates" - then the link between the factory itself and the station inside the town (the destination of goods) seems to vanish.
This is normal. Cargodist doesn't know when the factory will produce again. It might be never. If there weren't any goods being supplied to the station next to the factory for a whole month then exactly this is assumed. The supply calculation used to be done with a moving average but I had difficulties determining the optimal length so I just went with last month's supply. This is also in tune with a lot of other places in the game where usually things happening during the last month are the most important. I could reintroduce a moving average over maybe 3 months, though. I'll think about it.
The guy on the picture is not me, it's Alonso.
a.locritani
Engineer
Engineer
Posts: 111
Joined: 08 Feb 2007 11:59
Skype: a.locritani
Location: Italy

Re: Cargo Distribution

Post by a.locritani »

fonso wrote:
a.locritani wrote:In the attached savegame, if the factory do not produce anything for a month - ie: the info box of the factory says "production last month: 0 crates" - then the link between the factory itself and the station inside the town (the destination of goods) seems to vanish.
This is normal. Cargodist doesn't know when the factory will produce again. It might be never. If there weren't any goods being supplied to the station next to the factory for a whole month then exactly this is assumed. The supply calculation used to be done with a moving average but I had difficulties determining the optimal length so I just went with last month's supply. This is also in tune with a lot of other places in the game where usually things happening during the last month are the most important. I could reintroduce a moving average over maybe 3 months, though. I'll think about it.
Ok, I understand, but I think that the existing destination for waiting packages should be retained. Instead all waiting packages lost their destination.
I'm missing something?

thanks
donchatryit
Transport Coordinator
Transport Coordinator
Posts: 259
Joined: 16 Mar 2009 21:00

Re: Cargo Distribution

Post by donchatryit »

Rubidium wrote:
donchatryit wrote:The link to the compile farm seems to be broken. I eep getting an HTTP 405 error.
The link isn't broken, just the server it points to is currently having some technical issues. Actually, the server it points to isn't the compile farm; it's just the place where the final binaries are placed.
Ok. Thanks for the clarification. I will try it again later.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

a.locritani wrote: Ok, I understand, but I think that the existing destination for waiting packages should be retained. Instead all waiting packages lost their destination.
I'm missing something?
You might be right ... it could be a good idea not to reroute cargo in response to plan updates, but only in response to link drops. It would avoid a lot of cargo "to any station" and some extra effort on joining the link graph with the main game state. As long as the link still exists it doesn't hurt much to send the cargo along it. Of course it could have been the receiving end closing down. Then the remaining cargo will be taking detours until the link disappears (which is the player's responsibility). Or am I missing anything?
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 »

Suggestion how to handle not-deterministic orders:

I think that it is reasonable to assume that normal vehicle
- have not empty order list
- even with not-deterministic orders have constant or almost constant list of visited stations

So solution would be to
- cache list_of_visited_stations on every go and assume that on next route will be the same.
- add code to dump no_longer_legal_cargo_for_this_vehicle on one of station (it may be good also for deterministic orders, sometimes cargo is stuck in train)
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 »

Kogut wrote:Suggestion how to handle not-deterministic orders:

I think that it is reasonable to assume that normal vehicle
- have not empty order list
- even with not-deterministic orders have constant or almost constant list of visited stations

So solution would be to
- cache list_of_visited_stations on every go and assume that on next route will be the same.
- add code to dump no_longer_legal_cargo_for_this_vehicle on one of station (it may be good also for deterministic orders, sometimes cargo is stuck in train)
You might want to have a look at the auto-orders branch in my git repository. It implements the first part of your solution and I'll merge it into cargodist soon. I don't get the second part, though. If the vehicle cannot carry that cargo anymore it won't generate link stats anymore and the link will eventually time out. It would be quite complicated to keep track of all vehicles and their cargos at all stations (consider for example automatic refits).
The guy on the picture is not me, it's Alonso.
BigWolf
Engineer
Engineer
Posts: 1
Joined: 17 Dec 2010 15:46

Re: Cargo Distribution

Post by BigWolf »

Don't know if you've been made aware, but the bundles link doesn't contain a win64 version, only the PDB and checksum files
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Well, well ...
compile farm wrote: LINK : fatal error LNK1102: out of memory
Obviously the MS compiler needs a bigger machine for win64 builds. Sorry, but I can't do much about that.
The guy on the picture is not me, it's Alonso.
User avatar
michielh
Engineer
Engineer
Posts: 22
Joined: 29 Apr 2009 13:17
Location: NL

Re: Cargo Distribution

Post by michielh »

Short question: Is it possible to change the "saturation of short paths" setting when you've already started a game?

I am builing a network with trains and busses, but the linkgraph function keeps sending passengers on the low capacity-busroute, even if I put the saturation at 20%.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

michielh wrote:Short question: Is it possible to change the "saturation of short paths" setting when you've already started a game? I am builing a network with trains and busses, but the linkgraph function keeps sending passengers on the low capacity-busroute, even if I put the saturation at 20%.
It is possible, but takes effect only at the next link graph calculation. If the problem persists longer than that please post a savegame and tell me which version you're playing.
The guy on the picture is not me, it's Alonso.
User avatar
michielh
Engineer
Engineer
Posts: 22
Joined: 29 Apr 2009 13:17
Location: NL

Re: Cargo Distribution

Post by michielh »

I've set the linkgraph recalculation interval to 1 day, so it should take effect almost immediatly?

I could post a savegame, but I'm playing with the latest version of the ChillCore patchpack. Don't know if that's a problem?
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

michielh wrote:I've set the linkgraph recalculation interval to 1 day, so it should take effect almost immediatly?

I could post a savegame, but I'm playing with the latest version of the ChillCore patchpack. Don't know if that's a problem?
If you post a savegame I might look at it if I'm bored. If you don't, I have no chance to find out anything more about your problem. If you post a savegame and I'm not bored enough to examine it, it won't hurt anyone either. Don't forget to tell me the specific place where I can find the patch this savegame was created with. Chill's patch pack includes a patch for variable daylength and I don't know how that interacts with cargodist's link graph recalculation interval. Maybe you should ask ChillCore what he has done there.
The guy on the picture is not me, it's Alonso.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2867
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

fonso wrote: Chill's patch pack includes a patch for variable daylength and I don't know how that interacts with cargodist's link graph recalculation interval. Maybe you should ask ChillCore what he has done there.
I have not (yet) adjusted CargoDist to daylength, if that is needed at all.
If the linkgraph recalculation trigger is based on DAY_TICKS then it should be fine as the only thing that is then adjusted is "DAY_TICKS = ORIGINAL_DAY_TICKS * _date_daylength_factor" which makes te recalculation happen in slower intervals.

May I ask where exactly the linkgraph recalculation trigger is in CargoDist? I'll have a looksie if something needs adjusting.
Also the linkgraphs in the smallmap are only a graphical representations of the actual ones, are they? -> I do hope that makes sence.


Other than that,
I am still enjoying your patch very much fonso ... keep up the excellent progress, although most of it only shows in the codechanges.



@michielh:
If the linkgraph recalculation is set to 1 but the daylength factor is 10 then the linkgraph recalculations should be done every ten normal days (untill adjusted).
I have to check the code first and the discussion if disregarding daylenght factor (-> calculate every 74_ticks * linkgraph_recalculation_setting) is preferable is to be continued in the patchack thread.
What you can do, untill I had the chance to check the code, is set the daylength facor to 1, if it is not already, to see if it is recalculated at 'normal' intervals.
Also please (re)read the first post of my patchpack thread please.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 11 guests