Reachless Posted June 1, 2018 Share Posted June 1, 2018 (edited) Hello, I am in a transition from SA:MP to MTA after I was blown out by MTA's advanced features. I am now trying to create a gamemode from scratch in order to learn lua, and I'm currently working on a deathmatch system. I have found a problem (for me), though: sometimes when I'm shooting a running target (and I hit them), the target doesn't always lose hp. Instead, I need to shoot behind that target (in a point where the target was positioned previously). I understand that this a sync issue, but is there a method to bypass this? Can I somehow trust the damager about the bullet sync, instead of the damaged player? Here's a video to prove this: In the video you can see how the targeted player makes the "damaged" animation, but he doesn't lose hp. P.S: I have increased the FPS cap from the default (36 i think) to 60 Edited June 1, 2018 by Reachless 1 Link to comment
Skully Posted June 1, 2018 Share Posted June 1, 2018 Are you sure you have bullet sync enabled in your mtasa.conf file? You can also try adjusting the player sync interval for a server like deathmatch which would require more frequent player updates. Link to comment
Reachless Posted June 1, 2018 Author Share Posted June 1, 2018 Bullet sync is activated. I will try reducing the player sync, but doesn't this use more CPU? Won't there be problems at a big playerbase? Link to comment
Reachless Posted June 1, 2018 Author Share Posted June 1, 2018 I tried reducing the player sync to 50 but it's the same. Sorry for double posting! Link to comment
JustinMTA Posted September 2, 2019 Share Posted September 2, 2019 Check where the player you're shooting at is located on the globe compared to where you or your server host is located. For example, if he's from France and you're hosting in the USA, you'll have lag issues, especially if you're located far from the host too. Good luck Link to comment
Moderators IIYAMA Posted September 2, 2019 Moderators Share Posted September 2, 2019 On 01/06/2018 at 19:38, Reachless said: nstead, I need to shoot behind that target (in a point where the target was positioned previously). Hmm normally you would have to shoot in front of the target and not behind the target. Except when the target his fps is below the standards. The player movement speed is based on fps. So that is why they do not recommend to put the max fps too high for PvP modus. MTA is correcting this by reupdate the position, but that is not enough for the exact position. This issue is hard to solve, even in modern games like battlefield and cod. But there they have serverside bullet detection, that solves partly the issue. DO: exclude players with a too low fps OR reduce the max fps to something most machines can handle. Increased sync works well with good internet, but has the opposite effect for players with bad internet. With other words pick your target group for PvP or find a target group unlike yourself that doesn't mind lag. 1 Link to comment
Scripting Moderators ds1-e Posted September 2, 2019 Scripting Moderators Share Posted September 2, 2019 2 hours ago, IIYAMA said: Hmm normally you would have to shoot in front of the target and not behind the target. Except when the target his fps is below the standards. The player movement speed is based on fps. So that is why they do not recommend to put the max fps too high for PvP modus. MTA is correcting this by reupdate the position, but that is not enough for the exact position. This issue is hard to solve, even in modern games like battlefield and cod. But there they have serverside bullet detection, that solves partly the issue. DO: exclude players with a too low fps OR reduce the max fps to something most machines can handle. Increased sync works well with good internet, but has the opposite effect for players with bad internet. With other words pick your target group for PvP or find a target group unlike yourself that doesn't mind lag. I've played on server which created some kind of own "bullet sync". I'm just curious how it could be done, server owner explained that attacker fully decides if victim was hit (victim got hit on attacker screen - probably ping was not that important factor). Honestly i don't think there is other way than using processLineOfSight + some other event, anyways i don't even know if that function is used for this, just wondering. Link to comment
Moderators IIYAMA Posted September 2, 2019 Moderators Share Posted September 2, 2019 (edited) 31 minutes ago, majqq said: I've played on server which created some kind of own "bullet sync". I'm just curious how it could be done, server owner explained that attacker fully decides if victim was hit (victim got hit on attacker screen - probably ping was not that important factor). Honestly i don't think there is other way than using processLineOfSight + some other event, anyways i don't even know if that function is used for this, just wondering. It is more dirt than magic. One of the first concepts of it was used in this headshot resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=1600 It is really a disgusting concept... function sendHeadshot ( attacker, weapon, bodypart, loss ) At first it looks innocent, but if you see this line, you know you kissed your opponent: if attacker == getLocalPlayer() then if bodypart == 9 then triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss ) setElementHealth ( source, 0 ) setPedHeadless( source, true ) end end end addEventHandler ( "onClientPedDamage", getRootElement(), sendHeadshot ) addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot ) Edited September 2, 2019 by IIYAMA Link to comment
Scripting Moderators ds1-e Posted September 2, 2019 Scripting Moderators Share Posted September 2, 2019 2 hours ago, IIYAMA said: It is more dirt than magic. One of the first concepts of it was used in this headshot resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=1600 It is really a disgusting concept... function sendHeadshot ( attacker, weapon, bodypart, loss ) At first it looks innocent, but if you see this line, you know you kissed your opponent: if attacker == getLocalPlayer() then if bodypart == 9 then triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss ) setElementHealth ( source, 0 ) setPedHeadless( source, true ) end end end addEventHandler ( "onClientPedDamage", getRootElement(), sendHeadshot ) addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot ) I am not sure about that, server i'm talking about it's well done in almost every way, including PvP between players thanks to this "bullet sync", i think it's very complex feature. Atleast it looks like it is, honestly i wouldn't need such thing for my server, but i was everytime curious how it could be done. In my honest opinion, it's incomparable to others servers, maybe just one which have similar, but other in every aspect gamemode. Developer of this server is very experienced, 6+ years of practise, he's contributing to MTA SA, and he's the one of person which was engaged in releasing 1.5.7 version. Link to comment
Moderators IIYAMA Posted September 3, 2019 Moderators Share Posted September 3, 2019 (edited) 7 hours ago, majqq said: Developer of this server is very experienced, 6+ years of practise, he's contributing to MTA SA, and he's the one of person which was engaged in releasing 1.5.7 version. Does this person have a name? Bigbadbutler/PhatLooser from chaos.de perhaps? Probably not, as he is not active any more. He indeed used processLineOfSight. A player will 0.5k+ ping still manages to kill another player. But never the less, it looks advanced, but it is still at the very bone, similar to the headshot resource. It is just way less enchanted, without overwrites. Is the person you meant on this list? Edited September 3, 2019 by IIYAMA Link to comment
Scripting Moderators ds1-e Posted September 3, 2019 Scripting Moderators Share Posted September 3, 2019 41 minutes ago, IIYAMA said: Does this person have a name? Bigbadbutler/PhatLooser from chaos.de perhaps? Probably not, as he is not active any more. He indeed used processLineOfSight. A player will 0.5k+ ping still manages to kill another player. But never the less, it looks advanced, but it is still at the very bone, similar to the headshot resource. It is just way less enchanted, without overwrites. Is the person you meant on this list? Yeah, exactly. I'm talking about samr46. He develops DayZ server since 2013. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now