Slowing down my program on fast PCs (hee hee.. me again)

Kamochan
03-20-2002, 12:55 AM
I am programming my game on an AMD K6-2/400 without a graphics accelerator. "Why?" you ask? Well, I figure if I make sure my programs work on a comparably slow machine then it should work perfectly on a faster one... especially those with graphics acceleration.

My only problem is my theory works a little too well. If I try my program out on an Athlon 700 w/ accelerator (and we all know this is nowhere NEAR top-of-the-line) my program runs way too fast. Is there a prefered method of slowing down rather than inputting 'Gettickcount()' statements everywhere?

Pookie
03-20-2002, 01:50 AM
You only need to use the gettickcount once at the end of the main loop, not all over the code. :)

You can use a timer instead of a loop if you want the loop to run at set intervals, though some says timers ain't that accurate.

Kamochan
03-20-2002, 03:22 AM
I must be confused on how to use GetTickCount then. They way I've been using it is as follows:

1. Call GetTickcount before any calculations/screen updates are done and store this value in a variable.

2. When I want to refresh the screen, I use GetTickCount again and compare with the original GetTickCount. If a certain interval hasn't passed (say the difference is less than 1000 for example) then I have the program hang in a dummy loop that constantly calls GetTickCount until the desired difference is reached.

3. When the difference is what I want, I allow the program to continue.

Is there better way to use this?

Pookie
03-20-2002, 03:46 AM
Alot of people do it the same way as you said.
Make sure you have doevents in there otherwise the system might not respond too well to events...

Are you saying you use these gettickcount loops and it's still runs too fast on faster computers or when you jjust don't use these loops?

chrgibson
03-26-2002, 03:50 AM
Hi, i know the problem you talking about and i suggest you take a look at Luckys site (http://rookscape.com/vbgaming/tutorials.php)

You need to check the Time-based modelling tutorial. Im using it and my sprites/models move at the perfect speed on all machines.

My machines a AMD1.2ghz with 512mb. I was getting over 270fps at one point, imagine if i slowed it down just for my machine. God help the little fellas!

Hope that helps

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum