Why are most OpenTTD limits at 5000?

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

Post Reply
User avatar
TrainLover
Engineer
Engineer
Posts: 107
Joined: 01 Jul 2015 15:03

Why are most OpenTTD limits at 5000?

Post by TrainLover »

Forgive me if this is a noobish question, but when I learned programming I learned that most thigs are stored in ints. Ints have a maximum value of 2^32-1, and I am noticing that most of the limits of OpenTTD are powers of two. This is not the case, however for the maximum numbers of trains, buses, et cetera, the max is 5000. Why is this true, why don't they make the trunk maximum trains 2^32-1 (besides of course because of the fact no pc will handle it)? Also, why isn't like 2^32-1 grfs in trunk? Then again, these are probably the same answer.
Developer of North American Passenger Liveries: viewtopic.php?f=26&t=87228
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7238
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Why are most OpenTTD limits at 5000?

Post by Redirect Left »

If you'd like more units. I am using JGRs patchpack, and that has 10,000.

I am guessing the limits are probably more so people don't get to the point where they are choking their computers from all the path finding CPU cycles, rather than anything hard.
large numbers of pretty much anything will cause OpenTTD to eat a whole heap of RAM or CPU. I suspect it might be purely to save peoples computers, and reduce the amount of people going a bit overboard and choking up systems. They might also simply be following the original limits Chris Sawyer did, and trying to keep up some sort of consistency.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
TrainLover
Engineer
Engineer
Posts: 107
Joined: 01 Jul 2015 15:03

Re: Why are most OpenTTD limits at 5000?

Post by TrainLover »

How about for the NewGRF limits? What would happen if one loaded too many NewGRFs even though they are all compatible with each other? So, basically I can go an create a patch changing every value to 2^32-1, and it should be as stable as regular OpenTTD unless I build a inconceivably large amount of vehicles?
Developer of North American Passenger Liveries: viewtopic.php?f=26&t=87228
User avatar
acs121
Tycoon
Tycoon
Posts: 1956
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: Why are most OpenTTD limits at 5000?

Post by acs121 »

TrainLover wrote:SNAP !
The problem, like Redirect Left said, is that all vehicles need pathfinding. I raised to the max vehicles per company on my games - they all use JGR's patchpack. Me and my friends combined, even when we are 9, don't have this much vehicles. But as 5k doesn't seem enough, especially since we use road vehicles and ships like crazy guys, we raise to 10k. This said, trains don't lag very much. Admitting you have like me a distance between signals of 1, trains won't need much pathfinding because they will generally have their path indicated by signals and only need to continue to the next one.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Why are most OpenTTD limits at 5000?

Post by Eddi »

TrainLover wrote:How about for the NewGRF limits? What would happen if one loaded too many NewGRFs even though they are all compatible with each other? So, basically I can go an create a patch changing every value to 2^32-1, and it should be as stable as regular OpenTTD unless I build a inconceivably large amount of vehicles?
NewGRFs are limited by the network package that gets sent when querying servers. since servers get A LOT of these queries every time someone opens the server list, this cannot be made any larger

likewise, lots of other limits will create issues several steps down the line, when assumptions were made about maximum values. not all these limits are immediately obvious, so while it may appear to work at first, it may show issues later when it is too late to turn back.
User avatar
TrainLover
Engineer
Engineer
Posts: 107
Joined: 01 Jul 2015 15:03

Re: Why are most OpenTTD limits at 5000?

Post by TrainLover »

So, can one make it so that NewGRF are limited over servers, but for single player make the NewGRF limit 256? Doesn't that eliminate all of the problems?
Developer of North American Passenger Liveries: viewtopic.php?f=26&t=87228
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Why are most OpenTTD limits at 5000?

Post by PikkaBird »

TrainLover wrote:Doesn't that eliminate all of the problems?
Not being able to load more than ~60 NewGRFs isn't a problem, it's a limitation. Single player savegames not working in multiplayer would definitely be a problem.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Why are most OpenTTD limits at 5000?

Post by Eddi »

solving a problem creates two new ones.


you can never solve all the problems...
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Why are most OpenTTD limits at 5000?

Post by Pyoro »

I'm pretty sure you can patch the 5000 in the source code fairly easily for something a bit larger if you really need to. There's other stuff you might run into if you have too many vehicles - like maximum number of orders, perhaps. But significantally exceeding the limit will probably make the game unplayable anyway ^^;
PikkaBird wrote:Single player savegames not working in multiplayer would definitely be a problem.
I've always found this objection odd. How many games do you know where this is actually possible? Because I certainly can't think of many. If anything, if it IS possible, than it's usually advertised as an extra feature, not the standard, expected behavior.

Doesn't mean that OTTD has to follow the "mainstream", but I just don't find it very convincing argument.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7238
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Why are most OpenTTD limits at 5000?

Post by Redirect Left »

Pyoro wrote:
PikkaBird wrote:Single player savegames not working in multiplayer would definitely be a problem.
I've always found this objection odd. How many games do you know where this is actually possible? Because I certainly can't think of many. If anything, if it IS possible, than it's usually advertised as an extra feature, not the standard, expected behavior.
I think at this stage of development, it isnt expected either. Especially when it seems to be the number 1 reason for the stagnation of innovation in the game. I think if you were to poll people, you might be surprised at the amount of people in favor of dropping that in return for higher development of new things.
If that did occur, and back compatibility was lost, that isn't the end of the world either. As people can simply download an older version, thanks to OpenTTDs backward library storage of old versions, and either play that version, or use the versions to slowly 'up save' the game to newer versions, or a seperate .sav converter might also be possible to upgrade an older .sav to new format standards.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Why are most OpenTTD limits at 5000?

Post by PikkaBird »

Redirect Left wrote:Especially when it seems to be the number 1 reason for the stagnation of innovation in the game.
"Innovation" in trunk is slow because patches are expected to be robust and complete before they're added, and that includes not desyncing multiplayer. For some features, like NRT, that takes time and testing. For a lot of features, it will never happen, either because the author isn't willing to do the work, or the feature is conceptually flawed to begin with.

It may seem slow and stagnant to the casual observer, but if OpenTTD was the hacky mess of half-finished features that most long-term game projects are, all interest and progress would have disappeared years ago - probably around the time OTTD-SP and OTTD-MP became separate games.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 9 guests