A little thing that was mentioned 2 years ago

Moderator: GZDoom Developers

User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

A little thing that was mentioned 2 years ago

Post by TheDarkArchon »

I was looking at the general forum when I stumbled on this:
BBG wrote:To be able to set your own FPS cap instead of just having the option of a capped or uncapped FPS with no control over it. Thanks.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49188
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Easier said than done. The game still runs with an internal 35 fps and the high frame rate is only achieved by interpolating the movement. The only thing that would make sense is to cap it by vsync rate. That's something I always do anyway because I really don't like the tearing effects of higher frame rates.

But for setting an arbitrary frame rate you have to do some very messy timing to get it all right. You can't just set the game clock and be done.
It really isn't worth the effort.
User avatar
Chris
Posts: 2958
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

But for setting an arbitrary frame rate you have to do some very messy timing to get it all right.
Not really:

Code: Select all

int msec_per_frame = 1000/wanted_frame_rate;
next_msec = current_msec+mesc_per_frame;

gameloop:
   while(current_msec < next_msec)
      ;
   next_msec += msec_per_frame;
   do_frame();
That said though, I agree I don't see much point in an arbitrary cap.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49188
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Yes, and exactly that doesn't work because the game runs at 35 fps. Only the renderer is called more frequently.
User avatar
Chris
Posts: 2958
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

I'd imagine the main loop is split into main logic, interpolated logic, and renderer. Having just the renderer called wouldn't make much sense unless there was some logic to interpolate between the two tics.

Return to “Closed Feature Suggestions [GZDoom]”