tileAPI collision

GregAnims

  • Posts: 305
I remember a while back that adding tiles in realtime using the tileAPI would result in poor collision due to how Stencyl made the tile collisions.

Is this still true in 2.4, or can i draw a level using the tileAPI and collisions will all work fine?

Thanks :)

rob1221

  • *
  • Posts: 9466
I don't think that problem has ever been fixed, even in 3.0.  The tile API is usually used for performance reasons, but when every tile has a separate collision shape, it isn't really that great.  Try to use actors if you can.

Jay123

  • *
  • Posts: 153
i recently found an easy workaround for this, my actors kept getting stuck as i placed tiles - my main actor now has 2 circles overlapping like a '8' instead of a box and it's never got stuck again. Also you can make any tile collision box with a slight angled corner on each corner but i found having circles on the actors solved all for me. Hope this helps.
I feel like i'm stuck in groundhog day - same code, same pc, same shite... no retreat, no surrender yaa !!!

Stencyl Ninja

  • Posts: 246
Neat solution Jay123.

Btw, if someone more knowledgeable with lists and map editors than myself were to take a look
at my Barebones No Box2D collisions example they could probably use that code with a few
alterable values and place "platforms" within a list as they placed them realtime in their custom
map editor to work as a solution rather than tiles or actors.

Essentially it would turn it from a hard-coded thing good for only one platform into a nice and
useful way of creating as many platforms as you need at any rectangular size desired.

Granted, the thing doesn't land perfectly on the platform as is, but that can be fixed.
I was just trying to see if I could make a movement with collisions without the use of Box2D.
It's pretty rough but only because I have not refined it. Very Barebones. I'd probably redesign
the whole thing and only keep the basic idea.

Just saying, you guys, being more knowledgeable than myself at programming/coding could
probably make something nice out of the idea.

GregAnims

  • Posts: 305
Ninja - haven't looked at that, but do you just grab co-ordinates around the player, see what tile they're on, then apply forces in various directions if they're touching "collide-able" tiles..

Jay123 - i could do that! I thought the issue was also that because each tile has a singular collision, it slowed performance a lot?

Jay123

  • *
  • Posts: 153
Hmm i'm not entirely sure on that one Greg but i for me i found when using the Tile API collisions with the tiles i placed were often sticking to my actors causing them to get stuck.
I feel like i'm stuck in groundhog day - same code, same pc, same shite... no retreat, no surrender yaa !!!