I'm working on a 2D game (using Unity's new 2D features) and when I carefully study old games (Super Metroid, SOTN) to see how the player collides with the ground, I am lost as to how it is accomplished; how it is handled.
Here is what I notice:
When the player stands on a ledge, they can walk out to the very last pixel of their hit box, This suggests a square collision shape. Easy.
But when the player walks up a slope, it is the very center point of the character that rests on the ground. You can slowly walk up to a slope, and you never start moving upward or downward until the very center of the character touches the slope.
So the collision presents a bit of a contradiction, and becomes very difficult to reproduce with the modern tools I have. If I use a box collision, then I can walk to the very edge of a ledge, but when I walk up a slope I start going up when the farthest corner hits the slope. If I round out the bottom of my character's collision I can move up slopes with the center of my character on the ground, but then I can't walk to the very edge of a ledge because I'll fall off too soon.
How exactly is it even being handled in these older games? I suspect that I can't recreate the exact same method without rebuilding an engine, but even so I am left to wonder how this effect is even created in the first place. I've seen in ROM hacking tools that the levels give special blocks to the sloped ones; they don't simply use an angled collision polygon like modern games would. And yet they still have feats that defy this understanding, like in level 6 of Super Castlevania where you jump across swinging chandeliers. That's not simply angled ground, but moving angles. But yet you can stand on the edge of those ledges, and your feet still don't float above the ground when the angle is sharp.
So how was collision handled in these old games, and how did they keep your feet steady on sloped ground?