April 28, 2024, 01:52:11 pm

Author Topic: IMPORTANT - sync lag cause of every server  (Read 1667 times)

0 Members and 1 Guest are viewing this topic.

aXXo

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • *
  • *
  • *
  • *
  • Posts: 2722
  • Country: in
    • View Profile
Re: IMPORTANT - sync lag cause of every server
« Reply #15 on: April 20, 2021, 01:39:17 pm »
Unstable FPS(Frames Per Second) is the most likely cause of the bad sync.

Everything in VCMP happens in frames. When players have fluctuating FPS, they miss some frames. Shots that were fired in those frames do not appear to them. This defines desync.

FPS and sync is affected by everything that is added to the client side scripts. Yes, GUI is also a client side script that displays nice stuff on the screen. So, technically Hunting is absolutely right. GUI does cause desync.

But I don't think it is a major factor.

The actual problem is the client side code being used by the servers. GUI is something that the players can see with their eyes so it is the obvious culprit. But, there's a ton of stuff that could be happening in the backend client side scripts, that you don't see unless you read the code.

A bad loop or too much usage of ScriptProcess event(this code runs on every frame - 60 code executions per second), will use a lot of CPU power.

So, to answer Hunting's question....Should all servers decide to remove all client side code and go back to old days?
They could if they want. It will improve performance no doubt. But will it eradicate laggers?

Take Vicewar 6,7,9 for example. They all had minimal GUI and client side usage. It is a global event, so I ensured that it is as lightweight as possible.


But whenever you put 30+ players in the same area, the potatos will fry. VW9 after war celebration had 60 players in an area for a photo session and it was the worst FPS drop I have ever seen.

KotH and RTV are round based game modes, so they teleport all players in the same area. Hence, problem is more visible in these servers when they reach higher player count.
In my experience the number of players in vicinity has much more impact on FPS than client side scripts on RTV/KotH.
Agree Agree x 2 Useful Useful x 2 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


Spiller

  • Vice War Contributor
  • Regular
  • *
  • Posts: 71
  • Country: in
  • Easymode Criminal
    • View Profile
Re: IMPORTANT - sync lag cause of every server
« Reply #16 on: April 20, 2021, 06:19:16 pm »
I'm not sure why I came here even after knowing this will inevitably lead into toxicity because it seems to me that Hunting is only looking for an answer which satisfies him and his theory, and not ready to admit the otherwise. I won't be shocked if someone starts bringing up things which are a Lockheed U2 apart from this topic.

Though I tried to talk sense talking about all this, he only targeted me when I was talking from a general perspective. But I'll still try to explain stuff to the best of my knowledge because this is important.

Our team discussed with NewK on these issues and I believe he patched it out once we showed him what was up. But let's say RTV is using DecUI as a base to design their GUI, if it was on the earlier versions, then they are probably subject to this problem we noticed. If that timer GUI is all the GUI RTV has and its causing so much sync issues then I suspect there lies the problem.

Nope, RTV is neither using DecUI nor SetTexture. It has more than just the timer but I can assure you it has been scripted in the most efficient way possible, with the help of some of my utilities that I have thoroughly tested. There is only 1 high resolution sprite and total size of all sprites combined is under 1MB. The desync Hunting is referring to is completely out of his assumptions.

There's no reason to believe that GUI has any direct affect on sync. Yeah obviously if you overuse GUI it will definitely harm performance but isn't that obvious about overusing virtually anything?

Elements don't seem to cause any dramatic impact (apart from 3D ones) once they have been created. The major drop is either when creating elements or trying to manipulate them (using ScriptProcess), whatever drop a element has to cause, it causes it during the load event (hence the pause effect when your player is created in the server).

The ideal approach is to draw the GUI when script loads and show or hide it whenever it needs to be instead of creating it right before it needs to be shown. This way it wont interfere with memory or processing later on.

Talking about ScriptProcess, not everything will lead to high CPU consumption, if you're fading in or out a bunch of elements even PER FRAME, it would barely consume a percent. However, try resizing a label and you're instantly looking at the definition of a chaos.

So technically, you are good to go with any sort of UI unless you:
- create stuff when it needs to be shown up,
- use a humungous amount of stuff (especially 3D),
- try to achieve complex results using ScriptProcess.

If you need a bad example to learn from, RTV v3's source code might still be lying around somewhere. It perfectly explains how NOT to do things. In general, asking yourself "is this necessary?" would do the job.



Knowing about how a low-end PC will react to the use of ScriptProcess, there exists what I call a KillSwitch for all the fading animations in RTV's GUI since long. The switch is automatically triggered if the player is facing even the smallest of drops.

Here is some stuff I tested in RTV with and without the GUI.
Before you go looking at those, please note the following:

- The server was restarted, GUI was NOT loaded at all while testing for without it. Anything that uses ScriptProcess wasn't loaded either.

- While testing the with GUI case, the KillSwitch was prevented from being triggered so the results are more realistic.

- I would assume the PC I tested on is an ideal ground for testing because opening anything in the background would lead to FPS drops, if there are any considerable performance issues caused by the GUI, they would unequivocally surface on the overlay.

- Screen was captured at a point where the GUI is in fade-in animation or just has completed fading so the effect of ScriptProcess is also captured.

Looking at the base from above, still:
without GUI
with GUI (1)
with GUI (2)

shooting at a wall:
without GUI
with GUI (1)
with GUI (2)

getting in the vehicle:
without GUI
with GUI (1)
with GUI (2)

Even though my CPU temperature had risen up to 84 celc by end of all this, there was no significant difference. And I'm running the game on an integrated GPU with a f**ked up cooling system.



About those videos, the first one is a rare bug where you shoot the player out of his FOV and the shots never register. You can also reproduce this on LAN in a blank server.

Second video and third video, that is another story already explained on VCMP forum.



At the end I'm only gonna say this, do not kill your creativity by thinking that the stuff you create will ultimately cause lag or performance drop of some kind. VCMP might have some limitations but the GUI is certainly not anywhere near the top of the list. It's your perfect sandbox. This is the most important part because I've learnt a lot from this game and it may as well have contributed to my creative skills apart from a lot other.

If you use it how its supposed to be, the impact will always be infinitely less than a molotov being thrown at you. The sync itself is what needs to be reworked, GUI fits perfectly at its place.

Regards
« Last Edit: April 20, 2021, 06:22:08 pm by Spiller »
Agree Agree x 4 Winner Winner x 1 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


klein.

  • Crazy Man
  • *****
  • Posts: 564
  • Country: 00
    • View Profile
Re: IMPORTANT - sync lag cause of every server
« Reply #17 on: April 20, 2021, 11:05:05 pm »
.
« Last Edit: April 20, 2021, 11:07:05 pm by klein. »
Funny Funny x 1 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


FuckTinG

  • Banned
  • Fanatic
  • *
  • Posts: 138
  • Country: ro
    • View Profile
Re: IMPORTANT - sync lag cause of every server
« Reply #18 on: April 21, 2021, 05:58:23 pm »
great work axxo, KoTH now works normally, just like CTF, FunVice, LCS and rest of the normal servers left in VCMP. I must say, I'm impressed that someone finally listened and actually DONE something about my observation.

don't worry spiller, i know you're afraid of an asskick, but didn't think you were such lame to think i'd bring it here, bringing myself down to your and PL's level... i have nothing to say to you


while axxo DOES say that GUI affects etc.. spiller is like "no, not GUI fault. no. i wont limit it. i wont do anything"

all i'm saying is use GUI smartly and with tweaks, and then see magic, i think amount won't even matter after the tweaking is done..

plus, whatever axxo has did to KoTH (with the help of luckshya as i know), it is fucking awesome, and finally i can say this is an enjoyable server to play in, much unlike 90% of this VCMP.
so therefore, all likes and kudos to VU for managing to fix such a problem..

bring this on the rest of the servers, and let's see if you still can blame me for trying to improve the gameplay.. that goes mostly to the PL team of course..

@Spiller please, don't comment anything more, just admit that VU has pwned the shit out of all your so called "smart coders" and fixed one of the worst issues VCMP has ever faced, you know i just LOVE to say true things in face don't you?

I also suggest you learn what is modesty, Spiller. I never seen such a thing coming from you or your friends.... it's pretty much the opposite of "our team is the best" "the most numerous" "our script is most efficient"... get over it..

maybe now ask axxo and implement his fixes... ;)


edit:

what i've also noticed in KoTH is that the mouse lag also disappeared, that means my Y axis feels weaker by half (like i actually set it), same to X (feels normal, with no letting up at all)

just connect to EC for example, move your mouse for a few mins, then /disconnect, and while you're not connected to server, just move your mouse and see what i mean...

the sync issue DOES have to do with the GUI.

tell me a SINGLE server which uses A LOT of GUI that doesn't do that..
basically CTF, KoTH and LCS are the ones that use the GUI smartly, and without CPU losing power (optimization is a lot more powerful than using better hardware to cover it)

it doesn't matter if pc has bad hardware, server shouldn't mess it up


also, have you noticed that the image on the walls actually make your game load harder? I mean the posters of KoTH, they're the reason for the server hanging for a few seconds before actually bringing you ingame, differing from one PC to another..

that's a minimal effect, but just think that if such a minor thing can do THIS, then what can misleaded GUI do to the whole server?
« Last Edit: April 21, 2021, 06:05:13 pm by FuckTinG »
Winner Winner x 1 Informative Informative x 2 Useful Useful x 1 Brain Donor Brain Donor x 1 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor