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 / Frame Rate Fixed at ~60.

Author
Message
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 9th May 2010 06:50
Hi everyone, well, this is an interesting problem. I use to get upwards of 200 fps with my current code. I then put a cap on it to 60. I recently removed the cap to see what speed I would be getting, and guess what, it's 60. Now, to see what could possibly be bogging down my code, I removed almost everything that could possibly be doing this back down to what my code use to be before I made changes, and it's STILL running at 60. I have removed everything down to just a do sync loop.

Here's my current code:



There is the file initiation before this and some heavier image manipulation which slows the comp down a lot... BUT, after that it use to run smooth and fast. Now, I don't know what's doing it. I even removed the image manipulation.

Any ideas?

www.myspace.com/norseblod
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 9th May 2010 06:55
You're not enabling manual syncing, which you use sync on for.
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 9th May 2010 06:57
Well, in the earlier part of the initiation code I have:



Sorry, I guess I should have posted that part too!

www.myspace.com/norseblod
Invader Jim
21
Years of Service
User Offline
Joined: 22nd May 2005
Location:
Posted: 9th May 2010 07:02
Have you checked your video card driver settings? Could it be forcing v sync?

luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 9th May 2010 10:17 Edited at: 9th May 2010 10:19
You accidently use vsync?
Like this?
Set Display Mode 1024,768,32,1
No mather what it`s gona cap on 60fps if you do that, and you didn`t show your whole code, so this is an assumption.Just the heavy routine and the old ini setup.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
TuPP3
19
Years of Service
User Offline
Joined: 26th Jan 2007
Location: [+--]FINLAND
Posted: 9th May 2010 16:06
Thanks luskos for that information, I've always wondered this too, but I assumed that my game was so poorly optimized that I can get only 60fps without any limits.

After disabling Vsync I got fair 110fps to my game
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 9th May 2010 16:15
A small unrelated note...shouldn't gravity be -9.8? baring in mind I've only got experience in DarkPhysics.
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 9th May 2010 17:12
@NickH:
It depends, if you want to simulate earth gravity, else not.

@TuPP3:
I`m glad to help.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 10th May 2010 00:55 Edited at: 10th May 2010 06:43
@luskos, no, i haven't put a 1 at the end of the display mode command. I have tried earlier programs of mine all with the same result. So i believe that invader jim may be right though i dont know how to change it. i'm running vista with an ati radeon 2600 graphics card... i know i use to get good speeds until a day or two ago. now i'm getting an error saying that the catalyst control center is not supported by the driver version of my enabled graphics adapter...

but i dont know how o fix it...

EDIT: Well, I still haven't fixed it. I uninstalled catalyst control center and reinstalled the newest drivers, but now lost the control center I once had...

On another note... I minimized the game window, then upon openning it again, for a second or two it showed the normal speed it was running at (~300 fps) before dropping back down to ~60. This makes me believe that it is DBP. Since all my programs I have created are doing the same thing.

www.myspace.com/norseblod
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 10th May 2010 17:58
Anyone have any idea why this is happening, it's driving me nuts. The only thing i have done recently is update direct x, and install a vista theme modifier. Other than that, I haven't done anything different. Though my video card says it's set to 60 Hz, and i can't change that because i'm running vista and it is set to that for the system to decide the rate. The problem is it never did this before. I think it's a setting in DBPro that I may have checked, but I can't find it...

www.myspace.com/norseblod
Jimmy
22
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 10th May 2010 19:49 Edited at: 10th May 2010 19:50
Do you know how to get to the advanced settings for your display adapter in windows? (Click on 'Advanced settings' where you change the resolution) There should be an ATI or a 3D tab in there. Click on that then look for "Wait for vertical sync/refresh." If it's there, disable that bad mamma jamma.

NaGaFailMo.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th May 2010 21:48 Edited at: 10th May 2010 21:57
Do you have the same problem with very simple short programs such as the following snippet?



That runs at 120 fps on my laptop. I've attached the executable so you can compare the fps with your own executable. I guess they should be the same more or less (this was compiled using U7.4).

Edit Replaced the exe file with a zip.
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 11th May 2010 00:18 Edited at: 11th May 2010 00:46
Hmmm, it displays anywhere between 1700 and 2300.... wonder why my program dropped like that when I haven't even changed anything... and other programs of mine have also dropped without changing anything.

EDIT: I went and looked at my old code, and it appears to be running at 100 fps now... which is faster, but i just upgraded my ati drivers. Unfortunatley, it's still slower than it use to run at.

@Jimmy, I've looked but cannot find anything of that sort. Everywhere I look it just shows my "maximum allowable refresh rate" is 60 Hz...

www.myspace.com/norseblod
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 11th May 2010 00:42
You're not using D3Doverrider or anything like that, to force Vsync in games are you? Or any kind of Vsync/refresh rate override?

Like has been mentioned before, if you are forcing Vsync in your graphics card control panel, then it will always lock Direct3D/OpenGL apps to your refresh rate.

Although my experience has been ATI's CCC doesn't force Vsync even though it claims to... so I dunno.

The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 11th May 2010 05:38 Edited at: 11th May 2010 07:15
Ok, I tried making my own little program which brought me up to 200 fps.... BUT, that is pretty bad considering there is nothing in it...



That's it... and I only could get 200 from it... I don't understand this problem at all!

EDIT: I don't know what you mean by D3DOverrider to force Vsync in my games. Sorry, I just don't understand that.

www.myspace.com/norseblod
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th May 2010 12:49 Edited at: 11th May 2010 13:03
What screen resolution are you using?

I pasted that snippet straight into DBPro on Cyborg and got about 2700 fps - but the default screen setting is 640x480. I then changed the screen setting to 1680x1050 and got about 2600 fps, just a bit lower.

Hmm ... Suggests screen resolution is not the issue.

Quote: "That's it... and I only could get 200 from it... I don't understand this problem at all!"


Neither do I.

Your snippet is very similar to mine - but you said you get about 2000 for that. I wonder which specific change has resulted in the drop?

Edit The text lines might be involved - but I'd be surprised if they explain the size of fall you're you're getting.

Here are some results I get with following snippet by changing the number of times the for loop is executed.

Code:


Results:


Someone may have mentioned this. Have you changed the anti-aliasing settings?
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 11th May 2010 16:09
I don't know... Honestly, I don't know what the Anti-aliasing settings are. I may have changed them at some point with the graphics card, but any changes to the graphics card was before I tried out your code, if that makes a difference. I was wondering if the direct x models were contributing to this, but the drop from them seems to be purely from the polys, the shader, and the textures. I have put a lot of my code into gosubs recently instead of functions. But I don't think that would be the issue. I have been using a new plugin, but it also seems when i remove the plugin codes, the drop still occurs. I'm sure this isn't the issue as even my old game ran slower than normal.

Maybe I'll try to lower the anti-aliasing settings when I get home, just to see?

www.myspace.com/norseblod
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 11th May 2010 22:11
@The Viking:

It could be the Vista theme modifier. Which one is it?
Also, you said you updated the directx version? To which version did you upgrade?
And, you have an ATI graphics card, right? Do you have the ATI Catalyst Control Center installed?

Cheers

Slayer rules!!! Yeaaah, man!
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 11th May 2010 22:28
Well, I first installed Vistaglazz which didn't want to work because I'm running on 32 bit, not 64, so then I installed styleselector (i think it was). I also updated direct x to the most current one, I think it was 10.2??? not sure the number exactly, will find out when I get home. I do have Catalyst Control Center Installed (I think it's properly installed, it works though). The ATI graphics card use to run this fine, and I uninstalled it and updated it because it mentioned I had to update it because it gave me an error.

www.myspace.com/norseblod
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 11th May 2010 23:57
Vistaglazz works on 32bit, just so you know.

Rawwrr. Sig Fail.
Newcastle is awesome
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 12th May 2010 03:18 Edited at: 12th May 2010 07:00
oh really? I read it doesn't and it didn't want to do anything for allowing themes to be applied... but that's all off-topic.

On a side note... it appears my frame rate is still dropping... now, i'm getting between 29 and 45 fps... and getting worried here.

EDIT: Just out of curiosity, would having many arrays slow down the system this significantly? I'll list some of the plugins I'm using with it: I am using Cloggy's plugin for the text (the standard text commands i posted is just for a temporary purposes), I also am now using Xeno Physics, and Image Kit for the texture blending (found it worked fast, and I could add a shader to it after). I am also using a simple shader from one of my previous projects (thanks to GG). But, all these don't seem to really be contributing to any drop in speed. My model I am using is about 5000 to 6000 polys, and i exclude the parts which are not in view.

EDIT: Ok, did some optimizing, but, I still can't get it to work, and GG, I lowered the AA down to 2X and it still didn't affect it at all, and on another note, the code you gave me before to try and which ran at 2000 fps for me now only runs at 600...

www.myspace.com/norseblod
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th May 2010 15:14
It's beginning to sound like a problem with your system - whether it's software or hardware I've no idea. Does anything else seem slow? Does your hard disk need de-fragmenting, etc, etc? Might be worth getting hold of one of those system tuning applications. I use TuneUp Utilities which IanM recommended some time back.

It's certainly an odd problem.
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 12th May 2010 21:30
I doubt defrag is gonna solve much if even the simplest of programs runs so slow.. that would only affect load times, and on-the-fly FPS during a loading of data.

Is it possible your graphics card is dying? Is it running real hot? Is your CPU running real hot? A lot of hardware these days will also start underclocking themselves to prevent catastrophic damage from overheating, or other stuff like that. So if you've got a heat problem or something that could be causing it too.

Or perhaps you have some kind of malware infecting your system? If you have a spare hard drive, I would suggest doing a fresh format/install on that spare drive, getting your drivers, etc all up to date and then seeing how DBPro performs..

The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 13th May 2010 06:52
Well, I've managed to pull off 200 fps on my program again... though, it's not consistent. Some times I start the program will run at 56, next 180. Pretty much had to lower every setting I had to the lowest graphical possibility offered and run in desktop mode. Which I know i use to run at the highest before and get higher speeds than that, but I guess this will have to do for now.

Thanks guys for all help/suggestions.

www.myspace.com/norseblod
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 13th May 2010 13:24
Quote: "I also updated direct x to the most current one, I think it was 10.2??? "

Which version did you have before you updated? And, did you update the 32 or the x64 version of directx? Because that could cause conflicts between the drivers and the graphicscard.

Quote: "The ATI graphics card use to run this fine, and I uninstalled it and updated it because it mentioned I had to update it because it gave me an error."

Do you mean uninstalling only the drivers, or uninstallling the card aswell? And what error did you get?

Maybe there's still some conflict between some of the recent programs you installed (Vistaglazz or Styleselector). Most of the times when you uninstall a program, there's still some registrykeys or files left on the computer related to that program. Cleaning up your pc and registry could make the difference.

Or, you could do a system recovery and go back to the date your machine ran well?

You could also do a benchmark graphicstest with programs like 3DMark, and see what that gives as results?

Cheers

Slayer rules!!! Yeaaah, man!
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 14th May 2010 05:16 Edited at: 14th May 2010 06:33
Oddly today, I opened DBPro, and compiled my program right after the computer started up. I got my missed FPS of 750 to 850 fps.... then, the next time I compiled the same program, ~10 minutes later... 170 fps

I'm resisting the urge to yell, but... UGGH any ideas? I'm thinking it must be to do with a program which runs at startup that didn't have enough time to kick in yet?

Hmmm, yeah I was going to do a system recovery to a time it worked, but I'm not sure if I want to, because then i may have to install direct x, and my video drivers again.

Quote: "
Do you mean uninstalling only the drivers, or uninstallling the card aswell? And what error did you get?
"

I uninstalled the drivers, because I am working on a laptop. The error I had mentioned that the catalyst control center is not supported by the driver version of my enabled graphics adapter.

Quote: "
Which version did you have before you updated? And, did you update the 32 or the x64 version of directx? Because that could cause conflicts between the drivers and the graphicscard.
"

I can't find the files I used, but I'm pretty sure it was the 32 bit version

Quote: "
You could also do a benchmark graphicstest with programs like 3DMark, and see what that gives as results?
"

I'm not sure what you mean by this...

EDIT:
Well, looks like the system restore worked out great... this whole time and that's all i really needed to do... I guess I can live without the vista desktop styles (if that's what caused it or not i don't know) but... thanks, that fixed it all by the looks of it... i'm not up to 700 but i'm at least in the 500 fps range without any issues... Thanks Everyone!

www.myspace.com/norseblod

Login to post a reply

Server time is: 2026-07-25 11:48:54
Your offset time is: 2026-07-25 11:48:54