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
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

reylas wrote:First a problem, using the binary above of 16058, I cannot get links to die. It is this killing my network. I have several links now that show 0/0:0/0 in the map, but they stay there. Hence, none of the coal get delivered as I am trying to kill those routes. I want to drop coal off at a transfer station. Am I missing something on how they die?

Second, I currently have 390 tons of coal sitting at a station that has a destination that I do not want to deliver directly to. But there is currently one of those "hoping to die" links that keep other trains from picking it up. (ie station A has a link to station B and station C, I want the coal to go to station B then on to the power plant at C, but since it has a defunct link to C directly, it never gets picked up. I have no trains going from A to C directly, used to, but trying to get rid of that route). My question? Will those 390 tonnes ever get redirected to station B once that route dies? Or will it always sit there waiting for me to add a train that will keep that route from dieing
You have set the average unit to 10 and the average length to 512. This is very large. The larger you set the values the longer it takes for links to disappear. In the smallmap values are scaled down by unit*length/30 so that you get the numbers per month which are more meaningful than the raw numbers. If you set the unit and length to something lower you will see that there still is capacity left. It just is rounded to 0 when being divided by 170 (=512*10/30).
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 »

jungle wrote:OK, I have a crash - this is right on starting a game, build first route, set off the first two trains and... crash.

My guess is that it's because I hit start on the first two trains (built at opposite ends of the route) on pause mode, and then let them go - being in identical layouts they would have arrived at opposite ends of the new route absolutely at the exact same moment, causing some confusion...

Savegame etc attached...
That's the problem with vehicles that have no unloading orders, the same as zde-nek mentioned before. I have a fix for it.
The guy on the picture is not me, it's Alonso.
reylas
Engineer
Engineer
Posts: 52
Joined: 22 Dec 2007 01:04

Re: Cargo Distribution

Post by reylas »

fonso wrote:
reylas wrote:First a problem, using the binary above of 16058, I cannot get links to die. It is this killing my network. I have several links now that show 0/0:0/0 in the map, but they stay there. Hence, none of the coal get delivered as I am trying to kill those routes. I want to drop coal off at a transfer station. Am I missing something on how they die?

Second, I currently have 390 tons of coal sitting at a station that has a destination that I do not want to deliver directly to. But there is currently one of those "hoping to die" links that keep other trains from picking it up. (ie station A has a link to station B and station C, I want the coal to go to station B then on to the power plant at C, but since it has a defunct link to C directly, it never gets picked up. I have no trains going from A to C directly, used to, but trying to get rid of that route). My question? Will those 390 tonnes ever get redirected to station B once that route dies? Or will it always sit there waiting for me to add a train that will keep that route from dieing
You have set the average unit to 10 and the average length to 512. This is very large. The larger you set the values the longer it takes for links to disappear. In the smallmap values are scaled down by unit*length/30 so that you get the numbers per month which are more meaningful than the raw numbers. If you set the unit and length to something lower you will see that there still is capacity left. It just is rounded to 0 when being divided by 170 (=512*10/30).
Ok. I did set those high, but that was my attempt to get the links to 0. It took *years* of no cargo to get to that point.
stokey
Engineer
Engineer
Posts: 1
Joined: 22 Apr 2009 08:33

Re: Cargo Distribution

Post by stokey »

I just want to express my interest in this effort to develop sound Cargo Distribution in OpenTTD.

One question about its implementation: With this patch, is there now an incentive for players to connect multiple cities to each other, i.e. will there be more passengers when there 're more destinations to go to?
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: Cargo Distribution

Post by Expresso »

This patch is quite interesting, but when I went ahead and started using it in one of my running games the game was reduced to a crawl (about 750 vehicles) when I wanted to work on one of the busiest stations on the map.

Is there a way to improve performance? If not, can you please optimize the code a bit for performance?
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Expresso wrote:This patch is quite interesting, but when I went ahead and started using it in one of my running games the game was reduced to a crawl (about 750 vehicles) when I wanted to work on one of the busiest stations on the map.

Is there a way to improve performance? If not, can you please optimize the code a bit for performance?
Could you give me a savegame that shows the problem? Generally try increasing link graph recalculation interval to at least 32 if you get performance problems. If the link graph recalculation interval is lower than 32, two linkgraph components may be calculated at the same time. And decrease the MCF accuracy if that doesn't help.
The guy on the picture is not me, it's Alonso.
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Re: Cargo Distribution

Post by XeryusTC »

Is there anyone with a working win32 or win64 binary? I can't seem to compile this :s

@Fonso: it looks like I can't apply your patch when using TortoiseSVN as it doesn't even recognise the file as a patch file and shows me no changes in its window. When I use your git repository I get the same error that 'as' (get a proper nickname :P) also has. After I fix this error in an ugly way I get three unresolved symbol errors, are there any other library dependencies that this patch has?
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2858
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

Here is my bin.
Mind i applied 16096_v2 ... crashed it ...
When I was trying to reproduce what I did, before reporting the crash, I saw 16096_v3 and aplied the changes manually. I hope i have done nothing wrong there.
I have not crashed it since. (not really playtested neither...)
No diff for svn for the moment sorry.
Turtoise ...


[Edit]
waiting...
[/Edit]
Last edited by ChillCore on 22 Apr 2009 10:40, edited 2 times in total.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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 »

wait a minute ... I'm just preparing a release with the compiling bug and the no-orders-crash fixed.
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 »

So here it is. See first post.

New things:
  • problem with pointless const_iterator removed. Should compile on Windows like this. If not please tell me.
  • Capacity measurement is more intelligent now. It actually detects the last loading order of the vehicle now and assigns capacity accordingly. It doesn't assign capacity for waypoints, go via and the like. Of course, if you have one loading and a lot of no-loading orders in a row, the capacities will be wrong, as the overall capacity of the route is not the sum of the parts then. I'm still wondering how to get a more accurate measurement.
  • Crash with missing orders has been resolved.
  • Some improvements to the MCF algorithm.
The guy on the picture is not me, it's Alonso.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2858
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

Attached win32 binaries and the patch adapted to svn.

ps:
How to change the patch yourself for turtoise is explained on page 4.
How to use turtoise with new files is explained on page 5.
Attachments
cargodist_r16119_svn.patch
(158.36 KiB) Downloaded 168 times
cargodist_r16119_win32.7z
(2.89 MiB) Downloaded 257 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.
ftk
Engineer
Engineer
Posts: 9
Joined: 20 Mar 2009 16:07
Location: USA

Re: Cargo Distribution

Post by ftk »

All the versions compiled and ran fine on Linux...
:mrgreen:
el koeno
Route Supervisor
Route Supervisor
Posts: 454
Joined: 24 Sep 2004 15:47

Re: Cargo Distribution

Post by el koeno »

ChillCore wrote:Attached win32 binaries and the patch adapted to svn.

ps:
How to change the patch yourself for turtoise is explained on page 4.
How to use turtoise with new files is explained on page 5.
It seems to work, thanks! I'll be testing if I have some more time.
Tvel
Engineer
Engineer
Posts: 77
Joined: 29 Mar 2008 22:42
Skype: tvel___
Location: Bulgaria

Re: Cargo Distribution

Post by Tvel »

I had a crash with ChillCore's binary. Unfortunately i was afk and cannot give any usefull info.

I had a bus city network and linked to that a train between 2 towns. All was going ok. Then a "send/don't send" error with no useful info. :P
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Tvel wrote:I had a crash with ChillCore's binary. Unfortunately i was afk and cannot give any usefull info.

I had a bus city network and linked to that a train between 2 towns. All was going ok. Then a "send/don't send" error with no useful info. :P
What is a "send/don't send" error? Where does it appear and what text is contained in it? And you could post the last autosave before the crash so that I can try to reproduce it.
The guy on the picture is not me, it's Alonso.
Tvel
Engineer
Engineer
Posts: 77
Joined: 29 Mar 2008 22:42
Skype: tvel___
Location: Bulgaria

Re: Cargo Distribution

Post by Tvel »

Yes it was. No autosave and no useful text in the error(normal windows error).
Never happened before to have a "send/don't send" error for Ottd, so i guess it is the build.

I will try to reproduce, but i doubt it will happen again. It was a normal network with nothing special going on :P
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Tvel wrote:Yes it was. No autosave and no useful text in the error(normal windows error).
Never happened before to have a "send/don't send" error for Ottd, so i guess it is the build.

I will try to reproduce, but i doubt it will happen again. It was a normal network with nothing special going on :P
Please enable autosaves wherever possible. A savegame is much easier to debug with than a simple textual description. And don't underestimate things like that. It may well be that there is some crash bug left in my code. If we don't find it it will come back to you one day.
The guy on the picture is not me, it's Alonso.
Tvel
Engineer
Engineer
Posts: 77
Joined: 29 Mar 2008 22:42
Skype: tvel___
Location: Bulgaria

Re: Cargo Distribution

Post by Tvel »

ok it crashed one more time, and recreated the openttd.cfg file (which was from the 0.7.0) and it is ok now.
Now trying to see if it was because my configurations or something else.

autosave is always on with me usually, but not on my 0.7.0 and i missed to set it on. :rolleyes:
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2858
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

Hmm.
I have build it again and had a few warnings on compiling.
It compiled, and I had some visitors... I did not notice, sorry.

Here are the warnings.
Attachments
cargodist_r16119_compiler_warnings.txt
(3.06 KiB) Downloaded 133 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.
el koeno
Route Supervisor
Route Supervisor
Posts: 454
Joined: 24 Sep 2004 15:47

Re: Cargo Distribution

Post by el koeno »

Fonso,

With the build ChillCore posted I had three issues (the third is the most important):
Firstly I had a few crashes, that I've been unable to reproduce. It happend two times while clicking the + in the station GUI, right when a train was in there. But as said, I haven't reproduced it yet.
Secondly, the station GUI doesn't remember my choices: I'd like it to stay Via-Destination-Source. Is this possible?
Thirdly, I've got the same problem reylas reported; I've build a goods line from Bienne Factory to Friburg Sawmill (see save game). From the train stations, truck transport the goods into town. Then I decided to add Zug to the network, in march 1941. It's '43 now, and the goods still want to take the direct train between Bienne and Fribourg, which doesn't exist anymore. :( Meanwhile, my goods trains are running empty.

NewGRF-settings:
Prilly Transport, 22nd Mar 1943.png
Prilly Transport, 22nd Mar 1943.png (131.07 KiB) Viewed 3078 times
[OT](BTW, I was expecting snow from the Alpine climate, but there is none, anyone know why?)[/OT]

Savegame:
Prilly Transport, 9th Mar 1943.sav
(516.33 KiB) Downloaded 149 times
I was actaully testing to see if it would send enough goods on the longer route, which it did at first. So at least that aspect was working well! Also the passengers seem to be switching trains quite nicely. In fact I might have been the happiest OTTD-player on the planet, until my goods line stopped working. Mind you, I'm still happy with the work you seem to be putting in this patch, but there's goods trains that are making losses! ;)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: L3x4ur1n and 10 guests