Industry tile limit

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Industry tile limit

Post by FooBar »

While coding FIRS, I realised that we might hit the industry tile limit. I'm not asking for a workaround, as I already have a few up my sleeve. It's a short sleeve though, as I'm wearing a T-shirt...

Anyways, I'm wondering what the actual industry tile limit is in OpenTTD. Is it a global limit of 0xFF? Or is it similar to the house limit of 256 IDs per NewGRF with a maximum of 512 for all NewGRFs together?

Related to that: are the industry tile IDs unique to the grf (like houses) or global (like vehicles without the engine pool)? In case of the former I'm in the need of a longer sleeve as I have yet another trick in that case.

Thanks.
maquinista
Tycoon
Tycoon
Posts: 1829
Joined: 10 Jul 2006 00:43
Location: Spain

Re: Industry tile limit

Post by maquinista »

FooBar wrote:While coding FIRS, I realised that we might hit the industry tile limit. I'm not asking for a workaround, as I already have a few up my sleeve. It's a short sleeve though, as I'm wearing a T-shirt...

Anyways, I'm wondering what the actual industry tile limit is in OpenTTD. Is it a global limit of 0xFF? Or is it similar to the house limit of 256 IDs per NewGRF with a maximum of 512 for all NewGRFs together?

Related to that: are the industry tile IDs unique to the grf (like houses) or global (like vehicles without the engine pool)? In case of the former I'm in the need of a longer sleeve as I have yet another trick in that case.

Thanks.
:idea: Maybe You should use the same industry tile per industry, and later load different graphics (in action 2) with the variable 43:
This variable can be used to spare industry tile IDs: the same tile type can choose different representation depending on where exactly it is inside the industry.
http://dev.openttdcoop.org/projects/fir ... efarm.pnfo
http://dev.openttdcoop.org/projects/fir ... ewery.pnfo

This is a example code:

Code: Select all

   83 * 14	 02 09 6C 81
 43 // var 43 - Relative position
 10 FF // Not mask, offset 16 bits -> 00[yx]YYXX
 05 // 5 ranges
         02 00   11 11 // Tile type A --> Y=1 X=1
         04 00   26 26 // Tile type A --> Y=2 X=6
         03 00   20 24 // Tile type A --> Y=2 X=0-4
         02 00   35 35 // Tile type A --> Y=3 X=5
         01 00   40 42 // Tile type A --> Y=4 X=0-2
         00 00
George ECS industries uses the XX and YY info.

This is correct? Or I'm wrong?
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Industry tile limit

Post by FooBar »

Interesting. I think I'll code the next industry using a varaction2 chain. I haven't used one of those so far, but eventually we need one anyways. Thanks!


Although this should be a fine solution for my problems, I still would appreciate someone answering the original questions. It might be useful to add that bit of missing information to the newgrf wiki as well... (I hope that doesn't sound too demanding, as it isn't meant that way. I'm willing to update the wiki myself)
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Re: Industry tile limit

Post by Korenn »

FooBar wrote:(I hope that doesn't sound too demanding, as it isn't meant that way. I'm willing to update the wiki myself)
That's the power of a wiki, go right ahead!
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Industry tile limit

Post by Ammler »

Korenn wrote:
FooBar wrote:(I hope that doesn't sound too demanding, as it isn't meant that way. I'm willing to update the wiki myself)
That's the power of a wiki, go right ahead!
Don't think, you need to tell that to FooBar. ;-)
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Industry tile limit

Post by FooBar »

Korenn wrote:That's the power of a wiki, go right ahead!
Ofcourse, how silly of me. Let's see, what to put there... errr...

Obviously my questions need to be answered first before I can update it :P I'm probably the last person that doesn't update the wiki if he has new information to add...
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Industry tile limit

Post by frosch »

The global limit is 512 tiles (including non-overridden original tiles). 256 per grf. (OTTD limits, no idea about TTDP)
It is very very unlikely that the 512 limit is increased ever, as it needs map storage. Increasing the 256 limit to 512 was discussed and considered not worth the effort. Nevertheless you might want to avoid using tile 0xFF, so it can be turned into an extended byte in 50 years.

So you should not waste your tiles. Nearly all action0 properties of industry tiles can be controlled by callbacks. So you should get away with 2 or 3 tiles per industry. E.g. separating the tiles using callback 27 (the performance critical "animation speed" callback) from the tiles not using that callback. Similiary you could separate those tiles which do not accept anything, i.e. do also not need callback 2B and 2C. Though they are by far not as expensive as 27.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Industry tile limit

Post by FooBar »

Thanks for your reply, frosch! This is the answer I was hoping for :P

I'll continue to use varaction2 for the tiles so that 1 tile per industry and maybe some generic tiles are enough for most industries. I'll also add this info to the wiki right away!
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot] and 11 guests