Any downsides to changing room_speed many times?

Discussion in 'Programming' started by 2Dcube, Oct 12, 2019 at 3:52 AM.

  1. 2Dcube

    2Dcube Member

    Joined:
    Jun 23, 2016
    Posts:
    371
    I am working on a turn based puzzle game.
    It's fairly simple and I am using a fps setting of 30 frames per second.
    However to increase the responsiveness of touch control on mobile I am thinking of switching to 60 fps when dealing with player input, then going back to 30 after the move starts.
    When waiting for input there are no animations so I won't have to adjust anything.

    I can't think of any downsides, it's just that usually games are set to either 30 or 60 and don't change mid way.
     
  2. NightFrost

    NightFrost Member

    Joined:
    Jun 24, 2016
    Posts:
    1,959
    Well, if you have any counters running, they'll run twice as fast at 60, alarms likewise will run down double speed, and any variables derived from room speed will now be incorrect until updated.

    However I don't see any downside to running at 60fps all the time. In fact I don't see any upside to running at 30fps, unless performance on some super-weak platform would be an issue.
     
  3. 2Dcube

    2Dcube Member

    Joined:
    Jun 23, 2016
    Posts:
    371
    Good point about alarms but I don't use them during gameplay (as they are difficult to pause).

    The upside to 30 fps is to save battery life, although I don't know how much difference it really makes.

    I think I'll just have to try it out and see if the switching works smoothly.
     
  4. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,896
    Just want to chime in that alarms are actually very easy to pause! Simply increment them by 1 for each step the game is paused... For example, all my games have this in their step event (when required):

    Code:
    if !global.Pause
    {
    // RUN STEP CODE
    }
    else
    {
    alarm[n]++
    }
    Alternatively, since a paused game uses less resources you can do something more generic like this in a controller object:

    Code:
    if global.Pause
    {
    with (all)
        {
        for (var i = 0; i < 12; ++i;)
            {
            alarm[i]++;
            }
        }
    }
    Or any number of other ways can be used as long as the alarm is being added to each step that the paused state is being maintained. :)
     
    ParodyKnaveBob, Yal and 2Dcube like this.
  5. 2Dcube

    2Dcube Member

    Joined:
    Jun 23, 2016
    Posts:
    371
    I never thought about simply increasing them to keep them at the same level, brilliant.
     
    ParodyKnaveBob and Nocturne like 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