• How should I try to lag compensate on this?
    8 replies, posted
Hi everyone, just a simple question about lag compensation: Basically, [URL="https://github.com/Mysterypancake1/death-animation/blob/master/lua/autorun/server/sv_deathanimation.lua#L132"]I have some code[/URL] that sets the position of one entity's bones to match the ones of another (in a Think hook to mimic the animation). The problem is that I'm not sure how I could try to do lag compensation for this, I thought about networking the the first entity, which could then be used to set the second entity's bone positions clientside, but I'm not really sure since I've never tried lag compensation before. Any help would be appreciated! Also, you don't need to post any code, just a bit of an explanation or a link to the wiki would be good. Thanks! P.S. - I don't want to simply use the base_gmodentity for this, I'm just testing stuff and I just want to see if positioning a ragdoll would work instead of that
What lag compensation? Do you intend for the ragdoll to be shot? On your place I'd just use bonemerge and then unbonemerge and set up the bone positions and fake velocity if needed when the animation ends.
No, nothing to do with bullets being fired, I just thought using SetPos and SetAngles pretty frequently serverside would cause some sort of lag to be caused for clients with slow internet, maybe not, I don't know. Also, thanks for the bonemerging idea, I never thought about that. [editline]16th June 2016[/editline] Actually, does bonemerging need any lag compensation? I guess not, but I'm just asking [editline]16th June 2016[/editline] Also, is [CODE] some_entity:AddEffects(EF_BONEMERGE) [/CODE] A clientside thing or a serverside thing or a shared thing? The wiki (sort of) says it's a clientside thing, but most addons seem to run it shared. Sorry for all these dumb questions, but I've never even heard of bonemerging before Actually, it's probably shared, that'd make more sense. I guess you need to call SetParent as a shared thing as well
AddEffects is shared. Although it's handles clientside, setting it both ways allows more accurate prediction. [editline]16th June 2016[/editline] *Prediction by other clients on the entity from the networked value.
:snip: Read the post below
It turns out that bonemerging doesn't work between ragdolls and animated entities, so I'm back to the question of lag compensation - If I run SetPos and SetAngles frequently serverside, is there a way to lag-compensate this for all clients so it won't run awfully if they have slow internet?
[QUOTE=MPan1;50542712]It turns out that bonemerging doesn't work between ragdolls and animated entities, so I'm back to the question of lag compensation - If I run SetPos and SetAngles frequently serverside, is there a way to lag-compensate this for all clients so it won't run awfully if they have slow internet?[/QUOTE] That's not what lag compensation does. Why the hell do you even need to bonemerge, you already have a model playing the animation, all you have to do is create the ragdoll with proper bone positions once the animation is finished and you are done.
[QUOTE=Robotboy655;50543516]You already have a model playing the animation, all you have to do is create the ragdoll with proper bone positions once the animation is finished and you are done.[/QUOTE] That's what I'm currently doing, but the problem with that is that tons of addons (dismemberment mod, first person death, etc) don't work with that since they require a ragdoll for the ENTIRE duration of the death. Also, since I use OBS_MODE_CHASE to spectate the ragdoll, when the first entity gets swapped with the ragdoll, there's a visible 'jump' in the screen when the SpectateEntity is changed. [editline]18th June 2016[/editline] All I'm asking is how I should be setting the bone positions of the ragdoll in a less-laggy way. I don't know what the proper name for this is, but all I think is that there has to be a better way to do this than doing it all serverside.
I think I'll close this thread for now and open one with a better name
Sorry, you need to Log In to post a reply to this thread.