Tagged Questions

The tag has no usage guidance.

2k 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 Time.deltaTime should make the final ...
29k 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 ...
1k 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 ...
911 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: long ...
680 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, ...
458 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,...
323 views

How can I speed up cocos2d game engine?

I am developing a tower-defense game and I want to permit user to change game engine speed ,for example rotation speed of towers,rockets speed ,enemies moving speed ,counters and etc proportionally. ...
326 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 ...
605 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 ...
856 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: function applyForce (rigidbody, force) { rigidbody.forces.add(force); } function ...
208 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 ...
48 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: ...
353 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 ...
578 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 ...
59 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: public void ApplyRotation() { this....
48 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. ...
96 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 ...
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 game loop, we have a delta time as a ...
151 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) or change how slow/fast the in game elements interact as a scaler of ...
239 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 ...
113 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: ...
1k 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 ...
375 views

Correct way to update my physics frame rate

I've searched around here and Google and at last I looked at Fix your Timestep! article on the web which most of the people suggest. In according to that article I came up with an update method like ...
35 views

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. ...
100 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 ...
620 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 ...
59 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 only moves when the game logic updates, then it would appear to stutter badly especially for lower ...
110 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 : float ...
71 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: //This position += ...
213 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: ...
139 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 ...
386 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: void main() { while(game.isRunning()) { event.handle(...
112 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 ...