SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/01/2014, 10:01 PM   #21
MugiwaraNoLuffy
Huge Clucker
 
MugiwaraNoLuffy's Avatar
 
Join Date: Oct 2013
Posts: 254
Reputation: 40
Default Respuesta: Re: Issues with lag compensation

Quote:
Originally Posted by [uL]Pottus View Post
Well lag compensation obviously won't be perfect, but from what I understand the SAMP team has collected data directly related to the original bug I wouldn't call this finding a bug however there is a good reason why it happens just you need to keep in mind a few things.

1.) OnPlayerTakeDamage() and OnPlayerGiveDamage() will not always produce the same bodypart
2.) Just because OnPlayerWeaponShot() is called doesn't mean OnPlayerTakeDamage() will be called but it looks like OnPlayerGiveDamage() is.
1) It's not a bug, because TakeDamage is called when you lagshoot.
2) The same, bullet's impact position isn't synced.
__________________
MugiwaraNoLuffy is offline   Reply With Quote
Old 19/01/2014, 12:31 AM   #22
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,883
Reputation: 1321
Default Re: Issues with lag compensation

I never said It was a bug did I? Also there is no lag shooting anymore it's called lag compensation code OnPlayerTakeDamage() is called when a bullet collision is made on a players client. You think I don't know that already? I was pointing out implications scripters will need to take into account think about what your saying before posting next time please.
Pottus is offline   Reply With Quote
Old 19/01/2014, 12:36 AM   #23
Darius
Big Clucker
 
Darius's Avatar
 
Join Date: Jan 2007
Location: England, U.K.
Posts: 61
Reputation: 15
Default Re: Issues with lag compensation

Quote:
Originally Posted by [uL]Pottus View Post
I never said It was a bug did I? Also there is no lag shooting anymore it's called lag compensation code OnPlayerTakeDamage() is called when a bullet collision is made on their client. You think I don't know that already?
I think you ought to apologise Pottus.
__________________




http://partyserver.us/?page=player&player=[uL]Darius
Darius is offline   Reply With Quote
Old 19/01/2014, 04:46 AM   #24
Kalcor
SA-MP Developer
 
Join Date: Apr 2005
Posts: 1,180
Reputation: 2872
Default Re: Issues with lag compensation

We tried a whole bunch of things in testing and couldn't get this problem to happen.

There's potentionally a lot of things I could try to solve it, but I'd rather confirm it fixed internally before releasing another RC.

If anyone finds an easy way to replicate the problem please let us know asap.

Edit:
The animation IDs didn't turn out to be helpful in this case. It doesn't look like a specific animation problem.

Also, this problem is unrelated to the sniper issue.
Kalcor is offline   Reply With Quote
Old 19/01/2014, 10:01 AM   #25
Tamer
High-roller
 
Tamer's Avatar
 
Join Date: Nov 2011
Location: Turkey
Posts: 1,099
Reputation: 172
Default Re: Issues with lag compensation

Quote:
Originally Posted by Kalcor View Post
If someone could get a log of every shot along with the player animation index that would be helpful. You'd need to fish out which shots didn't work from the log.

Here is an FS to log the shots to scriptfiles/playershots.txt

pawn Code:
#include <a_samp>
#include <core>
#include <float>

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    new message[256+1];
    new weaponname[64+1];
    new File:file = fopen("playershots.txt",io_append);
   
    GetWeaponName(weaponid, weaponname, 64);

    if(hittype == BULLET_HIT_TYPE_PLAYER) {
        format(message,256,"Shooter(%d) hit Player(%d) PlayerAnim: %d Using: %s [%.2f, %.2f, %.2f]\r\n",playerid,hitid,GetPlayerAnimationIndex(hitid),weaponname,fX,fY,fZ);
    }
    else if(hittype == BULLET_HIT_TYPE_VEHICLE) {
        format(message,256,"Shooter(%d) hit Vehicle(%d) Using: %s [%.2f, %.2f, %.2f]\r\n",playerid,hitid,weaponname,fX,fY,fZ);
    }
    else if(hittype == BULLET_HIT_TYPE_NONE) {
        format(message,256,"Shooter(%d) hit World Using: %s [%.2f, %.2f, %.2f]\r\n",playerid,weaponname,fX,fY,fZ);
    }
   
    fwrite(file, message);
    fclose(file);
   
    return 1;
}


If not we might come across it during testing.
I'm loading this script to my server, the server can be found in Hosted tab. (We are in the sake of testing here, so don't find this post offending :P)

Incase you somehow manage to create the bug again, PM me your ingame name, your target's ingame name and also the weapon you used.
__________________
The three stages of truth:

- Ridicule.
- Violent opposition.
- Acceptance.


Quote:
The greatest hypnotist on the planet Earth is an oblong box in the corner of the room. It is constantly telling us what to believe is real. If you can persuade people that what they see with their eyes is what there is to see you've got them. you know because they'll laugh in your face of an explanation that portrays the biggest picture of what's happening... and they have.

Last edited by Tamer; 19/01/2014 at 12:35 PM.
Tamer is offline   Reply With Quote
Old 19/01/2014, 10:30 AM   #26
sampreader
Little Clucker
 
Join Date: Dec 2011
Posts: 36
Reputation: 35
Default Re: Issues with lag compensation

switching vitual worlds seemed to fix it (shooter or/and receiver)
sampreader is offline   Reply With Quote
Old 19/01/2014, 12:24 PM   #27
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,883
Reputation: 1321
Default Re: Issues with lag compensation

Quote:
Originally Posted by Kalcor View Post
We tried a whole bunch of things in testing and couldn't get this problem to happen.

There's potentionally a lot of things I could try to solve it, but I'd rather confirm it fixed internally before releasing another RC.

If anyone finds an easy way to replicate the problem please let us know asap.

Edit:
The animation IDs didn't turn out to be helpful in this case. It doesn't look like a specific animation problem.

Also, this problem is unrelated to the sniper issue.
I have a really good recording demonstrating some new findings of the effects of this bug. You can see the shots are still there but the vector is completely wrong.

LOL @ 37 seconds

[ame]http://www.youtube.com/watch?v=Vs6YR2ZkGYs[/ame]
Pottus is offline   Reply With Quote
Old 19/01/2014, 12:49 PM   #28
[LCK]Chris
Big Clucker
 
Join Date: Jun 2011
Posts: 58
Reputation: 59
Default Re: Issues with lag compensation

Has anyone got this bug without using weapon bugs?
[LCK]Chris is offline   Reply With Quote
Old 19/01/2014, 01:03 PM   #29
uk1
Little Clucker
 
Join Date: Dec 2012
Posts: 1
Reputation: 0
Default Re: Issues with lag compensation

Quote:
Originally Posted by sampreader View Post
switching vitual worlds seemed to fix it (shooter or/and receiver)
Can't disagree.
uk1 is offline   Reply With Quote
Old 19/01/2014, 08:47 PM   #30
JernejL
Beta Tester
 
JernejL's Avatar
 
Join Date: Jan 2006
Location: Slovenia
Posts: 580
Reputation: 418
Default Re: Issues with lag compensation

Quote:
Originally Posted by [uL]Pottus View Post
I have a really good recording demonstrating some new findings of the effects of this bug. You can see the shots are still there but the vector is completely wrong.

LOL @ 37 seconds

http://www.youtube.com/watch?v=Vs6YR2ZkGYs
using modified animations or mods perhaps?
__________________
Please, do no message me anymore, i'm no longer part of sa-mp scene.

I will not reply to private messages.
JernejL is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL issues. JoelR Scripting Help 5 30/12/2012 10:39 AM
Lag issues Scenario Everything and Nothing 22 16/11/2012 12:45 PM
2 issues nuriel8833 Help Archive 13 17/04/2011 08:56 AM
2 Bad Issues :( Rokzlive Help Archive 2 25/02/2011 08:25 PM


All times are GMT. The time now is 02:48 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.