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

iranair777
Traffic Manager
Traffic Manager
Posts: 163
Joined: 13 Apr 2007 21:18

Re: Cargo Distribution

Post by iranair777 »

petert wrote:
iranair777 wrote: I installed the latest cargodest
Did you install CargoDEst or CargoDIst? They are not the same thing.
sorry for not mentioning it, it was your file above, cargodist_r18286_win32.rar
User avatar
tsjook
Traffic Manager
Traffic Manager
Posts: 197
Joined: 22 Apr 2009 18:33

Re: Cargo Distribution

Post by tsjook »

fonso wrote:tsjook, I'd really like to know how you got that crash.sav . Obviously it's the title game. However, it's loaded with about 20 grfs, among which are 2 train grfs. At the same time the "multiple engine sets" option is off. Furthermore one of the trains is also listed as a tram in the savegame and as a truck in the vehicle list (train 9/ rv 20).
As you see, I was not actually playing the title game (sorry if I was unclear before) but I was not in a game at all, when I clicked economy in advanced settings (from the main menu) the game crashed.

The 'flow' was as such.
-> Started OpenTTD (mentioned version with cargodist) -> Started/opened game in temperate -> Played for a short while -> Left for main menu (it's called 'Abort game' or something) -> Clicked Advanced Settings -> Clicked 'Economy' category -> Crash

It's quite probable that it has absolutely nothing to do with cargodist. Sorry if I wasted your time. :oops:

After this crash I restarted the same version of OpenTTD and started a game which is still running smoothly after 20+ game years and multiple times saving and loading. :)
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

iranair777 wrote:
petert wrote:
iranair777 wrote: I installed the latest cargodest
Did you install CargoDEst or CargoDIst? They are not the same thing.
sorry for not mentioning it, it was your file above, cargodist_r18286_win32.rar
Ok, can you also provide a save of this incident?
Auge
Chief Executive
Chief Executive
Posts: 661
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Cargo Distribution

Post by Auge »

Hello
iranair777 wrote:Hiya all,
I installed the latest cargodest and set up a simple test run in the west of england and am wondering why is it when I transport passengers from a station, that stations passenger numbers doesn't decrease? I have about 7 buses on a route and none of the two stations pax decrease Image
Did you set the orders for the vehicle with "non stop"? Without non-stop-orders the passengers will be unloaded and loaded again to the vehicle. This is mentioned some times in this thread and (in ugly (and in basic forum style) unreadable red colour) in the opening posting too.

Tschö, Auge
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Auge wrote:...
... Also you get a warning if you start a game with "orders are non-stop by default" off and cargodist on.
The guy on the picture is not me, it's Alonso.
Coco-Banana-Man
Engineer
Engineer
Posts: 4
Joined: 14 Mar 2009 14:12
Location: Oberderdingen-Flehingen (Germany)
Contact:

Re: Cargo Distribution

Post by Coco-Banana-Man »

I seem to have a problem with the lastest version of CargoDist (r12186-win32-binary by petert).
I'm trying to start a game with much bigger cities (5x), but the generated towns only have up to 2000 inhabitants instead of 8000-10000.
Attachments
The initial city size multiplier is set at 5, but towns only have normal (1x) size
The initial city size multiplier is set at 5, but towns only have normal (1x) size
CargoDist_bug.png (44.88 KiB) Viewed 3238 times
openttd_20091126.cfg
My openttd.cfg
(23.59 KiB) Downloaded 145 times
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

Ok, a couple of things:
Coco-Banana-Man wrote:(r12186-win32-binary by petert).
The binary was r18186, right? ;)
Coco-Banana-Man wrote:I'm trying to start a game with much bigger cities (5x), but the generated towns only have up to 2000 inhabitants instead of 8000-10000.
Looking at your picture, I see that you have some town GRFs, could you take a screenshot of your GRFs and post them here?
Coco-Banana-Man
Engineer
Engineer
Posts: 4
Joined: 14 Mar 2009 14:12
Location: Oberderdingen-Flehingen (Germany)
Contact:

Re: Cargo Distribution

Post by Coco-Banana-Man »

petert wrote:Ok, a couple of things:
The binary was r18186, right? ;)
Err... it says 18286... so we both were wrong :D
petert wrote: Looking at your picture, I see that you have some town GRFs, could you take a screenshot of your GRFs and post them here?
sure.. here it is.

By the way.. I've tried to start a game without NewGRFs... the town were with highest multiplier setting (10x) even smaller: the biggest was 942.

EDIT: I've just noticed that the nightly has the same problem.. so it doesn't seem to be CargoDist's fault.

Thanks for helping, petert :)
Attachments
GRF list
GRF list
CargoDist_bug_GRFs.png (18.77 KiB) Viewed 1170 times
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

Whew! Quite a bit of work I've done. Here is the flyspray:
FS#3328
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

SmatZ has fixed the bug in r18302, so here are some files:
Attachments
fs3328.diff
The hotfix itself, by SmatZ
(1.57 KiB) Downloaded 156 times
cargodist+fs3228fix.diff
CargoDist patch along with the fix.
(230.49 KiB) Downloaded 153 times
cargodist_fs3328_fixed.rar
Bug fixed binary.
(3.62 MiB) Downloaded 193 times
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: Cargo Distribution

Post by Expresso »

I might have a solution for the problem of pax/cargo not picking a destination where no train has orders for.

Why not simply insert those orders when a station is encountered which is not in the order list, along with a count of how many tiles it took to arrive there from the previous station where the train stopped?

This behavior could simply be ignored if the next order is a non-stop order.

If the train takes x (percent) more tiles to reach the next station, the order could automatically be dropped if it was automatically inserted.

Now, this could be a simple switch which can be turned on and of for each train - this might help with trains which lost these automatically inserted orders for whatever reason.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Expresso wrote:I might have a solution for the problem of pax/cargo not picking a destination where no train has orders for.

Why not simply insert those orders when a station is encountered which is not in the order list, along with a count of how many tiles it took to arrive there from the previous station where the train stopped?
...
"Shadow orders" ... That's indeed the only sensible solution for the nondeterminism problem. However they are very prone to failure as you can easily construct a line where the vehicle alternates between two stations on each run and there's no way (short of simulating the whole game up to the point of decision) to know what way it'll take in advance.

Also if you have a look at the order code you'll see that it'll be a lot of work to implement them. They need reasonable timeouts, they have to be saved and loaded, they shouldn't interfer with the normal order system. Du to above mentioned problem you either need several parallel shadow orders and some heuristics on their probability or you need a heuristic to decide between "real" and "fake" nondeterminism where fake nondeterminism can be handled by shadow orders while the real one cannot. That's not as easy as it sounds. If some vehicle goes a different route only rarely it might be due to user intervention and not due to inherent nondeterminism. A lot of vehicles will visit some other stations right after their purchase or during construction work. You need some threshold there.

And finally I believe there are few people who consciously use orders without non-stop. For me it's not worth the hassle to implement a special workaround for those. I'm trying to get everyone who doesn't know the difference anyway to use "non-stop". That's far less work for greater benefit. But if someone steps up and gives me a working implementation of shadow orders I'll at least have a look at it.

I got a spontaneous idea there: In cargodist terms there is another trick you can do: You can record for each vehicle the links it has visited and how often (or for each link the vehicles). Then you can apply the moving average to the "how often" part in order to time out the information in a sensible way. If you encounter a nondeterministic order you can check how many outgoing links of that station the vehicle has been visiting. If it's only one you have fake nondeterminism and can load cargo for that link. That's much easier than real shadow orders, but it has a drawback: A vehicle might go some sort of "8" pattern where it visits several outgoing links of the central station, but the next hop is still deterministic each time. Or you can do the same thing with orders instead of vehicles, which might remedy this, but it needs some more thought ...
The guy on the picture is not me, it's Alonso.
User avatar
Hamilton2007
Transport Coordinator
Transport Coordinator
Posts: 289
Joined: 16 Nov 2008 10:57
Location: Belgium

Re: Cargo Distribution

Post by Hamilton2007 »

Getting a crash with build r18209-Win32, i used al lot less trainsetgrf's then my previous games that kept crashing with the other builds, but have no idea why this one keeps crashing. Altough i played a lot longer on the game then the previous builds, started 1920, crash 1936 or so...
Attachments
crash.txt
(16.18 KiB) Downloaded 163 times
crash.sav
(3.1 MiB) Downloaded 174 times
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Hamilton2007 wrote:...
You have a train with invalid length again. I guess it's the same problem as before. Could you provide an earlier save? At the time of the crash.sav the problematic event is already over and I can't easily find its cause as the crash log is meaningless due to missing debug symbols. And what is "proj1000.grf"? I can't find it.

Once again: as long as this thread is full of crash reports, please do build with debug symbols:

Code: Select all

./configure --enable-debug=3
The guy on the picture is not me, it's Alonso.
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

fonso wrote:And what is "proj1000.grf"? I can't find it.
It's PikkaBird's recently done GRF. Project 1000: http://www.tt-forums.net/viewtopic.php?f=26&t=45637
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Ah, thanks. With all the grfs present, the train looks normal again and the crash save doesn't crash ... This isn't much better, though. I need an earlier save and a more detailed description of what happened or a meaningful crash log.
The guy on the picture is not me, it's Alonso.
User avatar
Hamilton2007
Transport Coordinator
Transport Coordinator
Posts: 289
Joined: 16 Nov 2008 10:57
Location: Belgium

Re: Cargo Distribution

Post by Hamilton2007 »

So you think that it's two conflicting trainset GRF's that are causing the crashes?

I don't understand what you are meaning with this: :?

"Once again: as long as this thread is full of crash reports, please do build with debug symbols:
Code:

./configure --enable-debug=3"
Attachments
JUL Transport, 26 Nov 1936.sav
(3.11 MiB) Downloaded 159 times
JUL Transport, 5 Jan 1928.sav
(3.02 MiB) Downloaded 149 times
User avatar
John
Tycoon
Tycoon
Posts: 3402
Joined: 05 May 2003 18:44
Location: Cotswolds, UK
Contact:

Re: Cargo Distribution

Post by John »

Hamilton2007 wrote:So you think that it's two conflicting trainset GRF's that are causing the crashes?

I don't understand what you are meaning with this: :?

./configure --enable-debug=3"

It's an option you can set when you compile the game yourself.

If you use petert's builds however I suggest you ignore it.
Auge
Chief Executive
Chief Executive
Posts: 661
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Cargo Distribution

Post by Auge »

Hello

I play g40a1117b since a week without any trouble (crashwise). But, in difference to Hamilton2007, I use only one set for trains, airplanes and so on at a time.
Hamilton2007 wrote:I don't understand what you are meaning with this: :?

"Once again: as long as this thread is full of crash reports, please do build with debug symbols:
Code:

./configure --enable-debug=3"
If you compile the game yourself you should enable the debug mode. Otherwise (downloaded binary) the one who compiled it should use this mode.
John wrote:If you use petert's builds however I suggest you ignore it.
But, as many people use his builds, he shouldn't.

Tschö, Auge
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

I'm afraid I can't upload the enable debug build because the exe is 70 mb. You will either have to keep using my builds or build yourself.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 7 guests