1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

Windows Delta time

Discussion in 'GameMaker Studio 2 Community Tech Support' started by YupYup, Jan 29, 2019.

  1. YupYup

    YupYup Member

    Joined:
    Sep 2, 2017
    Posts:
    30
    I'm new to Game Maker 2.

    Is sprite speed moving some pixels per Step the same on some game running 30fps and another running 60fps or in different hardware ?

    Is Step function constant accross different hardware ? Will a sprite move 4 pixels per Step always have the same speed on different devices ?

    Or should i use Steady Delta plugin and use (speed*delta_time) ?
    https://marketplace.yoyogames.com/assets/1149/steady-delta-time
     
  2. csanyk

    csanyk Member

    Joined:
    Jun 20, 2016
    Posts:
    821
    "Speed per step" will be the same, but if the fps is different, the number of steps per second will be different, so it will seem faster at higher fps.

    GameMaker will try to achieve the fps called for by the Game FPS property (GMS2) or room_speed (GMS1.x and earlier) and if the hardware is capable of running the game at that speed, it will be the same. If the hardware can't keep up, it will slow down.

    Delta time is an advanced concept which requires some deeper understanding, although certainly it's easier to work with if you have a plugin that does it for you, assuming it's well documented and you use the plugin properly.

    I wrote an article on Delta Time not that long ago which is helpful to understand it if you're new to the concepts.

    https://csanyk.com/2018/08/gamemaker-tutorial-delta-time/

    Hope this helps!
     
  3. Amon

    Amon Member

    Joined:
    Sep 13, 2016
    Posts:
    278
  4. YupYup

    YupYup Member

    Joined:
    Sep 2, 2017
    Posts:
    30
    Do you need to control sprite animations and particles speed with steady delta time also ?
    Do you use it only for movement and rotations ?
     
  5. Amon

    Amon Member

    Joined:
    Sep 13, 2016
    Posts:
    278
    Sprite animation, no. Particle speed yes. You need to use it when anything needs to move i.e. a missile, a car, a cloud or particles; including rotations.
     
  6. YupYup

    YupYup Member

    Joined:
    Sep 2, 2017
    Posts:
    30
    You mean particle moving on screen speed, or particles emitter speed parameter ?
     
  7. NeZvers

    NeZvers Member

    Joined:
    Mar 24, 2018
    Posts:
    320
    Step is basically game frame. room_speed is frame limiter (no more frames in second than room_speed) meaning slower device will be too slow to reach room_speed if your game is too poorly optimized for it or some calculation will drop FPS.
    So if you want character move 1px per step and you have room_speed = 60, that mean you want to move character 60px per second but if device slows down you have moved way less than intended.
     

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