Register

If you already have an account with us, please use the login panel below to access your account.

Page 1 of 2 12 LastLast
Results 1 to 20 of 29
  1. #1
    3 Year Veteran MrBlackman's Avatar
    Join Date
    Nov 2012
    Location
    Slovakia
    Posts
    98
    In-Game Name(s)
    Bobby Apple
    Post Thanks / Like

    Ping and Sever Lag

    Basics Understanding Ping and Lag

    In this thread I would like to explain what ping is, and what is really causing the current lag on the server. Why am I doing this? To stop people from asking when the host will be changed, because this isn't the HOSTS fault.

    Ping

    Ping is a tool to measure how how long it takes for the server to send you a package(some data) and come back.Ping is measured in milliseconds, meaning if you have 98 ping it took 98 milliseconds to send the package to you and back.

    Higher the ping, the more the game lags for you, especially sync wise more than chat lag(unless your ping is like 500).

    What causes high ping? Well there can be more reasons, but the main two I can think of is your ISP being SHIT, and/or you are far away from the host.

    Server Lag

    Most people think the current server lag is caused due to the HOST, and them being far from the host so their ping is high. No this not true, the problem is the script.

    Okay so what you need to understand first is SAMP is single threaded. Single threaded means it executes one command(I don't mean player commands) at a time. For example, if player 1 types a /me, and player 2 types a /me a millisecond later, player 2 will have to wait until the first /me is executed. Now a /me command takes less than a second to execute, so that's not the problem right now.

    The biggest issue we have is loops. For example, "OnPlayerUpdate" is called MANY times per second. So think of this, if OnPlayerUpdate gets called right before you say something in the chat, your message won't be executed until OnPlayerUpdate is.

    What does this mean? Nothing usually, probably a split second most of the time. But if the there are many functions under OnPlayerUpdate it will take longer, especially with over a 100 players. Why? Because the more players, the more time it takes to loop through them.

    Another problem is strcmp, a so called "command processor". The original GF script uses strcmp, which SARP is based off of, so unless every single command was changed, we still use strcmp. What is the problem? Strcmp is much slower than other newer command processors, as it is not meant to be a command processor. Strcmp is simply a function that compares strings, but in the old days of SAMP they didn't know better so they used it as command processor. Which was fine back then, as scripts weren't complex and complicated, but as times goes by,scripts get bigger and more complex.

    Conclusion


    It is a bit complicated to understand, but I hope people get what I was trying to say here. So now that I've explained this, I hope you will already shut up about the host.

    Also, I'd really like to thank the admin and development team for admitting that this is a script problem and not the host. I also know that they are working hard to get this fixed.

    Last edited by MrBlackman; 20th November 2012 at 12:00 AM.
    Bobby Apple


  2. Thanks Justin Fakie, Claude™ thanked for this post
  3. #2

    Senior Community Helper
    3 Year Veteran
    500 Posts500 Posts500 Posts500 Posts Todd Stark's Avatar
    Join Date
    Mar 2012
    Location
    Asia Pacific.
    Posts
    2,192
    In-Game Name(s)
    tode sterk pls
    Post Thanks / Like
    Nice guide.
    I'll be back.

  4. #3
    Vinny Meadows
    Guest
    Thank you for clarifying this :]

  5. #4
    8 Year Veteran 500 Posts500 Posts500 Posts500 Posts500 Posts Cartorious.'s Avatar
    Join Date
    Jan 2012
    Location
    Stamford Bridge.
    Age
    34
    Posts
    3,533
    In-Game Name(s)
    cart
    Post Thanks / Like
    Nice guide , thank you.
    [

  6. #5
    3 Year Veteran MrBlackman's Avatar
    Join Date
    Nov 2012
    Location
    Slovakia
    Posts
    98
    In-Game Name(s)
    Bobby Apple
    Post Thanks / Like
    Another thing I forgot to mention, is that if the server has a slight lag spike, it can stop executing commands(again I don't mean player commands, but script functions). This means the amount of commands needing to be executed stacks up, and SAMP being single threaded they have to be executed one by one. This is why there is so much chat lag when hackers are on.

    All of this just shows how important code optimisation is needed.
    Bobby Apple


  7. Likes Justin Fakie liked this post
  8. #6
    1 Year Veteran 500 Posts Hollohan's Avatar
    Join Date
    Oct 2012
    Location
    Hidden in the Leaf
    Posts
    570
    In-Game Name(s)
    Hollohan_Cortez, Jhon_Devil
    Post Thanks / Like
    I understand what you're trying to say man
    "Matt your hp is lower then my nuts." -Jhon Devil
    Past Factions SANG under Tariqq Gambino and some other leaders R4, LSPD TDB R2 under Oliver Keys, Michael Watson, Claude Richards
    Co-Owner of _Devil Surname restriction.

  9. #7
    4 Year Veteran Batman.'s Avatar
    Join Date
    Jul 2011
    Location
    Skopje, Macedonia.
    Posts
    1,610
    In-Game Name(s)
    Oneyseven_Frawns
    Post Thanks / Like
    This even helps out the helpers team, since we didn't understand the issue that much, as we were only notified it was due to the script, not the host.Thank you, it's a great guide.
    Can't con the Don.

  10. #8
    Chartered Old-School Legend 500 Posts500 Posts500 Posts Hallar Maraz's Avatar
    Join Date
    Oct 2009
    Location
    Pakistan
    Posts
    1,764
    In-Game Name(s)
    Hallar Maraz
    Post Thanks / Like
    gj.
    ..




    The gun is cold, the blood is hot ^^ ~

  11. #9
    3 Year Veteran Zennor_Lock's Avatar
    Join Date
    Sep 2011
    Age
    33
    Posts
    56
    In-Game Name(s)
    Zennor_Lock Freddie_Jackson
    Post Thanks / Like
    Thanks for this post, now all the bitchers have something to shut them up.
    | Freddie_Jackson | LvL 10 |
    | Zennor_Lock | LvL 8 |

    YOUTUBE CHANNEL

  12. #10
    8 Year Veteran Bert's Avatar
    Join Date
    Dec 2011
    Posts
    375
    In-Game Name(s)
    Bert_Ruthless
    Post Thanks / Like
    NIce Guide coz I'm from GMT+8 and always lagging as fuck.

  13. #11
    Banned
    Join Date
    Jun 2012
    Age
    34
    Posts
    175
    In-Game Name(s)
    Kris Yellow
    Post Thanks / Like
    awesome

  14. #12
    10 Year Veteran 500 Posts500 Posts Mr.Silver's Avatar
    Join Date
    Jul 2011
    Location
    -
    Posts
    1,374
    In-Game Name(s)
    -
    Post Thanks / Like
    ye okay, and how it can help me?
    Gott mit uns

  15. #13
    3 Year Veteran MrBlackman's Avatar
    Join Date
    Nov 2012
    Location
    Slovakia
    Posts
    98
    In-Game Name(s)
    Bobby Apple
    Post Thanks / Like
    Well there's two reasons why I made this post. First is to inform people on how ping works so they understand it. Second is to explain why the sever is lagging, so they can stop asking. It can also help future developers not make mistakes that the ones before did, but I doubt the server would hire scripters that didn't know this.

    So yea MrSilver this probably won't help with the actual lag, but now you understand it so there is one less person asking about it.
    Bobby Apple


  16. #14
    Old-School Veteran
    Retired Executive Administrator
    Claude™'s Avatar
    Join Date
    Aug 2010
    Location
    Boston, Massachusetts - temporarily living in Europe, Latvia.
    Age
    34
    Posts
    5,527
    In-Game Name(s)
    Claude Richards
    Post Thanks / Like
    Great tutorial, it will make ''gamers'' without acknowledgment what SAMP is to understand what's going on. Great tutorial, a useful one.
    For faction members: add *FACTION* prefix to your PM subject for faction related things

  17. #15
    Banned
    Join Date
    Jun 2012
    Age
    34
    Posts
    175
    In-Game Name(s)
    Kris Yellow
    Post Thanks / Like
    cooooool

  18. #16
    Snitch Aero__'s Avatar
    Join Date
    Nov 2012
    Location
    I'm not sure.
    Posts
    64
    In-Game Name(s)
    Dom_Aero
    Post Thanks / Like
    Ah, thanks for this!

  19. #17
    9 Year Veteran 500 Posts Jay Westwood's Avatar
    Join Date
    Jul 2011
    Location
    Mountains.
    Posts
    883
    In-Game Name(s)
    Ragnar
    Post Thanks / Like
    Good guide , thanks for this post mayne.
    Gone.


  20. #18

  21. #19
    Member
    Join Date
    Nov 2012
    Age
    33
    Posts
    14
    In-Game Name(s)
    Rex Cool
    Post Thanks / Like
    Cool shit bro, I already knew this. But it's good for the people that didn't know that, and complaining in /n.

  22. #20
    3 Year Veteran MrBlackman's Avatar
    Join Date
    Nov 2012
    Location
    Slovakia
    Posts
    98
    In-Game Name(s)
    Bobby Apple
    Post Thanks / Like
    Thanks for all the positive feedback.
    Bobby Apple


 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Click to connect to Discord (San Andreas Roleplay)Click to go to the official San Andreas Multiplayer websiteDownload Teamspeak