1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Other My plugin causes lag?

Discussion in 'Development' started by Sheeplie, Apr 17, 2016.

  1. Sheeplie

    Sheeplie Hi.

    Hi- So I've got a plugin that basically uses trig and whatnot to draw a circular meter, attach it to the HUDPaint function, and then there's a timer: every 0.01 seconds, when you're holding down shift, (running) deplete number of squares by 1 and re-draw the meter. That's about it, but when I have this plugin on my server, I lag a lot- and things run smooth when the plugin is not on. I know that functions running every tick can be taxing, but are they this bad? Is there anything I can do?

    You might be wondering, having read my description about the plugin, why it doesn't actually do anything yet and instead just decreases a number. This is simply a toned down version of a plugin I'm working on to give this actual purpose and hook the value to something.
     
  2. kurozael

    kurozael Cloud Sixteen Director Staff Member Administrator Investor

    The issue is on line 45.
     
  3. Sheeplie

    Sheeplie Hi.

    Very funny kuro. ^_^ I'll PM you the pastebin of some of my code on c16.
     
  4. kurozael

    kurozael Cloud Sixteen Director Staff Member Administrator Investor

    This has to be why, you're sending a datastream from the client to the server every time the client renders a frame...
    Code:
    Clockwork.datastream:Start( "hudtick", iply )
    
    You have to understand that means if your client FPS was 60, it'd be sending a net message to the server 60 times a second.
     
    • Agree Agree x 1
  5. Sheeplie

    Sheeplie Hi.

    Yeah, true.. hm. I may try reverting the stamina to normal and using a uh, lerp or something to update my GUI smoothly. I'll get back to you guys on that.
     

Previous Readers (Total: 0)