Skip to main content
5 votes
Accepted

How to solve "server lag" problems that break the game

The easiest solution to the "who did it first?" problem is an authoritative server. Both players connect to the server which handles all the game mechanics. Whatever arrives first at the server is ...
Philipp's user avatar
  • 120k
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
2 votes

Network jitter, client input to server

A simple solution i found, is to keep track of how many server ticks have gone without processing input from the client. This amount is then decremented for each subsequently processed input. This ...
Jpst's user avatar
  • 141
2 votes

How can I standardize ping?

First of all, I commend you for thinking outside the box. Keep doing that. Here are a couple problems off the top of my head with one potential implementation. (Only a partial answer.) It ...
Evorlor's user avatar
  • 5,803
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
Accepted

Is web browsers, how much latency is there with event listeners?

The JS engine of the web browser operates in a single thread and has a task queue which operates on the first-come-first-served principle. That means anytime an event occurs, that event is pushed to ...
Philipp's user avatar
  • 120k
1 vote

Multiplayer networking and understanding snapshots between client and server

The client is currently at Tick=115, but the server is at Tick=130, but why?! Why is the client behind? Because the client has to wait until it has information from the server in order to process it. ...
Aithos's user avatar
  • 249
1 vote
Accepted

How to troubleshoot Godot HTTPRequest latency?

The problem is that I was using Django's built-in development server (runserver), which doesn't really handle multiple requests well. The problem goes away using Gunicorn. It doesn't matter if the ...
user2604415's user avatar
1 vote

How to troubleshoot Godot HTTPRequest latency?

I timed the Godot example (see below) and got the timings below both for curl and godot. Using the debug profiler I did not found any long running thread(s). You could use a process trace tool like ...
Clemens Tolboom's user avatar
1 vote
Accepted

Should I compress WebSocket payload data in a game where latency matters?

The time it takes to pack and unpack the data is likely negligible. But there is a different problem: Compression works best when you have a lot of data to compress. So if you want compression to be ...
Philipp's user avatar
  • 120k
1 vote

Should I compress WebSocket payload data in a game where latency matters?

TL;DR: Will compression hurt? No. But it probably won't help you if your goal is a very responsive game. You have two problems to solve with connectivity... Can I get enough data to the client in ...
Tim Holt's user avatar
  • 10.3k
1 vote

Should the server calculate the time of a player's input, or trust sent data?

As Steve Smith pointed out in the comment above: "the player will always send the correct info about Command Execution Time" - Are you sure? Could be a mechanic for cheating if the player could ...
DMGregory's user avatar
  • 135k
1 vote

Hide network latency for ingame dialog

First, you need to assure that you get your commands to be more stable than "highly unlikely." Why is 'pause' state ignoring remote updates? Second, often quoted networking reference contains ...
Patrick Hughes's user avatar
1 vote
Accepted

Is Update(GameTime) called before it's finished?

No. You have a condition in CheckCollision() that only prints 'Inner' if the condition is true (the condition is that there has to be at least one ...
Steve H's user avatar
  • 5,089
1 vote

RTS Lockstep: How to deal with high latency and packet drops?

It's been a while but I thought I'd answer for posterity. The algorithm is simply: Each player sends his commands to all other players every turn. (If they have nothing to order in particular, the ...
Asik's user avatar
  • 545
1 vote

In lockstep networking game, how to handle sudden lags and disconnection?

Lockstep Networking is simple in theory but hard in practice. I've implemented lockstep networked fight systems for AAA online games and I have a few recommendations. The most important thing is ...
JanSolo's user avatar
  • 95

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