Old stuff here :) !!! DX8.1 terrain generation acts silly

Started by
2 comments, last by republicall 15 years, 4 months ago
I am generating a terrain football field of size 100x200 at average 60 FPS(based on andre le blank tutorials). Now i multiply my rendering with 4 that is 400x800 and i still get an average 60 but sometimes FPS drops by to 30 and after a short while ups to 60 again(and this is happening all the time, not just at the begining). Now i multiply my rendering with 8 that is 800x1600 and the same situation. Now comes the strange part when multiplying with 16 that is 1600x3200. Call me crazy but everithing works just fine without dropping(only that at 40 FPS). So what is going up at 4 and 8 ? Is because i use a FPS limiter? I use this to limit it. DWORD end_time = GetTickCount(); if( (end_time-start_time) < gameSpeed ) Sleep( gameSpeed - (end_time-start_time) ); Anyway i limited at 40 FPS and now 4 and 8 works ok(better to say). I guess this is it just the maximum that my game can really render, although the average is 60 ???
Planet Yupeee 2009$100 maniac.planetyupeee.com
Advertisement
First of all, it's not a good idea to limit FPS arbitrarily, because there's be interplay with the monitor's display rate. Most monitors these days run at 60Hz, which makes your limit okay, but that won't always be the case. Your game will be limited to the monitor's refersh rate anyway (unless you set it to ignore vertical sync), and IMO it's a good idea to use that.

In fact, I'd guess the interplay between your limiter and the monitor's refresh rate is affecting the result. The 30-60Hz result is reasonable, though, with a fixed refresh rate. You can get 30 FPS if your frame is even a little over 1/60 of a second (since you'll have to wait for the next refresh).

I'd suggest turning your limiter off, and seeing what you get. For a little more research, turn vertical sync off, and see what you get with only your limiter.
I concur with Eyal - this sort of performance characteristic is very typical of a 'frame limiter' approach and is one of the primary reasons why you should never ever use them [smile]

Do as Eyal suggests and ideally replace it with time-based modelling and you'll be sorted!


hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

In my next release i will do so but till then i want to release it as soon as possible as i want to have some results before i turn 30. :)) .
I use frame limiter because the game is some kind of a football soccer at high speeds in a continuous play stile so a constant FPS is more that necessary. But for some reason it just work harder in some moments, and in others not.This is what hurts me. Is like the buffer is full and a internal management tryes its best, but i would deactivate that efficency if possible. In an First Person Shooter it would be kind of ok, but not here. It messes up my game play.

Later Edit:

It seems that you were right. By just removing the frame limiter the movement was smooth and actually went up to 63 FPS.
My guess is the Sleep() function is killing the frame rate.

<<<You can get 30 FPS if your frame is even a little over 1/60 of a second (since you'll have to wait for the next refresh).>>>
But this is actually what i would bat my money for, but i don't understand how it reflects in my code. I gues by just removing the frame limite it just does its job.

Planet Yupeee 2009$100 maniac.planetyupeee.com

This topic is closed to new replies.

Advertisement