Trust the client architecture OR Clientside

Mac mentioned that they’ll implement solutions to the lag problem at some point. To make a secure system you usually implement client-side prediction: https://en.wikipedia.org/wiki/Client-side_prediction
Validation by the server (and hence detection of mismatches) is done by reproducing the conditions present at the time the client received input using a tick.
http://www.gabrielgambetta.com/img/fpm2-05.png
Gabriella Gambetta explains the concept really well: http://www.gabrielgambetta.com/fpm4.html

EDIT: Valve explained lag compensation quite well: https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking#Lag_compensation

3 Likes

oh shit zennoe is pulling out his math textbook I GOTTA GET OUTTA HERE

1 Like

:frowning2:

2 Likes
2 Likes

what has this turned into

Honestly with a game with (mostly unstable) P2P connections like TU I think it’s best to trust the client more than the server when it comes to the gameworlds. I say that as there was a unit exploit recently down to the game trusting the client too much on gameworld payouts, you didn’t even need to touch to game to spawn units. With a proper anticheat in place I think it’ll work fine.

1 Like

2016

Trusting the client.

Please no. P2P is why there is latency issues and why for certain gamemodes there is host advantage. Better to just have dedicated servers for gamemodes as well and leave the peer to peer for condo’s.

2 Likes

Just wanted to point out that walking and looking around on plaza and condo already uses clientside predictions and lag compensation. It’s missing for guns, the jetpack, ballrace and minigolf.
@Nomad I want dedicated gameworld servers aswell. But you should still be able to host your own gameworld server from within the game.

Except when you are hosting yourself :stuck_out_tongue:

Like the days of Gears Of War on Xbox 360 “The host with the most”

the only real lag i felt in Virus was with the guns. shots are not calculated on the client-side and entirely depend on the server. so pleeaasee dear devs take some inspiration from this wikipage: https://developer.valvesoftware.com/wiki/Latency_Compensating_Methods_in_Client/Server_In-game_Protocol_Design_and_Optimization#Client-Side_Prediction_of_Weapon_Firing

As much as I agree that dedicated servers would be much better than P2P, they currently have no plans on implementing dedicated server support for game worlds. I hope this is something they plan later on in the future but as of now it’s looking far off.

So that’s why shooting in virus feels so delayed.

This has been a planned feature for a while:
https://trello.com/c/mC6cifE4/178-weapon-prediction

It’s lower priority than the stuff we’re working on right now, but once we have time we’ll be working on it I assure you.

Unreal already does latency compensation for movement, we just need to write a system for weapons.
The technique we plan to use is called “Backward Reconciliation”.

At a high level, this is the basic premise:

  1. The client fires the weapon and FX are played back immediately on the client
  2. The client sends a RPC call to the server noting the time the weapon was fired and the forward vector.
  3. The timestamp is checked for validity ( can the user be where it claims to be at that time ).
  4. The server rewinds all players back to the reported time.
  5. A ray is cast from the reported forward vector ( at the interpolated position ) into all other players.
  6. Hit-detection and damage takes place and the appropriate response is sent to all clients.

Please understand that this is by no means a simple feat and that it requires some major changes to the weapon code.
It will be implemented when we have time to implement it.

3 Likes