forums

TNT Basic Forums > Feedback
Refresh rate to low
< Last Thread     Next Thread >
Author
Thread        Post A Reply

10-13-2002 14:02

Posted by:
Yoc

Click Here to Email Yoc   Find more posts by Yoc

Would it be possible to adjust the refresh rate at a more higher speed ? It seems to be 60Hz even in 1024x768 mode. It hurts my eyes when I play Owari :)

I don't know how hard it would be because not all screen/video card can support high refresh rate.

10-13-2002 18:01

Posted by:
Mark Tully

Find more posts by Mark Tully

Refresh rate

TNT Basic doesn't limit the refresh rate in any way. As you know, the 'set framerate' command can be used to change the framerate to be whatever you want.

On Mac OS X, the system automatically limits the framerate to be no more than the refresh rate of the monitor, so you can't use the 'set framerate max' and 'vbl sync off' commands to run at insane speeds which are faster than the monitor like you can on OS 9.

On LCD screens which don't have an official refresh rate, the system automatically limits them to 60Hz (from what I can see anyway), so if you're on a LCD screen you may be seeing this. Alternately, Owari could be set to run at 60 frames per second or your monitor might not be able to refresh any quicker!

In cases where there are multiple refresh rates available for a given resolution, TNT Basic tends to pick the fastest one. If you want to know what rates are available to TNT Basic, try looking in the Owari.log file in the "Consoles" folder inside your user's "Preferences" folder (which is in your user's "Library" on OS X and "System Folder" on OS 9). This lists the resolutions TNT Basic has to choose from and what it went for.

Thanks,

Mark

10-16-2002 07:43

Posted by:
Yoc

Click Here to Email Yoc   Find more posts by Yoc

In fact I don't understand if thos framerate are fps framerates or monitor framerates. Here what I've got on OS 9 :
Graphics context request for 800x600
Available contexts are:
0: 640 x 480 @ 153.64Hz safe, unstretched
1: 800 x 600 @ 124.84Hz safe, unstretched
2: 832 x 624 @ 119.33Hz safe, unstretched
3: 1024 x 768 @ 98.140Hz safe, unstretched
4: 1056 x 792 @ 96.51Hz safe, unstretched
5: 1280 x 1024 @ 75.0Hz safe, unstretched
6: 1600 x 1200 @ 64.10Hz safe, unstretched
Choosing 1

I don't think the monitor can handle 124.84 Hz.
But in other way, the framerate of the game doesn't seems to be 124.84 fps.
I'm sure I'm missing something...

10-17-2002 20:13

Posted by:
Mark Tully

Find more posts by Mark Tully

Refresh rates

From that I can see that your display runs at 124.84Hz at 800x600, which means it redraws the image on the display 124.84 times a second, about once every 1/120th of a second.

This refresh rate is a separate rate from the rate that a TNT Basic game outputs its graphics. When you issue a draw frame statement, TNT Basic draws all its graphics into the Mac's video memory and it will stay there until it is time for the display to refresh. So once a frame has been drawn by TNT Basic, it has a maximum of 1/120th of a second to wait in the Macs video ram before the change is reflected on the screen.

Now if TNT Basic is putting out graphics at, for example, 60 frames a second, that is constant no matter what the refresh rate of the display is, because all TNT Basic is doing is writing the image to the mac's video memory 60 times a second, it doesn't care how quick changes from video memory get to the screen, that's the displays problem.

Well almost, this is where a little issue called the vertical blank (VBL) comes in. Your normal CRT display (ie a non-LCD mac display), works by refreshing the display from the macs video ram many times a second. The number of times it redraws it per frame is controlled by the refresh rate.

The display draws the image from the top left, to the bottom right, by drawing a row at a time, from left to right, then down onto the next row and left to right again. When the refresh is finished, the display pauses for a short time until it is time to refresh again, and then it redoes it all over again. And again... and again...

An interesting effect happens if TNT Basic outputs a new frame into the macs video memory while the display is halfway through its refresh, because suddenly what the display is drawing changes, but it will only change from whatever point the display was upto, it won't go back to make corrections, it just leaves it until the next refresh. What this means is that if TNT Basic outputs a frame while the display is refreshing, you can get a short period of time where the display the user sees on the monitor is split in half, where the top half is the last frame, and the bottom half is the new frame. (Of course, it needn't be half, it would depend on where the display was upto when the new frame was produced). This effect is called tearing, as it looks like the display is being ripped in half.

If this happened once, you'd probably never see it, but if TNT Basic were to continuously output new frames while the display was refreshing the image would always looked torn and the game would look very bad indeed. So the trick is to only get TNT Basic to output a new frame when the display is not refreshing, this can be done in the short pause that the display makes while waiting for the next time to refresh after it has finished drawing. This pause is called the 'vertical blank', the vbl.

On Mac OS 9, TNT Basic allowed you to turn vbl syncing on/off as you chose. If you ran your game at 60 frames per second with vbl sync on, you'd never see tearing effects, but your frame rate would fluxuote slightly as each time TNT Basic went to output a new frame, it would have to make sure the display wasn't refreshing, and if it was, it would wait for it to finish. This meant each frame would be delayed by between 0 seconds and the time it took the screen to refresh completely.
If you turned vbl syncing off, you'd become vulnerable to tearing graphics but you would be allowed to produce frames much faster than the display could handle them, basically meaning your game would run incredibly fast, but the user wouldn't get to see it all, because they can only get a new image as many times a second as their display is willing to redraw it.

When Mac OS X came along, it decided that having one program draw more frames than the user could actually see was a bit pointless and was squandering CPU time better given to other processes, and so it enforced vbl syncing. On Mac OS X, TNT Basic is not allowed to produce frames faster than the monitors refresh rate.

So in summary, the frame rate from TNT Basic is generally independent of the refresh rate of the display, except when VBL syncing is on or Mac OS X is being used, in which case TNT Basic's framerate cannot exceed the refresh rate of the monitor.

So if Owari isn't going fast enough for you and you know the refresh rate of your display is fast enough, it means that Owari isn't producing new frames quick enough, ie it's 'set framerate' command must have it limited to 60.

Hope this helps,

Mark

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.