Android [SOLVED] How can i baypass FPS limit ?

Discussion in 'Programming' started by Kasra_n, Jul 31, 2019.

  1. Kasra_n

    Kasra_n Member

    Joined:
    Jun 19, 2019
    Posts:
    26
    Hi there, i had been optimized my rts game and now it should be run something about 95 FPS on my 2015 samsung j5, but the game locks at 60FPS, how can i baypass this limmit ? is it possible ? iam using gms 1.4, thanks for reading
     
  2. Edwin

    Edwin Member

    Joined:
    Jul 15, 2018
    Posts:
    417
    Is your room speed equal 95? Where did you get this value?
     
    Kasra_n likes this.
  3. spoonsinbunnies

    spoonsinbunnies Member

    Joined:
    Aug 24, 2018
    Posts:
    115
    Im confused on what you mean honestly, if you want to increase room speed that's as easy reffrencing room_speed. If you want frames per second to go up but not increase the speed of everything in your game the best way is to make everything into delta time, which is a pain to implement later in your game if it wasn't added originally, essentially if you vary the frame rate, you first figure out how many frames you want something to move per second. Example if your game runs at 60 and something moves at 3 frames per step that's 180 frames per second. Now in this example instead of x+=3 in step its x+=180/room_speed, this allows you to change the room_speed without effecting the speed the character moves. So if you wanted to increase room_speed for faster computers every hardcoded time related thing in your step event has to be recalculated like this. Fun note this is why fallout and skyrims physics freak out if the frame rate varies too much, its not really going to be super beneficial in a rts to go above 60 fps clicking unless like you said you just want to increase everythings speed not just less latency, in which case once again its just increasing room speed.
     
    Kasra_n likes this.
  4. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    392
    • Set the room_speed to 9999
    • Calculate everything with delta_time
    • Create a script, name it as deltaTimeCalculator, put the below code inside of it
    Code:
    return argument0* ( delta_time / 1000000);
    Since you increased the room speed to a big one, there'll be more steps per second in your game. This will ensure that every calculation in your game is done according the real world time.

    CREATE EVENT
    Code:
    clock = 0;
    STEP EVENT
    Code:
    clock += deltaTimeCalculator(1);
    //The clock variable is increased by 1 every second!
    
     
    Kasra_n and Edwin like this.
  5. Coded Games

    Coded Games Member

    Joined:
    Jun 20, 2016
    Posts:
    413
    Make sure you also disable v-sync. If it's on you'll get capped at whatever the refresh rate of your monitor is.
     
    Kasra_n likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice