News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Loading queue in [3966]

Started by inkelyad, November 21, 2010, 06:47:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

inkelyad

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.

prissi

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.

inkelyad

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.')

prissi

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.

inkelyad

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.

prissi

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.

inkelyad

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.