The tag has no wiki summary.

learn more… | top users | synonyms

-2
votes
2answers
110 views

Delta times and frame lag in the game loop

Let's say we have a standard gameloop like this, in pseudocode: while (true) { dt = GetDeltaTime(); Update(dt); Render(); } Here Update(dt) either uses a true variable timestep, or it ...
2
votes
2answers
120 views

How can I create delays for sprite animations that work correctly when the application is killed and restored?

Please see my original question here: How should I use system time to compute delay times without stutters? In summary, I am attempting to to introduce a delay (say of 5 seconds or so) before a ...
0
votes
2answers
160 views

Using System Time to compute delay times that correctly deal with app pauses?

In my Android app I have the requirement to introduce small (for slowing down animation) and larger delays (for the purpose of delaying the appearance of a character for example). I've experimented ...
0
votes
1answer
105 views

Timing Calculations for Opengl ES 2.0 draw calls

I am drawing a cube in OpenGL ES 2.0 in Linux. I am calculating the time taken for each frame using below function #define NANO 1000000000 #define NANO_TO_MICRO(x) ((x)/1000) uint64_t getTick() { ...
0
votes
1answer
2k views

How do I make a game tick method?

I've seen in some other simple 2D games that a "tick" method is used to sync game logic and graphics rendering. My main reason for using this is due to my collision detection malfunctioning, since ...
1
vote
2answers
174 views

Game loop delta, factoring execution time?

Was thinking this morning, I 99.9% of the time, only see a main game loop, looking like this, just as much so where the delta is passed into update(): while running getDeltaTime() ... f(deltatime) ...
2
votes
4answers
218 views

Timing - use individual timer for every task or global timer?

I'm writing a game, where a player controls a spaceship. It regenerates energy over time. So I need to make a little timer that adds certain amount of energy to the pool per second. My enemies also ...
11
votes
2answers
505 views

Ghost replay - storage and timing

I am working on a car race game and just implemented a ghost sprite for replaying past races. I use a physics engine and after much reading I came to the conclusion that the best way to store the ...
2
votes
2answers
2k views

Frame timing for GLFW versus GLUT

I need a library which ensures me that the timing between frames are more constant as possible during an experiment of visual psychophics. This is usually done synchronizing the refresh rate of the ...
2
votes
1answer
588 views

using std::chrono::steady_clock for timing

I was wondering if it would be a good idea to use the steady_clock class (in the C++ std libraries) for game timing. What are the pros/cons of using it as opposed to using a game library's timing ...
2
votes
2answers
735 views

How to slow down a sprite that updates every frame?

I am going through a Allegro 5 tutorial which has a game loop. There is also a variable "active" which determines if a key is being held down. Thus if the left key is being held down active is on and ...
0
votes
1answer
281 views

Passing elapsed time to the update function from the game loop

I want to pass the time elapsed to the update() method as this would make easy to implement the animations and time related concepts. Here's my game-loop. public void gameLoop(){ boolean running ...
1
vote
3answers
146 views

Shooting intervals with variable framerates

lets say i have a gun which fires at a rate of 10 shots every seconds. so i every gameloop frame, i check if the necessary time has passed and instantiate a new shot. now what if the framerate of ...
5
votes
1answer
577 views

When to detect collisions in game loop

My game loop uses a fixed time step to do "physics" updates, say every 20 ms. In here I move objects. I draw frames as frequently as possible. I work out a value between 0 and 1 to represent the ...
4
votes
1answer
192 views

ID3D Query Where should I put them?

I'm currently trying to time different parts of my rendering to see how long it takes. I've got the queries working and I'm getting some results. My question is where should I actually start and end ...
1
vote
1answer
282 views

Stuck at enemy movement

I am making a TD game in unity, Initially I made all of my enemy movements frame rate dependent say: I had a grid point1 at -22.65 and other at -21.1, diagrammatically: (-22.65) ...
1
vote
1answer
141 views

How can I throttle certain player actions?

Background I have a variable time step, component based game, with components that collectively hold an entity's properties and different systems that act on entities with certain required ...
11
votes
3answers
2k views

How can I implement a “fast-forward” feature in my game?

How can I implement the fast forward feature for my tower defense game like in http://fieldrunners.com/ and other TD games? I am using Unity 3D. Would there be something to manage fewer frames per ...
14
votes
5answers
617 views

How to tie a bullet release with a firing animation

Lets say you have an animation that you want to happen when firing a bullet. How would you get the bullet to show up at the end of the animation. The only thing I can figure out is to know the time ...
6
votes
2answers
417 views

Is it possible to have concurrent collision detection where every entity acts at exactly the same time?

There are many algorithms that can be used for collision detection. In many cases we check for an overlap in coordinates of an entity. If we make a triangle a,b and c. We have 2 entities at a and b ...
4
votes
2answers
271 views

How to store the state of the world for a fixed time step?

Most of the posts on fixed time steps say something like this: State previous; State current; while ( !quit ) { double newTime = time(); double frameTime = newTime - currentTime; if ( ...
3
votes
2answers
291 views

Variable-step update() in game loop is falling behind, how can I get around this?

I'm working on a minimal game engine for my next game. I'm using the delta update method like shown: void update(double delta) { // Update code that uses `delta` goes here } I have a deep ...
1
vote
1answer
291 views

What time to display in text messages in multiplayer game?

Say I'm having a multiplayer RTS game. There's a main server for each individual game and several clients connected to it. All packets are sent to server first and then server retransmits them back to ...
5
votes
2answers
764 views

Splitting a tetris game apart - where to put time-management?

I am creating a tetris game in C++ & SDL, and I'm trying to do it "good" by making it object-oriented and keeping scopes small. So far I have the following structure: A main with some lowlevel ...
3
votes
2answers
457 views

Time granularity for games

So far I've always used a time granularity of 1 msec (that's it, 1 millisecond is the atomic time unit). I'm wondering if this is always fine, or if for some cases (some specific games, game ...