Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
21 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
151 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
50 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
40 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
81 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
44 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
176 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
51 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
186 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
122 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
318 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
75 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
42 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
91 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
190 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
61 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
192 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
205 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
113 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
534 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
264 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
795 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
642 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
143 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
414 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
98 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
26 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
168 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
91 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
521 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
980 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
85 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
394 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
65 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
382 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
66 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
402 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
449 views

How to use multiplication operation in game render delta time?

We are using delta time like this: ...
1
vote
0answers
147 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
199 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: ...
0
votes
1answer
317 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: ...
1
vote
2answers
2k 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 ...
0
votes
2answers
2k 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 ...
3
votes
2answers
2k 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 ...
0
votes
0answers
142 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 ...
3
votes
1answer
358 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 ...
2
votes
0answers
54 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: <...
5
votes
2answers
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: ...