How to remove train size limit and station spread limits.

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

How to remove train size limit and station spread limits.

Post by BillSargent »

Hello,

I know a lot of developers and players will think I'm stupid for posting this, but each player plays the game his or her own way. I also understand that limitations are set in the game so that people don't do stupid things and then complain because the game is too slow. However... Since we all DO play the game differently, I imagine some people like myself want to play without some limitations just for fun.

Two annoying limitations I found for how I play are the limits on the length of train, and the spread limitation on stations (64 tiles max). So I dug out the code and just removed those. I won't supply a patch, but I will tell you how to do it which should work in all versions of the game thus far.

And for this, I am assuming you know how to compile the game. If you don't, well this isn't for you. I compile in Visual Studio 10 and I won't be providing anyone with tutorials on how to do that.

Open src/table/settings.h and look for a line like this

Code: Select all

SDT_VAR(GameSettings, station.station_spread,               SLE_UINT8,                     
0, 0,    12,     4,      64, 0, STR_CONFIG_SETTING_STATION_SPREAD, 
and change it to

Code: Select all

SDT_VAR(GameSettings, station.station_spread,               SLE_UINT8,                     
0, 0,    12,     4,      255, 0, STR_CONFIG_SETTING_STATION_SPREAD, 
This will remove the limit on the station spread allowing you to have airports, bus stations, and train stations all over the place within a 255 tile radius that all belong to the same station increasing your cargo.

Now while still in the same file look for the line that reads...

Code: Select all

SDT_CONDVAR(GameSettings, vehicle.max_train_length,             SLE_UINT8,159, SL_MAX_VERSION, 
0, 0,     7,     1,      7, 1, STR_CONFIG_SETTING_TRAIN_LENGTH,   
and change it to this...

Code: Select all

SDT_CONDVAR(GameSettings, vehicle.max_train_length,             SLE_UINT8,159, SL_MAX_VERSION, 
0, 0,     7,     1,      255, 1, STR_CONFIG_SETTING_TRAIN_LENGTH,   
That will allow you to build trains up to 255 tiles long.


These changes to the source come with some drawbacks so don't expect the game to run perfectly, or smoothly if you build very large maps and very large stations.

I hope the developers don't yell at me for this ;) And I look for any feedback from them on drawbacks and all of that. I just like to play the game at an extreme level. I assume others might be out there like me.

Enjoy,

Bill
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: How to remove train size limit and station spread limits

Post by planetmaker »

BillSargent wrote:And I look for any feedback from them on drawbacks and all of that. I just like to play the game at an extreme level. I assume others might be out there like me.
The drawbacks for the station size are the path finder speed.

And the biggest draw back in my eyes is that increasing these limits even further takes the game to the limit of becoming pointless: build two adjacent stations and let trains travel one tile from one to another and both serve each half the map. What would be the point of a _transport_ game when I can cover the whole map with a single station?

Money is in the current state of affairs no good goal no matter what train length you choose.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: How to remove train size limit and station spread limits

Post by BillSargent »

planetmaker wrote:
BillSargent wrote:And I look for any feedback from them on drawbacks and all of that. I just like to play the game at an extreme level. I assume others might be out there like me.
The drawbacks for the station size are the path finder speed.

And the biggest draw back in my eyes is that increasing these limits even further takes the game to the limit of becoming pointless: build two adjacent stations and let trains travel one tile from one to another and both serve each half the map. What would be the point of a _transport_ game when I can cover the whole map with a single station?

Money is in the current state of affairs no good goal no matter what train length you choose.

Well the subject of this thread states REMOVE limits but as you saw here, it only limits to 255. Maps i play are often very very large with cities growing in average of 2 million in population. To cover a city with complete coverage , you would need to build your train station right down the middle of the densely populated area. That was why I increased station spread (and not cactchment). That way I could build my rail station on the edge of a very large town and increase its spread to the middle of the town with bus stations etc...

As for the train length, I did that for fun. I wanted to test the benefits of longer trains. And having a HUGE map with a couple of trains that are 255 in length DOES earn you a TON of money per trip. I use the Logic train as well which allows you to set the speed of the engine with a grf parameter. It's HP is also 65535 so it pulls those cars across the map quickly. This part is just for fun. To see how much money I can earn.

One of my goals in the game is to create scenarios where there are so many passengers that it becomes the object of the game to design a system that can move the most passengers without jams and bottlenecks. So as I originally said, we all have our own way of playing. :)

I have a different way of looking at this game than I think you developers do. I for example would like multithreaded support, because I would like to be able to use my 4 cores to create a map large enough to divide in to countries and have it playable but several people. And I know its been discussed and dismissed as being not worthy of anyone's time... but thats just another way I'd like to play. I bring this up not to debate multithreaded support, but just to show that there are other uses and ideas for play :)

Thanks for the feedback!
Bill
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: How to remove train size limit and station spread limits

Post by Eddi »

I'm not an Expert(tm), but wouldn't it be easier to increase the catchment area instead of the station spread, if covering a huge town is your concern?
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Re: How to remove train size limit and station spread limits

Post by peter1138 »

BillSargent wrote:

Code: Select all

SDT_CONDVAR(GameSettings, vehicle.max_train_length,             SLE_UINT8,159, SL_MAX_VERSION, 
0, 0,     7,     1,      7, 1, STR_CONFIG_SETTING_TRAIN_LENGTH,   
I wonder how you managed to get that 7 there. The limit is a more reasonable 64...
He's like, some kind of OpenTTD developer.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: How to remove train size limit and station spread limits

Post by BillSargent »

petern wrote:
BillSargent wrote:

Code: Select all

SDT_CONDVAR(GameSettings, vehicle.max_train_length,             SLE_UINT8,159, SL_MAX_VERSION, 
0, 0,     7,     1,      7, 1, STR_CONFIG_SETTING_TRAIN_LENGTH,   
I wonder how you managed to get that 7 there. The limit is a more reasonable 64...
I pulled this source from trunk. It's the default these days to make trains a max of 7 tiles. In older versions of openttd, i could set a train to a certain number of cars...and it was 99.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: How to remove train size limit and station spread limits

Post by BillSargent »

Eddi wrote:I'm not an Expert(tm), but wouldn't it be easier to increase the catchment area instead of the station spread, if covering a huge town is your concern?
I couldn't figure out how to do that and my way allows shaping the catchment basically.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: How to remove train size limit and station spread limits

Post by Yexo »

BillSargent wrote:
petern wrote:
BillSargent wrote:

Code: Select all

SDT_CONDVAR(GameSettings, vehicle.max_train_length,             SLE_UINT8,159, SL_MAX_VERSION, 
0, 0,     7,     1,      7, 1, STR_CONFIG_SETTING_TRAIN_LENGTH,   
I wonder how you managed to get that 7 there. The limit is a more reasonable 64...
I pulled this source from trunk. It's the default these days to make trains a max of 7 tiles. In older versions of openttd, i could set a train to a certain number of cars...and it was 99.
The line you posted it not in trunk. The second 7 (the maximum of the setting) is 64, not 7. The default max train length is indeed 7, but it's in tiles, not number of cars. A train of 64 tiles long is longer than a train with 100 wagons, assuming default length of half-tile per wagon.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: How to remove train size limit and station spread limits

Post by BillSargent »

Yeah you're right. I think there was some confusion on my part as to whether we were talking default setting or max setting.
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: How to remove train size limit and station spread limits

Post by Wasila »


And the biggest draw back in my eyes is that increasing these limits even further takes the game to the limit of becoming pointless: build two adjacent stations and let trains travel one tile from one to another and both serve each half the map. What would be the point of a _transport_ game when I can cover the whole map with a single station?

Money is in the current state of affairs no good goal no matter what train length you choose.
I am thinking that, as attaining money is so easy to do anyway, this won't make a difference. OpenTTD is fundamentally a sandbox game which aims to let you play how you please, and if somebody wants to take this patch and abuse it then it's down to them. In the meantime other people can use it in more productive ways.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: How to remove train size limit and station spread limits

Post by BillSargent »

It's a game. There's nothing productive about it. And I believe I more than justified my reasons for altering the game the way I did. I also believe others might enjoy learning how to lift limits as well... Just for fun. Because, after all, it is just a game and games are created for the fun and enjoyment of those playing them.

I get my kicks out of doing simple things like this, and I thought others might as well. :)

Also, if people are upset because my alteration or ways of playing aren't realistic, lets all be reminded that this game in no way is realistic. In real life, it doesn't take a full day to load and unload a train of passengers (at any train length). Planes don't circle an airport for 3 days waiting for a free terminal. And passengers don't pile up by the thousands on one platform of a station.

As I said, I had fun increasing the limit just to see what I could do. :)
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: How to remove train size limit and station spread limits

Post by BillSargent »

get back to us when you do ;)
CSX _Fan
Engineer
Engineer
Posts: 6
Joined: 13 Mar 2024 00:06

Re: How to remove train size limit and station spread limits.

Post by CSX _Fan »

Can you please please email me a patch or something I need longer stations but I can not for the life of me figure out visual studio to do this myself, I have tried but I don't wanna mess anything up. I would really appreciate this!
Last edited by kamnet on 13 Mar 2024 06:01, edited 1 time in total.
Reason: Removed long, unnecessary quoted text.
User avatar
kamnet
Moderator
Moderator
Posts: 8589
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: How to remove train size limit and station spread limits.

Post by kamnet »

CSX _Fan wrote: 13 Mar 2024 00:09 Can you please please email me a patch or something I need longer stations but I can not for the life of me figure out visual studio to do this myself, I have tried but I don't wanna mess anything up. I would really appreciate this!
For one, the original poster explicitly stated, "I will not provide a patch".

For two, you're replying to a topic from 2011, and the original poster has not logged in for over 12 years. They probably are not going to see this post.

For three, the OpenTTD source code has changed significantly since 2011. It is very likely that the above information is now invalid.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: How to remove train size limit and station spread limits.

Post by Eddi »

kamnet wrote: 13 Mar 2024 06:08For three, the OpenTTD source code has changed significantly since 2011. It is very likely that the above information is now invalid.
well, for the two quoted source lines, they may have shifted and morphed a bit, but they should still be pretty straightforward to find.

whether that modification still yields the desired results i cannot say.
User avatar
jfs
Tycoon
Tycoon
Posts: 1763
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: How to remove train size limit and station spread limits.

Post by jfs »

A quick glance at the instructions in the first post tells me that they will definitely not work on current versions of the game source.
But on the other hand, the changes made to the game source that makes these instructions no longer valid also makes the equivalent changes much more straightforward to do.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: How to remove train size limit and station spread limits.

Post by BillSargent »

kamnet wrote: 13 Mar 2024 06:08
CSX _Fan wrote: 13 Mar 2024 00:09 Can you please please email me a patch or something I need longer stations but I can not for the life of me figure out visual studio to do this myself, I have tried but I don't wanna mess anything up. I would really appreciate this!
For one, the original poster explicitly stated, "I will not provide a patch".

For two, you're replying to a topic from 2011, and the original poster has not logged in for over 12 years. They probably are not going to see this post.

For three, the OpenTTD source code has changed significantly since 2011. It is very likely that the above information is now invalid.
I saw it :D I have no memory of doing any of this LOL..... or writing any of this :)
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: How to remove train size limit and station spread limits.

Post by BillSargent »

jfs wrote: 13 Mar 2024 07:48 A quick glance at the instructions in the first post tells me that they will definitely not work on current versions of the game source.
But on the other hand, the changes made to the game source that makes these instructions no longer valid also makes the equivalent changes much more straightforward to do.
I haven't played this game in years. And I know a lot more about coding these days than I did back then. I'm sure the code has gotten a lot better and I could probably recreate this easily. -- But I have no real interest right now in openttd. Hard to get into games these days :)
CSX _Fan
Engineer
Engineer
Posts: 6
Joined: 13 Mar 2024 00:06

Re: How to remove train size limit and station spread limits.

Post by CSX _Fan »

Thanks Bill I was actaully looking to try and get this in Locomotion good to see your still on the forums now a days, but yes I was hoping to get longer trains in Locomotion not OpenTTD
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 15 guests