As others have suggested try storing your X and Y scroll positions as fixed point values with 8 bits of precision and then shift them down when you copy them to the screen. Im currently writing a game where ive got up to 32 layers of parralax scrolling all moving at different speeds (using all 4 layers in mode 0 and then with additional HBLANK splits for things like the clounds, mountains etc) and they are all linked to a player object that can be moving anywhere between 0 and 16 pixels in a given frame - as long as it remains locked at 60fps tho it always looks smooth to the eye - depsite the fact that some of those layers may be moving at very strange fractions of a pixel on some frames!!
sure, if you have a layer that is only moving 1 pixel every 4 or even 8 frames it might appear slightly jerky - but in most cases this speed will be reserved for layers way off in the "distance" so the eye tends to be drawn away from them and dosnt really notice as much.. really tho there isnt any trick to it - everyone does it the same way, well, unless the hardware supports sub-pixel accuracy, but thats a whole different thing all together!
Does anyone know any tricks for smooth scrolling? I want to be able to control the speed of the background scroll without it becoming jagged. At the moment I can only get a smooth scroll if I add an integer number (pixels) to the scroll registers, but I want to be able to add the equivalent of 1.5 pixels per frame. If I add 1 (pixel) then 2 (pixels) then 1 (pixel) it goes jagged. I have seen games that smooth scroll at more variable speeds, but I can't work out how.
Does anyone know any tricks for smooth scrolling? I want to be able to control the speed of the background scroll without it becoming jagged. At the moment I...
... Store your current scroll value and delta as floating- or, even better, fixed-point numbers, then convert to integer just before sending to registers. -- ...
Are you sure about other GBA games scrolling smoothly at various speeds? I imagine they would all go a little blurry when they are doing a non-integer scroll....
Robert Murray
rmurray@...
Mar 3, 2002 1:24 am
As others have suggested try storing your X and Y scroll positions as fixed point values with 8 bits of precision and then shift them down when you copy them...
HI, I've encountered the same problem in my current project.What i do to solve the problem is to update the scrolling factor of each layer in different times....
Giuseppe Crugliano
g.crugliano@...
Mar 3, 2002 1:14 pm
Hi Everyone, Thanks for your suggestions - very helpfull. The games I was looking at seem to use a 'roving' camera, I guess this is push scrolling. I am...
I use fixed point number to store all coordinates (sprites, scrolling,...) . (0-255 is the float part of the number). It works perfectly. If you want to have a...
Christian Votava
cvotava@...
Mar 4, 2002 12:53 pm
Exactly the method I use but it still exhibits the problems the original poster didn't want. Taking 192 as a 3/4 pixel scroll you get: 0, 0, 1, 2, 3, 3, 4 You...
Francis Lillie
francis_lillie@...
Mar 4, 2002 1:33 pm
I think there isn't any problem because the refresh rate is 60hz. So, you have a lot of scrolls in 1 second. Sometime I have a 3/4 pixel scroll and it works...
Christian Votava
cvotava@...
Mar 6, 2002 2:09 am
I don't know if anyone has pointed it out, but you'll find that the problem comes from the rapidly changing time step between each integer pixel scroll. i.e. 1...
I think this is a bit of a non-problem. When writing the scroll routine you are (obviously) looking closely at the scrolling and will notice that it's a ...
I actually tried to use subpixel rendered backgrounds for scrolling in my first project (a Shadow Of The Beast clone) where I needed a very slow scrolling...
Hi, ok I read a bit more about linkscripts at http://www.gnu.org/manual/ld-2.9.1/ and http://sources.redhat.com/binutils/docs-2.10/ld.html and found out how to...