Page 1 of 1

[posila] [1.1.88] tile.variants.material_background does not work at higher scales than 8x8

Posted: Thu Aug 10, 2023 1:29 am
by micromario
Good morning :lol:

I am trying to add some new tilesets for the next pY mod... pYSE
My plan is to have similar effect to the "water wube" tile. Aka it uses the material background property to repeat the sprite every N tiles.

However I noticed that this prototype property breaks when going to higher resolutions than 8x8 (size of water wube tile). I tried to make a 32x32.
The game loads just fine but it seems to just use random textures from the altas. There is also a strange shearing effect on the sprite borders.
I tried with the builtin __base__/graphics/terrain/water-wube/concrete-dummy.png and also custom __pystellarexpeditiongraphics__/graphics/tile/space-platform/concrete-dummy.png

I have attached some resources to help debugging. :D
1. Image of the broken tiles
2. Code used to make this tile
3. HR and LR images for the intended texture

Thanks for looking at this :?

Re: [1.1.88] tile.variants.material_background does not work at higher scales than 8x8

Posted: Thu Aug 10, 2023 1:30 am
by micromario
space-platform.lua
(4.01 KiB) Downloaded 70 times

Re: [1.1.88] tile.variants.material_background does not work at higher scales than 8x8

Posted: Thu Aug 10, 2023 1:34 am
by micromario
Loggers

Re: [1.1.88] tile.variants.material_background does not work at higher scales than 8x8

Posted: Thu Aug 10, 2023 2:07 am
by Rseding91
Thanks for the report. The maximum size is 8; at best this can be enforced at load time. Runtime tiles do not support a variation size larger than 8 x 8. To change that would make all tiles use more RAM and more space in save files even if not used.

Re: [1.1.88] tile.variants.material_background does not work at higher scales than 8x8

Posted: Thu Aug 10, 2023 2:13 am
by micromario
Error on load would be great :D

Re: [posila] [1.1.88] tile.variants.material_background does not work at higher scales than 8x8

Posted: Fri Oct 18, 2024 11:21 am
by posila
Thanks for the report.
I am going to call this "Fixed in 2.0". The core issue of tiles larger than material background texture don't render the material background correctly, is not fixed, but it's not reproducible in 2.0. Also in 2.0 it's possible to achieve what I understand you were trying to achieve. In 2.0 there are following changes.
  • main tile pictures don't support transparency anymore, so the whole defining transparent tiles using concrete-dummy.png thing is not a thing anymore.
  • material background texture is no longer hardcoded to 8x8 tiles, it can be configured to be arbitrary rectangle where each side is within range 1 to 32 tiles.
  • -> if main tile pictures are defined, material background texture won't be visible; If they are not defined, tile sizes are inferred from size of material background texture (but tile size is just internal engine thing in this case)
Also, it is untrue that maximum tile size is 8x8, it's 128x128 ... tiles do store size in 3 bits, but since their size is always power of 2, the exponent is stored only, allowing the engine to support 8 first powers of 2 as size of tile. OP's issue was that they configured 32x32 tiles, but material background texture was hardcoded to 8x8, and the engine doesn't fill tiles larger than the material texture with the texture.

Re: [posila] [1.1.88] tile.variants.material_background does not work at higher scales than 8x8

Posted: Fri Oct 18, 2024 9:25 pm
by micromario
This is great news. Thanks!