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 Discussion / Frames per second jumping to 300?

Author
Message
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Dec 2008 02:04 Edited at: 20th Dec 2008 02:09
Well i was having a 80 to 110 fps but the other day my fps on my pong game jumped to 300 in the editor but when i compile to exe it goes to 60 i havn't changed anything idk why its doing this

[edit]
wait just tested it on my First person shooter and that has a fps of around 60 aaahhhh i'm confused. lately my fps has been topping out at aaround 60(gr) but now just on the pong game its at 300 to 350 gr
[/edit]
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Dec 2008 13:21
You should set the sync rate to a fixed rate, not 0. If I set the sync rate to 0(I have a huge processor), my games run at around 800-1000 fps, where my really slow computer manages 25 fps when the sync rate is set to 0.

So, that means that every computer is going to run the game faster or slower than the other, and some (like mine) will run it at 800-1000 fps, and that is too fast to play the game...

So, in your case, set the sync rate to 60. Then the fps will always hover around 60.

TheComet

Peachy, and the Chaos of the Gems

Robert The Robot
18
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 20th Dec 2008 17:47 Edited at: 20th Dec 2008 17:47
@Caleb1994
It's ironic, there's a thread going on this very topic! You can do one of two things to make your compiled code run as fast as it did in the editor:

1) Find the Setup.ini file that's in the same folder as your DB.exe, and copy it into the folder with your Pong exe. Open this copy of the Setup.ini file in Notepad, and check that the setting for "BlitflipMode" reads as:

That should give you the high fps in the standalone exe. If this fails, try method two:

2) This is more complex - you need to check how your graphics card is set up. Check the windows control panel, under display. There should be a settings option and maybe an advanced button. There should be a series of tabs or buttons depending on the graphics card. Somewhere around there, there will be a setting for VSync, or Vertical sync. On my computer there are three settings - "Let the application decide", "Force On" and "Force off". If you set it to "Force Off", the compiled DB exe ought run at the high frame rate found in the editor.


If neither of these work, and you still get an fps hovering around 60fps in a compiled exe, let me know. I have another trick up my sleeve, but I'd like to see if this works out...

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 22nd Dec 2008 01:03
worked great thanks robert!

Hey how would you figure how fast the ball and stuff moves because i had it set for 60 FPS and now it's at 300 and i was wondering if i should give the player a choice for how fast the computer is or just on every loop check the fps and if its below a certain point speed everything up and if its above it then slow it down.
Robert The Robot
18
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 22nd Dec 2008 15:36
Quote: "worked great thanks robert!"

Just out of interest, did you use the Setup.ini file or the VSync?

Quote: "how would you figure how fast the ball and stuff moves because i had it set for 60 FPS and now it's at 300 "


Personally, I would follow TheComet's advice, and use "Sync Rate 60" instead of "Sync Rate 0". Yes, this returns you to the maximum of 60fps you got in an exe, but I think most if not all modern computers will be able to run the exe at that speed and it will ensure consistency of game play for most players.

Quote: "on every loop check the fps and if its below a certain point speed everything up and if its above it then slow it down."

You've got the essence of a timer based system. It's explained in detail here and agian hinges on you choosing an "Optimum frame rate". It might be alittle tricky to implement, but do have a read of the article, its very informative.

Hope this helps!

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 22nd Dec 2008 17:50
I used the setup.ini one the setting in there was already changed correctly but i just put it with the exe and it did it

so sync rate sets the accual fps?? i wasn't sure what it did to be honest i just knew that the common use of it was either 0 or 60 lol
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 22nd Dec 2008 17:51
I used the setup.ini one the setting in there was already changed correctly but i just put it with the exe and it did it

so sync rate sets the accual fps?? i wasn't sure what it did to be honest i just knew that the common use of it was either 0 or 60 lol


ok i will look into that page thanks!

Login to post a reply

Server time is: 2025-06-07 20:59:48
Your offset time is: 2025-06-07 20:59:48