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 [timing]

The tag has no usage guidance.

0
votes
1answer
44 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
1answer
184 views

How do I make my game (without performance problems) not stutter?

I've made a game that has gameticks every 1/60 seconds. These gameticks take very little time to calculate (< 0.5 ms). The game is written in Javascript and uses requestAnimationFrame (rAF). rAF ...
0
votes
1answer
150 views

Frame rate independent gameplay implementation in pure Java

I've been looking up on FPS independent movement recently, and I somewhat understand the concept. But I'm having trouble implementing it in pure Java. Any one have any idea of how I could implement ...
0
votes
0answers
31 views

How to determine the amount of idel time left in main thread for Unity before next frame?

Hi I'm trying to improve a thread tool and would like to make a function which use the idle time before the next frame. So how can I determine the time left?
0
votes
1answer
91 views

Implement delay using polling or threads?

I'm making a real-time risk-like game in Python. Players can move armies from one region to another. I want army movement to take time proportional to the distance between the two regions, therefore I ...
9
votes
5answers
2k views

How can I set the duration of a splash screen?

I am using Unity Pro, so I have all Splash Screen Tools available. I have a full screen image which I want to use as my splash screen. I want my splash screen to remain on the screen for n seconds. ...
1
vote
1answer
103 views

Timing in holding LWJGL keyboard event

I'm using LWJGL to develop a 3D game. I'm having trouble with my keyboard handler. My aim is to implement the function which is holding Space then release it to trigger an increasing of the velocity ...
0
votes
2answers
93 views

How long should a user's input be delayed?

For browsing the web, the UX site has a great answer. My question is about games, not forms. How long from the time a button is pressed, should the player's character react? On the one hand, ...
2
votes
2answers
1k views

Game Loop getting 58-62 FPS. Why not exactly 60FPS? (SDL/C++/OSX)

Here's my game loop: ...
0
votes
2answers
81 views

Timing while calling update more than once per frame

TL;DR: Using a timestep method that calls update() multiple times per frame. After an event happens, need to add a wait time before it can happen again. What's the ...
0
votes
1answer
452 views

How to make async step timing (game loop) using Box2D and C++

I'm making a game in C++ using Box2D and WebSocket++. The world needs to updated every 1/60 second. Meanwhile the WebSocket server handles players. How I should ...
2
votes
1answer
421 views

Player motion and combo systems

Where do you usually implement player motion when going through the state machine of a combo system? An example, when player presses X+Y it must do an uppercut like movement (Like street fighter) ...
0
votes
2answers
63 views

Object shrinks at same rate no matter what

I am using the following code to shrink a sprite: ...
6
votes
2answers
567 views

Is it safe to base a combo system in frames instead of time?

I'm building a prototype for a fighting game (not vs, something like Final Fight). I'm trying to define the data for the player combo tree and had a look around looking for inspiration and have seen ...
0
votes
1answer
94 views

Slaving OpenSceneGraph to an external time base?

I'm working on an OpenSceneGraph animation, and I want events in the animation to be synchronized to a time reference provided by my audio player (BASS or FMod). Yes, this is a demo :) . Which time ...
1
vote
1answer
1k views

Libgdx spawning enemies at random time

Hello I want to spawn enemies at certain location but at random time,like for example every 10 seconds. Atm I am spawning enemies whenever I click to spawn heroes but with delay, but I sure does not ...
4
votes
1answer
131 views

Timers and performance for mobile JS

I'm using the Three.js JavaScript library to do some things in WebGL, and I wonder how the graphic aspects of timers are done on mobile. I was creating numbers with geometries and just replacing them ...
6
votes
1answer
170 views

How do I set an object's speed to arrive in X seconds?

I want to move an object to a point in the game world, I have the distance value which is far the player should move. I want to complete the movement in X seconds. I have tried many equations and ...
-2
votes
1answer
174 views

Why is my delta time constantly under 1 millisecond?

I have a game loop that looks like this: while (Sync()) { DoStuff(); } The sync function computes my delta time like this: ...
5
votes
1answer
5k views

In Unity, why do my animator states wait until the end of each animation to change?

I'm trying to make a simple idle-walk transition in Animator using Unity. I've set a script that changes the Speed value from the Animator, and it works perfectly when I move the character forward ...
0
votes
1answer
2k views

Set Non-Looping Animation Time to Seconds

I have an animation that does not loop. It plays for the default duration (n seconds), then stops on the last frame. This is exactly what I want to have happen, but I want it to play for m seconds, ...
0
votes
2answers
2k views

Accurately measure time between calls to onDrawFrame (Android OpelGL ES 2.0)

I'm trying to sort out some timing issues within my gameloop and I've seen something that I don't understand. The Nexus 10 is supposed to have (as far as I'm aware) a VSync on 60Hz. So that would be ...
1
vote
1answer
1k views

Firing bullets with a time interval between them [duplicate]

How can I make my enemies shoot bullets in intervals? I already have the enemy shooting bullets, however my problem is that it shoots the next bullet instantly, making it look like a line instead of ...
1
vote
3answers
1k 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: ...
1
vote
2answers
197 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: ...
1
vote
1answer
597 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 ...
3
votes
1answer
78 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
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 ...
0
votes
1answer
2k 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
139 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 ...
4
votes
3answers
168 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
234 views

How do I temporarily pause an XNA game?

Collision with an enemy should pause the game for 1.5 seconds. My failed attempt: ...
2
votes
3answers
3k 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 ...
2
votes
2answers
2k 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: Using System Time to compute delay times that correctly deal with app pauses? In summary, I am attempting to to introduce a delay (say of 5 seconds or so) ...
0
votes
2answers
4k 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
526 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 ...
5
votes
1answer
20k 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
244 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(): ...
2
votes
4answers
643 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 ...
1
vote
3answers
318 views

Creating an update “Tick” on tiles for simulating growth of plants

In my 2D tile based platformer I have added plants to be able to farm such as the simplest, grass, to other things like corn. Now each of these speacial tiles must be updated to show how much it has ...
11
votes
2answers
975 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 ...
3
votes
2answers
5k 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 ...
5
votes
3answers
7k 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
3k 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 ...
1
vote
1answer
1k 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. ...
1
vote
3answers
180 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
1k 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
449 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
338 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) _________(-21.1)...
1
vote
1answer
176 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 components....