   collision detection
  What are some ideas for collison detection that allows for fast game play.Just take 2 2d objects for example, where the tile size is big 32 pixels. A sprite wont collide witha perfect block that size and it is likely only 1/2 - 1/4 the tile it needs to collides with.If you then create smaller tile sizes to make collision detection less complicated like 8 pixels but the programs frame rate is far slower now with so much more drawing needed. Speed wise, it seems better having larger objects to collide with then having a more detailed logic to decide what part of the tile it collids with.What do you think?   
  Smaller tilesize will make the collision more complicated... or to be more precise mean you'll likely be doing a lot more collision checks.  If an entire tile is 'solid' then make the entire tile the bounding box; break it down further if you need the detail.So yes, you're correct; larger objects will generally be more efficient for you.   ;  I think modern CPU's could perform enough 2D-tile collision tests to allow for 100 square kilometer maps to be checked without cullin :)Performance of collisions really becomes a problem in 3D.Jeroen   ;  One way is to divide your map up into equal parts say 4.  Then keep track where the object that needs to be tested is located.  Then all you have to do is check 1/4 of the map at a time instead of the entire map.   ;Quote:Original post by godmodderI think modern CPU's could perform enough 2D-tile collision tests to allow for 100 square kilometer maps to be checked without cullin :)That's no reason to be lazy, and depending on what you're doing you may want that processor time for something else; consider that an RTS with some processor-hungry AI and pathfinding may be the game those 2d collisions are being used in. [wink]  2d gaming is also big on mobile devices, which have less memory and processing power available.If you're just learning and creating a small shooter/platformer/whatever you very likely don't need to worry about it much, but it can be worth thinking about these things in case you need something more efficient in future.   ;  a collision detection with a tile and a sprite can be messy. If only only part of the tile can be collided with , you need to hard code in exact details of the objects to collide with.I guess you would need to know the direction and exact x,y point compared to a specific tile on where to collide with. These things don't come across as simple.Eg what about a sprite and another sprite where you need to see if the hand touches the other sprite or just the head.   