rainwarrior wrote:
- height can be determined by a line function or heightmap
Height maps are much simpler, IMO (landing in the middle of a slope, for example, is much simpler). Functions save a little ROM, but the amount of clean slopes (respecting tile boundaries and all) you can define is so limited that you might as well just use height maps (which are more versatile) instead and not even sacrifice a lot of ROM.
Quote:
where do you put the player's feet? are you using a collision rectangle, or the centre of the player?
I prefer to use the center of the player/character, but that makes edges harder to handle (i.e. the character can't fall just because there's nothing below its center point, so for edges you must use the full rectangle).
Quote:
do you adjust velocity or just bump them up to the heightmap value?
If the slopes aren't very steep it doesn't make much difference, but games with more varied terrain should have slopes affect the velocity.
Quote:
when moving downhill do you keep the player stuck to the slope, or will they skip down it with a series of natural falls?
Chinese games like Somari use natural falls, and it looks terrible. I believe that the best rule is to have the character stick to the ground, unless the difference between the previous floor height and the new floor height is above a certain threshold (which allows you to run off ledges).
Quote:
what happens at edges? (can be rather complicated depending on what neighbouring tiles you allow)
I decided to use the leftmost or the rightmost height value depending on which side the edge is.
Quote:
I usually find it simplest to hide most of the edge cases by only allowing slope tiles that connect to a flat ground or another slope
When analyzing a few games, I noticed Mega Man X does this. There are very few slopes ending in pits, and they are usually not very steep.