After messing around in MMF2 for a while i decided to open a game and try to make it run better.
I discovered that matching the frames per second to your refresh rate gets you almost perfect scrolling (although that isn't exactly a discovery is it?)
And adding vsync to that gets you perfectly smooth scrolling with no 'tearing' where part of the screen is not matched up when the screen has refreshed.
I thought 'brillant ive wanted this for ages!' however.
My pc's refresh rate is 85, and i had to change my games framerate to 85 to get that smoothness.
Now as you all may know, not everyone refresh rate is 85, So i looked in the current list ofd extensions for a way to force the refresh rate to match the game so everyone can enjoy pixel perfect scrolling. However there isn't one!
so if someone was thinking of making a video releate extension (and if it's possible) could you please consider making one. Thank you.
.
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
19th October, 2006 at 23:37:00 -
Huh... I think there was an extension to get framerate in MMF1.5, dunno about MMF2.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
I doubt that there will be such an extension. Because when somebody usess 75 Hz, and another player uses 100 Hz, the one with 100 Hz will have the game run 1/4 faster than the one with 75 Hz. Animation speed is connected to Mainloop. Make the Mainloop faster, and the game runs faster ...
I think you'd be better off with an extension that could say 'the screen is running at 75fps'.
You change MMF2's frame rate to that FPS so they match, and THEN you use a custom movement with decimal values.
You work out that if you designed the game in 50fps, and it now runs at 75fps, the 'step' in your movements must simply be adjusted. Perhaps the player normally moves 0.5px per event loop?
Let's try some maths (someone correct me if this is wrong, hopefully you can see what we're trying to do here):
50fps / 75fps = 0.666667
So this will be our adjusting ratio.
0.5px * 0.666667 = 0.333333px as our new step value.
Or simply put as an equation:
Step * Design Framerate / Actual Framerate = New Step
So now, instead of moving 0.5px per loop, he moves 0.333333px per loop. Effectively, he's moving in slow motion, but the display is refreshing faster, so they appear to be the same speed as before, just smoother.
EDIT: Yup, that works. Just made a little example (not uploaded yet) which keeps objects moving at the same speed no matter what the frame rate (they'll cross the screen in the same time at 30fps as at 80fps)
The problem with changing the framerate on MMF2 games at runtime, unless to adjest for performance, is the fact that unlike in 3D games, framerate speeds the game up. It increases the number of loops produced in 1 second, and this is easyly 'purged' if you play the game on a computer that doesn't play the game as smoothly. If this was all automaticly set to the monitor refresh rate, then someone with 60hertz will play the game 'slower' then someone with 85hertz.
The framerate will match and the game will play very smoothly, yes... that's all fine and well. The entire game will slow down too though.
Or am I just misreading yours? If so, I'm very sorry
If you simply divide the framerate you designed it in by the actual framerate, you get an adjusting ratio that you can multiply into any distance that you want your objects to move.
I ran a test, and it works surprisingly well. You get objects travelling the same distance-per-second no matter what framerate you go into.
The only real problem I found is when the machine can't handle the framerate you selected. The formula thinks you must be running at 100fps, for example, and adjusts accordingly by slowing all the movements down per frame. In fact, your machine can only push so high as 60, and the objects are crawling.
To solve that, you'd need to make your app monitor the framerate and make sure it was matching closely to the framerate selected. If not, it would reduce the rate.
I will just say you need to be careful when changing refresh rates, alot of TFTs for example wont go over 60hz in their native resolution, just a heads up.. and CRTs flicker horribly at 60hz
hi
if you set the framerate of your screen to 60 and your game at 60 too the screen is perfectly smooth. 100 is too much ^^
if your game has dark coulours you can set the screen at 60fps it will not do a lot a flickering; but it's more obstructing if there is bright coulours...
i am the author of the big box, it can change the display frequency but if you use this function you MUST NOT use the display options in mmf ! (like "change resolution mode" ...) because they use the same display routine (gdi).