Tile map collisions scale to fit?

#1

I’d like to request a feature for tilemap collisions. Currently, the engine requires the collision mask be the same size. However, for the sub-pixel shading, or for 3D uses of tilemaps, it makes sense to have a high resolution tile size but a low resolution collision map. Currently you have to have the same size for both. This makes creating areas w/ lower or higher resolution textures hard to scale properly since the physics is based on the texture size for each tile.

I’m willing to help with this if possible, but not sure I understand enough yet :blush:

EDIT: Here’s an example I created which shows the benefits of scaling down tiles. The difference is small (you’ll have to see the actual size to notice likely) but adding the extra sub-pixel detail preserves the sense of depth w/ perspective view better imo.

Zooming in on the texture in the bottom right for a clear example of the benefit:

The top image is the 24x20 tiles. The bottom is the 48x40 tiles which have been scaled down. The depth of the rock texture is preserved much better in the bottom image.

2 Likes

#2

There are most likely tricks you can use to utilize lower resolution textures but still have them look good in 3D. Can be done with shaders to upscale pixel art (like xBRZ - I bet you could grab the tilemap texture once at runtime, upscale it with one of those pixel upscalers made for emulators, replace the resource texture, and it would just work), or doing things like disabling mipmaps or at least adjusting the mipmap bias and then apply a post processing effect on top to unify the image and take care of artifacts.

Being able to use lower resolution images for tilemap physics does seem like a good and useful idea.

1 Like