Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Internal Game Timer
#11
You see what I'm asking is that I have ratio counters to determine which do loop does what. Like every 3 LOOPs it updates the background.

But instead of doing counter vars like that I want to know if I can do a TIMER thing that will still be ratios but instead of checking what Do loop your on deterimins what does what, make it check the TIMER statment to do that.

You see now?
i]"But...it was so beautifully done"[/i]
Reply
#12
I don't see why you need a 0.1 millisecond-accurate timer... 1 / 0.1x10^-3 = 0.1x10^3 = 10^4 fps. That's 10000 frames per second, which you will never render.

Under Windows, your best bet is to use the GetTickCount() function in the Win32API. Or you can use SDL_GetTicks() with SDL. This is a millisecond-timer and, as far as I know, has an inaccuracy of approximately +/- 5 milliseconds.

For a microsecond timer (1x10^-6), you will need to use the high-performance timer, which is unavailable on some systems... look up the QueryPerformanceCounter Win32 API function for more information on this (although you need to store the value in a 64-bit integer).

You really shouldn't need 10000 fps ever... 100fps is more than enough, which means your game has a frame period of 10 milliseconds.

-shiftLynx
img]http://www.cdsoft.co.uk/misc/shiftlynx.png[/img]
Reply
#13
No. I don't need 1000fps.

These are not variables for frames, but for counters for when stuff happens.

Never mind.
i]"But...it was so beautifully done"[/i]
Reply
#14
I know what you're talking about. Only problem is that I haven't tried it myself to give you any advice on it.

Instead of making something happen at a particular frame time, you want to do something at a particular TIME time.

Like being able to get an accuracy on the TIMER using .00001

.00001
.00002
.00003
.00004

being able to track that kind of number and having something happen in your program at say .00003

Am I with you on this?
I'm your Huckleberry; that's just my game."

Doc Holiday, TOMBSTONE
Reply
#15
Your right on.
i]"But...it was so beautifully done"[/i]
Reply
#16
I did try doing that once when I used just the TIMER for .01

I should try this out too, since I was wondering how to do this myself once; but to no avail.

I tried some math or some type of conversion to get a value from the decimel point and on instead of 84261.64 which is always what I ended up with in the end.

But if I was to try something, I would try subtracting 84261.64 with the other TIMER .

89381.53
-89381.52
= .01

If someone could figure out how to return a value in the .0001 state using something to that effect, then we would be getting somewhere with this.
I'm your Huckleberry; that's just my game."

Doc Holiday, TOMBSTONE
Reply
#17
You can't get something that thats not there is Math....
If the computer doesn't keep track of time in between then we are out of luck.

However there is probally a way to do this...Mabey not in the decimal system but Binary or Hexidecimal or even Oct, if you convert it.

They don't have to be numbers but variables. Unfortunately I'm no mathematician, so this is as far as I'll be able to go on my own...
i]"But...it was so beautifully done"[/i]
Reply
#18
http://www.network54.com/Forum/message?f...1074664292seems to indicate the max accuracy is 0.054 seconds in QBasic.

Mac
Reply
#19
Hmm I'll have to experiment with that....Thanks Mac.
i]"But...it was so beautifully done"[/i]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)