Code Monkey home page Code Monkey logo

delaynomore's People

Contributors

genxium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

delaynomore's Issues

Downsync inputFrameIds might not be order preserving in certain cases

On backend, as "Room.downsyncToAllPlayers -> downsyncToSinglePlayer" is always called when "Room.InputsBufferLock" is released (for good reason, i.e. allowing all-confirmed inputFrames to be marked/forced asap), it's possible that in certain cases "inputsBufferSnapshot with larger snapshotStFrameId" is sent BEFORE "inputsBufferSnapshot with smaller snapshotStFrameId" for a same player, e.g. "Room.OnBattleCmdReceived" called twice for different players resulting in two inputsBufferSnapshots with different snapshotStFrameIds but the later "Room.OnBattleCmdReceived" call invoked "downsyncToAllPlayers" earlier.

To prevent such pitfall, it's possible to put each "queueElement = (refRenderFrameId, unconfirmedMask, inputsBufferSnapshot)" into a FIFO queue "Room.downsyncBuffer" while "Room.InputsBufferLock" is still held but before any network I/O, then let "Room.downsyncToAllPlayers" consume it with network I/O.

ConvertToLastUsedRenderFrameId used too conservatively

On backend,

  1. The backend dynamics can be calculated for 1 more renderFrame, i.e. nextDynamicsRenderFrame should be "ConvertToLastUsedRenderFrameId(lastAllConfirmedInputFrameId, inputDelayFrames) + 1" w.r.t. "lastAllConfirmedInputFrame"

  2. When creating inputsBufferSnapshot, refRenderFrameId can just be "ConvertToLastUsedRenderFrameId(lastAllConfirmedInputFrameId, inputDelayFrames)" which is EXACTLY the last renderFrame our "lastAllConfirmedInputFrame" can apply on. There's no need to make an extra "-1".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.