No more than 255 tiles?

Chaos234
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Sat Jun 27, 2015 10:45 pm
Contact:

No more than 255 tiles?

Post by Chaos234 »

I report this as a bug because this game, compared to e. g. minecraft, is not written in java so I don't understand any limitation here and after all not for tiles.
Modding was implemented very early so why limitin tiles to 255 in times where PCs have at last +8 GB memory and at last a quad-core cpu with hyperthreading?

There is no reason for limiting tiles or any other stuff compared to minecraft e. g. the potions due to there potionIDs (well, they where removed later but it is only an example).

I please you, to remove it and implement a dynamic loading for this, thanks.
posila
Factorio Staff
Factorio Staff
Posts: 5353
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: No more than 255 tiles?

Post by posila »

"255 tile types ought to be enough for anybody." - Bill Gates, 1981

Moved to modding interface requests, I suppose.
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: No more than 255 tiles?

Post by steinio »

Image

Transport Belt Repair Man

View unread Posts
Chaos234
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Sat Jun 27, 2015 10:45 pm
Contact:

Re: No more than 255 tiles?

Post by Chaos234 »

Well, wouldn't it possible to check if an game instance is loading more than the "base" mode?

If "yes" > Modded Game > Allow more than 255 tiles at own risk
If "No" > Let the limit untouched because nothing todo here (or maybe reduce it, if possible)

Or is this not possible atm?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14290
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: No more than 255 tiles?

Post by Rseding91 »

Chaos234 wrote: Thu Apr 30, 2020 5:05 pm Well, wouldn't it possible to check if an game instance is loading more than the "base" mode?

If "yes" > Modded Game > Allow more than 255 tiles at own risk
If "No" > Let the limit untouched because nothing todo here (or maybe reduce it, if possible)

Or is this not possible atm?
It's not possible. You would have to compile and ship a different version of the game for it to work.

We store tiles on a chunk as an array<array<Tile, 32>, 32>

Where each Tile has:

TileID (1 byte)
Variation (1 byte)

So each Tile is 2 bytes big, that means the entire array of tiles on a chunk is 32 * 32 * 2 tiles big or: 2048 bytes big.

That's a compile time constant and you can't dynamically change it runtime.
If you want to get ahold of me I'm almost always on Discord.
GeneralTank
Burner Inserter
Burner Inserter
Posts: 14
Joined: Fri Aug 09, 2019 1:35 am
Contact:

Re: No more than 255 tiles?

Post by GeneralTank »

Rseding91 wrote: Thu Apr 30, 2020 6:04 pm
Chaos234 wrote: Thu Apr 30, 2020 5:05 pm Well, wouldn't it possible to check if an game instance is loading more than the "base" mode?

If "yes" > Modded Game > Allow more than 255 tiles at own risk
If "No" > Let the limit untouched because nothing todo here (or maybe reduce it, if possible)

Or is this not possible atm?
It's not possible. You would have to compile and ship a different version of the game for it to work.

We store tiles on a chunk as an array<array<Tile, 32>, 32>

Where each Tile has:

TileID (1 byte)
Variation (1 byte)

So each Tile is 2 bytes big, that means the entire array of tiles on a chunk is 32 * 32 * 2 tiles big or: 2048 bytes big.

That's a compile time constant and you can't dynamically change it runtime.
Even of it costs me an extra Gigabyte or more in memory and a slight performance hit I would take the increased flexibility of having more space for tiles than currently.

Right now you only need 4 mods to hit the limit

Dectorio
Alien Biomes
Asphalt Roads
Krastorio 2

Now because 1.0 is likely more inportant than increasing the limit but it's something that will have to be fixed with sooner or later as this topic will be keep coming back. A temporary solution would be in the in game mod download page and the mod option list the number of tiles a mod would add, how many active per mod and the total amount of tiles active. This would save a lot of trial and error and would let people know how many tiles are currently loaded (or will be loaded).
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: No more than 255 tiles?

Post by steinio »

Alien biomes tells you in the log which tiles are loaded and which not...

Ah BTW it also let you disable alien tiles to make room for other mods.
Image

Transport Belt Repair Man

View unread Posts
Rseding91
Factorio Staff
Factorio Staff
Posts: 14290
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: No more than 255 tiles?

Post by Rseding91 »

GeneralTank wrote: Fri May 01, 2020 8:22 am Even of it costs me an extra Gigabyte or more in memory and a slight performance hit I would take the increased flexibility of having more space for tiles than currently.

Right now you only need 4 mods to hit the limit

Dectorio
Alien Biomes
Asphalt Roads
Krastorio 2

Now because 1.0 is likely more inportant than increasing the limit but it's something that will have to be fixed with sooner or later as this topic will be keep coming back. A temporary solution would be in the in game mod download page and the mod option list the number of tiles a mod would add, how many active per mod and the total amount of tiles active. This would save a lot of trial and error and would let people know how many tiles are currently loaded (or will be loaded).
It's not going to happen. It would be a memory and performance hit for *every single base game player regardless of them using mods* - that's not going to happen.
If you want to get ahold of me I'm almost always on Discord.
GeneralTank
Burner Inserter
Burner Inserter
Posts: 14
Joined: Fri Aug 09, 2019 1:35 am
Contact:

Re: No more than 255 tiles?

Post by GeneralTank »

steinio wrote: Fri May 01, 2020 8:56 am Alien biomes tells you in the log which tiles are loaded and which not...

Ah BTW it also let you disable alien tiles to make room for other mods.
Not as easy as just seeing a number in the in game mod portal. Basically I want the ability to see i real time in game if enabling a mod or an option in a mod would send me over the 255 limit.
User avatar
spiro9
Inserter
Inserter
Posts: 25
Joined: Tue Jul 12, 2016 12:15 am
Contact:

Re: No more than 255 tiles?

Post by spiro9 »

Rseding91 wrote: Fri May 01, 2020 5:15 pm It's not going to happen. It would be a memory and performance hit for *every single base game player regardless of them using mods* - that's not going to happen.
Wouldn't this be inevitable in the future, anyways? If a major content update is ever released, or Factorio nears the end of its development (implication: community patches), wouldn't an increase in tile limit become absolutely necessary to still allow tile modding?
Hi hungry, I'm dad!
Rseding91
Factorio Staff
Factorio Staff
Posts: 14290
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: No more than 255 tiles?

Post by Rseding91 »

spiro9 wrote: Mon Aug 21, 2023 7:20 am
Rseding91 wrote: Fri May 01, 2020 5:15 pm It's not going to happen. It would be a memory and performance hit for *every single base game player regardless of them using mods* - that's not going to happen.
Wouldn't this be inevitable in the future, anyways? If a major content update is ever released, or Factorio nears the end of its development (implication: community patches), wouldn't an increase in tile limit become absolutely necessary to still allow tile modding?
Maybe. I don't know the future.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14290
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: No more than 255 tiles?

Post by Rseding91 »

As part of the Space Age work we had to bite the bullet and change tiles to support up to 65'000~ tiles. It means more memory used and potentially save file size but it's now going to be there.
If you want to get ahold of me I'm almost always on Discord.
User avatar
spiro9
Inserter
Inserter
Posts: 25
Joined: Tue Jul 12, 2016 12:15 am
Contact:

Re: No more than 255 tiles?

Post by spiro9 »

Rseding91 wrote: Mon Aug 28, 2023 4:00 pm As part of the Space Age work we had to bite the bullet and change tiles to support up to 65'000~ tiles. It means more memory used and potentially save file size but it's now going to be there.
Rseding91 wrote: Mon Aug 28, 2023 4:00 pm up to 65'000~ tiles.
Holy tile space, Batman!
Hi hungry, I'm dad!
curiosity
Filter Inserter
Filter Inserter
Posts: 471
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: No more than 255 tiles?

Post by curiosity »

Rseding91 wrote: Mon Aug 28, 2023 4:00 pm As part of the Space Age work we had to bite the bullet and change tiles to support up to 65'000~ tiles. It means more memory used and potentially save file size but it's now going to be there.
When you eventually mark this as implemented, don't forget about viewtopic.php?f=28&t=103485
vjbone
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Feb 14, 2016 10:02 am
Contact:

Re: No more than 255 tiles?

Post by vjbone »

Actually sad that you could not find a way to avoid limit increase
Nidan
Filter Inserter
Filter Inserter
Posts: 268
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: No more than 255 tiles?

Post by Nidan »

spiro9 wrote: Mon Aug 28, 2023 7:01 pm
Rseding91 wrote: Mon Aug 28, 2023 4:00 pm up to 65'000~ tiles.
Holy tile space, Batman!
The limit of 255 tiles means that they're stored in one byte currently. The next larger reasonable size is two bytes, which gets us 2^16-1 or 65535 tiles.


A middle ground between expanded tile limit and memory use could have been using 12 bit per tile, but a) it's awkward to read and b) only makes sense if there's something to fill the second half of the second byte, otherwise it'll get rounded up to 2 bytes anyways. The limit for 12 bit would have been 4095 tiles.
pleegwat
Filter Inserter
Filter Inserter
Posts: 278
Joined: Fri May 19, 2017 7:31 pm
Contact:

Re: No more than 255 tiles?

Post by pleegwat »

Nidan wrote: Tue Aug 29, 2023 8:45 am
spiro9 wrote: Mon Aug 28, 2023 7:01 pm
Rseding91 wrote: Mon Aug 28, 2023 4:00 pm up to 65'000~ tiles.
Holy tile space, Batman!
The limit of 255 tiles means that they're stored in one byte currently. The next larger reasonable size is two bytes, which gets us 2^16-1 or 65535 tiles.


A middle ground between expanded tile limit and memory use could have been using 12 bit per tile, but a) it's awkward to read and b) only makes sense if there's something to fill the second half of the second byte, otherwise it'll get rounded up to 2 bytes anyways. The limit for 12 bit would have been 4095 tiles.
Awkwardness to read isn't that bad. There are C/C++ language constructs to assemble these bit fields, or the bits of extra data can be relegated to the top of the half-word and simply ANDed out. The second point is more applicable - there isn't anything in the 1-4 bit range you'd want to store per tile and save yourself the time to look up the tile, and things like 'tile variants' can just be handled by duplicating the base tile. A one-off 64k slot lookup table isn't expensive enough to worry about.

I do wonder whether it would have been possible to stay under the 255 tile limit if that limit were applied on a per-surface basis.
User avatar
TheKillerChicken
Long Handed Inserter
Long Handed Inserter
Posts: 80
Joined: Sat Mar 02, 2019 7:06 am
Contact:

Re: No more than 255 tiles?

Post by TheKillerChicken »

If every byte was set to the true 64-bit integer (1 decellion), this game would need ~200 TB of memory. So that is why these practical values exist.
BicycleEater
Fast Inserter
Fast Inserter
Posts: 153
Joined: Sun Jul 26, 2020 4:05 pm
Contact:

Re: No more than 255 tiles?

Post by BicycleEater »

Rseding91 wrote: Mon Aug 28, 2023 4:00 pm As part of the Space Age work we had to bite the bullet and change tiles to support up to 65'000~ tiles. It means more memory used and potentially save file size but it's now going to be there.
YESSSSS
DarkShadow44
Filter Inserter
Filter Inserter
Posts: 353
Joined: Thu Jun 01, 2017 12:05 pm
Contact:

Re: No more than 255 tiles?

Post by DarkShadow44 »

TheKillerChicken wrote: Sat Sep 02, 2023 6:30 pm If every byte was set to the true 64-bit integer (1 decellion), this game would need ~200 TB of memory. So that is why these practical values exist.
I have no idea where you got that number from. If you were to use a 64bit integer instead of a byte for the tile id, you'd need 8 times as much memory for tile id storage. Nothing else.
Post Reply

Return to “Implemented mod requests”