Everytime I have coded "working" collision, I always went about it very haphazardly and unstructured. If I use Axis Aligned, or Verlet, Or Euler, any or all of these theories, my problems always lie in the edge cases. Let me invent a scenario to better explain my question.
Imagine a 2D game, let's use Mario as the best example. So there is gravity, there is acceleration and friction. If the world is being loaded as all individual, let's say 32 x 32, tiles, while the player is moving along the ground, there will always be that edge case of when he happens to be in the dead center of both tiles, and collision ends up being checked on both tiles below him and of course he gets moved based on both tiles' positions.
So in that case, I assume I would only want to be checking top block collision (bottom of player) only, and not side collisions, but then when I'm jumping onto a tile, or block, I know I want to check bottom player collision, so I can land, but that doesn't stand for anytime the player is in the air right? Cause what if I'm falling/jumping, and I hit the side of a block or wall, I want to check side collision. And then what if I hit the side of one block, but in that frame of collision when the player overlapped the tiles, he also got into the top of one of the tiles and now gets his y position moved because of it.
So the tl;dr version of my rambling is...
What's the most sensible way to structure collision? Totally case specific, i.e. only check specific collisions dependant on surrounding tiles, or the movement of the player?
Or is there a broad way to keep all collisions being checked (top, sides and bottom of player) and deal with the edge cases as well?
Also this isn't language specific, I'm speaking totally in generics. Any code examples are welcome. (Any language)
Thanks. (Hope my rambling isn't too convoluted and it makes sense. ><