Page 103 of 154

Re: Cargo Distribution

Posted: 12 Dec 2010 12:50
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.

Re: Cargo Distribution

Posted: 12 Dec 2010 13:48
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.

Re: Cargo Distribution

Posted: 12 Dec 2010 15:30
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?

Re: Cargo Distribution

Posted: 14 Dec 2010 11:47
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

Re: Cargo Distribution

Posted: 14 Dec 2010 11:52
by Eddi
please always state the version that appears in the main menu (a string like "gXXXXXXXX-cd") when uploading savegames.

Re: Cargo Distribution

Posted: 14 Dec 2010 16:41
by donchatryit
The link to the compile farm seems to be broken. I eep getting an HTTP 405 error.

Re: Cargo Distribution

Posted: 14 Dec 2010 18:15
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.

Re: Cargo Distribution

Posted: 15 Dec 2010 08:36
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.

Re: Cargo Distribution

Posted: 15 Dec 2010 09:24
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

Re: Cargo Distribution

Posted: 15 Dec 2010 14:25
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.

Re: Cargo Distribution

Posted: 15 Dec 2010 22:19
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?

Re: Cargo Distribution

Posted: 16 Dec 2010 06:26
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)

Re: Cargo Distribution

Posted: 16 Dec 2010 20:54
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).

Re: Cargo Distribution

Posted: 17 Dec 2010 22:24
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

Re: Cargo Distribution

Posted: 18 Dec 2010 10:36
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.

Re: Cargo Distribution

Posted: 22 Dec 2010 16:37
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%.

Re: Cargo Distribution

Posted: 22 Dec 2010 21:07
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.

Re: Cargo Distribution

Posted: 22 Dec 2010 21:21
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?

Re: Cargo Distribution

Posted: 24 Dec 2010 14:31
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.

Re: Cargo Distribution

Posted: 24 Dec 2010 15:20
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.