Page 1 of 3

how to get the number ob max trains (and others) higer??

Posted: 12 Jan 2008 15:53
by dante
with the patch settings i can't get the maximum higher than 5000. can somone tell me how i can make this higher? is there a file i should edit?

Re: how to get the number ob max trains (and others) higer??

Posted: 12 Jan 2008 18:52
by Draakon
Are you crazy? no computer can run 5000 trains.

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 11:10
by dante
but if i want to try it anyway :P how could i make it higher? :roll:

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 11:18
by Bilbo
Open src\settings.cpp
Find lines with:

Code: Select all

	 SDT_VAR(Patches, max_trains,        SLE_UINT16, 0, 0,   500,     0,    5000, 0, STR_CONFIG_PATCHES_MAX_TRAINS,           RedrawScreen),
	 SDT_VAR(Patches, max_roadveh,       SLE_UINT16, 0, 0,   500,     0,    5000, 0, STR_CONFIG_PATCHES_MAX_ROADVEH,          RedrawScreen),
	 SDT_VAR(Patches, max_aircraft,      SLE_UINT16, 0, 0,   200,     0,    5000, 0, STR_CONFIG_PATCHES_MAX_AIRCRAFT,         RedrawScreen),
	 SDT_VAR(Patches, max_ships,         SLE_UINT16, 0, 0,   300,     0,    5000, 0, STR_CONFIG_PATCHES_MAX_SHIPS,            RedrawScreen),
Change 5000 to anything higher (max is 65535 as it is 16bit number).
Recompile

That should do the trick. Note that some problems may arise with so many vehicles and things may break. You have been warned.

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 11:23
by dante
tnx :)

it will take some while before i get to 5000 anyway, but i play a huge map so i think i will need more later.

worst thing that could happen is the game crases i think. maybe savegame unuseble, but i make backupsaves :)

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 11:35
by Rubidium
There can be a maximum of 65535 vehicle in game. A vehicle means *any* wagon, articulated part, engine smoke, sparks, aircrafts + shadows, rotors, road vehicles, ships, etc. With 5000 trains, and nothing else (except smoke and sparks), that would mean trains with an average length of about 10.

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 11:58
by Bilbo
Rubidium wrote:There can be a maximum of 65535 vehicle in game. A vehicle means *any* wagon, articulated part,...
So .. if the server raises limits on trains to 700 and you build 655 trains, 100 wagons(parts) each (plus one with 35 parts), nobody in game can build any vehicle anymore?

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 12:15
by Rubidium
Exactly.

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 14:11
by Draakon
Rubidium wrote:There can be a maximum of 65535 vehicle in game. A vehicle means *any* wagon, articulated part, engine smoke, sparks, aircrafts + shadows, rotors, road vehicles, ships, etc. With 5000 trains, and nothing else (except smoke and sparks), that would mean trains with an average length of about 10.
well then if this is true, how can i build 9 train engines and 1 one train with 12 wagons on it if train limit is 10?

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 14:31
by Rubidium
Draakon wrote:well then if this is true, how can i build 9 train engines and 1 one train with 12 wagons on it if train limit is 10?
Because a wagon is not a train.

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 15:36
by Bilbo
These are separate limits. The 500/5000/10 train limits that can be set in settings is for entire trains. That 65535 limit Rubidium mentioned is total number of objects in game. Engine is an object. Wagon is an object. Spark, plane, shadow, ship or road vehicle is an object. Articulated part is also object.

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 22:35
by CMircea
Bilbo wrote:These are separate limits. The 500/5000/10 train limits that can be set in settings is for entire trains. That 65535 limit Rubidium mentioned is total number of objects in game. Engine is an object. Wagon is an object. Spark, plane, shadow, ship or road vehicle is an object. Articulated part is also object.
65535 means an `unsigned int'. I don't know the OTTD internals, but I think changing it to a `long int' would make the limit impossible to reach, but it may not be that simple at all and I don't want to say anything about resource usage.

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 22:52
by Yexo
Desolator wrote:
Bilbo wrote:These are separate limits. The 500/5000/10 train limits that can be set in settings is for entire trains. That 65535 limit Rubidium mentioned is total number of objects in game. Engine is an object. Wagon is an object. Spark, plane, shadow, ship or road vehicle is an object. Articulated part is also object.
65535 means an `unsigned int'. I don't know the OTTD internals, but I think changing it to a `long int' would make the limit impossible to reach, but it may not be that simple at all and I don't want to say anything about resource usage.
Nope, that's an uint16 in openttd code. On most modern compilers for x86, that would be an unsigned short int. But it's not quite as simple as changing that to uint32, and the limit is pretty unreachable anyway.

Re: how to get the number ob max trains (and others) higer??

Posted: 13 Jan 2008 23:17
by Bilbo
Yexo wrote:...pretty unreachable anyway.
Well, I don't think it is unreachable but it is large enough to be very little issue for most people

One openttdcoop map (1024x1024) came to 1000 trains with 6 wagons each (approx 10% of the limit while CPU usage got to about 40%), so with 2048x2048 and more industries you may actually hit the limit, although the game would become quite slow then.

Re: how to get the number ob max trains (and others) higer??

Posted: 14 Jan 2008 06:59
by CMircea
Yexo wrote:
Desolator wrote:Nope, that's an uint16 in openttd code.
Ooops, yeah, I forgot, it was very late when I posted :)

Re: how to get the number ob max trains (and others) higer??

Posted: 14 Jan 2008 17:59
by CARST
Hi...

Can that hard-limit be raised? Why a limit that low?


Some weeks ago i started a game on a 2048x2048-map in year 1950, after about 10 years everyone of us had around 1000 airplanes. I imagine we will reach the 5000 airplane limit around year 2000 to 2010. Then everyone will start building trains as it is the 2nd best income market. I think you get what i mean... seems to be a low set limit and we are only 3 players in that specific game...


rmk:
3x 5000 planes = 15000 objects, add some trains ... okay it could be enough till 2051, but i'm not sure about that.

Re: how to get the number ob max trains (and others) higer??

Posted: 14 Jan 2008 18:36
by Maedhros
CARST wrote:3x 5000 planes = 15000 objects
Actually, 3 x 5000 planes = 30,000 objects, since the shadow is a separate vehicle.

Re: how to get the number ob max trains (and others) higer??

Posted: 14 Jan 2008 19:53
by CMircea
Maedhros wrote:
CARST wrote:3x 5000 planes = 15000 objects
Actually, 3 x 5000 planes = 30,000 objects, since the shadow is a separate vehicle.
Well then could we have it an uint32, please?

Re: how to get the number ob max trains (and others) higer??

Posted: 14 Jan 2008 20:03
by Maedhros
Desolator wrote:Well then could we have it an uint32, please?
Not easily, no. VehicleIDs are used frequently in Commands, and I suspect that many of them don't have 16 more bits in p1 and p2 spare in order to increase the size of a VehicleID.

Re: how to get the number ob max trains (and others) higer??

Posted: 14 Jan 2008 20:31
by Bilbo
Maedhros wrote:
Desolator wrote:Well then could we have it an uint32, please?
Not easily, no. VehicleIDs are used frequently in Commands, and I suspect that many of them don't have 16 more bits in p1 and p2 spare in order to increase the size of a VehicleID.
Well, it is possible for these commands to have some p3 or p4 if needed or is the size of the command fixed?