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.

Dark GDK / Anychance on uncapping DGDK?

Author
Message
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 13th Jan 2008 09:09
Is there any chance that we would get an uncapped version of GDK, because limiting an app to the refresh rate really is bad for me in terms of working on my app since I do not know how fast it runs on my 2 computers, they just display 60fps


Making dreams possible, one line at a time...
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 13th Jan 2008 09:16
dbSyncRate( 0 );

That's it.
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 13th Jan 2008 09:23
That doesnt fix anything, It is still just capped at 60, my screen's refresh rate


Making dreams possible, one line at a time...
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 13th Jan 2008 09:29
Unfortunately not ... setting dbSyncRate(0) will still leave it capped at the monitors current refresh rate. I don't know of any way of changing this, its inherent in DGDK.

This has been discussed in many threads before and, as far as I'm aware, there has been no response from TGC.

No matter how good your code is, someone will improve on it
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 13th Jan 2008 10:32
Quote: "Unfortunately not ... setting dbSyncRate(0) will still leave it capped at the monitors current refresh rate. I don't know of any way of changing this, its inherent in DGDK."


I didn't try that, thought I will use it when needed.

Sad, sad, sad and shame :/
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 13th Jan 2008 19:50
Quote: "Isn't there a dbSetDisplayMode() command in Dark GDK?"


Yes, there is, but can not set the refresh rate. There's even set of undocumented dbSetDisplayModeEx functions, but none of them seems to enable it. According to the doc you can set it by dbSyncRate(), but that doesn't work (an ugly bug or just a doc mistake?). I even tried to perform device Reset on my own to choose the IMMEDIATE refresh interval mode, but then GDK crashes indeed as it has some resource created in DEFAULT pool
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 13th Jan 2008 20:03
So, TGC should definately fix this, because I want the benefits of an uncapped application so that it can actually run faster on my better computer than the crappier one :/


Making dreams possible, one line at a time...
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 13th Jan 2008 21:25
dbSyncRate(0) is said to disable the v-sync (applying IMMEDIATE mode), but it does not do that.

dbSetDisplayMode() have only 3 arguments
Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 13th Jan 2008 23:00
I just posted a joystick conversion from DBPro on my machine the DBPro version shows 130 FPS with sync rate set to 0.

The converted version shows 72 FPS
But does this mean the application runs slower on Dark GDK or only that it refreshes less often?
The DBPro version cannot display 130 times per second if the monitor can only refresh 72 times per second.
I assumed that the application does not wait for the monitor you can verify this by printing a counter. This assumption was wrong so the program does wait for the refresh.

I added the following which allowed me to sync every 3rd frame using the following code

dbText (10,10, dbStr(frames));
frames++;
// Update screen
if ( frames % 3 == 0){
dbSync();
};


I timed the frames at 1000 per 6 seconds or 160 times per second
even though the FPS shows 72 FPS

This does allow for more cycles but does it improve real game speed?

Codger

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 13th Jan 2008 23:04
Quote: "This does allow for more cycles but does it improve real game speed?"


It surely doesn't improve speed of anything, but you can do some stuff more often (than screen refresh), which can be what you want, right?
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 14th Jan 2008 00:22
If you can sync is more than the refresh rate, it will only show upto the refresh rate, so if I have 500fps, only 60frames will be shown in that second, 60 calls and 440 frames left over, which lets my program still perform things but is not visually update till the next set of refreshes...So when it is limited to 60fps my program is slower because it is holding the app for a duration of time so that I only get 60 frames in a second, versus getting 500 frames and only displaying 60


Making dreams possible, one line at a time...
Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 14th Jan 2008 00:48 Edited at: 14th Jan 2008 00:49
Running faster than the real frame rate (refresh rate) can cause all kinds of problems in games.
Sounds and motion are too fast to be realistic or represent the programmers intent.
Using Pacman as an example if the machine is too fast the ghosts will be upon the player before the player has a chance to make a decision. The ghost will flicker from one spot to another rather than flow.

If you are not interested in smoothness but only how many cycles per second a program can achieve then skip every 10th sync and use a manual counter.

Personally I find it more of a challenge optimizing my programs so the cycle rate equals the frame rate

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 14th Jan 2008 02:52
Well its pretty easy to code it if the frame rate is faster than the refresh rate...You just use timer based operations which, I have been using in all of my projects, not slowing it down


Making dreams possible, one line at a time...
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th Jan 2008 04:59
Um - The Short answer for this one is you need THREE things to "UnCap" GDK.

1: Full Screen Exclusive
2: Sync Rate (0)
3: Tell You Video Card Driver to Allow Software Control or Turn V Sync Off in Your card's Control Panel applet.

#3 is different for each card. I had same issue until I looked in every nook and cranny of my NVidia Card's Control Panel.

Note that the VSync of the monitor doesn't ACTUALLY go higher, WHAT HAPPENS is DarkGDK doesn't WAIT for the VSYNC. This means - it writes to the "SURFACE BACKBUFFER" and Flipps It as fast as possible. Because there is no "Waiting for VSync" in this configuration, you might see RIPPING or TEARING (Which I don't personally mind) its when the Video RAM Pointer changes to another memory buffer (Surface) "Mid Sync" and you for a brief instant see the TOP half of the Previous buffer and the Bottom Half of the New one - usually a staggered diagonal line is what your eyes pick up but its actually a left to right, down a scanline, left to right, down a scan line pattern that you basically are seeing at...well... 60 cycles a second!

Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 14th Jan 2008 05:19
Jason

I was trying to find the syntax for Full Screen Exclusive when I came across this from the DBPro Help Files

Quote: "
SET DISPLAY MODE

This command will set the screen display mode if it is available on the current graphics card. If this command fails, it will
only generate a runtime warning in the CLI. A final EXE produced with this command will not cause your program to fail on
machines that do not support the resolution. It is recommended, however, that you check the availability of the display
mode before using this command. You can use the CHECK DISPLAY MODE() command to see whether the display mode is
supported. It is vital to know that when this command is called, everything is deleted, including music and sound, so you
must re-load all your assets after a call to this command. An additional property to force VSYNC on or off (cap to 60fps
or not). Using SYNC RATE is something of a hack when compared to this new feature which creates a perfect VSYNC
between the render and the monitor. The downside is that the VSYNC is fixed to the refresh of the monitor. Be aware
that if the rendering area is stretched (usually via window desktop and window fullscreen modes), then it will not be a
true framerate returned by 'screen fps()
'. 8-Bit screen resolutions are not supported.
"


Does this affect your approach?
Are you able to verify this approach by using a counter?

Codger

p.s. How do you set full Screen exclusive in Dark GDK?

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th Jan 2008 05:25
Answer: No... Maybe, definately uncaps GDK! Infact the documentation (for full screen) matches what I said. You game will loop faster than the card/monitor refresh - but worry not! I haven't been able to blow up a monitor messing with Sync Rates in YEARS! (Used to beable to break monitors in the past programming graphics cards directly on some...well... less capable monitors

// First


//Second - no reason for order - my preference I guess...


tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 14th Jan 2008 09:35
2 Codger:
Quote: "Running faster than the real frame rate (refresh rate) can cause all kinds of problems in games. Using Pacman as an example if the machine is too fast the ghosts will be upon the player before the player has a chance to make a decision."


You should always write your game to use a timer to control everything in it! You can't compute object's movement or even game time on the base of number of rendered frames. That can change. That will change! If you do this properly, you can compute things more often than you are drawing them and it still makes sense.

2 Jason:
Quote: "1: Full Screen Exclusive
2: Sync Rate (0)
3: Tell You Video Card Driver to Allow Software Control or Turn V Sync Off in Your card's Control Panel applet."


Did you actually try this? Because I'm pretty sure this won't work. First, you generaly don't need full screen to get unsynced framerate, why would that be necessary with GDK? (anyway, I tried - didn't make it) Second, on many video cards you don't have the option to enable/disable vsync (loosy drivers) and if you had, you can't set it for your user automatically.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th Jan 2008 10:44
Quote: "
2 Jason:

Quote: "1: Full Screen Exclusive
2: Sync Rate (0)
3: Tell You Video Card Driver to Allow Software Control or Turn V Sync Off in Your card's Control Panel applet."

Did you actually try this? Because I'm pretty sure this won't work. First, you generaly don't need full screen to get unsynced framerate, why would that be necessary with GDK? (anyway, I tried - didn't make it) Second, on many video cards you don't have the option to enable/disable vsync (loosy drivers) and if you had, you can't set it for your user automatically.
"


Of course I Tried it My Experience has been just like I wrote about. In a WINDOWED "game" I can't get faster than whatever the DESKTOP - Right Click->Properties->Setings->Refresh rate (Somewhere in here)

However in Full Screen Mode - I set Sync Rate (0) AFTER setting my grafix card like I wrote about - Whella - FPS 200+ , some guys here with newer cards/pc's have reported in the thousands.

Though Sync rate (0) alone is not enough, you have to tell you video card like I said.

Yes - I tried it - and was stumped like this guy was for awhile - until I finally dug into the Video Card Control Panel to Set it to off or software controlled or something - and as far as some video cards not having the options - I'm with you - bad drivers or limited card or both.

As far as the original post is concerned - "Uncapping GDK" which I believe means - How do I make it go faster than 60fps if I have the Horse Power... then I think I am correct in saying HOW to get there.

LOL - My EYES are RED - need sleep - I got the QUAD TREE FRUSTRUM Culling Working - WOO HOO! LOL

tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 14th Jan 2008 11:24
Quote: "Of course I Tried it "


Oooooukej My apologise. It's pretty weird though, you know. Maybe - did you actually set the vsync in your driver options to "Off", or "Application control"? If you used the second, it's really weird because it doesn't work for me on either of my machines and it would make no sense if it did. However, if you set it to "Off Always" then you indeed get your higher FPS since it is the driver who makes the decision, but then we are at the same situation - unable to set it consistently for our game written in GDK and that's what matters GDK looses again :/
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th Jan 2008 11:42
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 14th Jan 2008 11:48
And we are there again. How to disable vsync in GDK (Could be just a bug? Maybe it will be fixed in next release, but it seems on purpose.) I start thinking about writing an usable game engine, gonna need it anyway, why don't make it more general?
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 15th Jan 2008 00:18
Well I posted it in the bug reports as I dont think too many people look in this section often, so hopefully it will get some attention there!


Making dreams possible, one line at a time...
Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 19th Jan 2008 09:43
FYI
I just checked out the Dark AI GDK demo "Patrolling" and it reports frame rate over 250

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
Darth Sidious 666
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location:
Posted: 19th Jan 2008 13:58
Hey everyone, just read this post and its kinda weird

In DBPro you can do the sync rate like this as you all know:
Set Display Mode (1024, 768, 32, 0)

Why is it missing in DarkGDK? I know, they had an oversight!

As a side note, ran my DBPro HDR project and got a framerate of 54, converted it into DarkGDK and got 66 (if sync rate is set to 60). HOW cool is that? At least 15 frames faster...

Gonna see if it'll lag with bigger levels now

Your skills are no match for the Power of DarkBASIC Pro!
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 27th Jan 2008 01:30
Well, I have found a way about this and it is to call syncs manually every x amount of time and it alleviates the problem

I have been able to get my app at 17~18,000 frames per second now, and only call about 60 syncs a second or every 17ms This is working very nicely and allows my program to process everything I need it to extremely fast at C++ speed


Making dreams possible, one line at a time...
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 27th Jan 2008 19:51
Quote: "get my app at 17~18,000 frames per second now"


Hm.... it could be interesting if that could be done in .NET also...

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine (thanks kBessa)
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 27th Jan 2008 21:08
Haha awesome Oneka!! Now get working into your MMORPG with DGK/C++ ! Will do better than dbp.


Click For Details!
Dark Inferno Studios
18
Years of Service
User Offline
Joined: 7th Nov 2006
Location: United Kingdom
Posted: 27th Jan 2008 23:14
How did you do it?

-Dark Inferno Studios
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 27th Jan 2008 23:31
This isnt the greatest example yet because I havent remade it yet but it generally gets the job done



Of course now that it is done like this, you will want to put anything that is draw in it's own section and call it the same time you call the sync command


Making dreams possible, one line at a time...
General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 28th Jan 2008 15:02
It just means the graphical rendering to 2d is performed at the v-sync rate, but positioning calculations are still performed at the peek fps the computer can handle.

For example, if the v-sync is set to 50mhz, but the actual update rate is 100, and an object is being moved forward at a speed of 1 per frame, by the next second the object would have moved 100 units, rather than just 50.

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 28th Jan 2008 17:22
Which is good because the way I do things are, I use timing anyway so its just overall faster now but acts the same


Making dreams possible, one line at a time...
General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 28th Jan 2008 19:04
Indeed. So theres not much point in decapping it, when the same results as before will be obtained.

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 28th Jan 2008 22:00
Well not exactly, because it is still hanging the system based on refresh rate which I think should be fixed


Making dreams possible, one line at a time...
General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 29th Jan 2008 00:48
But if it is uncapped the rendering side of things will not render faster than that of the screens refresh rate anyway.

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 29th Jan 2008 02:46
Not exactly, it can still render faster but visually it wont look different


Making dreams possible, one line at a time...
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 29th Jan 2008 12:30
Agreed - You're monitor will only be able to reflect FULL SCREEN changes at the sync rate - but it draws a horizontal line at a time going down screen.

It draws what's in memory for the scan line at the time it draws that scanline.

This is why ripping occurs. I personally don't mind ripping...

In short - having game engine not "wait" means your code can run faster - no pause each sync command...

Ideally - game would be in one thread - and refresh loop might be in another - so game can run full speed while - refresh rate gets a nice - v-sync full screen render - without impeding game logic.

Login to post a reply

Server time is: 2024-11-20 01:45:31
Your offset time is: 2024-11-20 01:45:31