From 3d1cb65330b40edd01fc8f3d4f13277bcafbfb02 Mon Sep 17 00:00:00 2001 From: juanjp600 Date: Wed, 31 Aug 2016 20:58:01 -0300 Subject: [PATCH] Added design plan Here's a basic outline of what this is going to be, not a really in-depth explanation. --- NETCODE REWRITE DESIGN PLAN.html | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 NETCODE REWRITE DESIGN PLAN.html diff --git a/NETCODE REWRITE DESIGN PLAN.html b/NETCODE REWRITE DESIGN PLAN.html new file mode 100644 index 000000000..e13b7e4ef --- /dev/null +++ b/NETCODE REWRITE DESIGN PLAN.html @@ -0,0 +1,54 @@ + + + +Netcode Rewrite Design Plan + + + +

NETCODE REWRITE DESIGN PLAN

+

Problems with current netcode

+ +

Goals of rewrite

+ +

How new netcode will work

+

Authentication

+Login encryption will be essentially the same as it is now. Hash of hashed password + nonce. +
+
Authentication will be split into two steps: + + +

Syncing data

+Rather than sending data (chat messages, character inputs, etc) with Lidgren's reliability, changes are stacked on each peer's side and given IDs. +
Each peer will tell the other which was the last ID they got. The other peer will send all messages in their stack that are newer than that ID. +
If a peer gets data that it already has, it'll discard it. The other peer will eventually know that it has to stop sending this data. +
+
In the case of player input, the server will freeze each character until it receives input. Once it does, it'll move the player accordingly. +
Clients WILL NOT send positions to the server. Instead, they'll send a queue with inputs from the last frames that haven't been synced, with a limit of about 100 inputs or so. +
Since server will be receiving all inputs from the player, a normal client should not have too much desyncing if their connection is good enough. +
Server will send each client their own positions, because that's the server's decision, not the client's. The client will remember its last 100 predicted positions, so when it receives this data from the server it'll compare with old data and compensate only if there's a big enough difference with that old position. +
+
If none of this makes sense, ask me on Discord and I'll reply whenever I'm on. +
      - juan + + \ No newline at end of file