Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Is there a DB/ DB Pro command that will get the PROCESSOR SPEED of the user's computer?

Author
Message
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 14th Jul 2004 14:46
Hello,
okay well im not exactly a n00b but i didnt know where else to put this. But anywayz, I've found that with the game im writing, the program is reacting differently on computers with varying processor speeds. So, if at the beginning of the program i can automatically "check" the processor speed, i can create a variable for the player speeds and the like.

Thanks!!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Jul 2004 15:11 Edited at: 14th Jul 2004 15:17
I don't think DBP has a native command for that but there is a plugin that will do it. Though its name and who made it eludes me at the moment. While it is true that programs run differently on machines with different processor speeds ... that is not the only thing that will affect how it runs. It is probably best to check how long it takes to complete each loop and use that to make your program run the same (or very close) on all machines. I think spooky posted a neat snippet that works very well I'll see If I can find it for you.
Here it is. Hope this helps.
http://forum.thegamecreators.com/?m=forum_view&t=18986&b=6

SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 14th Jul 2004 21:46
I've been using the TIMER() command which returns the computer's clock details, then adjusting the rate to that number. For example;

a = 0
do
....
lp1:
x = timer()
if x < a + 100 then goto lp1
a = x
...
loop

rest of game goes in the dots. This makes a little wait loop for the timer to flow past. Trouble is, on widely different machines the main loop may take too long to process, so the above may not operate.
S.

Any truly great code should be indisguishable from magic.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Jul 2004 22:01
The plug-in for processor speed is the Utility plug-in from my site. This doesn't do what is required though.

Even if you could work out how to move your objects based on processor speed, there are so many other variables that affect speed that it would generate nonsense results.

Spooky's way is better

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 15th Jul 2004 02:01 Edited at: 15th Jul 2004 03:02
Okay thanks guys i ill check out that spookys thing, and also IanM, for right now it was only the players speed that was sort of screwin up things.

[edit] okay i'm lookin at spooky's method...well...i dont exactly get what hes trying to do. If i just attached my code, could someone explain to me where i needed to add it? Sorry, its kinda long (300 lines). Thanks



if you run this on like say a 3 GHZ the player will go reallly fast but if you run on like a 1.8 or so it wont go as fast, thats what im trying to change...th
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 15th Jul 2004 03:36
You will need to increase the speed variables.



can i scream
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 15th Jul 2004 03:51
okay, thanks, i changed the speed variables to 3, but now its really choppy...any suggestions?
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 15th Jul 2004 05:05
lol okay i fixed one thing: I missed the incredibly OBVIOUS solution: SYNC ON! eheh when i started the prorgam i told my self i was gonna put in the sync a little later, but totally forgot about it ! Okay but i have one minor problem...well heres my code, try it out, you'll immediately see what it is..when you move its kinda messed


I put sync on and sync rate 30 at the beginning, but i dont know where else to put sync! the only place i know is at the end of the main loop..where else? Thanks

Login to post a reply

Server time is: 2024-09-22 16:21:28
Your offset time is: 2024-09-22 16:21:28