Vice Underdogs

Discussion => VC:MP General => Topic started by: FuckTinG on April 18, 2021, 02:00:49 am

Title: IMPORTANT - sync lag cause of every server
Post by: FuckTinG on April 18, 2021, 02:00:49 am
you might be familiar with this strange phenomenon, which occured, most evidently of all, in European City (known as EC), but also present in servers like The Demolition Wars (TDW), Rob The Vehicle and so on...

the cause of this is pretty simple, all i did was put things together like a puzzle,only to find out that the most evident cause of this is the abuse of GUI as in:
- too frequent use of it
- too big/too HD images of GUI
- size in server of GUI (as in dimensions of the text, how much area it covers, etc.)

i suggest all server owners to try to limit the resolution + size + use of the GUI as much as possible.. beyond that, VC:MP is created in 2002, what's the point of enhancing it with shitty addons.. in 0.3z not even 10% of 0.4 was possible, and VCMP players could handle things alright, without having game lags (unless they own a poverty PC of course)

so yes, you should test this out and tell me if this works, i am really curious...

and as well, if you could pass this message to my beloved EC administrators and let them know what happened to their sweet playercount?

again, this is the most likely cause which the sync in some servers feels almost impossible to handle.. out of all servers, i think EC uses the most GUIs, also the most detailed (which means high in resolution and size), leading to the WORST case, EC having worst sync in VC:MP one has ever played in.


why VU forum? it's clear - everybody is active here everyday, and it's most likely the best way to distribute a message all over community...


the GUIs need a pass, either that or extreme limitation, such as in LCS, in CTF, in BRL...
Title: Re: IMPORTANT - sync lag cause of every server
Post by: mairee on April 18, 2021, 07:46:01 am
GUI itself is not supposed to have any kind of impact on your latency or your sync with the server. This is because it is all being done on your client, the client side files are downloaded on your PC and then they are executed without any relation to the server (except for streams that are sent to and from your client). Therefore, GUI itself as a whole does not have any impact on your sync. It can be other things, perhaps the latest VCMP version?
Title: Re: IMPORTANT - sync lag cause of every server
Post by: FuckTinG on April 18, 2021, 08:48:19 am
latest vcmp version has nothing to do with it, EC had messed up ever since rel006_1

it's GUI most likely, i would believe it's not its fault only when someone actually removes GUI totally and i can test the server and tell if there's any difference, other players could do that too instead of me...

sync lag doesn't necessarily mean FPS drop, it actually means that shots get missed, or not received, and everything feels sloppy in general, affecting seriously competitive results..

i still believe the GUI fault variant, unless someone can prove me wrong... because based on my observations, servers that have very less GUI (plus that it's not ultra detailed) or don't have at all, actually do not have the very same problem as the ones that do use a lot of GUI, and with realistic detail..
Title: Re: IMPORTANT - sync lag cause of every server
Post by: Hazard on April 18, 2021, 09:04:02 am
so pak vs balkan? Axxo make it happen
bro you are in wrong topic
Title: Re: IMPORTANT - sync lag cause of every server
Post by: mairee on April 18, 2021, 10:25:16 am
latest vcmp version has nothing to do with it, EC had messed up ever since rel006_1

it's GUI most likely, i would believe it's not its fault only when someone actually removes GUI totally and i can test the server and tell if there's any difference, other players could do that too instead of me...

sync lag doesn't necessarily mean FPS drop, it actually means that shots get missed, or not received, and everything feels sloppy in general, affecting seriously competitive results..

i still believe the GUI fault variant, unless someone can prove me wrong... because based on my observations, servers that have very less GUI (plus that it's not ultra detailed) or don't have at all, actually do not have the very same problem as the ones that do use a lot of GUI, and with realistic detail..
What you are facing has absolutely nothing to do with GUI.
Here's the GUI library being used by VCMP, find me a single line that makes use of sockets: https://github.com/Juppi88/mgui
Title: Re: IMPORTANT - sync lag cause of every server
Post by: FuckTinG on April 18, 2021, 12:12:49 pm
lol then how come all of the servers that use a shit load of GUI make things laggy?

i want a perfect TEST first, a server such as King of the hill

i want to experiment it without GUIs vs with GUIs, and then we will have a proper answer.

i don't dwell on solving things without a test, if i could take this server alone i would do it, but i have no scripts to test it on, plus that the servers that don't use GUIs at all or just use a very low amount are actually lag-free, without any sync problems

and by sync problems i mean: players not getting hit, grenades/mols even rock not getting hit, the mouse movement feels laggy, keyboard feels laggy, controls feel like not responding.. those are the most of the symptoms that occur...

like i said, i want to test it, if this is the problem then get rid of it, if not - keep it as it is.. i am almost certainly sure this is it, because there's no other possible reason for things like that to happen, plus nothing else fits according to the history of servers changes that i have learned about..
Title: Re: IMPORTANT - sync lag cause of every server
Post by: GangstaRas on April 18, 2021, 07:53:12 pm
The servers just need smart use of the GUI. Sync issue you're describing could be frame pacing issues.

We did test KoTH during development and it takes a lot of CPU if you just throw the GUI out there. What would take 25% of my full CPU speed to hit 30 FPS in VC:MP now takes around 62.5% of full speed to get 30 FPS in KOTH (Intel Core i3 3240 @ stock). In noting this during development, we deliberately designed the game in a fashion where combat uses very minimal GUI to work around this fact.

The killer in GUI is drawing images and 3D sprites. If whatever is being added can be a GUI box element, we do that instead. All the heavy sprite stuff are accessible only when the you are not an active participant of the round in some way.


These optimizations provide a very vanilla experience during combat where it matters most, all EXCEPT for that one GUI element....the zone border.

That has optimizations of its own but it definitely the performance dropper of the server currently. Before, the border you saw was made up of individual squares in an array going across the land. We immediately saw how shit of a method that was when we created that Hunter base. We then created a rather complicated algorithm to switch between using a stretched rectangle to create the boundaries of the border when things were straight, it would resort back to the square tile method when creating curved borders. This is far better than to have 10,000 tiles create a straight line.

Just like that, a near vanilla experience but we acknowledged that not even that was enough for the truly weaker end systems and so we provide the command /disableborder to hide the border if your system is absolute shit.

So its just for servers to make those optimizations. The sprite elements in KoTH were designed towards the native resolution of 4K, not even 1080p, we use algos to shrink it accordingly to the player's resolution.
Title: Re: IMPORTANT - sync lag cause of every server
Post by: FuckTinG on April 18, 2021, 09:48:31 pm
oook, so then here we go - servers DO need smart use of GUI, and probably as LESS as possible..

oh and gangstaras, what you said just adds up, because out of all the servers, King of The Hill makes just M4 sync feel a LITTLE nasty (still it does but, much unlike the other servers, other weapons can still be played with)

so...here goes the answer .. my suggestion is, let go of all the GUIs so we can have the smooth experience we used to have in past, either that or just limit it as much as possible, similarly to CTF or LCS server, where GUIs are not even 1080p as i noticed (idk if it's true, but resolution of it doesn't feel like it's 1080p)


Quote
The servers just need smart use of the GUI
^

please just do something about it, the state vcmp currently is in is really getting on my nerves, there's not 1 TDM server that i could say "finally a good sync server", apart from CTF which is mostly empty


it DOESN'T matter on how good your PC is.. when you code something wrong, it's gonna lag either way, on some PCs more than on others, just like the teargas weapon in the game.. since it's badly coded, even the GTX owners can feel a little stutter when passing through it.. the same with GUI, the problem i'm not certain if it's FPS lag, but i'm certain that the sync doesn't feel good overall, because i am used to playing in classic servers, and when i switched to the nowadays TDM servers, i was shocked...
Title: Re: IMPORTANT - sync lag cause of every server
Post by: Charley on April 19, 2021, 04:10:39 am
I think the bigger problem here is the size of the files that servers have added - it makes it impossible for many players around the world to even get ingame, let alone sync with anyone.

Connecting from China, the only populated server I can play in these days is Littlewhiteys. With the others, the files either don't download at all, or take more than 30 minutes to download. There's no working progress bar on the downloads, it usually just looks like the game has crashed.

I'd imagine other people living in other countries also encounter this problem, and it is keeping the VC:MP playercount down.
Title: Re: IMPORTANT - sync lag cause of every server
Post by: GangstaRas on April 19, 2021, 08:54:50 am
it DOESN'T matter on how good your PC is.. when you code something wrong, it's gonna lag either way, on some PCs more than on others, just like the teargas weapon in the game.. since it's badly coded, even the GTX owners can feel a little stutter when passing through it.. the same with GUI, the problem i'm not certain if it's FPS lag, but i'm certain that the sync doesn't feel good overall, because i am used to playing in classic servers, and when i switched to the nowadays TDM servers, i was shocked...

Try disabling the border and tell me what you think. You should have an uplift cuz everything else onscreen as GUI is very negligible, even the medal transitions (which surprized me personally) didnt have a perceivable impact at 25% full CPU speed.

I'd imagine other people living in other countries also encounter this problem, and it is keeping the VC:MP playercount down.

Oh no its just you Charley lol. Can download 1 GB worth of game but cant get server files. Let's talk there and get some input from the devs at that one ;D

The GUI is made native to 4K, yes, but the file sizes arent big at all. The actual GUI files, you'll see some 444x444 and lower resolution elements that just take up mere kilobytes. It is just that that 444x444 size matches exactly how we would want things to look at 100% scaling on a 4K screen should the playerbase be having 4K monitors running on, so the GUI will always look good. Only the big full screen backgrounds and so on are a full fat 4K image and thats just 3 of them. So thats the other careful consideration. KoTH size comes mainly from the audio files.
Title: Re: IMPORTANT - sync lag cause of every server
Post by: FuckTinG on April 19, 2021, 10:26:54 am
amount of files downloaded have no matter at all.. LCS uses a lot more files than CTF, still the both of their sync looks just as smooth

with GUI:
https://www.youtube.com/watch?v=RsT4eg5SeiU

without GUI:
https://www.youtube.com/watch?v=C2fPHEEpzhg

in 0:06 and 0:35 in 2nd video as u can see the players do get hit way easily..
in 1:31 in the first video, the shot is missed for some reason...

bonus i've experienced something in very unusual in EC when i was testing the server after i got unbanned: i shot the grenade like 4 times, and it just didn't want to bounce, and p.s: this is after they became top 1 of useless GUI usage

what led me to think that GUI is the fault of this, is that there's absolutely no server that uses a high amount of GUI that doesn't have this issue..
technically you cannot catch a 100% legit proof that GUI is the fault in a VIDEO, because you need to actually FEEL the sync while playing, and when controls stand to respond harder, then you know something is wrong.
Title: Re: IMPORTANT - sync lag cause of every server
Post by: GangstaRas on April 19, 2021, 02:05:49 pm
Did some fresher testing of my own as well today and noticed a few things:

Frame Cap OFF

This is me just running VC:MP like anyone else would

(https://cdn.discordapp.com/attachments/737685980609249320/833676686973337630/unknown.png)

As you can see, my system is holding 60 FPS but my frame time (the green line) is all over the place. This is normal with any game you play to be honest so not a point to fuss on, just note the amplitude of those spikes. I'd spike anywhere from about 14 to 20 ms, averaging the 60 FPS.

When in-game, you can see and feel the jitteriness to it, or at least I can. It's okay if you've never experienced jitter free gameplay before but its noticeable once you have.

(https://cdn.discordapp.com/attachments/737685980609249320/833696580871782400/unknown.png)

Different map but take my word for it, same result really; this is how it looks when you disable the border. Frame capping is still off, and as you can see, the frame time looks much more relaxed than the first one. This graph is a typical VC:MP vanilla experience, but it still can be improved upon.


Frame Cap ON


(https://cdn.discordapp.com/attachments/737685980609249320/833676827268481024/unknown.png)

This is with frame cap on in the same game of the first image. As you can see, it smooths out all that jitter and provides a much cleaner experience. Do note however those momentary spikes. I wasn't able to see it but I can say that the game didn't feel like my specs were overkill, more felt like when you run a game max detail and all is good but not perfect. It just felt right, not pristine.


Then you have the fourth experience, frame cap on with border disabled. Didn't bother to take a pic cuz its nearly the same as the 3rd image you see, the only difference was that those momentary spikes you see in the third image were significantly reduced. I didn't see a difference but I definitely felt a difference and would attribute it to less input lag (but I have no real way to measure that atm). I will not lie, I definitely noticed it. Border off was what felt like my system was overkill and pristine as it should.



Now I might know how to cap my framerate to deliver a smooth experience but the typical VC:MP player just hops in and does his thing. This is how my end respond but other systems might be doing much worse than what I'm capable of so I see the point.

Again I ask to try KoTH with border disabled and tell me if you get the same experience like I'm expressing, but from what you showed of the RTV video, I would say that an optimization that could be made in general of GUIs is not to have translucent designs and avoid sprites if you can, but if you have to use it, use very minimal amounts.

Another thing that you have to and must avoid is font resizing. We were going to animate the countdown to 1 in KoTH, like a pulse effect, but that brought every system to its knees, the VC:MP code around it is not good. It made wep selection lag severely so we had to scrap that idea
Title: Re: IMPORTANT - sync lag cause of every server
Post by: FuckTinG on April 19, 2021, 05:33:08 pm
everything started once with that RTV fashion of sprites, fancy GUIs and so on..
VCMP never needed any, thanks for the helpful comment Gangstaras
my suggestion is you do as Gangstaras said, and try to limit as much as possible the GUI (removing even some of it, useless points at least, such as kill streak, achievement and whatever), and replace them instead with command, what's the point of having beautiful graphics but broken mechanics in a gameplay?
Title: Re: IMPORTANT - sync lag cause of every server
Post by: FuckTinG on April 19, 2021, 10:53:00 pm
update: https://www.youtube.com/watch?v=YR5qJA_7Lrg

i found this video while searching around, this is the 100% proof that the sync bug i mentioned EXISTS, i didn't expect to find such a clear frag actually... do something about it please


bonus clip: https://www.youtube.com/watch?v=lAM_os-7_Bs

players often confuse it with hp hack or lag

https://www.youtube.com/watch?v=Wvm5iva3zE8

and for the unexperienced ones, even 'suspicious hacks'
Title: Re: IMPORTANT - sync lag cause of every server
Post by: GangstaRas on April 20, 2021, 10:20:49 am
Another optimization I forgot to mention was the use of this SetTexture command on client-side scripts. Basically, don't use it.

I'm not a scripter so I'm not too sure of its true purpose but remember how that initial Freeze all we do at round end, just before the GUI would come up would temporarily stutter all KoTH clients for a second or three? That command was the sole sole problem. Displaying a GUI the regular way absolutely nuked that lag.

DecUI uses it as a public tool that's out there for everyone to adopt. We honestly didn't know it was the problem because there's another property to that SetTexture command for GUI that makes its usage subpar. From a 3D modeler perspective, I believe that command changes the GUI into something of a 2D object trying to react to the 3D world. I can be wrong but when you use that to load a GUI sprite versus the regular way to display it, you will notice side by side that the SetTexture version is darker than your original image, making me infer that if there was a light source nearby when this GUI displays, it may probably react to it to brighten itself, that's my theory.

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.

In KoTH, that SetTexture was on everything that was a sprite. The timer, the scoreboard above the map (that use to be black in appearance even though I didn't design it that way), the notifications aren't sprites so no lag there, but the medals too, everything you can imagine. It was the design flaw we saw that made do a massive purging of that command, not the hidden performance implications it had but that's even more info for you guys out there. Don't use SetTexture
Title: Re: IMPORTANT - sync lag cause of every server
Post by: aXXo 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.
https://www.youtube.com/watch?v=Bp7fFDu19Ug

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.
Title: Re: IMPORTANT - sync lag cause of every server
Post by: Spiller 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 (https://i.imgur.com/76KjPMI.png)
with GUI (1) (https://i.imgur.com/NNz90As.png)
with GUI (2) (https://i.imgur.com/lmmBTyg.png)

shooting at a wall:
without GUI (https://i.imgur.com/3IvQvJK.png)
with GUI (1) (https://i.imgur.com/8i3Dc75.png)
with GUI (2) (https://i.imgur.com/6sgEa2k.png)

getting in the vehicle:
without GUI (https://i.imgur.com/13zA06H.png)
with GUI (1) (https://i.imgur.com/ffoewIj.png)
with GUI (2) (https://i.imgur.com/x9eW47B.png)

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
Title: Re: IMPORTANT - sync lag cause of every server
Post by: klein. on April 20, 2021, 11:05:05 pm
.
Title: Re: IMPORTANT - sync lag cause of every server
Post by: FuckTinG 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?