Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Feature Request Lag Compensation is a necessary feature. Is it planned?

Discussion in 'Netcode for GameObjects' started by qNaN, May 21, 2023.

  1. qNaN

    qNaN

    Joined:
    Dec 29, 2015
    Posts:
    26
    After Client-side Prediction with Reconciliation, the next feature should be Lag Compensation, which is essential for any consistent hit detection across the network.
    It is an essential piece in any FPS/TPS or other actionbased games where shooting at other players is a part of the gameplay.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,977
    This feature isn't planned as per the roadmap.
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    The roadmap allows making suggestions. ;)
     
    ledbetterMRI and RikuTheFuffs-U like this.
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,977
    Which is as useful as shouting my suggestions in an empty void, just less cathartic.
     
    gooby429 and ledbetterMRI like this.
  6. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    426
    Not really, there are people on Unity side who actually read that stuff ^^'
    But yeah, I get what you're saying. I have the same feeling whenever I ask my accountant to demistify taxes.
     
    ledbetterMRI likes this.
  7. KikiSaintonge

    KikiSaintonge

    Unity Technologies

    Joined:
    Mar 24, 2022
    Posts:
    12
    Hi there! It's me. I'm the drama. I personally triage those roadmap feature suggestions.

    I prefer to call it "server rewind" since that is essentially what this feature is doing. Unfortunately, Netcode for GameObjects has limitations and is currently not the best solution for competitive, server-auth, PvP types of games.

    However, Netcode for Entities supports all of the main netcode concepts necessary to build a competitive action multiplayer title. Including:
    • Prediction
    • Reconciliation
    • Rollback
    • Determinism (working on cross-plat)
    • Interpolation
    • Server Rewind (lag compensation)
     
  8. ledbetterMRI

    ledbetterMRI

    Joined:
    May 29, 2019
    Posts:
    23
    I haven't used Unity ECS (though I'm fairly comfortable with the architectural paradigm) and I know this question implies a ton of implementation unknowns, but...

    If these features are needed, how practical would it be to integrate Netcode for Entities with an existing gameobject-based project? The project I'm working on has kept the majority of its net code separate from game logic for, among other reasons, the ability to revise/replace the networking layer as painlessly as possible. Currently, Netcode for Gameobjects-based Network Objects observe critical data about clients' offline player state and use that to replicate across the network. Could a similar observer approach be taken using networked entities in a hybrid format?
     
  9. qNaN

    qNaN

    Joined:
    Dec 29, 2015
    Posts:
    26
    I agree, "Lag Compensation" is not an optimal name, since it doesn't accurately describe what is going on. But this is what it is known as in the game development world, so I prefer to go with that.

    I don't understand how smaller companies like Photon and Netick - this is a single developer! (https://assetstore.unity.com/packages/tools/network/netick-free-aaa-networking-engine-205414) - can implement Lag Compensation, and Unity with its size can not. Why?

    The big battle will be for online (and in Unity's case it is against Unreal), as the vast majority of games will be moving in that direction, and to me it looks like Unity is far behind. Which is hard to believe, given the amount of resources you should have available.

    I simply don't understand why you didn't just outright buy Photon, but since you didn't, why not allocate the resources to properly compete?
     
    Last edited: May 27, 2023
  10. KikiSaintonge

    KikiSaintonge

    Unity Technologies

    Joined:
    Mar 24, 2022
    Posts:
    12
    So those two netcodes are built on top of completely different tech stacks which makes hybrid rather impossible. Unless of course, by hybrid you mean mixing tools and UX/workflows of gameobjects, but having the core architecture and performance be entities based - which is something we could look into.

    Lag compensation vs server rewind is a battle of terminologies I have with my devs constantly - having community backup is always nice ;)

    There's a lot to unpack there with your statements, but I should call out that unfortunately the size of a company does not equal speed. In my experience, it's usually the reverse. This is because smaller companies (especially those who develop a package on top of an editor they do not have to take responsibility for) do not have to worry as much about legacy tech or ensuring they can work with other packages or features within the editor. There is a standard that Unity must hold itself to that companies like Photon and Netick do not need to, but inherently still benefit from - does that make sense? Put another way, Unity must put in work to not break anything Photon (or any other asset store package) takes a dependency on, but the reverse isn't true; Therefore, we can't move as fast.
     
    Last edited: May 30, 2023
  11. ledbetterMRI

    ledbetterMRI

    Joined:
    May 29, 2019
    Posts:
    23
    I appreciate the insight! I mean more the latter for sure, using Netcode for Entities as the core networking architecture and doing some kind of data interchange between network entities and offline gameobjects (if that's what is meant by mixing gameobject workflows). Since I have no experience in Unity ECS, I'm speaking from a place of wishful thinking :p. Definitely looking forward to the 1.0 release of UECS in June, no better time to pick up the new workflow.
     
    KikiSaintonge likes this.