pythonframe-rateursina

How do I get rid of the 60 fps limit in the ursina game engine


any game I make with ursina seems to be capped at 60fps, I have turned off vsync, and development mode

code:

from ursina import *
import pygame

if __name__ == '__main__':

    clock = pygame.time.Clock()
    app = Ursina(development_mode=False, vsync=False)
                                                                                
    window.windowed = True                                                                                       
    window.fullscreen = True                                                                                     
    FPS = 120                                                                                                    
    box = Entity(model='cube', collider='box', position=(5,0,10), scale=6, rotation=(80,0,0))

    while True:
        clock.tick(FPS)
        print(str(clock))
        app.step()

I am using the clock from pygame to manually step the game. this works for limiting the fps, but only below 60. if I try to set the fps above 60, the program runs, but only reaches 60 fps

console output:

...
<Clock(fps=59.88)>
<Clock(fps=59.88)>
<Clock(fps=59.88)>
<Clock(fps=60.24)>
<Clock(fps=60.24)>
<Clock(fps=60.24)>
<Clock(fps=60.24)>
...

I am using python 3.12 and ursina version 7.0.0


Solution

  • It turns out this was a problem with my gpu driver settings, NOT the ursina game engine. I was able to turn off vsync manually https://wiki.archlinux.org/title/ATI#Turn_vsync_off