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

el koeno
Route Supervisor
Route Supervisor
Posts: 454
Joined: 24 Sep 2004 15:47

Re: Cargo Distribution

Post by el koeno »

fonso wrote:
el koeno wrote: Forget about that. It's going waaay to slow for me. Map is very busy, lots of boats, lots of cargo, but it might be cargodist creating the slowdown. R16284, binary here.
I guess you are right with blaming cargodist. It uses way too much memory on this map. If you have an older computer this may well be the reason for the slowdown. It probably has a memory leak somewhere. I'm investigating that.
el koeno wrote: The savegame is positioned at a spot where the problem described above happens; I created a train with exactly the same capacity as an oil tanker, it reaches 100%, and doesn't leave. I didn't think it was a cargodist problem, but you might be interested.
Of course it was a cargodist problem and it is fixed in the latest version.
Cheers! Keep up the good work!
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

New version: I found the reason for the memory leak. Actually this bug was also responsible for the massive lag when loading a game that has been saved and loaded several times and it should also have created desyncs en masse in any network game. Did anyone try a multiplayer game with cargodist yet?

Windows binary: http://fickzoo.com/fonsinchen/openttd-c ... -win32.zip
The guy on the picture is not me, it's Alonso.
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Cargo Distribution

Post by Leanden »

fonso you have my utmost respect for this mod. Kudos to you!
Image
albeva
Engineer
Engineer
Posts: 8
Joined: 22 May 2009 21:36

Re: Cargo Distribution

Post by albeva »

fonso wrote:Did anyone try a multiplayer game with cargodist yet?
Yes. It's great. Haven't really noticed any problems, but we didn't play much.
User avatar
SkeedR
Tycoon
Tycoon
Posts: 2267
Joined: 11 Jul 2004 14:55
Location: West Midlands
Contact:

Re: Cargo Distribution

Post by SkeedR »

Having done some basic testing i can say that it works brilliantly. Well, sort of. I can for see problems when there are large numbers involved, as such i was finding it very difficult to make arrangements for the numbers of passengers i was getting. I'm wondering if you have anything along the lines of "Shortest route" for things. I had passengers hopping from station to station to get somewhere when there was a quicker and more direct route (I had a town wide bus route that had one stop used for a route to an Airport).

Apart from that, awesome. I don't know if it's for every one but a save from 0.7.0 worked quite well too, although my net profits did take quite a hit.

Again, magnificent work.

(Tested with r16520)

EDIT: Save included as you asked.
Attachments
Skeed Corp, 11-11-2154-CARGODIST.sav
(306.44 KiB) Downloaded 70 times
Last edited by SkeedR on 08 Jun 2009 09:06, edited 1 time in total.
Last known as: Weirdy
jmurrayufo
Engineer
Engineer
Posts: 22
Joined: 24 May 2008 23:06

Re: Cargo Distribution

Post by jmurrayufo »

I think i am a bit confused about some of the set-up for this. When I try to have a large line serviced by a number of feeder lines (for passengers in this case) the feeder lines will load up with passengers, go to the transfer station, unload all of them and them promptly pick them back up. I can force them to unload and leave empty, but that means i'll need a second line to get cargo back to the branch station.

Anyone care to point out my mistake here? Is there an option that I have somehow selected that will cause this or is this a bug?
jungle
Engineer
Engineer
Posts: 76
Joined: 17 Dec 2004 23:40
Location: UK

Re: Cargo Distribution

Post by jungle »

jmurrayufo wrote:I think i am a bit confused about some of the set-up for this. When I try to have a large line serviced by a number of feeder lines (for passengers in this case) the feeder lines will load up with passengers, go to the transfer station, unload all of them and them promptly pick them back up.
This is what happened in my game until I realised that all vehicles need to have every order as "non-stop" for the routing to work - even if there is no possibility of other stops.

Works fine then - although I have spotted one slightly odd problem where you switch the direction of trains on an already existing circular route. Will post a savegame in the next few days (want to test with a newer binary to see if it's been fixed already first).
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

You notice something? Those are 3 posts with questions but without savegames. :roll: I refuse to answer them until I get savegames.
The guy on the picture is not me, it's Alonso.
Aqua77
Engineer
Engineer
Posts: 27
Joined: 26 May 2009 09:31

Re: Cargo Distribution

Post by Aqua77 »

Havent had any problems while playing multiplayer in a LAN.
Thanks to fonso for doing a great job here, and i am really impressed about the speed u offer new improved versions.
jungle
Engineer
Engineer
Posts: 76
Joined: 17 Dec 2004 23:40
Location: UK

Re: Cargo Distribution

Post by jungle »

fonso wrote:You notice something? Those are 3 posts with questions but without savegames. :roll: I refuse to answer them until I get savegames.
I was not expecting an answer - as I said in the post I will attempt to produce a useful savegame as soon as I have time (no extra GRFs, using the most recent binary).
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

SkeedR wrote:Having done some basic testing i can say that it works brilliantly. Well, sort of. I can for see problems when there are large numbers involved, as such i was finding it very difficult to make arrangements for the numbers of passengers i was getting. I'm wondering if you have anything along the lines of "Shortest route" for things. I had passengers hopping from station to station to get somewhere when there was a quicker and more direct route (I had a town wide bus route that had one stop used for a route to an Airport).
Edit: Most of your orders aren't "non-stop". This causes orders to be interpreted as nondeterministic. When the next order is nondeterministic a vehicle can load any cargo waiting at a station, even if it's not destined for the station of the next order. I implemented it this way because I can't know in advance where the vehicle will stop the next time and thus I can't know which cargo to load onto it. This is why the passengers are hopping back and forth.

General explanation of the MCF algorithm, 743rd time:
Looking at the link stats in the smallmap it's easy to see that almost all of your links are massively overloaded. Compare the red boxes (planned flows) with the white ones (capacity) and you'll see. The MCF solver tries to equally overload all routes if there is more demand than capacity. This means very long routes that have been selected towards the end of the first pass receive roughly the same flow in the second pass as short routes. This is intended as otherwise you might get artificial bottlenecks at the shortest routes with other routes not being overloaded. In order to improve the general quality of routes you can raise the mcf accuracy. In order to have more flow assigned in the first pass and less in the second one you can increase the short path saturation.
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 »

This time I've got a real problem :P

I'm used to frequent crashes, but it's going a bit far now. Pretty much whenever I click, there's a crash. Every few seconds, it crashes. It started just after I finished upgrading to maglev.

Too big to upload to site.

http://www.2shared.com/file/6188540/140 ... sport.html
jungle
Engineer
Engineer
Posts: 76
Joined: 17 Dec 2004 23:40
Location: UK

Re: Cargo Distribution

Post by jungle »

OK, now I have a useful savegame.

This bug occurs when building a single track one-way circular route around a city.

First, you start building your circular track - but the town won't let you finish the route. So while you wait for the town to calm down, you start with a shuttle service in both directions along the track with just the one train (as in the first savegame).

Later on, with the town council calmed down, you can complete your circular route. You then change the orders of the train to run in a circle, which enables two or three trains to run.

But... cargodist does not recognise that the old route has stopped, and passengers pile up trying to go around the circular route in the other direction (second savegame). This seems to continue for at least 5 years - I haven't checked any further.

I used the latest (3 June) build downloaded from the openttdcoop ftp.

Thanks very much for all your work on this, by the way - it adds a whole new dimension to the game.
Attachments
Rarningstone-on-sea Transport, 1950-03-06.sav
First savegame - two way shuttle
(408.2 KiB) Downloaded 74 times
Rarningstone-on-sea Transport, 1950-12-30.sav
Second savegame - one way circular route... seems to work at first, but fast forward and watch the passenger totals on the two stations on the left hand side.
(419.46 KiB) Downloaded 78 times
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

jungle wrote:OK, now I have a useful savegame...
Your moving average is much too high. Reduce it to the current default (1 and 128) and the dead links will time out faster. See discussion in previous pages for explanation.
Wasila wrote:I'm used to frequent crashes, but it's going a bit far now.
Every time you don't report a bug god kills a kitten. Please do tell me when the game crashes!
Wasila wrote:Pretty much whenever I click, there's a crash. Every few seconds, it crashes. It started just after I finished upgrading to maglev.
I need to know the version you are playing in order to be able to load the game. What does the title bar in the menu window say for you? It should be something like "OpenTTD g80b8ebbb-cd-gui".
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 »

It's:

OpenTTD g0ddaddf5-(no branch)
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Wasila wrote:It's:

OpenTTD g0ddaddf5-(no branch)
Nice, thanks. Your savegame highlights yet another way to create flow circles. Perhaps I should read some more on this problem before I come up with another algorithm ...
The guy on the picture is not me, it's Alonso.
User avatar
Zhall
Tycoon
Tycoon
Posts: 1237
Joined: 17 Jul 2007 01:36
Skype: moonray_zdo
Location: Teh matrix, duh.
Contact:

Re: Cargo Distribution

Post by Zhall »

TO HELL WITH..

Hmm, well maybe it would be a nice change of pace.. usually i hate cargo destinations, because most of the time they want you to connect close industries like how the subsidaries operate.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Cargo Distribution

Post by Eddi »

cargo destinations do not force you to do anything. destinations are only chosen for connections that you already built.
User avatar
Zhall
Tycoon
Tycoon
Posts: 1237
Joined: 17 Jul 2007 01:36
Skype: moonray_zdo
Location: Teh matrix, duh.
Contact:

Re: Cargo Distribution

Post by Zhall »

Unlike simutrans? hmm interesting.
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Cargo Distribution

Post by 2007Alain2007 »

Hi

The road map for openttd 8 dose not say its gonig to have this patch but dose say it have cargodest

just liked to know what ther going to have in it
For Community Integrated Version http://code.google.com/p/civopenttd/
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 17 guests