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

PAC doesnt follow lag compensation in TTT #1341

Open
Earu opened this issue Mar 25, 2024 · 5 comments
Open

PAC doesnt follow lag compensation in TTT #1341

Earu opened this issue Mar 25, 2024 · 5 comments

Comments

@Earu
Copy link
Contributor

Earu commented Mar 25, 2024

To reproduce this issue, have a player wear an outfit with model parts parented to any bone of a player. Hit the player while they are moving, notice how the part are desync'd.

@CapsAdmin
Copy link
Owner

related garrysmod issue
Facepunch/garrysmod-issues#884

@wrefgtzweve
Copy link
Collaborator

wrefgtzweve commented Apr 4, 2024

If i understand the issue correctly whats shown in the video is what you mean right?
Did a test with this, seems like only GetBonePosition is affected while GetBoneMatrix + GetTranslation doesnt

gmod_erEwwfLhcl.mp4

The test code:

hook.Add( "HUDPaint", "BoneExample", function()
    for _, ply in ipairs( player.GetAll() ) do
        if not ply:Alive() then continue end
        if ply == LocalPlayer() then continue end

        local bone = ply:LookupBone( "ValveBiped.Bip01_Head1" )
        if not bone then continue end

        local matrix = ply:GetBoneMatrix( bone )
        if not matrix then continue end

        local pos = matrix:GetTranslation()
        local toScreen = pos:ToScreen()

        draw.SimpleText( "GetBoneMatrix", "DermaDefault", toScreen.x, toScreen.y, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )

        local pos = ply:GetBonePosition( bone )
        local toScreen = pos:ToScreen()

        draw.SimpleText( "GetBonePosition", "DermaDefault", toScreen.x, toScreen.y, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
    end
end )

@TW1STaL1CKY
Copy link
Collaborator

TW1STaL1CKY commented Apr 4, 2024

Yeah, that is the problem. It looks like PAC does mainly use Entity:GetBoneMatrix, though there are a couple of spots still using Entity:GetBonePosition it seems. Those few instances are likely the cause

@CapsAdmin
Copy link
Owner

CapsAdmin commented Apr 4, 2024

Last time I looked into this, I couldn't figure out how to use GetBoneMatrix without breaking the part placement of old outfits.

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

No branches or pull requests

5 participants