Skip to main content
7 votes
Accepted

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

SDL_Delay() doesn't really have fidelity of any sort; it puts your main thread to sleep, and once your thread is sleeping it's up to the OS to decide when to wake ...
Trevor Powell's user avatar
5 votes
Accepted

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

Locking at 60 fps is certainly viable. From what I've seen, just as you've said, it appears fighting games typically describe timings in number of frames, even as most fighting games have transitioned ...
Jibb Smart's user avatar
  • 2,460
3 votes
Accepted

Should I bother with SDL_WaitEvent?

That's an interesting problem, I handle my SDL events like this, while (SDL_PollEvent(&e) != 0) { // handle events here } This will handle all the SDL ...
Tonia Sanzo's user avatar
3 votes

How long should a user's input be delayed?

As discussed in the question's comments, there should be no delays between the moment the payer hits the button and the visual feedback on the screen. As for the time taken to "unsheathe the sword, ...
Vaillancourt's user avatar
  • 16.3k
2 votes

How can I set the duration of a splash screen?

I don't have Unity Pro, but I've created my own "splash screen" in the past by just using Unity GUI. Then you have complete control.
carlilelance's user avatar
1 vote

How to make real-time pvp game where both players perceive in-game time normally while actual relative time-flow speed between them is different?

Combining different techniques There are multiple techniques to achive this and all of them will feel really bad for the player if overdone. To reduce the "bad feeling" I suggest to combine ...
datacube's user avatar
  • 213
1 vote

Should I bother with SDL_WaitEvent?

As you pointed out, SDL_WaitEvent is not suitable if you need to draw even if there are no input events. That is not desirable for games. But it could be useful, ...
tuket's user avatar
  • 485
1 vote

Timing in holding LWJGL keyboard event

Why not get the system time upon the 1st detection of the event, then get the system time when the event is no longer detected (i.e. "button up")? This interval could then be used to calculate the ...
KareemElashmawy's user avatar
1 vote
Accepted

Huge input delay although framerate is stable - possibly related to the DirectX Tool Kit?

Your main Win32 message pump is only ever processing a single Win32 message per frame. You need to empty the message queue between each render frame since there are usually dozens or more messages ...
Chuck Walbourn's user avatar
1 vote

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

What you're experiencing is called judder - it comes from a mismatch between the rate at which motion is updated and the rate at which it's displayed/sampled. Sometimes a sample falls immediately ...
DMGregory's user avatar
  • 135k
1 vote

Implement delay using polling or threads?

Handle it in the main update loop if you can. The first rule of multithreading is: Don't use multithreading unless you have to. "X and Y should happen simultaneously from the perspective of the user" ...
Philipp's user avatar
  • 120k
1 vote

How can I set the duration of a splash screen?

The splash screen stays some minimum amount of time plus until the first scene is ready. Haven't tried it myself yet but what you can possibly do is -using the background image-, you can delay the ...
Lexicon's user avatar
  • 251
1 vote
Accepted

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

It looks you fell into "I need this!" scheme. But all you need is just call some specific part of game loop asynchronously or non-blocking. How to achieve this? Make sure whole loop is executed 60 ...
Mars's user avatar
  • 233
1 vote
Accepted

Object shrinks at same rate no matter what

It turns out I should have paid more attention in CS class. I didn't realize Unity overrides any initialized values from scripts with whatever is present in the Inspector. Having made all my variables ...
Matt's user avatar
  • 375
1 vote

using std::chrono::steady_clock for timing

Try this: ...
Avery Michelle Dawn's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible