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
0 votes
2 answers
1k views

What is wrong with my deltatime?

I have this simple struct that is supposed to calculate the time difference between 2 frames: ...
WaveOnyx's user avatar
3 votes
3 answers
969 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 ...
Sea Scout's user avatar
0 votes
1 answer
2k 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: ...
Evorlor's user avatar
  • 5,775
0 votes
1 answer
2k 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 ...
smeeb's user avatar
  • 1,045
0 votes
2 answers
330 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): ...
Pins's user avatar
  • 549
3 votes
2 answers
1k 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 ...
chanu19's user avatar
  • 43
0 votes
1 answer
207 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.
Kevin Bryan's user avatar
3 votes
2 answers
4k 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 ...
user3797758's user avatar
  • 3,631
0 votes
2 answers
40 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 ...
MetalGodwin's user avatar
1 vote
0 answers
216 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-...
hilderic sb's user avatar
0 votes
2 answers
117 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 ...
Tasos's user avatar
  • 571
4 votes
1 answer
2k 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: ...
Ethan Bierlein's user avatar
0 votes
2 answers
3k 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 : ...
Biix_2's user avatar
  • 1
0 votes
2 answers
103 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 ...
Anonymous Entity's user avatar
13 votes
2 answers
8k 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 <...
General Waters's user avatar
0 votes
2 answers
1k 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: ...
Shyy Guy's user avatar
  • 589
1 vote
1 answer
82 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. ...
J.Doe's user avatar
  • 289
2 votes
1 answer
777 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 ...
sl133's user avatar
  • 133
1 vote
0 answers
85 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. ...
InsOp's user avatar
  • 153
2 votes
1 answer
429 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 ...
tmp's user avatar
  • 43
2 votes
1 answer
681 views

How to use multiplication operation in game render delta time?

We are using delta time like this: ...
MarsPeople's user avatar
1 vote
0 answers
160 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 ...
user53841's user avatar
1 vote
2 answers
377 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: ...
clamp's user avatar
  • 563
0 votes
1 answer
465 views

Trying to understand the XNA fixed time step game loop logic

I came across the blog post Understanding GameTime, and after lots of reading on fixed time steps in game loops this is the approach I would like to take. In summary, this is the logic from the post: ...
user avatar
1 vote
2 answers
3k views

Really simple count down timer

I'm making a little 2D tank game that fires bullets depending on where you click (This has been done and works a treat). I'm currently working on a timer class with a simple function that displays a ...
Johnathan Brown's user avatar
0 votes
2 answers
4k views

Creating A TickRate Class

I need to implement tickrate into my engine to handle timed events such as pushing out entity updates and I don't know where to start. I have access to a timer which allows me get the time in ...
KKlouzal's user avatar
  • 252
4 votes
2 answers
4k views

Frame-rate independent friction on movement in 2d game

I have been trying to implement a simple physics system for a 2D space game I am making. I have it pretty much working, but I have encountered an issue with the way I apply friction. I have tried ...
Rasmus Øvlesen's user avatar
0 votes
0 answers
174 views

Particle friction with variable timestep in XNA

Alright, so I'm working on an engine of sorts in XNA (yes, it's deprecated, I know) and I'm implementing my own particle system. I've defined a "ParticleEffect" such that when it's supplied a ...
Kyle Baran's user avatar
3 votes
1 answer
656 views

Fixed timestep and interpolation question

I'm following Glenn Fiedlers excellent Fix Your Timestep! tutorial to step my 2D game. The problem I'm facing is in the interpolation phase in the end. My game has a Tween-function which lets me ...
Eric's user avatar
  • 148
2 votes
0 answers
56 views

Xna 4 Model Rotation with inertia not working as expected with variable updates

I am trying to rotate a model with inertia damping with the keyboard. The code works great with a fixed time step but it doesn't behave the same with a variable update frequency. Update method: <...
aammbbeerr's user avatar
5 votes
2 answers
1k views

Why is my gameloop slightly faster than 60 per second?

Here is my gameloop (taken from http://www.koonsolo.com/news/dewitters-gameloop/) which is supposed to limit the game (logic) updates to 60 per seconds and render as fast as the device allows: ...
BungleBonce's user avatar
  • 1,927
0 votes
0 answers
667 views

Run a few seconds of simulation just after loading a scene

I'm looking for a way to execute 3 to 15 seconds of simulation once a scene is loaded. The problem is: some objects can be left suspended in motion while the player exits the scene. their state is ...
Coyote's user avatar
  • 3,220
4 votes
1 answer
515 views

Fixed timestep with interpolation in AS3

I'm trying to implement Glenn Fiedler's popular fixed timestep system as documented here: http://gafferongames.com/game-physics/fix-your-timestep/ In Flash. I'm fairly sure that I've got it set up ...
Jim Sreven's user avatar
2 votes
2 answers
2k views

Physics engine deltaTime and force acceleration

I am working on a physics engine that uses basic Euler integration to compute forces. So, here is the thing: ...
nialna2's user avatar
  • 920
1 vote
1 answer
184 views

GameTime Replacement / Wrapper for Pausing , Slow-mo and 'Fast-mo'

I'm looking to change the way in which my game uses GameTime to run the game so that I can easily pause the game (elapsedTime = 0...
Joe Shanahan's user avatar
4 votes
3 answers
2k views

Smooth interpolation with variable time steps

My game engine just went through a small overhaul that changed its fixed time step loops into variable time steps ones. Though everything has already been adapted steadily to the new environment, ...
Mutoh's user avatar
  • 817
0 votes
1 answer
178 views

Separate game clocks/intervals in XNA

I am making a real time strategy game in XNA. I have separated the Client (rendering, input, sound) code from the Sim (game logic). I want to have features like replaying and fast forwarding. Also, I ...
Rye bread's user avatar
  • 278
1 vote
2 answers
1k views

Movement doesn't look smooth (slight lag)

Currently I'm using a variable time step and when the FPS drops by even a small amount you can easily notice a slight lurch forward of the player. I'm making a platformer and I'm wondering whether I ...
Troubleshoot's user avatar
0 votes
1 answer
533 views

Framerate and game loop on mobile

I'm searching how to manage game framerate on mobiles devices, here is my problem: On a computer with got something like that: ...
Papi75's user avatar
  • 103
1 vote
2 answers
241 views

Updating the jump in game

I am making a Java game and I want my game to run the same on any FPS so I'm using time delta between each update. This is the update method of the Player: ...
Luka Tiger's user avatar
2 votes
1 answer
2k views

What is the correct way to update a physics frame rate?

I've searched around the Internet, and eventually read a suggested article, "Fix your Timestep!". In accordance with the article, I came up with an update method, but I still have problems. Whenever I ...
MahanGM's user avatar
  • 367
1 vote
2 answers
2k views

Should I accumulate state time based on a global or a parameter?

Generally, we associate a "state time" with our sprites. Libgdx provides a method to do so: float deltaTime = Gdx.graphics.getDeltaTime(); However, in the main ...
Vicky's user avatar
  • 21
1 vote
1 answer
537 views

How to make camera rotation independent from frame rate?

I multiply the mouse movement by a given number to get camera rotation of a desired speed. But it only works at 60 FPS. When I don't limit the frame rate I get around 350 FPS and the camera rotation ...
danijar's user avatar
  • 5,681
0 votes
2 answers
207 views

Variable timeStep not working as intended

I've been working on a game in javascript/html5 (through typescript) using my own little library. This library uses a variable timestep since I plan on using it on mobile devices, and I was under the ...
ben657's user avatar
  • 101
8 votes
1 answer
2k views

Timestep in multiplayer game

I'm trying to wrap my brain around the concept of creating a server/client multiplayer experience. My problem is mainly related to timestep. Consider the following scenario: A client connects to ...
jgallant's user avatar
  • 8,374
4 votes
1 answer
737 views

Glenn Fiedler's fixed timestep with fake threads

I've implemented Glenn Fiedler's Fix Your Timestep! quite a few times in single-threaded games. Now I'm facing a different situation: I'm trying to do this in JavaScript. I know JS is single-threaded,...
kaoD's user avatar
  • 1,935
1 vote
2 answers
821 views

Player Movement

I started developing games recently, teaching myself using a german book about C++ and Direct3D 9. The author states, player movement should be implemented using a time delta, like this ...
LaVolpe's user avatar
  • 1,792
17 votes
1 answer
65k views

How to get and use delta time

I have mice looking and walking in my game, but they are very slow and hard to use. I think it's because I'm using fixed speed. I heard that in big projects developers use delta time. How do I ...
Mark Fedurin's user avatar

1
2