saxman Posted June 6, 2006 Report Share Posted June 6, 2006 EDIT Nevermind. I figured it out. It makes sense to me now. It adds 8, and when it is below the decimal, it adds 10 instead of 8. An except seems to be 2.375, where it varies between 2 and 3 rather than 2 and 4. Perhaps this is because 8.83 rounds up while 2.375 rounds down. Original message Okay, now the Sonic games didn't use much floating point stuff at all. Sonic games used fixed point stuff. For example, Sonic's speed is composed of a 16-bit word... the upper byte represents full pixel movements, while the lower byte represents 1/256ths (does that make sense to people?) Well I've been studying sky scrolling movement, and I came across an interesting pattern. On a particular line, it sometimes moves two pixels, and sometimes one. Some Sonic skys have strange patterns because there are small layers within bigger layers (in other words, a big chunk moves at a speed, but a smaller chunk moves at a different speed, resulting that it sometimes moves different amounts at a time). The point is, this particular lines on this particular sky is different from the others I've looked at. There's no evidence I can find that the lines are matched with bigger layer movements. There's no evidence I can tell that it's a floating point movement either, because generally floating point movements vary between two numbers that are 1 away from each other (example would be 4 and 5). Look at this pattern: 10 - 8.8333333 8 - 17.6666666 8 - 26.4999999 10 - 35.3333332 8 - 44.1666665 10 - 52.9999998 8 - 61.8333331 8 - 70.6666664 10 - 79.4999997 8 - 88.3333333 10 - 97.1666666 8 - 105.9999999 The numbers on the left are the timings. It waits 10 frames to move, then it waits 8, etc. The right shows how many frames would be waited at each point if it were added by floating-point in order to come up with the same total as that on the left. I hope I explained this right. But can anyone think of any way it'd be able to vary between 8 and 10 like it does? I'd like to doubt they actually told it to move "10, then 8, then this, then that"... that'd be silly. If you didn't understand a word I just wrote, please let me know so I can work on explaining it better. Link to comment Share on other sites More sharing options...
Recommended Posts