Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

Tile Map Collision - TileData vs. Colliders

Started by ChristOwnsMe Oct 9, 2013 at 10:52 PM 1 replies 2.1k views
Original Post
ChristOwnsMe
ChristOwnsMe

Hello. I have a large tile map(8400x2400) and am streaming the tile data around the player as he moves around(no collision yet, so just a camera). I am debating between using colliders on the tiles that are within a small radius around the player, or any object that can collide with terrain. Are there any advantages to dynamically adding and removing colliders to tiles for collision vs. having all of your collision logic be based around the "solid" tile data of a tile?

I am using Unity, so it is very easy to have the collider logic work for entities with a rigid body. I would just like everyones input. Thank you!

Khatharr
Khatharr

You'd probably want to go with passability data for each tile, and just stream it along with the other tile info. Constantly generating and destroying objects for the sole purpose of map collision is really not very efficient. If your tile interactions aren't hugely complex then you could probably just use a uint for each tile and treat it as a mask that describes the tile's passability.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.
Goran Milovanovic
Goran Milovanovic

I don't know, but I think you should implement the most straightforward algorithm you can think of, and if that performs well, then you can consider that to be the best solution.

I reason that software development is largely about managing complexity, so try to introduce as little as you possibly can, while satisfying the specification in question.

+---------------------------------------------------------------------+ | Game Dev video tutorials  ->   http://www.youtube.com/goranmilovano | +-------------------------------------

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.