The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: inkelyad on November 21, 2010, 06:47:34 AM

Title: Loading queue in [3966]
Post by: inkelyad on November 21, 2010, 06:47:34 AM
I can see there was loading queue implemented in Standard. (haltestelle_t::loading_here and haltestelle_t::request_loading()).

But current implementation (one queue per stop) will work bad with multiple players on one public stop. One big convoy in queue head will get all goods. It is better to make queue per player and rotate between them.
Title: Re: Loading queue in [3966]
Post by: prissi on November 21, 2010, 07:09:40 PM
This was actually intended, as the longest waiting convoi was the first (first come first serve). Otherwise the convoi started earlier (lower convoi ID) will get all of them.

With the current implementation, a railway with wait for loading could win over a busline or an airline.

However, routing but taking the static (theoretical) traveling time into account is still superiour and might come after the next stable.

But I am open to discussion on this topic.
Title: Re: Loading queue in [3966]
Post by: inkelyad on November 21, 2010, 07:36:15 PM
I think each player should have equal chance in loading.

Else it will be great way to sabotage of public stations.
Put one big convoy in waiting mode. All others players will load nothing. Is especially bad for public water stops. Ships have big capacity.

As for implementing it:
1) use 'haltestelle_t::loading_here[MAX_PLAYER_COUNT]'. one queue per player.
2) In 'haltestelle_t::request_loading()' cycle over all 'loading_here', but use random offset, like haltestelle_t::hole_ab do. ( search '// The random offset will ensure that all goods have an equal chance to be loaded.')
Title: Re: Loading queue in [3966]
Post by: prissi on November 21, 2010, 08:39:33 PM
The simutrans should allow competitive as well as a cooperative gaming. Thus the big ship takes them first.

But Experimetnal is even much more agressive in this regard. Here the better connection will take them all, and no sharing at all, if I am not wrong.
Title: Re: Loading queue in [3966]
Post by: inkelyad on November 21, 2010, 09:09:28 PM
Well, i it will be tested in network games.

Experimental should do sharing when players share connections. But i nobody tested it.
It does not matter now. Your implementation should replace mine.
Title: Re: Loading queue in [3966]
Post by: prissi on November 21, 2010, 09:20:23 PM
Before all convois were loaded equally. This lead to a bunch of ships departing form a oil rigg, and overflowing supplier instead of a steady stream and the waiting for free halt was not working very good with busses.
Title: Re: Loading queue in [3966]
Post by: inkelyad on November 21, 2010, 09:52:43 PM
I know. Loading queue is good thing. Even better will be automatic spacing between convoys. I am working on it for next (10.0) version of Experimental, but it hard to do right. There is  pathological  cases with self-crossing lines etc.