This is a response to @Digital Brilliance Hour's question posted in the following YouTube video. The video was originally meant as a visual aid to answer this question from @aL BeasTie.
Question from @Digital Brilliance Hour:
Yes, and no. Street Fighter and other games like it are using a technique called line scrolling. This relies on a hardware interrupt that occurs each time the video unit draws one line on the screen. With carefully timed (and optimized) code, you can offset the next line more or less. This technique has a wide range of uses:
OpenBOR does not and cannot use raster line interrupts because those are very specific to each hardware. Instead, OpenBOR applies a simple affine transformation in software, which is what the above tricks were faking anyway. The disadvantage is it's much more CPU taxing, but of course this is compensated by contemporary CPUs having adequate power to do it assuming optimal code. As the effect was originally intended for water, in OpenBOR it's called Watermode. You can apply Watermode to an fglayer, or as a drawmethod to sub-screens. The latter is insanely powerful if you know how to leverage it, and it's what enables OpenBOR to replicate any visual effect seen in any game to date.
Now the big problem. Remember, graphics and physics are two different things. All of the techniques above have to assume your objects are at static Z points, and therefore you can calculate their scroll rates in production. Ex. Street Fighter 2 can warp the floor all it wants, because the fighters are always in the same line scroll position. Same goes for platformers or games where everything is flying. In pseudo 3D environments like an OpenBOR Beat em 'up where objects are usually grounded and do move on the Z axis, this completely falls apart. Once the object changes Z position, its scroll rate won't match and it then appears completely disconnected from the background. There's only four ways to handle this:
Whew... hope that explains everything!
DC
Question from @Digital Brilliance Hour:
so this like a street fighter 2 floor?
Yes, and no. Street Fighter and other games like it are using a technique called line scrolling. This relies on a hardware interrupt that occurs each time the video unit draws one line on the screen. With carefully timed (and optimized) code, you can offset the next line more or less. This technique has a wide range of uses:
- Creating a HUD. Just about any game you see with a designated HUD area is using line scrolling. The HUD is technically part of the background, with line scrolling used to keep it in a static position as the game scrolls. This allowed you to make complex HUD displays without eating up your sprite budget.

- Faking layers. Ever wonder how some games appear to have far more scrolling layers than the hardware supports? This is how it's done. When you are about to draw the next "layer", you use your interrupt code to offset the next line and create a new "layer". The limitation is that the faked layers cannot overlap, so developers would carefully design the artwork to hide this as much as possible. See Sonic The Hedgehog's first level for an example. Another great one is the second level (train) of Ninja Gaiden 2. The mountains, forest, train, tracks, and grass all scroll at different rates. Notice how there's black matte between each pseudo layer. Pay particular attention to the tracks. The rail is a solid line, and just under it is a black line, then the cross-ties. That one pixel of black gives the NES hardware time to catch its breath before needing to run more interrupt code. Then the cross-ties get their own offset, and naturally they're drawn to appear shadowed out by the train to mask the lack of overlap. It all coalesces beautifully to create an illusion of multiple scrolling layers. Oh, and as above, the HUD is a "layer" too.
- 3D warping. Fourth gen hardware has enough juice to offset multiple lines one after another. With a bit of math to work out the rate and carefully designed artwork, you could simulate a belt scrolled area with affine transformation. This is what you see in Street Fighter 2. It's explained in detail by the lead developer of Toy Story in the video below:
This technique is also how the SNES achieves all of its Mode 7 effects. Mode 7 on its own only scales and rotates one background layer, but you can use raster interrupts to change the scale/rotation values by line, and that's how they could build all those plane effects.
OpenBOR does not and cannot use raster line interrupts because those are very specific to each hardware. Instead, OpenBOR applies a simple affine transformation in software, which is what the above tricks were faking anyway. The disadvantage is it's much more CPU taxing, but of course this is compensated by contemporary CPUs having adequate power to do it assuming optimal code. As the effect was originally intended for water, in OpenBOR it's called Watermode. You can apply Watermode to an fglayer, or as a drawmethod to sub-screens. The latter is insanely powerful if you know how to leverage it, and it's what enables OpenBOR to replicate any visual effect seen in any game to date.
Now the big problem. Remember, graphics and physics are two different things. All of the techniques above have to assume your objects are at static Z points, and therefore you can calculate their scroll rates in production. Ex. Street Fighter 2 can warp the floor all it wants, because the fighters are always in the same line scroll position. Same goes for platformers or games where everything is flying. In pseudo 3D environments like an OpenBOR Beat em 'up where objects are usually grounded and do move on the Z axis, this completely falls apart. Once the object changes Z position, its scroll rate won't match and it then appears completely disconnected from the background. There's only four ways to handle this:
- Hide it best as you can. Early racers designed their tracks and artwork to hide the scrolling dissonance, and for the most part did a good job.
- Design your hardware to handle it all out of the gate. This is what the Sega Super Scaler systems did, and oh man is it sweet. Power Drift from 1988 drew everything, the cars, the tracks, you name it, all using overlapped sprites in precise locations at 60FPS. The hardware to do this was (and remains) insane.
- F*** it, nobody will notice. This is what a lot of Super NES games did. The most egregious example I can think of is Batman Returns. Those trashcans give it away instantly.
- OpenBOR's Scroll property! Sort of like the Super Scaler solution, but you don't need to melt down the CPU and your sanity trying to rewrite the scrolling algorithm on every frame. Instead, you just work out some delta math to update the scroll property based on Z location, and the engine's scroll routine takes it from there. Done! You still have to do some on update calculations and planning but compared to the old days it’s brain dead simple.
Whew... hope that explains everything!
DC
Last edited: