feat: cut the online bandwidth to under 2 kB/s per guest with compact commands and frames - #177
Merged
Merged
Conversation
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #176
Ce que fait la PR
src/net/wire.ts:commandetframedeviennent des octets (id joueur, un octet de drapeaux,moveetaimen entiers 16 bits, actions seulement quand il y en a, tick en varint). Salon, lancement et empreintes restent du JSON lisible. PeerJS passe en sérialisationraw(chaîne ou ArrayBuffer tels quels), le transport mémoire des tests passe par le même encodage.quantizeCommand(sa commande), ce que les invités décodent. Le solo et la coop locale ne passent pas par là, leurs empreintes de rejeu ne bougent pas. Lockstep et sim inchangés.aimaléatoire) finit sur une empreinte unique ; il échoue si l'hôte ne quantifie pas.Mesures (banc
?dev=benchen ligne, courtier local, une minute, octets de charge utile du canal pargetStats)Le rendu logiciel fait varier les ticks par minute : octets par tick, puis ko/s à 29 ticks/s.
Cible de moins de 10 ko/s par invité à quatre : 1,8 ko/s envoyés plus reçus.
Preuves
pnpm checkvert ; e2e chromium : tous les tests en ligne verts. Quatre tests solo (feedback, full-game, held-input) ont échoué une fois sous charge et passent seuls.