The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: HeinBloed on April 14, 2012, 12:22:45 PM

Title: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: HeinBloed on April 14, 2012, 12:22:45 PM
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. ;)
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: Isaac Eiland-Hall on April 14, 2012, 01:56:13 PM
Hmm, having >3 truck trailers for a convoi would be a reason for me to install Experimental again. XD
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: jamespetts on April 14, 2012, 10:31:48 PM
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?
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: HeinBloed on April 15, 2012, 09:00:34 AM
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.
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: jamespetts on April 15, 2012, 11:13:06 AM
Hmm, that's odd - I can't see anywhere in the code where max_vehicle is used as a limit.
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: greenling on April 15, 2012, 11:30:39 AM
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.
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: HeinBloed on April 15, 2012, 11:32:37 AM
@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.
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: jamespetts on April 15, 2012, 11:39:05 AM
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.
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: kierongreen on April 15, 2012, 11:42:33 AM
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.
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: jamespetts on April 15, 2012, 11:45:53 AM
Kieron,

thank you - that is useful information. Do you happen to know where in the code that this is enforced?
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: kierongreen on April 15, 2012, 12:05:28 PM
I've not worked with that piece of code sorry, you will be just as quick (or not!) finding it as I would be.
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: greenling on April 15, 2012, 12:06:47 PM
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.
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: jamespetts on April 15, 2012, 12:31:01 PM
That rather beats the London bendy 'bus! But that's still within the constraint limit of Simutrans.
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: Isaac Eiland-Hall on April 15, 2012, 02:06:44 PM
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
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: jamespetts on April 15, 2012, 02:36:20 PM
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.)?
Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: isidoro on April 15, 2012, 07:52:04 PM
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 (http://forum.simutrans.com/index.php?topic=681.msg5466#msg5466)


Title: Re: [Bug] Convoy replacing doesn't respect convoy constraints
Post by: kierongreen on April 15, 2012, 09:07:30 PM
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.