zoukankan      html  css  js  c++  java
  • 关于游戏网络延迟的资料

    client-server

    1. the server takes snapshots of the current world state at a constant rate and broadcasts these snapshots to the clients.
    2. server -> snapshot  -> client
    3. server  <- userinput <- client
    4. server runs a physical simulation step, checks the game rules, and updates all object states
    5. the client has to tell the server its incoming bandwidth capacity
    6. server doesn't send a full world snapshot each time, but rather only changes, Usually full (non-delta) snapshots are only sent when a game starts or a client suffers from heavy packet loss for a couple of seconds

    Input prediction

    1.local client just predicts the results of its own user commands. 2.if server result != client, Then the client has to correct its own position, since the server has final authority over client-side prediction 3.Prediction is only possible for the local player and entities affected only by him

    Lag compensation

    1.The lag compensation system keeps a history of all recent player positions for one second. If a user command is executed, the server estimates at what time the command was created as follows:

    Command Execution Time = Current Server Time - Packet Latency - Client View Interpolation

    Then the server moves all other players - only players - back to where they were at the command execution time. The user command is executed and the hit is detected correctly. After the user command has been processed, the players revert to their original positions.

    end

    Network latencies and lag compensation can create paradoxes that seem illogical compared to the real world. For example, you can be hit by an attacker you can't even see anymore because you already took cover. What happened is that the server moved your player hitboxes back in time, where you were still exposed to your attacker. This inconsistency problem can't be solved in general because of the relatively slow packet speeds. In the real world, you don't notice this problem because light (the packets) travels so fast and you and everybody around you sees the same world as it is right now.

  • 相关阅读:
    python路径拼接os.path.join()函数的用法
    tensorflow_1.x(七):波士顿房价预测(1),数据读取,准备建模,训练模型、进行预测
    (三)基于tfidf和textrank关键字提取
    (二)TextRank原理与实现
    (一)TF-IDF 原理与实现
    文本分类(七):从理论到实践解决文本分类中的样本不均衡问题
    tensorflow_1.x(六):tensorflow2的简单线性回归,
    tensorflow_1.x(五):在训练中显示损失
    反编译工具的使用
    HttpServletResponse
  • 原文地址:https://www.cnblogs.com/lightlfyan/p/4201109.html
Copyright © 2011-2022 走看看