Inconsistent Framerate on Mac 94.1

  • phatjesus94
    29th Aug 2019 Member 0 Permalink

    I'm having wildly inconsistent framerates on my Macbook Pro. It hovers around 30 FPS but randomly jumps from 30 to 40 down to 20 and back and forth constantly. I have nothing else running on the computer when it's doing this. I downloaded TPT 93.3 and I have no framerate issues whatsoever. It stays at 60 FPS no matter what I'm doing on TPT. I also noticed that my framerate issues with TPT 94.1 go away when I connect an external monitor even if I keep the TPT on my built in Macbook Pro screen. Is there a fix for this issue? I feel like I've tried everything.

  • jacob1
    30th Aug 2019 Developer 0 Permalink
    The 94.0 release of TPT switched from sdl1.2 to sdl2. sdl is the library we use that handles input / output, rendering to the screen, and other operating system specific stuff. We don't have too much control over what exactly it does, but it sounds like switching to the newer version of the library affected your fps somehow.

    I will mention, I've heard of this problem before on macs, but in sdl1.2. I thought one of the benefits of upgrading is getting rid of that issue. It happened on high dpi screens. I think some users found workarounds back then in order to tell macOS to not do whatever laggy thing it's doing to the screen.


    So I don't have any fix for you ... I don't even have a real mac to test on (only a vm). What version of macOS are you using?
  • phatjesus94
    30th Aug 2019 Member 0 Permalink

    I'm using 10.14.6 which is the latest release of macOS Mojave. Do you happen to know any of those workarounds they used or have a link to a post where they talk about it? I tried looking but I couldn't find anything. That could just be because I'm not very familiar with how to use the TPT forum, though.

  • jacob1
    30th Aug 2019 Developer 0 Permalink
    Did some searches, the main post I remember about the mac version is here: https://tpt.io/.306715

    I also found another post that suggested turning on double scale mode in tpt settings. (Try 2x, and even 3x or 4x, whatever the highest your resolution will let you go). This apparently helped the fps.
  • phatjesus94
    30th Aug 2019 Member 0 Permalink

    I tried changing the window scale, but when I click on it there's no option to change it. The box with the 1 in it just grows slightly. Does this mean I can't change the window scale?

  • jacob1
    30th Aug 2019 Developer 0 Permalink
    @phatjesus94 (View Post)
    Yeah, that means you can't change it. TPT thinks your screen resolution isn't large enough. I really doubt that is the case. Your mac is probably applying some kind of laggy auto scaling.

    Try typing tpt.setwindowsize(2) in the console and then restarting the game. If that makes the window too large, then switch it back to tpt.setwindowsize(1).
  • phatjesus94
    30th Aug 2019 Member 0 Permalink

    That got it close to working but it's still not quite right. The framerate averages around 45 FPS now, but it's still really inconsistent. It will randomly drop to 35 then go up to 45 then back down to 30. 

  • jacob1
    30th Aug 2019 Developer 0 Permalink
    @phatjesus94 (View Post)
    Much better. You could try the same thing with tpt.setwindowsize(3), and then tpt.setwindowsize(4). Eventually it will make it actually too large to fix on your monitor, use the highest possible size.

    You could also play around with the fullscreen options we have, they may help.
    Edited once by jacob1. Last: 30th Aug 2019
  • Cracker1000
    30th Aug 2019 Member 0 Permalink

    @phatjesus94 (View Post)

     Not sure if you have tried turning on force integer scaling and change resolution.

    Those options make it perform much better (atleast they did on my previous machine.)

     

    I experienced similar framedrops on my older pc when i tried to run newer snapshots with those options disabled.

     

  • phatjesus94
    30th Aug 2019 Member 0 Permalink

    @jacob1 (View Post)

     It seems to be working now. Thanks for your help! If the problem starts up again though I'll just start using 93.3.

     

    @Cracker1000 (View Post)

     I had those options turned on and the problem was still there. I'm not sure what causes it, but I think @jacob1 was right when he mentioned that it may have something to do with sdl2. The external monitor I have is older and I think that's why the problem is solved when I plug it into my laptop.

    Edited once by phatjesus94. Last: 30th Aug 2019