Wednesday, September 18, 2013

Daily Update: Networking Code Progress

These past couple of days, I've been working on getting the network code in a better state.

hold tab to show player names

console dropdown


Yesterday, I added a couple features such as the reliable packet layer, player list, and chat messages. The Console subsystem I wrote for a previous project is becoming incredibly useful for debugging and development. It allows me to bind any key to a test function, as well as any c++ variable to a console variable(cvar). This means, instead of recompiling the project to try out a player gravity of 0.8, you can simply type something like 'sv_gravity 0.8' into the console. As you might be able to tell from the screenshot, the Console is very much influenced by the Quake/HalfLife engine :)


Today, I added entity interpolation and a basis for client prediction.

I'm really happy with the interpolation code I wrote. The way the engine is structured, the game logic tickrate is completely separate from the graphics tickrate. So even though the server and client's logic run at 20 frames a second, the entities are drawn on the screen interpolating smoothly at over 100 frames per second. All I need to do is structure this new code to be applicable to all objects, not just other players.

In addition, I added basic client prediction to your character. It works in the sense that the player's input is immediate, but because there is no interpolation for your own player it still feels jerky. I'll be fixing this soon for sure.

Feeling good about progress right now! My sleep schedule is really off, but I can say I'm productive.

Immediate TODO:

  • Generalize interpolation code
  • Smooth out player prediction
  • Do some online testing with four people

No comments:

Post a Comment