🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Individual collider for each tile, or composite collider?

Started by
3 comments, last by 1Garrett2010 4 years, 9 months ago

So I know the composite collider is an efficiency thing, but I'm having a problem with it making my tiles uneven. I downloaded a free tile set that has grass lumps kind of on the corners, and the composite collider surrounds those clumps. What I really want is for the player to just walk through the grass and stay on the flat square. My question is is how much of a performance hit, in a complete Metroidvania style game, would it be for me to just use individual colliders on each tile instead of composite colliders? Is this bad practice? Is the real problem with the tiles and should I address that instead? I want to work on a Metroidvania game but I first want to gather more information on best practices and workflows that are typical of making a game like that. I've attached a pick of the collider issue for reference.

grassOnTiles.PNG

Advertisement

Use  more tile Layers, one for base blocks and another (or more) for other objects, decors (like your example grass with no colliders) etc.  

 

 

Graphic contribute for your game/character?  https://www.deviantart.com/garrett2010 https://www.facebook.com/Garrett2010graphics/

Just to make sure i'm understanding you correctly, the problem then is really with the tiles. I should have flat topped square tiles for walking on, but for grass like this, that should be on a layer in front of the one my character is walking on, correct?

Yes, grass covers partially the block, put it on a layer drawn after the "base" one. Remember you can also have hidden layers like "trigger" tiles (when touched they fire an event like ladders creation, bonus items, etc etc). It all depends on what you need on your level, as a rule of thumb create a system that lets you make your levels as easier and sooner as possible!

 

Graphic contribute for your game/character?  https://www.deviantart.com/garrett2010 https://www.facebook.com/Garrett2010graphics/

This topic is closed to new replies.

Advertisement