Page 1 of 1

Collision masks for whole surfaces OR collision mask of hidden tiles

Posted: Sun May 12, 2024 10:17 am
by Natha
I need to prevent placement of certain entities in certain surfaces. For now, I have a placement cancelling logic which directly mines the entity if it is prohibited there. But it is still colored green in the cursor.
Applying collision masks on these entities and some tiles wouldn't work because when using concrete or other floors, placement is (dis)allowed either on all or none surfaces.

So what I would need, to not copy all existing tiles with custom collision masks, is
a) that collision masks of hidden tiles are also applied to placement logic
or b) that whole surfaces can have a collision mask.

Re: Collision masks for whole surfaces OR collision mask of hidden tiles

Posted: Sun May 12, 2024 1:43 pm
by FuryoftheStars
Something along this line might be in 2.0, as you can't build certain entities on space platforms. Although this may be a simple allow in space boolean, but if that's the case I would hope we can ask them to change it.

Re: Collision masks for whole surfaces OR collision mask of hidden tiles

Posted: Sun May 12, 2024 4:13 pm
by Nidan
You can take a look at how Space Exploration solved this, which, I believe, is done via collisions on ground tiles. Space-only building collide with all natural ground tiles, land-only buildings collide with the space platform tile. Obviously, this wont help you in case some ground tiles are used on surfaces with different building restrictions, although a bit of duplication in the data stage probably can work around that (which could get messy if you need to touch the chunk generation - or replace them afterwards in on_chunk_generated).

Re: Collision masks for whole surfaces OR collision mask of hidden tiles

Posted: Mon May 13, 2024 1:41 pm
by Natha
Nidan wrote:
Sun May 12, 2024 4:13 pm
You can take a look at how Space Exploration solved this, which, I believe, is done via collisions on ground tiles. Space-only building collide with all natural ground tiles, land-only buildings collide with the space platform tile. Obviously, this wont help you in case some ground tiles are used on surfaces with different building restrictions, although a bit of duplication in the data stage probably can work around that (which could get messy if you need to touch the chunk generation - or replace them afterwards in on_chunk_generated).
Yeah I know how it is done there, but in SE you can't place concrete or other floor tiles in space which makes it a lot easier