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 / Frame Rate Issues

Author
Message
Jam144
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 16th Sep 2008 16:08
Hi, Ive had DBPro for a while now but only recently started to code in it. However I seem to have a problem with the Sync Rate command. The differance between sync rate 708 and 709 is about 500 frames per second however this only occurs in fullscreen mode. Does anyone have any idea why this occurs?

James
Jam144
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 16th Sep 2008 19:16
Thanks, however is there anyway of just fixing the sync rate command. As it seems that we arn't actually fixing the problem just finding an alternate way around it!
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 16th Sep 2008 20:16
I don't get you guys and your fps' of several hundred hertz
I'm happy if I can make something run at 40, 50.

And yes, I agree with what WK said about using your own timing system.

"I kören hörs de brummande busarna Björnligan och Gondolen"
Jam144
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 16th Sep 2008 21:29
I ain't perticulerly after an fps of several hundred. Its just that once I go below 700 it goes slow as hell. I mean it does less then 50. I couldn't work out why. Maybe it's just my PC. Also as for my own timing system, that would be cheating as I wouldn't understand the normal way of configuring the FPS. I like to fix the problem not find an alternative
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 16th Sep 2008 22:11
if iam not wrong so do almost all comercial games have an sync rate locked at 60.
you do mostly nead to have the sync rate 0 command during development to instantly see if some changes have made dramatic changes to the fps.
but you still have to use your own timed movement as no computer runs your app at same speed.
and yust to point out that windows killer is right as with setting the sync rate to 0 so will the app always run at max fps.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Sep 2008 22:32 Edited at: 16th Sep 2008 22:33
Quote: "Also as for my own timing system, that would be cheating as I wouldn't understand the normal way of configuring the FPS"

Cheating?
Oh dear, and all these years I didn't know that I'd cheated.

Here's the first two lines of my current piece of code:


I cheat by timing the rate myself and adapting the movement to that rate. I also cheat by using fixed-interval timers so that I can have events or checks happen regular as clock-work. The benefit of that extra work is that code I write will run correctly no matter how fast or slow the target PC is.

I don't set the sync rate to anything other than 0 unless I'm writing a quick-n-dirty example or test code where I need to keep things simple, and then I nearly always use 60 - then I throw the code away.

Jam144
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 17th Sep 2008 00:06
Whoa, I didn't mean to offend you! Im on about a personal thing, I would rather know how it worked and why it wasn't working then use a completly differant method. Its a coding preferance, there is often many ways of doing something if one doesn't work first go then I wouldn't simply switch to the next instantly.

As for extra work I don't mind it. Currently I'm using a 13 year old compiler in my computing course, the language has half the commands missing, and to do colour takes well over 200 lines of code. Sure I could just switch to Delphi but it wouldn't feel right.

Can you see where I am coming from? I want to know why Sync Rate isn't working probably, how to fix it. And if I learn a better way of doing it in the process all the better!
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Sep 2008 00:07 Edited at: 17th Sep 2008 00:14
there must be some kind of delay on your posts as when i wrote mine so wasent your last post there
about cheating ?????
i dont want to be crappy to you but how long have you bin programming?
as you can only achive an program that runs well on all computers with an timed movement.
and if i where you so would i listen to ian as he is one of the code gurus here
you sound like me when i started to code and didt know that much about fps and timed movement

simply explained.-------------------------------------
fps is the same as how many cycles your prg runs your main loop in seconds.
so if you move an object with the speed 10 so will it move alot faster and further if you have an fps of 700 then an fps of 50.
as you then moves it 700 times in an second with the speed 10.
but iam an pretty lame coder when it comes to the hardcore terms of coding so please gandalf,darkcoder or ian or van help me out to explain
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Sep 2008 00:31
hi me again
have you checked the help files about the sync command ?

SYNC OFF

This command is used to improve the performance of demanding programs that require a consistent frame rate. This is especially true of games. By
default, sync is set to off which allows the system to automatically handle screen refreshing. When SYNC ON is used, your program is responsible for
handling screen refreshing. You can refresh the screen using the SYNC command. When you want the system to automatically handle screen refreshing
again, you can use the SYNC OFF command. By placing the SYNC command at the end of your main program loop, all drawing and refresh tasks can
occur in a single call. This dramatically increases the speed and smoothness of graphical operations, allowing your programs to run at their best.

Syntax

SYNC OFF
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Sep 2008 00:32 Edited at: 17th Sep 2008 00:40
The timing of the posts is a bit crappy because Jam144 is currently on the new user post approval.

Quote: "I didn't mean to offend you"

Not offended, don't think anyone is. It's just that what you consider 'cheating' is simply the way things are done, not only here, but in commercial games too - very few games are what is called 'frame-locked'.

To explain your 500fps measurement: Windows timers have a resolution of 1ms (1000th of a second). They have an accuracy under XP of (I believe) 10ms, which means that they can be up to 10ms 'off'. When you specify a rate of 700-ish, you are asking for an resolution of just over 1ms - rounded to up (because timers use whole numbers), this is 2ms, which is 1/500th of a second.

[EDIT]Put accuracy when I meant resolution

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Sep 2008 00:35
i knew that ian had an answer to it
Jam144
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 17th Sep 2008 01:39 Edited at: 17th Sep 2008 02:03
The delay is because in my two years of owning this program these are my first posts. So the system is insisting on checking each post to see if I am 'spamming' the forum. I think I sent a hastily wrote letter to TGC about the fact I wouldn't spend £50 on software, only to get booted from the help source.

As for programming I've got 5 years under my bonnet. I like to dabble in differant languages nothing to complex. At the moment I have decided to revive this language since I've barely used it. And partly because I took a computing course and Pascal was to easy. Anyway as for my languages I have learned DM, DB(In training),Pascal, some of the mark up languages although not fully I just learnt the parts that I needed, I am starting on C. Well downloaded the Compiler.

I didn't know about timed movement thanks for the info. As for the screen rate thing I was just curious to know why it didn't work properly. The differance between 703 to 704 was staggering but below that it was always the same slow speed, above it super fast.

Glad to know you were not offended Ian. Another question I would like to ask since you guys are here is how come DB doesn't work on differant O/S's such as Linux? I can get it to run under wine but compilings a nightmare!

Will incorperate the Timer based movement!(Strange how I am doing so much to create Pong(It does work), must start an FPS)
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Sep 2008 23:53
dark basic is specificly writen to use direct x, and i belive that is the problem .
its aimed for use with windows and making games for windows.
oooh i envy you as i couldt any programming at all when i started with dbp
and still struggles with some coding issues and terms as i are self learned completely.
cheers and good luck with your coding

Login to post a reply

Server time is: 2024-11-25 17:49:05
Your offset time is: 2024-11-25 17:49:05