Post news Report RSS Our Checkpoint System

How can we know where are the players in an online racing game? We proudly present to you our custom “checkpoint system”! Let’s see how we got here, for those of you working in a similar problem or are inquisitive about technical aspects of online games.

Posted by on

How can we know where are the players in an online racing game? We proudly present to you our custom “checkpoint system”! Let’s see how we got here, for those of you working in a similar problem or are inquisitive about technical aspects of online games.

Our first try consisted in a classical checkpoint system, very similar of today’s racing games: a lot of invisible “boxes” interconnected, following the road. Every time a player touches one of these boxes, we know the portion of the circuit the player has completed.

This approach is actually fine… if we were an offline game.

Unfortunately, we cannot use this simple solution in an online game, where we must be extremely lag-tolerant and a bit forgiving. Packets sent through the network may be lost, corrupted, or cheated. But on the same time –for certain other reasons- we cannot emulate the player’s movement in our servers with total accuracy.

So in the end, to our servers, the placer is “jumping” from position to position, and due to architectural reasons, there is no workaround on that. We had to cope with it. The immediate problem this presented in testing sessions was a well-known issue: The Bullet Problem.

The Bullet Problem is very simple to understand: if our car is “jumping” from position to position, it may miss touching a checkpoint! This problem is worsened by lag. And thus, this problem broke completely our previous, classical checkpoint system.

The Bullet Problem. The car jumps from t1 to t2 missing the checkpoint.

Of course there are a lot of ways in which we can solve this problem. But actually, FW has an architecture a bit more compelx than many online games, so certains solutions which may be valid for you that we could not use.

Typical solutions range from authoritative servers (a past-decade favourite), unorthodox and “dirty” fixes like increasing the width of checkpoints and the car’s detection area, to more complex and ellegant solutions like raycasting towards the last stored position. All of these solutions may be ok for some games, but due to our exigent architecture none of them worked for us.


So we created a new system, inspired by the last-position raycasting but extending its power to adapt to any circuit geometry. It works like this:

Our new checkpoint system detect without error where a player is at by creating a “box” between last stored checkpoint and a few next ones. This box is deformed to adapt to the rotation of checkpoints.

Then, we check if the player is in that box.


This way, we check a few checkpoints forward. The number of checkpoints we check define our lag tolerance and at the same time we can roughly detect “potential” cheatings by detecting situations in wich a player could not possibly be at, even if a lot of lag slowed down the network. We can even know if the player has been going in the right way, in wrong way, or even correcting its position, and we can act accordingly.

This system has demostrated to be robust and efficient and we are sure this will help in delivering the best experience for anyone playing Formula Wincars!

More info and other dev post at our blog www.formulawincars.com

Post comment Comments
hashpling
hashpling - - 35 comments

Whoa, smart move!

Reply Good karma Bad karma+2 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: