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 / accurate fps measure?

Author
Message
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 28th May 2003 15:42
I'd like to see the accurate screen fps...
when I use the screen fps() command, I see a value which is about the sync rate and which stays the same. When I set sync rate 0, it returns 99 (it seems this function can't return higher values)

anyone who knows how I can know the real screen fps (its not a problem when the fps checking routine slows down the program, it's just to compare different methods for hiding offscreen objects)
[href]www.bernardfrancois.com[/href]
GameKit
22
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 28th May 2003 17:27
instead of using [sync rate] use [sync on] then at the end of every loop put [sync]...example...

...code...
sync on
...code...
Do
print screen fps()
...code...
Sync
Loop

...i think this will solve your problem... the way screen fps() works is it counts how many times the screen refreshes every second...then it counts it again for another second and displays it...ect...if you have an increadably fast computer you will get a high fps() rate...if you set like sync rate 60... your fps will stay constant...i hope this helps...

Anyone Can Destroy...But Few Can Create...
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 28th May 2003 17:41
in fact I just want to test the speed of certain loops

offcourse when I use the sync on and sync rate commands, screen fps() returns the sync rate that I had set... but when I set the sync rate to 0, it runs as fast as possible...
when I use the screen fps() command than, I could see the maximum frame rate... but my problem is that screen fps() can maximumly return 99...

anyone who knows how to avoid this?

[href]www.bernardfrancois.com[/href]
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 28th May 2003 18:22
its solved now... I don't know what was the problem but now it returns a higher framerate, which varies when I move the camera

I now tested the loop to hide objects. It lets the framerate drop from 160 to 140 fps (not that this is visible but it might make the difference when I'll use more objects)

this is the code I used to hide objects. it's a gosub which is called every frame in the main loop



any suggestions to make it faster? I often read that people have a faster frame rate when they hide things... or maybe it could only be faster when you use more objects? now there are 16344 poly's visible...

hmm changing the screen res gives also a higher frame rate... 190 (320*240*16) instead of 160 (1280*1024*32), but offcourse that's not the way of boosting the speed that I'm thinking of...

[href]www.bernardfrancois.com[/href]
Darksoft
22
Years of Service
User Offline
Joined: 17th Sep 2002
Location: United States
Posted: 28th May 2003 19:06
Something that you could do, is only call that function if the camera moves a certain distance that you specify. So it wound't do it every iteration but only every 100 units or so.

TH -Darksoft.net
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 28th May 2003 20:10
that's a good idea! checking the distance between old and new camera coordinates must be much faster...
maybe I could do this only once in a second, and not every frame... that would make it even faster

but the code that I made seems so slow... coz it checks so many objects (in fact there aren't that much object but I want to avoid problems when I have more)

[href]www.bernardfrancois.com[/href]

Login to post a reply

Server time is: 2025-05-18 08:20:16
Your offset time is: 2025-05-18 08:20:16