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.

DarkBASIC Professional Discussion / Mysterious FPS drop at sync rate 60

Author
Message
New World Order
21
Years of Service
User Offline
Joined: 31st Oct 2004
Location:
Posted: 24th Aug 2012 22:29 Edited at: 25th Aug 2012 11:18
So, I've been noticing this slightly weird phenomenon with a number of DBPro projects I worked on recently:

(The following may sound really noobish, but please bear with me)
I set the Sync Rate to 60. I spawn a lot of characters. The program FPS drops to something around 43-47.
The characters kill each other off, when most are dead, the framerate goes up to 60.
Now, it's only natural that the ai and collision-detection (which are done only for living characters) drain the games fps.

!BUT!

When I un-cap the frame rate with "Sync Rate 0", THE WHOLE PROGRAM (including the part where loads of characters fight each other, *identical situation*) runs at >60 FPS. Therefore the problem is not that the program is too complex for my machine to handle it at a smooth 60 fps.
In fact, if I set "Sync Rate 80", the game runs at 80 FPS!
This is totally weirding me out.. why the dropped 15 frames at Sync Rate 60?

Also, I should mention this problem seems to appear somewhat eratically, being there in one compile, and being absent in the next...


I know it might be difficult to say anything without the code, but it's... well literally thousands of lines all in all, and the problem seems to come up after some degree of complexity of the program, but not predictably...

Has anyone ever experienced a similar problem?
Anyone have any suggestions?

Thanks in advance!

[edit: further research has revealed that it's even more random than I thought... for example, I haven't been able to replicate the bug this morning (no matter how crayz big armies I send against each other - the framerate (legitimately) drops beneath 60 both with sync rate 60 and sync rate 0.. Also, it seems to disappear after restarting the computer (or perhaps only indigo..?) I'll post here if I find out anything interesting ]
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 25th Aug 2012 17:26
I think scrutinising your system build may reveal the issue...

PSU
CPU
MBOARD
MEMORY
HARD DRIVE
GRAPHICS CHIPSET
SOUND CHIPSET
MONITOR CONNECTION DSUB/DVI/HDMI
MULTI-MONITOR YES/NO

Whether or not using VSYNC might help too

Sometimes its not the code...

New World Order
21
Years of Service
User Offline
Joined: 31st Oct 2004
Location:
Posted: 27th Aug 2012 15:06
Hey Valentine!
sorry for getting back to you only now and thanks for offering to help!
After reading another heap of threads on the forum I've decided to avoid the "sync rate" command completeley and go for VSync (or not even that)... with timer based movement etc. that shouldn't really be a problem, should it?
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 27th Aug 2012 15:35 Edited at: 27th Aug 2012 15:36
as far as I understand, if you are making a networked application then timer based movement is essential as otherwise you get disadvantaged users and advantaged users...

VSync should always be optional, and also SYNC RATE should not be neglected as sometimes VSYNC will be different computer to computer... as it is dependent on screen refresh rates... so some users will experience 30fps and others will esperience 60 or 75 fps... but then again timer based movement should help remedy this as well...

it all boils down to your program and its nature...

I must say I did find VSYNC to be a saviour in a recent project... where sync rate was giving me grief...

hope that helps...

mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 28th Aug 2012 12:41
I think it is DBP's fault.
There was a similar thread. Here is the solution by Fallout:


MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 28th Aug 2012 19:15
what is Sync Mask Camera?

New World Order
21
Years of Service
User Offline
Joined: 31st Oct 2004
Location:
Posted: 28th Aug 2012 21:54 Edited at: 28th Aug 2012 21:54
yeah, it's a shooter with aspirations of multiplayer, so timer based *everything* is kind of necessary .. Well, with timber base, now frame rate doesn't matter at all anymore, in a sense (except it will become laggy at too low fps, of course..) -- besides, timer base inspired me to add a cool "bullet-time" effect
Thanks for your help anyways!
Thanks for your suggestion too, Mr Handy! Interesting to see that your framerate was also off by 15 frames (although in the opposite direction^^)
I'm using the Matrix1 plug in's hitimer(), that should be pretty much the same as perftimer(), right?
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 29th Aug 2012 01:01
Sure!

@MrValentine
maybe it's a typo

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Aug 2012 01:10
well that code does not work... so why post it?

Login to post a reply

Server time is: 2026-07-08 08:31:35
Your offset time is: 2026-07-08 08:31:35