Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theoretically better unlag based on bose position restoring #624

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

a1batross
Copy link
Contributor

@a1batross a1batross commented Jun 7, 2018

How it (should) work?

The main idea is to remember client's bone position on each frame. It's intended to help with situation where one player is updated in real-time, but lagging second player not yet got this updates. Unlag fixes it only for player position(i.e. working when player is running) and does not restores any other states.

Example:
Let's say we have a server with two players and they "see" each other at one frame lag.

  • Frame[0]:

    • Player[0]:
      • Physics is running.
  • Frame[1]:

    • Player[0]:
      • Physics is running.
    • Player[1]:
      • Player[1] is connected.
      • Physics is running.
  • Frame[2]:

    • Player[0]:
      • Player is ducking, i.e. his head is a bit below.
      • Physics is running.
    • Player[1]:
      • Player[1] shoots at Player[0] right to his head. Due to lag, Player[1] sees Player[0] as NOT ducking.
      • Physics is running. Bullet is traced.
      • WITH bone position history:
        • Player[0] origin restored at Frame[1] AND head hull position is restored at Frame[1] position.
      • WITHOUT bone position history:
        • Player[0] origin restored at Frame[1], BUT his bones are set up in Frame[2] position, because previous sequence is unknown.

Yes, this demonstrates only sequence changing(i.e. ducking) but due to unlag imperfection, there can be more real life examples.

P.S. I did not tested this at all as I don't have any server and players. :)
P. P. S. Originally I thought to make this for Xash3D, but it would be faster to check this concept on bigger community.

@a1batross
Copy link
Contributor Author

a1batross commented Jun 7, 2018

Also, don't forget to set up sv_bone_unlag 1 in game config.

Interpolation is done at a4f4e34

frame = &_host_client->frames[SV_UPDATE_MASK & (_host_client->netchan.outgoing_sequence)];

// not a studio model
if( g_psv.models[i]->type != mod_studio )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i -> edict->v.modelindex

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Thanks :)

@@ -1152,6 +1159,89 @@ entity_state_t *SV_FindEntInPack(int index, packet_entities_t *pack)
return NULL;
}

#ifdef REHLDS_FIXES
void VectorsAngles( const vec3_t forward, const vec3_t right, const vec3_t up, vec3_t angles )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to include this under REHLDS_FIXES

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@In-line ok, will remove in next commit.

@di57inct
Copy link

is this the same as how source handles it? if so, PLEASE DONT FUCKING TOUCH IT
i don't want that cancerous source unlag on my goldsource games

@a1batross
Copy link
Contributor Author

@di57inct I don't know how Source doing it.

@di57inct
Copy link

Sounds to me like that's it.
https://youtube.com/watch?v=6EwaW2iz4iA

@a1batross
Copy link
Contributor Author

@di57inct I hear only common words, without the details. Will the reasoning be better? Or just childish "it's cancerous"?

@di57inct
Copy link

I don't have the patience to argue or explain it to you.
Don't force it into the main ReHLDS or if you do, make it optional.
Don't ruin GoldSrc games.

@WPMGPRoSToTeMa
Copy link
Contributor

Sounds to me like that's it.

That's how it currently works (without this commit).
This commit adds only correct interpolation of animations, not player position, it'll be the same.

@di57inct
Copy link

Okay I sure hope so. Thanks for the info.

@a1batross
Copy link
Contributor Author

a1batross commented Feb 5, 2021 via email

@SNMetamorph
Copy link

Is it still actual? It'll be cool to implement it, because there are issues with hitreg in fast-paced mods

@a1batross
Copy link
Contributor Author

@SNMetamorph nah, not really.

You can try reimplement it for Xash though.

@Nord1cWarr1or
Copy link
Contributor

@a1batross hope this PR will be completed & merged

@UnrealKaraulov
Copy link

No video with how to it works? No possibility to merge it?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants