Load vehicles gradually

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

User avatar
RiTi
Transport Coordinator
Transport Coordinator
Posts: 374
Joined: 23 Jun 2006 10:24

Load vehicles gradually

Post by RiTi »

In the latest Nightly r7326 I found a for me new option Load Vehicles Gradually (see screenshot). A simple question, what is it or what can it do?
Attachments
Transport, 10 Mei 1978.png
(90.04 KiB) Downloaded 448 times
Keep life simple...
User avatar
Ameecher
Tycoon
Tycoon
Posts: 11919
Joined: 12 Aug 2006 15:39
Contact:

Post by Ameecher »

I believe it to be like the TTPatch feature which means that the trains/planes/boats/lorries load gradually, usually 5 items at a time, it is not advantageous for the player but it does make it much more realistic because IRL 40 people can get off a train and another 40 cram on in the space of a second.
Image
User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Post by White Rabbit »

Actually, it IS advantageous for the player. Start a new game and make a train, the longer the better (needs to have at least 14 wagons). Then have that train fully unload. Just before it does, save the game. Load the game using the gradual loading patch on, and then off, and see whether the train unloads faster with the patch. You'll notice a big difference.

I'm not sure if this is OTTD's own gradual loading patch, or if it's a newgrf feature. Some vehicle sets feature wagons/vehicles that (un)load instantly, and others do it more slowly, which will make our games that much better. :)
Image
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Post by Maedhros »

White Rabbit wrote:I'm not sure if this is OTTD's own gradual loading patch, or if it's a newgrf feature. Some vehicle sets feature wagons/vehicles that (un)load instantly, and others do it more slowly, which will make our games that much better. :)
Newgrf sets can specify how much to load or unload in each time interval, but actually getting it to work means changing the OpenTTD's loading function. So it's both, really. :)
No-one's more important than the earthworm.
User avatar
RiTi
Transport Coordinator
Transport Coordinator
Posts: 374
Joined: 23 Jun 2006 10:24

Post by RiTi »

White Rabbit wrote:Actually, it IS advantageous for the player. Start a new game and make a train, the longer the better (needs to have at least 14 wagons). Then have that train fully unload. Just before it does, save the game. Load the game using the gradual loading patch on, and then off, and see whether the train unloads faster with the patch. You'll notice a big difference.

I'm not sure if this is OTTD's own gradual loading patch, or if it's a newgrf feature. Some vehicle sets feature wagons/vehicles that (un)load instantly, and others do it more slowly, which will make our games that much better. :)
Maedhros wrote:Newgrf sets can specify how much to load or unload in each time interval, but actually getting it to work means changing the OpenTTD's loading function. So it's both, really. :)
Thanks for the answer. I have still some questions:

It works only with new games and not old saved games?
It works only with the unload option and not with the (full) load option?
It looks like a lot of steps (patch on, save game, load game, patch off). Has this to be done with every train as a seperate action? What will happen with new bought trains after these steps (the patch is then off) are they also using this patch?
And is it already working (see answer of Maedhros)?
Keep life simple...
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Post by Maedhros »

It's in trunk, so it works now. It doesn't matter what happened when the vehicle was bought - it only affects what happens while the vehicle is at a station, and it works when loading and unloading, with and without Full Load or Unload in the orders. It works for older savegames too (it defaults to On, so it should just work, but check the patch option in the game).
No-one's more important than the earthworm.
User avatar
RiTi
Transport Coordinator
Transport Coordinator
Posts: 374
Joined: 23 Jun 2006 10:24

Post by RiTi »

It works and makes the game much more realistic. Great job. :P
Keep life simple...
User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Post by White Rabbit »

* Unloading to a station that didn't accept the cargo didn't work past the first $load_amount, and then it added the wrong amount to the station anyway.
* If the "Improved loading algorithm" patch was enabled, vehicles wouldn't load while another train was in the station. It now checks to see if Full Load is in the orders so vehicles without it can load if another is in the station.
* If the "Leave station when any cargo is full" patch was enabled, vehicles would leave the station when one cargo type was full. It now checks if Full Load is in the orders so they carry on loading the other cargo if it's available and they're not set to Full Load.
I think your fixes are insufficient. I think those two behaviours should be used for all trains, regardless of whether they have full load or not. I have a 6-platform passenger stations filled with thousands of waiting people, enough to fill 10 trains, yet only one train can load at a time because they're all set to full load? While trains may load/unload faster with the patch, the total time wasted because only one can load at a time will result in a reduction of profits (may I mention that trains can unload simultaneously?).

It gets even worse if you mix in road vehicles and planes. While one 30 passenger bus is loading, 4 trains can't load and must wait. It's ridiculous. :x
Image
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Post by peter1138 »

The whole point of the improved loading is that only one vehicle loads at a time...
He's like, some kind of OpenTTD developer.
User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Post by White Rabbit »

But the 'improved' loading algorithm doesn't even check how much cargo is waiting. I could understand if it was a well serviced coal mine, but you can see what it does to passenger stations, which are often connected to bus stations and airports...and docks.

EDIT: Well, I've thought some more about it. The old loading behaviour lead to vehicles appearing to load simultaneously because they did it instantly, but this is now gone with gradual loading. Since the improved loading is so inefficient when cargo is plentiful, it's the one that needs to be improved, and not actually the gradual loading patch. I think perhaps trains could 'reserve' cargo the moment they arrive at a station. That way, if there's enough cargo waiting, trains can load simultaneously.
Image
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

peter1138 wrote:The whole point of the improved loading is that only one vehicle loads at a time...
Which obviates the need for more than two platforms for loading any cargo. Trains can queue up outside the station with no loss of performance.

Personally, I dislike it.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Quark
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 20 Sep 2006 11:36
Location: Russia, Moscow

Post by Quark »

Brianetta wrote:
peter1138 wrote:The whole point of the improved loading is that only one vehicle loads at a time...
Which obviates the need for more than two platforms for loading any cargo. Trains can queue up outside the station with no loss of performance.

Personally, I dislike it.
There IS loss of perfomance — for example, imagine transfer station which produces more cargo that one train can load at time.
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

My solution was to maintain two sets of cargo amounts. The first is the amount displayed in the station window, and the second is the amount that will actually be available after all currently loading vehicles finish loading.

When a vehicle arrives, it checks the second amount, and if there is sufficient cargo, it immediately removes its (remaining) capacity from that, and starts loading. If there is not sufficient cargo, it waits until there is, and then behaves as above.

(Techical note: The second amount is maintained internally as "amount to subtract from the first amount", since that doesn't have to be updated when new cargo arrives at the station.)
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

Quark wrote:
Brianetta wrote:
peter1138 wrote:The whole point of the improved loading is that only one vehicle loads at a time...
Which obviates the need for more than two platforms for loading any cargo. Trains can queue up outside the station with no loss of performance.

Personally, I dislike it.
There IS loss of perfomance — for example, imagine transfer station which produces more cargo that one train can load at time.
I meant no loss of performance when compared to many trains loading, while this setting is on. Your hypothetical transfer station can only be loaded onto one train at a time unless "improved" loading is disabled.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Psistorm
Traffic Manager
Traffic Manager
Posts: 173
Joined: 05 Jun 2004 12:22

Post by Psistorm »

Ive noticed one problem with gradual loading regarding passenger trains:
my trains will head to a station with, say, 400 passengers. each carriage can hold like 30 passengers, but it will only load 5 in every waggon, then leave the station - is this intended?
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Post by Maedhros »

Err, no, not at all. Which version are you running?
No-one's more important than the earthworm.
Psistorm
Traffic Manager
Traffic Manager
Posts: 173
Joined: 05 Jun 2004 12:22

Post by Psistorm »

running miniIN r7344

edit: and since they are passenger trains, their default behaviour is set to not full load - but to simply go to the stations. - another odd thing I spotted:
my coal trains will only unload 5 units of coal from each wagon when arriving at the destination unless I set full unload in the orders
User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Post by White Rabbit »

That is a known MiniIN bug that apparently occurs when FIFO loading is on.
Image
Psistorm
Traffic Manager
Traffic Manager
Posts: 173
Joined: 05 Jun 2004 12:22

Post by Psistorm »

yup, turned FIFO loading off and it works as intended - thanks! :D

this patch really is cool, it should make some noteable gameplay difference for DBsetXL, where the wagons have different loading speeds :)
Quark
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 20 Sep 2006 11:36
Location: Russia, Moscow

Post by Quark »

Brianetta wrote:
Quark wrote:
Brianetta wrote: Which obviates the need for more than two platforms for loading any cargo. Trains can queue up outside the station with no loss of performance.

Personally, I dislike it.
There IS loss of perfomance — for example, imagine transfer station which produces more cargo that one train can load at time.
I meant no loss of performance when compared to many trains loading, while this setting is on. Your hypothetical transfer station can only be loaded onto one train at a time unless "improved" loading is disabled.
So in which case more cargo will be transfered if 4 trains unloading and 4 trains is loading that cargo back?
Image
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 28 guests