Complex Tile Collision Shapes

Alan1

  • Posts: 88
Is there any way to create a concave or compound shape within one tile space? I've tried putting separate segments on different scene layers but the top layer overrides the bottom layer's collision shape. I also tried using smaller tiles but anything smaller than 32 x 32 creates other problems:

http://community.stencyl.com/index.php/topic,30712.0.html
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn

sdieters

  • Posts: 2068
Use a terrain instead of tile collision.
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

Alan1

  • Posts: 88
Thanks but terrains appear to be pretty limited. For example, I need these collision shapes(and all its points) to line up with the grid which terrains apparently do not. Also, how do you add graphics to terrains? I can't even find the section in Stencylpedia covering terrains. Did I miss it?
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn

sdieters

  • Posts: 2068
you cant give texture to a terain (as far as i know) but you can place tiles without collisions, and draw a small terain over that tile.

for what purpose is it? maybee i can give you another hint. screenshots will do =)
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

Alan1

  • Posts: 88
Thanks again. I think I'm staying away from terrains for this project due to lack of grid functionality and also because collision shapes do not merge like tile shapes do. Since levels will be based on a grid pattern it would be very tedious to draw the terrain for each level.
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn

sdieters

  • Posts: 2068
and creating a custom collision shape is to diificult?

you can add a custom collision shape per tile by pressing the + in the collision shape editor. then select create polygon, add as amny vertexis as you want and place them where ever you need them.
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

Alan1

  • Posts: 88
and creating a custom collision shape is to diificult?

At the moment, the average level planned will be a grid of 1200 tiles. Creating a terrain collision shape for this would be tedious, if even possible, especially since points do not align to the grid and I would need to zoom in to properly place every single point.

you can add a custom collision shape per tile by pressing the + in the collision shape editor. then select create polygon, add as amny vertexis as you want and place them where ever you need them.

This still won't give me the concave and compound collision shapes I'm hoping for.
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn

gamegirlxl

  • Posts: 713
What are you trying to do with concave collisions for tiles?  How would that work if an actor got wedged into a triangular crack (Like Pacman's mouth)?

Alan1

  • Posts: 88
Creating a maze.
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn

SanjayPatel

  • Posts: 18
I've definitely found that sticking with a 32x32 size tile works out better for stencyl. 

Have you tried using the Tile API?
http://www.stencyl.com/help/viewArticle/47/

You could have the level generated by loops that read from a list.   In that list you could note which tile from a particular tile set to use for each tile in the scene. Then you just make a tileset that you can customize the collisions of.


Alan1

  • Posts: 88
Not sure I follow. You mean use Tile API to rapidly alternate each tile space between two different collision shapes, mimicking a complex tile collision shape?
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn

SanjayPatel

  • Posts: 18
hmm... not really.  As far as i can tell, the Tile API is designed more for setting up the tiles for a scene at the load.  Is the maze you're trying to build dynamic? Like do the collisions change while the scene is live?

Alan1

  • Posts: 88
Like do the collisions change while the scene is live?
Nope.
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn

MyChairHasALooIn

  • Posts: 310
It's tough to offer solutions when it's so hard to see what you're aiming for, I can't think of a good reason to have concave tile shapes in a 1200 tile maze, unless it's a ball rolling affair, and they are 'resting' points?

Alan1

  • Posts: 88
Yeah, sorry bout that. I'm a little guarded with IP. Need-to-know basis. If this doesn't work out, I'm already working on a fallback. Basically spread out the collision shapes to a larger area, thus eliminating the need for concave and compound shapes. But spreading it out makes it tougher to navigate a maze within 640 x 480, so I need either a mini-map or a movable camera system. I'll create a separate post for that if needed. Just trying to exhaust this option first, if at all possible. Also, It's probably more like a 7-800 tile grid. 1200's what I'm working with now.
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn