Ultra Smooth Scrolling?

Miscellaneous Forums/General Discussion/Ultra Smooth Scrolling?

Maybe its just me, but it seems that even though modern computers have hardware accelerated 3d cards, none of them seem to offer good 2D features. I'm primarily thinking of scrolling, in particular smooth parallax scrolling.

I've seen lots of BMax demos and games, plus lots of other 2D games using other engines, but none seem to exhibit the kind of ultra smooth scrolling you used to be able to get with machines like the commodore 64 or Amiga. Now I think those machines offered hardware assisted scrolling but modern graphics cards should easily be able to offer as good or even better scrolling surely?

Am I just missing something - or can someone offer up examples of modern 2D games or demos that offer silky smooth parallax scrolling?

I can offer a reason why machines like C64 and Amiga used to be so good at parallax scrolling and the likes..

They usually had to write their own tile scrolling capabilities by taking direct control of the raster bar.
The c64 even had a few registers that when manipulated could offset the normal screen by up to 8 pixels in any direction. (correct me if my facts are a bit off) ^^

Well, take a 3d engine, use a orthogonal camera and you will have ultra sweet scrolling...

oopsa his has been sent twice...truely 2d... :O)

AshMantle covered it, to scroll on an old 16bit machine you'd just tell the graphics hardware the top left of the screen had moved and then redraw the new bits at the edge.

However, using a textured quad (or sprite) you can scroll equally smoothly (smoother as machines now are faster) and it's a whole load easier to code.

2D performance now, using quad sprites, far exceeds anything that could have been produced in the 16 bit era, plus the system is more flexible now.

If you wanted to apply alpha or rescale a graphic in 2D you had to do per-pixel effects which where CPU intensive to calculate, now you can apply alpha, colour shifts, and rescales simply by adjusting the information stored in 4 points. That's a heck of a CPU saving when you think of a 16x16 sprite...

I here what you are all saying about textured quads etc but I don't necessarily agree that they give you better capabilities for scrolling - and as yet nobody has suggesed a modern game that does parallax scrolling really well?

The absense of parallax scrolling in modern games is nothing at all to do with a technical inability to do it, and quite a lot to do with publishing companies ideas of perceived end-user demand.

Shifting a UV co-ordinate of a quad you can use the exact same techniques as the 2D days to achieve parallax scrolling if you want.

Just dont expect a publisher to be interested in faked 3D effects any more...

Its not so much published games I'm asking about. With engines like Blitz and Torque2D which are specifically meant as 2D engines for independant developers- you would expect to see far more examples of smooth scrolling games if they are that easy to do. As I dont see that many I can only conclude that engines like Blitz aren't capable of producing smooth scrolling games.

Now more than ever independant games have a foothold in the market yet most 2d games released these days aren't a patch on games of yesteryear.

BlitzMax produces smooth scrolling.

Example
http://www.eiksoft.com/wsc93151839/JOJ_.30.zip

Notice the Hertz param of the Graphics command which lets you lock your game to a certain refresh rate.

WHAT?

I've not seen any examples of Blitz2D games that scroll and have difficuty with it. Here's one from my team:

http://spacecorps.bansheestudios.com/

OK it's not got the parallax you mentioned earlier, but that's just the style of the game. Parallax isn't vogue right now but that doesn't meen it's impossible to do, the command you want is positionTexture, it executes in a tiny insy winsy fraction of a milli-second.

If you really want a parallax game that badly do me some nice high quality graphics and a game design and when I get a break in my schedule i'll make it for you, I guarantee you it'll run smoother than the eye can discern, depending on your design the technique could easily run faster than the eye can discern on my rig, much faster.

Eikon. Believe me my the background in your game is NOT scrolling smoothly. It may be scrolling at a consistent speed but you can see the difference when the background is static, the apples and bricks are crystal clear but when the background scrolls both the bricks and apples are not as crystal clear. It may be scrolling at 60fps but it isn't smooth. it has nothing to do with my PC either which is a top spec pc.

Your game highlights the point I was trying to make. Those bricks in your background would have remained crystal clear when scrolling on a commodore 64.

I take it from your description (I havn't played the game) that what you want is a 1:1 pixel ratio. That is still possible too.

Becky,

Nice example - but I don't really class that as a good example of scrolling. Also you can see blurring in your game too. For example, the main space ship is crystal clear when it is static but when it is moving it is slightly blurry. Like I said at that start, scrolling (and really anything) that moves in 2D should have no blurring at all.

Maybe it's just a difference of opinion in what people class as smooth scrolling or movement.

I'm not trying to flame anyone here, I'm just trying to get across the point that 2D games on the PC don't compare to 2D games on dedicated systems like game consoles such as the old Super Nintendo - and I want to know why when PCs have far more graphical power than those old consoles.

That Space Corps game blurs the graphics because i've got mipmapping on when I rotate the sprite, i'm also not sure if it even uses 1:1 pixel ratio anyway.

There is no technical reason why a modern game cannot use 1:1 ratio (1 pixel on the texture is 1 pixel on screen), the reason they often dont is because it's easier to ignore pixel ratio.

The reason to ignore pixel ratio is that modern resolutions are mich higher, and the "bluring" is in effect anti-aliasing - which if we had in the oldschool days we *would* have used.

Like I said before, you draw the graphics to a high enough standard and do the design doc and i'll write you your 1:1 ratio game with parallax scrolling, and i'll evven turn off the anti-aliasing...

The two main problems with matching an Amiga scroller on the average PC would be

1. LCD monitors are now the norm and I have yet to see one that can scroll any image without blurring the hell out of it

2. you would need to run the monitor at 1280 horizontal to reproduce the subpixel horizontal positioning available for free on the AGA chipset

Eikon. Believe me my the background in your game is NOT scrolling smoothly. It may be scrolling at a consistent speed but you can see the difference when the background is static, the apples and bricks are crystal clear but when the background scrolls both the bricks and apples are not as crystal clear. It may be scrolling at 60fps but it isn't smooth. it has nothing to do with my PC either which is a top spec pc.
Problem is on your end, then. Make sure both D3D and OpenGL VSYNC is on in your drivers. You can also try setting Direct3D in the game options and then use the override function on the "More Help" tab of dxdiag.exe to set it at 60hz. I've tryed it on multiple machines and it has always scrolled smoothly in full screen.

If it is blurring instead of tearing, it would be your monitor as skid said.

I'm not convinced about any of these arguments because any commercial 3d game moves around the screen ultra smoothly - even on an LCD monitor. It's nothing to do with anti-aliasing, thats not the blurring I'm referring to. I guess it's just the 2d engines like torque and blitz don't do 2d graphics very well - I presume thats because opengl doesn't do 2D very well. Hell even Direct 3D doesn't have directdraw anymore

and I still maintain that something has been lost with all the progression to 3D - people have forgotten how to do quality 2D.

How I yearn for the days of hardware sprites again...

I don't think it's fair to compare with 3D games.

A scroller involves moving the camera sideways at high speed, something they don't even do in the movies because film has such a low frame rate.

I think I know what's you're getting at - the scrolling display in every Blitz2D and BMax example I've tried exhibits a slight but noticeable lack of smoothness - you can see the display jerking slightly every now and then. I assumed it was to do with refresh rates and suchlike.

Just writing a simple 2D program to move a sprite smoothly from one side of the screen to the other is tricky, unless it seems you custom match your refresh rate to the rate of your monitor - the sprite moves OK for a second, then jumps slightly, then is OK again etc...

Must be a PC thing...I don't recall ever having this problem scrolling stuff around using AMOS on the Amiga -- it was smooth as silk all the time.

Dud,

One reason was scrolling was less difficult in the old days was computers like the Atari 8 bit computer and the 16 bit 32 bit Amiga computers had dedicated hardware graphics chips to do ALL the work. The hardware scrolling on the 8-bit Atari was awesome. I used to programme 6502 on that beast, and using the Antic chip, which was programmable graphice processing unit, gave programmers direct access to the display list. This meant I could make it do exactly what I wanted and when I wanted it.

You have to remember we had a lot less colour depth back then and had colour indirection and character set tile scrolling for tiled gaves was a dodle. Each of those would be factors too.

Parallax scrolling, such as Psygnosis's 'Shadow of the Beast' where something like multiple levels of scrolling in parallax was acheieved was done through hardware control too.

Consoles can achieve the scrolling you speak about, again I would say because they have the hardware. Have you seen Super Aleste on the Super Nintendo? Fab. Sonic 2D used some parallax as I remember too.

I also think a lot has to do with the ability of the consoles to lock the frame rate of the console to the television refresh rate.

Also consoles and computers were shown mainly through RF leads on TV screens which both are a lot more forgiving than RGB monitors. I have seen crumbly MPEG 1 files look good on tv, so I've seen this phenomena first hand.

Its a combination of things, but as Becky said above, the scrolling in B2D is very good IMHO, considering we have to work on PCs!

Whatever you say, having a machine which can provide access to hardware scrolling is ALWAYs going to be better than scrolling in software.

IPete2.

Dud, I'm slightly confused. Is this not smooth paralax scrolling? :

http://www.blitzbasic.com/Community/posts.php?topic=52248
(A slight plug, sorry)

I've seen plenty of stuff like this done before and it seems
smooth. What's wrong with this? I've never seen a Commodore
64 in action, so I may have no idea what I'm missing.

I'm not convinced about any of these arguments because any commercial 3d game moves around the screen ultra smoothly - even on an LCD monitor.


I cannot say that I have noticed this blurring either. Try following Eikon's suggestions and let us know if it makes a difference.

I would also point out that in 3D games the elements on screen tend not to move from one side of the screen to the other as quickly.

I cannot think of any technical reasons for the blurring to occur.

It sounds more like your LCD screen has a response rate of 25 or higher - ie too slow.

Eikon: Thanks for a demo of Jill to play with, it runs flawlessly

LCD monitors are now the norm
I have been trying to find a new 19" CRT locally and all the stores are carrying are LCDs :c(

Dud: Eikon's demo runs smooth as can be on my clunker 500MHz/128MB RAM/32MB VRAM

the apples and bricks are crystal clear but when the background scrolls both the bricks and apples are not as crystal clear.
I know exactly what you are describing (I really do), but what you are seeing, isn't really what you think it is.

In the old days, you had fixed spec systems, your games ran full throttle, as fast as the system would allow. Even in the early PC days, people ran the games full throttle, which is why so many old DOS games are unplayable today because they go too darn fast.

Today systems are blazing fast and not fixed spec. Video cards have super fast processors on them, the processor in your computer is blazing fast, monitors have super high refresh rates. Today, when we make games, we are actually slowing the game down so it will display properly, because if the game ran at full speed, it would be impossible to play it or really even see anything.

What you are seeing is how things SHOULD look. You see a slight blur sometimes because the images are moving faster than you can process the info. To get the effect you are describing you would need to slow your game down to 15-20 FPS.

If you want the type of scrolling you are describing, you might want to check Liberty BASIC. It is the slowest Windows programming language in existence, and its sprite scrolling and movement is very close to what you are talking about. Seriously download the demo of Liberty Basic and try the sprite scrolling example that comes with it, and you will see what I mean.

ok I'm giving up on this conversation because only vorderman and iPete2 seem to know what I'm talking about. Yes all these examples posted on here offer a level of smooth scrolling with no shearing or tearing - but that's not what I was getting at. Whilst the images are scrolling they are not as clear as they are when they are static. i.e they become slightly fuzzy.

Honestly those who have seen old consoles or home computers doing scrolling would understand the difference. I really think a lot of the misunderstanding is down to what people perceive as 'smooth' scrolling.

I'm just disappointed that with all of todays hardware we cant seem to achieve the same effect as those old consoles when it comes to scrolling or hardware sprites.

Whilst the images are scrolling they are not as clear as they are when they are static. i.e they become slightly fuzzy.
I explained to you why this is.

the apples and bricks are crystal clear but when the background scrolls both the bricks and apples are not as crystal clear

I know what you mean, I've have seen this before, my old monitor suffered from this a lot, my new one on the otherhand is crystal clear and Eikons jill demo IS perfectly smooth, I'd put this down to hardware IMHO ;)

Does it sort of look like it renders 2 frames forward and one frame back? (not literally, but LOOKS like)

People seem to be finding very complex explanations for a very simple problem. Vsynced scrolling on a PC will be just as smooth as on an old style computer or console. The problem is, PC screens run at all different rates to making a vsynced game isn't really all that practical on a PC.


1. LCD monitors are now the norm and I have yet to see one that can scroll any image without blurring the hell out of it


New generation LCD's don't blur much at all. Mine's a VP191B ~(new version, not the old one with the same name) rated at 8ms, but after extensive testing shows that under all conditions, peaks at just under 15ms, which is well within 60fps worth of non blurry heaven. Wicked MPV display too...

Cost too much.

The LCD tech is getting better and faster all the time. Mine's happier at 75hz and it just goes to show you can't take technology for granted. 2ms panels are just round the corner.

The biggest problem for scrolling, I think is the different refresh rates, not the lack of custom hardware.

I will buy an LCD the day I can randomly zzap my mouse across the pad and still see stuff while playing Quake III at more than 100 fps!!! So far - nope! ;-)

@Dud: why don't you make a mock up photoshopped image of a typical scoller game scene and show us (with blur tools or something) what you mean exactly?

I've read every reply to your post here, and they've summed up every possible concievable reason you see this blur. What are you seeing that the rest of us don't?

you also need to keep the following in mind:

1) The vast majority of the Amiga games ran in 320x256 or 320x200, meaning that pixels looked a lot bigger on your screen than they do on most modern games. Bigger pixels is more 'crisp'.
You probably find that console games look better on a TV because those too are displayed at at a lower resolution than your computer does. A standard NTSC TV only has 525 x 480 pixels, and part of those are not even visible because they extend beyond the visible frame of the screen.

2) The vast majority of the Amiga games ran in 32 color mode. That by itself means that there are sharper seperations between various colors (more banding, less smoothing), and a more crisp image

3) The European Amiga's ran in 50Hz refreshrate (PAL). LEss changes per second, means more time for your eyes to discern the information on the screen, and a 'crisper' image

All of these factures promote 'crisp'ness, but don't always make things better overall.
It means less eyecandy, a lower response rate (50 FPS max instead of 60/75/85/100-whatever your refreshrate is set to), fast-moving objects look much jerkier on the amiga than one a PC covering the same distance per second since the PC will have more intermediate frames.

Now, since a PC typically doesn't support a 50Hz refresh rate, you could fake this by locking your hardware and software to 100Hz, and only drawing every other frame. Now use 320x240 resolution, and limit everything to 32 colors. Also make sure that you draw your images only to integer x- and y-coordinates, no partial or floating point positions. Also make sure to disable any hardware anti-aliasing, smoothing or blending functionality.
That should be a pretty close aproximation of how things used to look on the Amiga -- but I doubt that you'll find very many people that would consider your game to look 'good', since for the vast majority of people having true-color environments and higher framerates is preferred over non-'blurry' moving objects.

(Don't get me wrong, I loved playing games & programming on the Amiga, but I really wouldn't want to give up todays technology to go back to those days. Fitting everything you wanted into a 32-bit palette sure is a challenge.)

Dud, did you say you have an LCD monitor? If that's the case, then shush. That's why =]

Modern LCDs are getting OK again for gaming though... one with a low latency like 10ms is good for a game running at 100FPS... Lower end LCDs (at around 27ms) are only good for 37FPS.

@Dud, it certainly isn't hard to get smooth scrolling in a PC game, except for interference by background processes. Hopefully Vista is going to go a long way to improve that issue, but of course by then true 2D mode games will be completely unsupported, except through emulation layers of DX... shudder. In the game I'm working on (been through B3D, B+ and now a BMax port) I have 15+ layers of parrallax... of course this has nothing to do with scrolling, because it's just a bunch of images redrawn to the screen every frame at different offsets. Even the screen scrolling is handled exactly the same way - it's just images drawn one pixel to the right of where it was last frame. So, scrolling is not really the issue. The issue is CPU/gfx card speed, refresh rate, background tasks and (if you have one) LCD monitor latency related.

I think you can try Mappy or TileStudio, they have Blitz port to handle map loading/scrolling functions.

Modern LCDs are getting OK again for gaming though... one with a low latency like 10ms is good for a game running at 100FPS


Even then you still won't have 'perfect' results -- the latency of an LCD measures the typical time it goes from 50% grey to white to 50% grey. It takes longer to switch between more 'extreme' color values, so if you have a pixel that switches between black and white and back again, it will be slower than that.

Still, I'm very pleased with my 16ms LCD... And Viewsonis just released their new VX924 LCd screen, which has a 3ms response time:
http://www.xyzcomputing.com/index.php?option=content&task=view&id=457&Itemid=2

You also had a lot of difference on the amiga when you used another monitor instead of the 1081. If connecting a better and sharper monitor instead the graphics were looking much more sharper and so also uglier as the pixel steps in colour transitions were much more obvious.

Anyway as written before there are solutions to get a nice parallax scrolling out so what's the matter?! :O)


Greetings,

taumel

Basically *most* TFTs suck for games, I won't buy one yet, when they can run at 85fps and ALL the colours don't blur then I'll get one. See, a lot of the ms times quoted for TFTs are actually the BEST CASE under certain conditions and you'll find that other colours have twice the ms time! It's kinda like false advertising.

If you have a TFT, scolling games will blur it simple. On monitors you'll get a slight blur too, but TVs used to blur too! The PC is outputting a perfect image but the visual device is blurring it.

Also regarding scrolling, as a (only a) couple of people have said, the Amiga had a FIXED refresh rate so the scrolling could be timed to that and would be perfectly smooth with no tearing or jerks! On a PC you are not supposed to fix you game to a fixed refresh rate due to varying hardware so you have to move your game screen and sprites by a calculated floating point amount each second (or game frame which varies depending on the PC you are on). This means you get the moire effect http://en.wikipedia.org/wiki/Moire in scrolling/animation where things appear to jerk a bit. This is because they might stay on one pixel fractionally longer than another pixel.

I find it a bummer too that PCs can't all have a standard set of Hz that they will all work on and that it's safe to make games for. Although by most accounts 60Hz 800x640 should be OK, and I think you can fix it in BMax, but other people have reported problems with this. I still don't have clear information on this and may still resort to delta timing or retro64 method.

Forget LCDs altogether. I still own a Crt and I'm only
upgrading once Oleds become a bit more viable. Then
I'll have some crisp visuals.

I love the minimal blurring off my TFT. Otherwise i would need a accumulation buffer and would waste V/G-PU power! ;O)


Greetings,

taumel

In Blitz2D you can set your game for 60FPS using WaitTimer(60) or whatever the command is and then you can force the DirectX refresh rate to 60.

Then your game will perform that effortless super silky scrolling effect.

The trouble is almost all your other games will look worse.

I'm afraid it's a problem that is never going to go away with PCs never having a default refresh rate.
And yeah as Skid says new crappy monitors are making the problem even worse.

ENAY: I can do this "WaitTimer(60)" but how do you do this? "then you can force the DirectX refresh rate to 60"

My pennies worth....

Amiga hardware let you define a huge screen, twice as wide as the display area for example. So you could define a screen of say 640x256 but only display 320x256 pixels. A simple call to a Screen Offset function allowed you to reposition the screen anywhere on the X axis using hardware coordinates. This made scrolling super smooth and glitch free!

Unfortunately, you can't do that on a PC (not strictly true). What you have to do it shift everything on the display a few pixels in a certain direction to create the illusion of movement because the display is static and cannot be moved in hardware like the Amiga did it. This means more processing power needed.

So I agree with Dud on this issue. Even though these days graphics cards are really powerful and can do amazing things, I have still yet to see similar smooth scrolling on a PC that matched the quality of say Sensi Soccer or Katakis on the Amiga.

Prof, it doesn't matter how the image is created. If you move the pixels on a PC it will be exactly the same as moving the pixels on an Amiga.

The only difference (on this issue) between a PC and an old style console\computer is the lack of a standard refresh rate.

Sorry Prof you're wrong on both counts, well sort of, that's not the best way to scroll an Amiga as it would limit your playfield to the size of the image which for a lot of games wouldn't be viable, and the PC can do scrolling using the same method as we can adjust UV co-ords in the same way as adjusting the X/Y offset of the screen, so 2D scrolling techniques havn't necessarily changed except that now we have more versatility in the way we go about it.

I dont know specifically what blur effect Dud is talking about, it's been like talking to a brick wall in getting that answer. As far as I am concerned anti-aliasing and other forms of bluring are a good thing especially at modern screen resolutions, but if you want pixel perfect clunkyness it can still be done, and you can do it at modern resolutions too - but nobody wants clunky graphics because they look aweful except for Dud who thinks technology has moved backwards as a result.

I dont get it, I really dont. Sorry.

>In Blitz2D you can set your game for 60FPS using WaitTimer
>(60) or whatever the command is and then you can force the
>DirectX refresh rate to 60.
>
>Then your game will perform that effortless super silky >
>scrolling effect.

Actually it won't... Waittimer forces the game to wait for 60 milisecs and your FPS will be all over the place because the rendering takes different amounts of time depending on the complexity of the scene rendered. It may be silky smooth on a small scene, but for medium and highly complex scenes it won't.


Andy

go to DxDiag.exe in DIrectX setup and then double click, then you can force the framerate on one of the popup tabs, this gets rid of the stupid lack of standard frame rate.

> Actually it won't... Waittimer forces the game to wait for
> 60 milisecs and your FPS will be all over the place because
> the rendering takes different amounts of time depending on
> the complexity of the scene rendered.

It works fine for me Sweet Cakes.
Besides, we're talking about 2D anyway.

The mere fact that there is such a heated discussion and differing opinions on this whole issue is proof to me that scrolling on modern machines is simply not as straightforward as it used to be on 8 and 16 bit computers, whatever reasons you come up with.

There are but a few people on here who seem to understand what I mean. As for the rest I don't think we can settle this argument because it seems like we have different interpretations of what smooth scrolling is.

And no Becky I dont think technology has moved backwards - it was just an observation on my part that in this modern age of 3D graphics we have lost elements of graphical style and gameplay that existed before. Maybe in a sense you agree otherwise you wouldn't be using a 2D game programming tool like BlitzMax.

*laughing* Ahhh this one was really great... :O)

Come on Dud and be honest you have simply no idea or experience what you are talking about, right?!

Sorry can't resist... *continue laughing*

Although by most accounts 800x640 should be ok


Um... Surely you mean either 800x600 or 640x480?
I don't believe I've ever owned a videocard that could do 800x640...

xlsior: yeah it was a @#!* up. I meant 800x600 although to be honest you'd expect 60Hz on 640x480 to work on more machines.

Prof. The Iron Fist game in my sig is a 2D platform that redraws the entire screen every frame. I'd never do this on an Amiga as it would be *way* to slow and you have to use clever functions instead. On a PC, brute force means you can just redraw the lot (kinda takes the cleverness out of it, oh well) and IF you just use Flip in your game and time to that it will be 100% silky smooth. BUT I choose not to time to Flip, otherwise the game runs at the default refresh rate of the end user's graphics adapter i.e. 60Hz or 75Hz or 85Hz etc, thus it plays slower or faster on some PCs.

Dud: Yeah I don't want to be rude but you seem to be making a point but really not understanding the technical explanations given to you as taumel says. Some of use have programmed both platforms (Amiga/PC even 64/Spec) and know what we are talking about. Some of us have probably also programmed consoles, now I suspect they run at 50/60Hz (PAL/NTSC) and 2D games are timed to those, mind you almost all console games are 3D these days anyway.

ENAY: Thought so. I can't expect the user to go into DirectX and tweak settings before playing a game they've bought. If this can be done in code then it is of interest for sure.

ENAY: The blitz plus WaitTimer example is as follows:
; Create the timer to track speed 
frameTimer=CreateTimer(60) 

; Your main screen draw loop 
While Not KeyHit(1) 
WaitTimer(frameTimer) ; Pause until the timer reaches 60 
Cls 
; Draw your screen stuff 
Flip 
Wend 


If you used as is, your game loop would wait until 1/60th of a second had passed before doing the logic and draw and then flip would cause another wait (Vwait) before drawing. If the screen refresh rate wasn't 60Hz it would be messy, which is why you are setting it in Direct X I guess. Even if refresh rate is set to 60Hz, your timer may not be in sync with it, depending on when you game was run it could be out by up to 1/60th of a second, e.g. timer event occurs just after vwait or just before or anywhere in between! this could result in jerks if the logic takes too long. Unless I'm missing something about your explanation?

Maybe in a sense you agree otherwise you wouldn't be using a 2D game programming tool like BlitzMax.

I have never touched BMax, and I wont do until there's an officially supported 3D module and the user base stop finding fresh bugs. It's the other-lot around here who use BMax. They are my beta testers!

There are but a few people on here who seem to understand what I mean

And herein lies the problem, again, please show us. A diagram says a thousand words.

At the moment everything you've been said has been answered and you've just come back and said "Nope, it's still blurred". There's no answer to belligerance... Your original post is "scrolling is blurred, BMax and Torque cant handle 2D as well as my font memories of child hood." which is just wrong. The exact same techniques can be used today, only there is no need because we can do it better with modern technology.

I have never touched BMax, and I wont do until there's an officially supported 3D module and the user base stop finding fresh bugs. It's the other-lot around here who use BMax. They are my beta testers!

Ditto, with the possible exception of insisting on a 3D module. ;)

John....
Prof, it doesn't matter how the image is created. If you move the pixels on a PC it will be exactly the same as moving the pixels on an Amiga.


That is not what we are talking about. You can scroll a screen on the amiga without moving ANY pixels at all using hardware offsets. Try scrolling a screen in BlitzPlus/BlitzBasic WITHOUT having to re-draw everything.

Becky...
Sorry Prof you're wrong on both counts, well sort of, that's not the best way to scroll an Amiga as it would limit your playfield to the size of the image which for a lot of games wouldn't be viable

Rubbish! Its the best way because it is less cpu intensive and leaves more time for your sprites/collisions etc.

I should know because I designed 14 games on the Amiga and most used hardware scrolling.

[EDIT] Check out the Rom Kernal Reference Manuals if you don't believe me or any Hardware Reference Manual.

That is not what we are talking about. You can scroll a screen on the amiga without moving ANY pixels at all using hardware offsets. Try scrolling a screen in BlitzPlus/BlitzBasic WITHOUT having to re-draw everything.


I though we were talking about why its hard to get smooth scrolling looking good on a PC.

Pc games work by redrawing the screen. So what? It's actually easier to code that way. And I wrote a couple of commercial Amiga (& ST) games so I've worked with both systems.

As for just having a big image, it's only "the best way" for a very limited number of games. Most games would require a bigger playfield so you'd have to do some edge updating.

I can't believe some of the tripe I'm reading in here.

1. Hardware vs Software scrolling.
Hardware scrolling was a great benefit on the Amiga because it enabled smooth scrolling. Without it, there was no way of doing it. Hardware scrolling used quite a chunk of RAM (precious 'chip' RAM on the Amiga, of which the A500 had only 512k and could only be expanded to 1M maximum. The A1200 and other AGA chipset Amigas had, or could have, 2M of chip RAM).

Software scrolling was a great benefit on the Amiga when you needed to conserve RAM. Having the blitter (or CPU) move pixels around was obviously never going to be fast enough to make things smooth. Games like Magic Pockets and Gods used software scrolling.

Modern graphics do not have a hardware scrolling capability. Any implementation of hardware scrolling would be ridiculously redundant, an exercise in idiocy. Scrolling images in software is so fast that it may as well be considered as hardware. Even a low-end card (Geforce 5200 for example) could quite easily have 4 layers of imagery with alpha blending at 1280x1024 being pushed around at 85Hz.


2. Ways to acheive smooth scrolling.
The only way to acheive smooth scrolling like the Amiga and consoles would be to have your monitor locked to e.g. 60Hz and for your game to update the screen at 60Hz using double buffering, switching buffers during the VBL.

This is more difficult to acheive on modern PC's, not because they are incapable of keeping up a steady frame rate, more that individual users force their monitors to their preferred refresh rates (I know I do), disable VBL waits or in some other way tinker with their graphics subsystem in a way that 'breaks' the syncronicity between display updates and monitor refresh.

3. TFT vs CRT.
It is a fundamental property of modern CRT's that they have very fast response to changes in the displayed image. they are not entirely immune from movement-ghosting. This is due to phosphor persistence. My Iiyama 454 has (I think) short to medium persistence. Short-persistence is roughly equivalent to a TFT having sub 4ms response. Longer persistence (not popular, or even available, in modern CRT's) would be like having a 16ms (or slower) TFT.

That CRT's have short, medium or long persistence may seem a bit daft. However, consider that a CRT must update the image many times per second because that is the only way the image can be displayed (i.e. if it didn't redraw the display, it would be black!). Very short persistance would mean that if you displayed the image 60 times a second, the phosphor would fade very quickly and enhance the flickering nature of the display (causing a distraction and, ultimately, eye-strain). Longer persistance gives a more stable display, at the expense of more pronounced 'trails' on moving images (worst case would be a bright white object moving on a black background, test it on your monitor and you'll see what I mean).

Just recently, 3ms (grey to grey) TFT's have become available. This is almost CRT performance. Most people would probably not be able to tell the difference (apart from the obvious increased image quality of TFT over CRT!).

TFTs do not have to update their display just to make it visible. All a TFT has to do is maintain the voltage to the TFT matrix and provide a back-light. This is why TFT screens can display an incoming 60Hz signal completely steady (i.e. the screen is not redrawn and fades-to-black 60 times a second).

Smooth-scrolling is therefore perfectly attainable on a TFT (though perhaps with pronounced ghosting on anything slower than an 8ms capable display).

4. Dud's original point.
I know what you mean. You want very smooth scrolling for background imagery.

This means that you would need to be able to scroll an image at a physically slow speed but have it look nice and smooth as it moves across your monitor's display.

Two methods:-

A) A very high resolution display (1920x1200 for instance). Move your image at the same rate as your monitor refresh (60Hz usually, at a resolution that high). To scroll something from one side of the display to the other in 1 pixel jumps would take 32 seconds (1920 / 60).

Actually, at a resolution that high, if you only moved the image every other frame (and perhaps a foreground image ever frame) you would probably not notice that it was no longer quite as smooth.

B) Sub-pixel movement. If you have an 800x600 display and you want to be able to scroll something across the screen in 1600 steps, you would obviously have to move the image by half-pixel increments. There is only one way to do it, display an average of the colour of the two pixels next to each other. This is anti-aliasing.

So, you will get a slight blurring but it will give very smooth scrolling.

Your average modern 3D card can do sub pixel movement very accurately (a flat, textured 3D object far from camera, no special anti-aliasing needed, just very careful mip-mapping).

Any wish to do smooth scrolling any other way is nonsensical. You cannot go beyond the bound of your displayed resolution and you cannot scroll something by half a pixel without anti-aliasing. Nothing can defy these very physical constraints.

I think the only approximation of what you desire would be to have a high-res (1280x960) display, have a 640x480 image which is zoomed (so image 'pixels' are actually made up of 4 real pixels) then you could move things around by 1 real pixel and it would look like you are moving something at 640x480 resolution by half a pixel.

Prof, read the start of the thread when scrolling methods where already covered more accurately than your post above. Your method may be fine for something the size of a speedball arena, but for most scrolling games you just couldn't create the whole level as an image - and to say i'm talking rubbish, well, I think you need to get your testosterone levels checked.

The Amiga just didn't have enough RAM to store an entire level as an image for most games, especially where parallax was concerned and so you need more than a screens worth of data to draw a screen of graphics. Just where is all the information stored if it's an image?

Move the pointer to the screen and draw the new bit, that's how the rest of us did it in the 14 games you didn't write.

I'm pretty sure the issue is tft based, directx is easily capable of smooth scrolling...it's probably down to the way images on the c64/Amiga were softened by the tv/monitor.

The Amiga just didn't have enough RAM to store an entire level as an image for most games, especially where parallax was concerned and so you need more than a screens worth of data to draw a screen of graphics

I agree with you there Becky. What I am saying is that you could use hardware scrolling on the Amiga and use a tilemap system but you only needed to paste the new tiles on the display (not every tile on the screen). You could do this quite easy on the Amiga because of the hardware sprites being independant of the display (no background replacing) and the dual playfield system. The PC is different because there are limited hardware tricks you can use and you therefore have to do much more in software.

When the Amiga 500 came out there were some great shoot em ups with super smooth scrolling. The PC simply couldn't produce the same results even though the PC had a superior(much faster) 386/486 CPU.

Becky rose,

Actually Prof is kind of right. The smoothscrolling in ALL the games on Amiga relied on shifting the videomemoryoffset with HW, BUT you are talking about tile based big worlds right?

For that you created your buffer a little larger than the screen, so that you could blit new tiles in the area outside of the screen and then you scrolled the screen by manipulating the pointer to vidmem.

Grey Alien, you live in the UK i see, drove over to my house and I'll demonstrate :)

Becky: you remember that thread a while ago where I described my cool Amiga scrolling routine. That used an area 2 to 4 times as big as the screen, and only drew one row/column of tiles and manipulated the screen pointer, this is what Prof is describing I think. He is right in that early PCs couldn't keep up, I know this from coding in C++ for DOS and trying to make a scroller, but of course modern ones can just totaly redraw with minimal overhead.

ENAY: Problem is you are quite far away as I live in Dorset, land of the Combine Harvester! How about posting an example and I'll test it on my PC :-)

I really wish that nVidia & ATI got their heads together and incorporated a hardware sprite engine in their GFX cards. Just imagine what you could do with it with today's modern AMD/Intel CPU's.

Why on earth do we need outdated stuff like that?

[Why on earth do we need outdated stuff like that?]

>AAArrrrgggggggg !!! o_O

Explain?

No Grey/Bouncer.

Prof was right to a point, we where both talking about moving the HW pointer, the difference is Prof is saying i'm wrong about scrolling on the Amiga, and also that you cannot do the same on a PC - when you can - and he's saying the only way to do it is with a big image and that other methods are, and I quote, "rubbish".

You can do both the big image in the view window thing, and you can do dynamic scrolling (with tiles or image blocks) on both the Amiga and the PC. The only difference is now you have four co-ords to adjust instead of 1 - which gives you loads more power for some funky special effects.

I used Prof's method in some of my games, it's fine for small maps. I also used the other method I and others previously described at the start of the thread, which was fine for big stuff and great for parallax layers that where not constant (ie: had some variety in them). It certainly wasn't rubbish, and it wasn't Prof's most endeering moment when he said I was talking rubbish and he knew better - when frankly, he's not listening to a word i've said.

Why on earth do we need outdated stuff like that?


I can think of a few reasons....

1) Windows On Screen Displays
2) Windows GUI enhancements so that windows works like a hardware OS (fast like Workbench) - I know they are doing it with Vista.
3) Faster 2D apps & faster 2D games
4) 3D games will be faster too! Imagine a HUD made out of hardware sprites.
5) Probably some more....

and he's saying the only way to do it is with a big image and that other methods are, and I quote, "rubbish".


Becky, you know what I meant. You are just twisting things now to your advantage.

Yeah, chuck in the ability to be able to specify a rock steady standard refresh rate for 2D games and we're well away!

GFX cards paste sprites from one area of video ram to another using on-board processing - I call that hardware sprites.

GFX cards paste sprites from one area of video ram to another using on-board processing - I call that hardware sprites

When I say hardware sprites, I am talking about dedicated hardware to deal with them that is independant of the display. The result is that no background replacing is needed at all meaning they are extremely fast.

Yeah, and please also make them limited to 16 pixel width blocks and only 16 colours... :)

In a 2D game i'm not sure it's possible to encounter speed issues using quad-sprites unless you've got a particle system suffering from so much over-use you barely get to see the background, so i'm not sure there is really a need for a dedicated 2D sprite layer anymore as brute force has long since superceded it.

If you did want to ditch quad-sprites completely for a project there are enhancements that could be made to the 2D handling we have now sure, I agree, but why not just use quad-sprites and make use of all that processing power?

Prof/Becky: You may be arguing the same point now...

1) Amiga, not possible to draw entire screen as it's too slow, even using tiles, as blitting all thoses pixels is too much to do each frame. PC, possible of course due to speed of CPU/Graphics card.
2) Amiga can make big screen in memory (not too big) and scroll around by moving screen pointer (1 pixel minimum movement), but game will be limited to that area. PC can actually do the same (at least you could in C++/ASM for DOS but not by pixels only by words (16 bits) so you needed extra techniques), you don't seem to be able to in Blitz as you only have the Flip command. Maybe someone else knows more ...
3) Amiga can make big screen AND use special tiling on edges ONLY technique to give impression of UNLIMITED size game area. This is still very fast and gives lovely smooth scrolling. PC could too in DOS (with limitation mentioned above) but nowadays it just isn't worth the hassle to code like this when the whole screen can be redrawn.
4) Using Amiga hardware scrolling (well, adjusting the screen pointer and using the copper) is JUST AS GOOD, NO BETTER, than redrawing the whole screen on the PC every frame imho. With the exception that if you don't sync the PC to the refresh rate, the scrolling will be jerky, but if you do sync, then it'll be lovely.
5) The other important point is that you should move by a whole pixel at a time to appear smooth or half a pixel. If you move by say 0.4 of a pixel you end up with jittery scrolling due to 0=0, 0.4 being rounded down, 0.8 being rounded up, 1.2 being rounded down, 1.6 up, 2.0 same, 2.4 down etc. This yields 0,0, 1, 1, 2, 2, 2 (note the three 2s, this introduces a jitter.) Worse still I have discovered that Blitz Plus uses banker's rounding with the Round command and also if you pass a float to DrawImage it uses it then as well! (This means the 0.5 sometimes gets rounded up and sometimes down depending on if the integer part is odd or even respectively). So even if you move things by 0.5 in your game you will get 0=0, 0.5=0, 1=1, 1.5=2, 2=2, 2.5=2, 3=3, 3.5=4, 4=4 etc which yields 0,0,1,2,2,2,3,4. Can you see the jitter now? Hope this make's sense. As a result of discovering this I have made my own round function (with some help) and apply to to all float coords within the DrawImage command! It works beautifully, you can see the difference on-screen. Actually it occurs that the same issue may affect blitz max and Blitz 3D, look into it, you might be surprised!

I agree with you on all point Grey except:

texturePosition backgroundImage,horizontalScroll,verticalScroll
and/or
verttexTexCoords backgroundSurface,0,horizontalScroll,verticalScroll
...

Both do the same thing as HW pointer scrolling, i'm moving a pointer to where the image is drawn. Yes technically speaking the image will be replaced in video memory but this is a background architecture task of sufficient gusto on modern cards that it's done faster than waiting on the vertical blank on an Amiga. In a programming sence it's the exact same thing but with online help.

*gets tired of repeating herself and goes to bed*

Jepp like vinylpusher says, the best way is double buffering,
or use triple if that makes you feel better :o)

[Yeah, chuck in the ability to be able to specify a rock steady standard refresh rate for 2D games and we're well away!]
>it existes : 60hz is the standard safe mode !

>For 5) >that's true. Just do DrawImage,ceil#(x),ceil#(y)

@Grey Alien: interesting points, thanks for summing them up here.. I started on a platformer in blitz2D a few years ago, but gave up when I never could quite make that jerkiness go away.

Becky: Cool gald you *almost* agree ;-) Those commands are Blitz 3D which I don't have, so there's no way to move the screen pointer in Blitz Plus. What about Max? Also as you've said, those commands "Do" the same thing as HW pointer scrolling but I say they *are not* the actual same thing technically speaking, even though the end result is the same.

Reno: Problem is I can't set 60Hz in Blitz Plus plus I heard there was some problems with setting it in Blitz Max, didn't you experience any probs with your platform game? Also, yeah thanks, Ceil does work on the coords but it's not very precise if 1.01 gets rounded up to 2! So I prefer to use
Function ccRound(flot#)
	Return Floor(flot+0.5)
End Function
which Beaker suggested.

AshMantle: You are welcome.

Becky: Bed for me too ;-)

Grey Alien
>Yes, none of the Blitz products can force the 60hz mode... bha, you know what I think about that >:|

Ceil#() or Floor#(), there are no problems, as you applie them just for the drawing ( and not for the maths ) ! 'Brium' was my last game with BlitzBasic2D ( I'm going to switch to Plus and something else ), the only problem is that I can't let the user force the 60hz mode...

BPlus is good, but as you've identified, you can't set 60Hz and you can't tell the user to go into Display Properties in Windows and change it either just for your game.

Don't worry I'd never use Ceil or Floor on the maths, I only round for the drawing. What I'm saying is if you man is at position 33.1, using Ceil will put him at 32 which may be 1 pixel inside a wall or whatever so I prefer to use my rounding method. Rather than calling that function it can be inlined for speed instead such as DrawImage(whatever, Floor(x#+0.5), Floor(y#+0.5) and as DrawImage should really be part of a function that draws all your sprites, you should only need to type it once!

Right, I've stayed up late to do this, so I hope some of you appreciate it!

I've just modified a WIP shoot 'em up of mine (don't expect much in terms of gameplay yet!) to show the principles of scrolling and rounding that I've been discussing. Download it here.

http://www.jbcomputersolutions.com/orion/orion.shtml

1) When you run the game, press D. This will bring up the debug stats and show your FPS (which is what your graphics adapter is set to in windows).

2) Look at the scrolling stars and notice they re pretty smooth but not perfect (they also have a *slight* vertical blur on my CRT monitor)

3) Move the ship from side to side, it has a slightly jerky motion but believe me this is the best that is possible without syncing to refresh. It also has a blur caused by the monitor not any clever anti-alias code or any "natural" effect of the video card.

4) Now press N (for syNc) This will change the game timing to be in sync with the refresh rate. It slows down a bit, ignore that, but notice how the stars scroll PERFECTLY smoothly and how the ship moves PERFECTLY too (it also has a slight blur). Problem is you CANNOT release a pro game that has this type of syncing as on my PC it plays at 85Hz, what does yours play at 100Hz or 60Hz etc?

5) Now finally press O (for rOunding). This will switch off my special rounding technique. Notice how the stars jerk horribly. The ship is OK as it moves >1 pixel per frame but I tested it slower (<1 pixel per frame) and it's horrid too. This type of rounding anomaly is DEFAULT in Blitz Plus and I'm willing to bet that nearly all of you are using it unknowingly! Try my new technique and be amazed ;-) Really I should have kept it secret so that my games just looked that little bit smoother, but it's not really in the spirit of the community is it?

Enjoy, and hopefully learn something useful.

P.S. Why doesn't someone test that rounding thing in Blitz Max and B3D to see if scrolling a texture results in jerks or not. It could really improve some games! In fact it's not just textures but entities as well. It may be less noticable in 3D but the effect could still be there depending on how the numbers are rounded.

Don't forget that a lot of people has the Vsync disable forced by the video card divers !

Exactly why you can't depend on it! Having said that, it's off on my Catalyst drivers BUT VWait blatantly works in my game! I think maybe it only affects 3D games. Anyone know more about this?

Grrrr...

So for Orion : what can we say after saying the standard timming and the Vsync timming... one is horrible, the other is perfect...

Prof: Ah I see where you're coming from now.

Grey: Some interesting stuff about the rounding. I had some similar jerkiness in my B+ scroller.

Prof: yeah independant sprites could be great for 2D games and windows.

Nomen: Got a link to yor scroller?

Exactly why you can't depend on it! Having said that, it's off on my Catalyst drivers BUT VWait blatantly works in my game! I think maybe it only affects 3D games. Anyone know more about this?


From the blitz3D docs:

VWait
Note that this command is different to the vertical blank waiting mechanism in Flip because Flip will cause the graphics card (as opposed to the CPU) to wait for the next vertical blank. The vertical blank can be disabled on some graphics cards, hence it is quite common to use "VWait : Flip False" to ensure consistent updates on all setups.


Strangely, "VWait : Flip False" used to work like a charm on my machine, but now I get tearing!? I have no idea even how this is possible since I'm using VWait. :/

Grey: No link - I don't even know if I have the code any more. Ditched all my old stuff when I moved to Max.

shame.

Big10p: I have found that although Vwait: FlipFalse is supposed to be better it causes more graphics glitches than plain Vwait. Also that line from the docs is exactly the same as the Blitz Plus one for VWait. As I said, my Vwait is turned off on my video card yet Flip and Vwait:Flip False both work perfectly neither zooms ahead at full speed.

[Edit] OK I take it back, my ATI was set to "Off, unless App Specifies". When I changed it to "always off" my game sped up when using plain Flip and was fine with VWait:FlipFalse.

it would be so much easier if everyone's pc was the same spec. :)


it would be so much easier if everyone's pc was the same spec. :)


LOL - it would make things a lot easier. Ok lets stop buying new graphics cards and processors (I have anyway).

Why would we need hardware sprites on a modern gfx card? Utter insanity. A geforce mx 440 can chuck graphics around the screen like no tomorrow. If you get slowdown, well hell, you're obviously doing a lot of stuff in the background! Besides, dropping frames is hardly the worst thing that could happen. Mind you, we are in 2005 now, in-game graphics should dynamically adapt to drop to a lower detail level in order to maintain consistent framerate.

This is not exactly a new concept guys (and gals).

as demonstrated by the Havok engine using the GPU's to handle more of the physics.

Today's GPU's can handle alot, although since the PC is still considered a working machine and not a play machine by most people, we probably have to do with what we got.

I don't much care for the 3D "revolution" that everyone else is screaming about. I was perfectly happy with my c64 games in the days, and I just want to get back to "the roots" of fun gameplay.

Ratchet & Clank felt good, but with the new fourth installment, it too is ruined by focusing too much on multiplayer.. I couldn't care less about multiplayer, I just want my new R&C shot!

anyway, enough rambling.

Dropping frames is unacceptable in 2d games.

"Dropping frames is unacceptable in 2d games."
Yes sir!

Ash R&C was a great game and they got even better, no. 3 was cool, haven't played 4? My son loves it, he's really good at it and he's only 4.

1) The vast majority of the Amiga games ran in 320x256 or 320x200, meaning that pixels looked a lot bigger on your screen than they do on most modern games. Bigger pixels is more 'crisp'.
You probably find that console games look better on a TV because those too are displayed at at a lower resolution than your computer does. A standard NTSC TV only has 525 x 480 pixels, and part of those are not even visible because they extend beyond the visible frame of the screen.

2) The vast majority of the Amiga games ran in 32 color mode. That by itself means that there are sharper seperations between various colors (more banding, less smoothing), and a more crisp image

3) The European Amiga's ran in 50Hz refreshrate (PAL). LEss changes per second, means more time for your eyes to discern the information on the screen, and a 'crisper' image

This makes me curious if Dud would think that my Pitfall II remake running at 320x200/30 fps would be smooth or not?

Wolron. What a plug. Your game is flip screen, it doesn't scroll as far as I remember, or does it? (I played it a while ago).

I had 3,029 angels dancing on the head of a pin here.

Of course you may have a slightly different sized pin where you are. And owing to geo-racial inbreeding, your angels may have smaller/larger feet (on average)... so you might get slightly different results from me. Also, cultural differences in dance styles can effect the statistics somewhat...


... Smooth scrolling isn't a matter of life and death... It's far more serious than that !

100th post, and this thread have lost its usefullness since about 50 posts ago ^^

Summary for everyone else, blitz community tried to help, got kicked in the nuts :)

write a email to Nvidia & ATI to give us
Hardwarescrolling and Hardwaresprites as Amiga or Atari

;)

ah and Displaylist's (atari) also

and a SID !!!

mfg panno

I think Creative should include a SID "emulation" mode for their powerful soundcards.. A chip that instantly converts new high-fidelity sounds into crisp SID sound :D

AshMantle: Yes, but it would be at 192KHz 24 bit 10295473:1 SNR

Actually, that was me exaggerating in an attempt to show (in a sarcastic way) that Creative love their marketing guff.

If they thought they could make a buck, they'd include hardware SID emulation.

Their hardware is so multivariously (disclaimer: not a real word) programmable that it wouldn't surprise me if someone did hack SID emulation for it.


This post is horribly off topic but I feel no shame. 90% of the posts in this thread are either off topic, dead-headed or just plain wrong.

So's your mother.

Wolron. What a plug. Your game is flip screen, it doesn't scroll as far as I remember, or does it? (I played it a while ago).
To be honest, yes, it was a bit of a plug, but it actually fit the scenario they were discussing in the text I quoted. It's a low resolution, low frequency game WITH scrolling. It doesn't scroll horizontally (as you pointed out), but it DOES scroll vertically. I truly was curious if xlsiors comments described what Dud was experiencing, because I thought he had a valid point.

I understand. Now I remember the vertical scrolling. Dud seems to have stopped posting anyway!

Well I never expected this thread to go on for so long :)

haha, I spoke to soon!