News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[Bug] Convoy replacing doesn't respect convoy constraints

Started by HeinBloed, April 14, 2012, 12:22:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

HeinBloed

I'm sure I've seen a config setting for the maximum length of road and train convoys, but I can't find it again. :-[ Anyway, when buying a new Heavy Traction Engine in a road depot, 3 trailers can be appended at most, totalling 4 vehicles. Using the replace dialog, one can append a seemingly infinite number of trailers and that will be applied too. Haven't tested with other constellations/trains yet, but I guess if the check is missing in the code, they should be equally affected.

As usual, playing the latest Windows Complete Package. ;)
(previously known as "tttron")

Isaac Eiland-Hall

Hmm, having >3 truck trailers for a convoi would be a reason for me to install Experimental again. XD

jamespetts

#2
Hmm - that's odd. I thought that this should be the same in the convoy and the depot window. I shall have to look into this...

Edit: This is not the normal sort of constraint - are road vehicles intended to be limited by design to only three trailers?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

HeinBloed

James, thanks to your reply I realized that I must have seen that setting somewhere else than in the config files (which I had all searched again in vain), and then quickly found this in simconvoi.h:

    /* Konstanten
    * @author prissi
    */
    enum { max_vehicle=4, max_rail_vehicle = 64 };


I guess that could explain it. That enumeration is used in the code too.
(previously known as "tttron")

jamespetts

Hmm, that's odd - I can't see anywhere in the code where max_vehicle is used as a limit.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

greenling

Jamespetts
It´s Possible to Set the Limit for Road vehicles on 8 Vehicles per convoy?
I will devlop A Bus with 8 Modules.
And By the the Tram it a Limit for 16 vehicles in a convoy good.
There will i Devlop a Tram with 16 modules.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

HeinBloed

@James
I guess you're right, what I did was just a quick search for the string "max_vehicle" and I found some hits in simconvoi.cc, but I don't have the insight yet to tell the consequences of its usage in those places.

However, the fact remains one can't seem to make longer road convoys than 4 vehicles, unless going through the replacing dialog.
(previously known as "tttron")

jamespetts

Greenling, I don't think that the limit applies to trams. As to the limits for road vehicles, I'm not entirely sure whether the limit is intentional or not.

HeinBloed,

hmm - that is odd.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

kierongreen

From standard it is intended to have a 4 long limit for road vehicles. The reason being that longer is not generally found in real life.

jamespetts

Kieron,

thank you - that is useful information. Do you happen to know where in the code that this is enforced?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

kierongreen

I've not worked with that piece of code sorry, you will be just as quick (or not!) finding it as I would be.

greenling

Sorry.
In Germany by The Hamburger Hochbahn gives Bues They Have Three Modules.
http://de.wikipedia.org/w/index.php?title=Datei:Doppelgelenkbus_P7161210.JPG&filetimestamp=20080717130027
And i plans a Bus With More as four modules.
A bus how carry Disables and  Mother with Childern.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

jamespetts

That rather beats the London bendy 'bus! But that's still within the constraint limit of Simutrans.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Isaac Eiland-Hall

I've long wanted longer convois in Simutrans, using Autralia's road trains as the example that they most certainly *do* exist in real life.

I cannot complain that it is not allowed, since it's hardly a game I've paid for -- but it's one thing I wish was a preference somewhere, even obscurely set, instead of a permanent disallowance. :)

(One thing that used to be on that list - elevated ways are now allowed on shallow water, which I've wished for since elevated ways were first added hehe)

In most situations, the limit of three trailers should be enough; but for Australian road trains, it is not enough. I want to set up an Arctic map where road trains are used, but right now, only three trailers, which is illegal in the US anyway. hehe

jamespetts

Hmm - Isaac raises an interesting point: might it be desirable in Experimental to disable this limit (and perhaps leave it to pakset designers if they want to enforce this limit in a similar way to that currently used for railways if a limit is necessary, by defining coach 1, coach 2, coach 3, etc.)?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

isidoro

The convoi_t obect has an array of vehicle pointers to store the references to the actual vehicles that conform the convoy.  It's called fahr.  The method bool convoi_t::add_vehikel(vehikel_t *v, bool infront)
checks the length of that array and returns false if the limit is reached.

But the easiest thing is to modify that max value to something high enough for you.  But beware that it seems (I have not checked) that if the number is too high, memory may be wasted.

I remember a test patch developed by vilvoh and Google has come to help me locate it, so if some of you is interested in overcoming that limit, it is quite easy...

http://forum.simutrans.com/index.php?topic=681.msg5466#msg5466



kierongreen

With regards to memory there is a standard vehicle limit with is automatically allocated, and a rail limit which is allocated for trains that exceed this I think.