Questions tagged [timestep]

A timestep (commonly represented as `dt` or `deltaTime`) is the amount of in-game time that elapses between two discrete updates of a piece of the game's internal state, or the duration that an update operation is meant to model. Timesteps arise in game loops, physics simulations, animation timelines, interpolation, and other systems modeling change over time.

Filter by
Sorted by
Tagged with
3
votes
0answers
80 views

Game runs at different speeds in Chrome versus Firefox

I am using Box2D for physics on the server side. Player position is updated on the server, so there is nothing the client can do except give input. But running game in Chrome only, the player moves ...
0
votes
0answers
96 views

Implementation of continous, grid aligned, smooth movement (C / C++)

I've been trying to make my own implementation of Snake clone using Allegro 5 / C. Unfortunetaly I can't find a good method to align x & y position of snake to grid. I'm looking for some good ...
1
vote
1answer
110 views

Tile based smooth snake movement

while making my own Snake implementation I decided to use delta time for smoothing movement on screen. The problem is that before Snake was moving fixed amount of pixels every frame, but now when ...
-1
votes
1answer
68 views

What is a Frame and Frame Per Second?

I'm new to the unity Editor, trying to understand Unity scripting. What is frame? I can't tell from how it's used whether "frame" is a function, or a measure of time. I see this term used in ...
0
votes
0answers
13 views

Correcting different dash distances depending on frame rate when using deltaTime

I'm trying to make a character do a short hop or dash. The player doesn't have control of the character for the duration of the dash, which is supposed to be about .4 seconds. I tried several ways of ...
1
vote
2answers
109 views

How to handle player input with fixed rate variable fps time step?

I've made a system which uses the ideas from "Fix your Time Step" in order update physics. I'm having trouble finding standard methods for dealing with this when user input affects player movement ...
2
votes
1answer
134 views

How to measure time interval (different languages)

What is the recommended way to measure time intervals for a game loop? Consider the situation in which a developer is writing their own game loop. Using a third party game engine such that you do not ...
0
votes
2answers
36 views

Adding some new velocity to player in FixedUpdate. Should I use FixedDeltaTime or nothing?

I am trying to learn how to move objects in Unity without using the built in features like AddForce etc. Some tutorials on Unity website (and other places) is where I have got most of my 'knowledge' ...
0
votes
1answer
53 views

Unity Events executed out of order

According to this page Events in unity are suppose to execute in a specific order. Specifically, OnCollisionEnter is supposed to be called right after OnTriggerEnter; however, FixedUpdate and Update ...
4
votes
1answer
172 views

Fixed Timestep with Interpolation | Blurry & Choppy

I've been implementing a game loop with a fixed timestep which uses interpolation as described in the (legendary as I have come to find out as it is referenced in almost every post I have read trying ...
0
votes
1answer
57 views

Huge input delay although framerate is stable - possibly related to the DirectX Tool Kit?

I'm in the process of learning how to use the DirectX 11 API and came upon the following problem: Although my rendering function executes quite fast at around 150 fps (as one expects considering how ...
1
vote
0answers
43 views

Keeping simulations in sync over long periods of time

I'm working on a multiplayer game which involves a huge amount of predictable AI enemies, and a few other players. The enemies are the most important to be accurate, because the game involves pixel ...
0
votes
1answer
89 views

Time loop/ticking architecture

Say I build a snooker game, where balls need to jitter around. Balls belong to a class (ball class), where all the ball functions are defined. In the animation, time evolves by a clock ticking ...
0
votes
1answer
60 views

Smooth behaviours at high Time.timeScale

When I set the Time.timeScale in unity very high, many scripts seem to do werid things (because of the high deltaTime they use for their logic). Is there an option ...
1
vote
1answer
229 views

MonoGame tick cannot go lower than 16ms

I'm trying to build play with MonoGame and I'm trying basing this regarding the GameTime steps. In my main Game class that is being run in the main entrypoint of my project, I'm doing something like ...
2
votes
2answers
68 views

How do I use delta time time-stepping in a triple-buffering scenario?

I am creating a graphics application in Metal. One of the things we are suggested to do is to use triple buffers in order to allow for the GPU and CPU to work more in parallel. Essentially instead of ...
1
vote
1answer
350 views

Is Update() called on the very first frame in Unity?

I'm calling Time.frameCount inside Update() and then immediately Debug.Break() to pause the ...
1
vote
1answer
164 views

Fixed timestep without physics?

I read Gaffer's Fix Your Timestep article many years ago, and have since had the impression that game code should have a fixed timestep, with only non-gameplay related tasks outside of that in the ...
1
vote
1answer
439 views

Is Time.deltaTime different on various devices?

Can someone say what is wrong with my code. I have custom timer implemented like this: ...
1
vote
1answer
87 views

Converting Frame-Dependent Movement to Frame-Independent

I fine-tuned some movement physics for a 2D platformer in a frame-dependent manner and now I want to convert them to frame-independent. I though this would be as easy as multiplying a few things by ...
1
vote
1answer
44 views

How to move while a timer is going in an event

I'm trying to make a switch activated gate and this is what I have setup so far "picture #1" but what happens when the timer is going on, I cannot move. so what I'm trying to do is go through the ...
3
votes
2answers
93 views

To implement a game object that expires, should I store the start time and total, or store the remaining time?

Example: There is a bomb (like in Counter Strike) which explodes after 45 seconds. Should I— store the 45 seconds in a variable, and decrease it by the delta time at every update, or store the time ...
1
vote
1answer
265 views

Fixed timestep updates with a variable timestep update

Many suggest that a game loop looks something like this. See: http://gameprogrammingpatterns.com/game-loop.html http://www.koonsolo.com/news/dewitters-gameloop/ https://gafferongames.com/post/...
2
votes
3answers
66 views

Spawn rates and variable time steps

How would I work a spawning algorithm into a sim engine with variable time steps? If each engine step is, say, 1/30 of a second and I have some event occur with a 0.001 probability each step, how do ...
1
vote
1answer
218 views

Timestep with multithreading

There are several questions and articles which deal with timestep - for example: Should game logic update per second or per frame? https://gafferongames.com/post/fix_your_timestep/ Accounting for ...
0
votes
1answer
266 views

How to use delta time when your speed needs to be always the same?

I am using Bezier curve, and that curve positions the entity when the step reaches 1, so anthing between 0 and 1 is his travelling distance. So in my game, according to the speed I set, I want the ...
1
vote
1answer
124 views

Accounting for drift between ticks

What are some solid techniques to account for the gap between processing time and frame update ticks? In other words, the game/render loop looks like this: Some important points: Tick timings are ...
0
votes
2answers
613 views

What is wrong with my deltatime?

I have this simple struct that is supposed to calculate the time difference between 2 frames: ...
3
votes
2answers
313 views

Finding average input value over time in seconds

I'd like to find the average input value from a controller over the last n seconds (say the last 0.1 seconds) and do this every frame. I can see how to do this for the past n frames by storing a list ...
0
votes
1answer
1k views

How can I accurately lerp Colors over seconds?

I have some code to lerp between two colors over a set number of seconds, and the lerp works fine: ...
1
vote
1answer
731 views

Multiplayer networking and understanding snapshots between client and server

Please note: Although this question involves a link to the Source Engine, its really a generic question about client-server interactions in multi-player games, and I think can be answered by anyone ...
0
votes
2answers
170 views

Do I still need limit FPS when I have a variable timestep?

Lets say I have a simple game loop (variable timestep - but it applies also for other timesteps): ...
3
votes
2answers
451 views

Why do we put deltaTime as an argument in render() LibGDX?

I know that deltaTime is the time the last frame took to be rendered. However, I have no idea why we have to put it inside the parameter of the render method. I ...
0
votes
1answer
102 views

What is the formula or algorithm used in libgdx delta time?

I'm studying time stepping algorithm and I need to know how delta time works in libgdx, because I think delta time uses some kind of time stepping algorithm.
1
vote
1answer
2k views

Can I always assume that fixed time step in Unity is reliable?

I was thinking about games on low end machines or phones where the CPU would be limited. If I were to move all of my game logic into FixedUpdate() can I assume that ...
0
votes
2answers
28 views

Timebased transition from start to end value

I'm trying to implement time line objects, the purpose of those would be to issue events at specific times. When and what is specified through objects called units, which is what you attach in the ...
1
vote
0answers
181 views

Physics fixed time step with client/server games

I'm trying to make a 2D platforming multiplayer game with client/server system. I want to use Node.js and Phaser for the display. I read a lot about fixedTimeStep : http://gafferongames.com/game-...
0
votes
2answers
93 views

Time series for creating new events in a PVP game

This is more like a mathematical problem, but I guess this is the best place to ask it. I am working on a PVP concept and I have the following problem. There is a "battle" between two players that ...
3
votes
1answer
629 views

Should camera rotation be framerate independent?

I currently have my own custom first person controller, and the code to rotate the camera and controller based on the mouse position deltas looks like this: ...
0
votes
2answers
1k views

DeltaTime won't create smooth movement

The problem : I tried adding deltaTime into my game, which seems to not be working when I try to smoothly move a object in my game. How I calculate delta time : Delta Time variables : ...
0
votes
2answers
87 views

Running subsystems at difference update intervals

I want to update the rendering at 60fps, but the logic at some lower rate, say 15Hz. But if an object only moves when the game logic updates, then it would appear to stutter badly especially for lower ...
13
votes
2answers
5k views

Movement appears to be frame rate dependent, despite use of Time.deltaTime

I have the following code to calculate the translation required to move a game object in Unity, which is called in LateUpdate. From what I understand, my use of <...
0
votes
2answers
479 views

XNA's GameTime.ElapsedGameTime.TotalSeconds isn't working as expected

As I've seen at quite a few website, the best way to handle variable frame rate and movement (moving projectiles, monsters, swinging swords)... looks something like this: ...
1
vote
1answer
68 views

Better way to timestep?

So I know how timestepping works. As I understand it if I wanted to move a character at the same speed in real-world time I need to simply multiply the movement of the character by DT on each frame. ...
1
vote
1answer
413 views

Fixed-Timestep still updating too fast

I'm trying to figure out if I'm approaching my simple fixed-timestep implementation correctly, following examples such as: Gaffer (without RK4), and DeWitters Currently, I have a game object which ...
1
vote
0answers
67 views

Interpolate Entitiypositions received from Server

I want to Inter, or perhaps, extrapolate the positions of gameentities on the client. Those positions are received from the Server. The vague updaterate of the server makes it difficult to implement. ...
3
votes
1answer
406 views

How do I make a sine wave without using an infinitely-increasing time value as input?

I have a basic understanding of sine wave generation. The problem I am facing is that as the input parameter for time gets larger, my sine wave falls apart and starts to look really ugly. I'd like to ...
1
vote
1answer
470 views

How to use multiplication operation in game render delta time?

We are using delta time like this: ...
1
vote
0answers
149 views

Particle System Tracking

I have a particle system where instead of tracking the time each particle is alive, I just track the time of the oldest particle and the time of the youngest particle. Basically, the oldest particle ...
1
vote
2answers
211 views

How do I implement time scaling?

I want to be able to change the game speed, to speed up or slow down all animations and gameplay. Ideally, this could also be set to a negative number to make everything go backwards. I tried this: ...