Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Sep 2012
Offline Last Active Nov 06 2012 02:41 AM

Topics I've Started

How do I view the articles so that the code samples aren't messed up?

03 November 2012 - 07:21 PM

This is what I see when I try to read this Spatial Hashing article:

Posted Image

All of the articles are like this... it makes the code samples pretty useless. Should I be viewing them through another source or something?

Keeping physics consistent under varying processor load: what's this called?

07 October 2012 - 11:42 AM

I have what is undoubtedly a common problem, but I don't know what it's called, and thus am having trouble finding solutions.

Suppose in a game, holding down the right arrow makes the player's avatar move 2 pixels to the right.

If the game loop runs 100 times per second, then the avatar moves 200 pixels per second.

But of course, we cannot rely on the game loop running the same amount of times every second.

If the game loop runs 10 times the next second, the avatar will only move 20 pixels.

I know that in the vocabulary of graphics programming, the solution to this is called "frame locking", but I'm not just talking about animation updates; this affects the physics of gameplay itself. The game I'm currently writing is also networked using a client/server approach, so it affects multiplayer balance as well.

What is this problem called? Where can I start finding some basic solutions? So far it seems like I'll need to keep track of physics updates the same way an FPS-lock keeps track of frame draws, and lock them similarly. It would be great to see some discussion of the topic, though.

I don't mind if the best articles only cover the non-networked case; if I know how to solve it for an offline single-player context, I can probably figure it out from there using my meager existing knowledge about latency handling and client-side prediction.