Tilemap: del collision poly from individual tiles?

Discussion and feedback on Construct 2

Post » Fri Jan 10, 2014 2:23 pm

Hi all,

I searched the forum and was unable to see a way to remove the collision polygon from individual tiles in a tileset.

My project is a top down (zelda-ish) view:

The first layer is a tiled-background object of "grass".

The second layer is a tilemap containing my tiles on which the player is on top of. It contains things that would block movement (tree stumps, rivers) but also stuff I want the player to walk over (different ground types like dirt or different coloured grass).

The third layer is a second tilemap with things the character would pass behind (like tree-tops).

My problem is I cannot delete the collision polygon on tiles I want the player to walk over.

You can see my work in progress at gordonlittle.ca / tinymage

Is there plans to implement this or is there a better way to do this?
B
31
S
7
G
1
Posts: 80
Reputation: 2,550

Post » Fri Jan 10, 2014 3:34 pm

Hey, I've been thinking about this too and I have a different approach to it, but I still haven't made it so I'm not even sure it's doable.

What I'm thinking about is having a "special" kind of tile in the tilemap, for instance, a "special wall" tile.

When I load my tilemap, I was thinking of checking for said tile, erasing it, and creating an "special wall" object where it was. The same could be done for enemies, or anything else really.

As I said, it's only an idea and I haven't gotten to the point to implement it yet, but since tiles are basically an array of tiles, I think it's doable. Also I wouldn't advise messing with tiles directly unless you're drawing on them or something, you wouldn't even be able to animate a tile if you wanted to destroy it or something, just erase.
B
125
S
43
G
41
Posts: 849
Reputation: 28,260

Post » Fri Jan 10, 2014 4:26 pm

I think that's the opposite of my problem. I want to turn off the collision on tile and have it still be seen. So it can be walked over, like a different shade of grass, or flowers, etc. Without creating any extra sprites, etc.
B
31
S
7
G
1
Posts: 80
Reputation: 2,550

Post » Fri Jan 10, 2014 4:30 pm

I think I'm going to have to make a 3rd tileset for non-solid background. Maybe turn off the tiled-background and replace it with another tileset.
B
31
S
7
G
1
Posts: 80
Reputation: 2,550

Post » Fri Jan 10, 2014 5:15 pm

Oh, I think I see what you mean now. Can't you just have a tile with every dot on the bounding box set to 0,0? It would still show up, but there would be no collision I think.
B
125
S
43
G
41
Posts: 849
Reputation: 28,260

Post » Fri Jan 10, 2014 5:16 pm

Use two tilemaps: one for the tiles that are shown, and another invisible one for collisions only.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Sat Jan 11, 2014 1:00 pm

Is there much of a performance penalty layering multiple tile maps? Right now I have a background, solids, foreground, and parallax each with a different tileset.
B
31
S
7
G
1
Posts: 80
Reputation: 2,550

Post » Sat Jan 11, 2014 1:39 pm

There shouldn't be, no.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Sun Jan 12, 2014 12:21 am

Thank you very much!
B
31
S
7
G
1
Posts: 80
Reputation: 2,550

Post » Wed Jan 15, 2014 11:17 pm

Hello

I'm stuck with just trying to get collision working. I don't know how to tell it to enable collision for non empty tiles.

I have the tilemap with a "solid" behaviour but it's doing collision even on empty tiles. Help?
B
20
S
6
G
2
Posts: 157
Reputation: 3,116

Next

Return to Construct 2 General

Who is online

Users browsing this forum: AekiroStudio and 9 guests