The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
34 views

How do I make my character move during its animation?

I have an OGRE animation problem: I want to control a character with the WASD keys, but pressing W, the character only moves once the animation completes. I want to move the character with the ...
1
vote
3answers
139 views

Why cap game loop delta-time?

I was reading some game's source code on Github and saw this game loop implementation for the first time: var lastTime = 0; var maxTime = 1/30; /** * @param {DOMHighResTimeStamp} curTime ...
1
vote
2answers
73 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
56 views

Timing in fighting game using animations time?

I am developing a 2D fighting game in C++. I have made the basic components such as moving, guarding and even a combo system that works perfectly well. My main concern now is that I want the game to ...
2
votes
1answer
70 views

Giving one controler button two functions

I'm currently working on a game that allows the player to do some different actions. Dodge (X button) Attack (A button) Use Item (Y Button) Block (BButton) I would like to be able to use the "Y" ...
0
votes
2answers
125 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 ...
0
votes
1answer
189 views

C++ timer function acts as if time limit is instantly reached if it is less than 1 second [closed]

I'm trying to make a Snake clone with C++ and OpenGL/GLUT, but I've been having trouble with programming the timed input. I made a timer class, as you'll see below, to be used for the short time ...
0
votes
1answer
86 views

How should I detect collisions with objects on a “timeline”?

I'd like to replicate this game's mechanic of the player smashing walls with a precise timing to a background rhythm. How should I check when each wall should be broken? Does the player animation use ...
0
votes
0answers
100 views

Vsync and Gameloops

I was about to publish my app but I tested it on a cheap Android tablet. It's anew tablet, but a cheap / low spec one. The game runs, but is pretty choppy. I'm made a discovery that quite surprised ...
4
votes
3answers
121 views

Approaches to timed puzzle elements

I'm working on a side scrolling game that has a number of timed puzzle elements. As a simple example: I have a number of moving platforms that have been setup to transition in a pattern. Ideally I'd ...
1
vote
1answer
89 views

How do I temporarily pause an XNA game?

Collision with an enemy should pause the game for 1.5 seconds. My failed attempt: bool tPause; float timer; public ovveride Update(GameTime gameTime) { if(!tPause) { // ... ...
0
votes
3answers
376 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
226 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
536 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
141 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
3k 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
187 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
313 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
580 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
780 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
931 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
410 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
159 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 ...
6
votes
1answer
677 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
213 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
299 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
682 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
443 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
276 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
296 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
307 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
851 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
490 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 ...