PDA

View Full Version : Startzones, "Lags", and Moving Forward



Beetle179
07-20-2016, 08:49 PM
Lately there's been a lot of talk about "lagged" wrcp/wrb startzones. I'd like to provide some information about identifying these records and incite some discussion about how KSF should handle/treat these cases.

To start with some basics:
-The KSF servers run at 66 tickrate.
-This means the server processes information about each player (notably position and velocity) 66 times a second.
-This corresponds to an update 66 times a second, or once every ~0.015 seconds.
-This means there is a discrete, integer number of ticks to everything the server reports -- PRs, WRs, and times could all be expressed as a non-decimal number of ticks, meaning perfect ties are possible (two records could both be exactly 352 ticks long, for example). (random note: 352 ticks would be about 5.33 seconds.)

Sidenote about server resolution and interpolation:
-Ideally, all reported times would exactly fall in line with the tickrate and be spaced apart by exactly 1/66 (0.01515…) or some multiple thereof.
-However, based on some coding backend we aren’t familiar with (believed to be the server clock), the server “fakes” a resolution more accurate than 1/66 tick. We know that any time which does not fall in line with the scale of the tickrate is effectively completely random, pure guesswork by the server.
-The implications of this are that times reported as +0.00 over each other, or reported as, say, 3.711 seconds vs 3.712 seconds, are actually perfect ties as far as number of ticks goes -- the maximum accuracy the server can report -- but randomly ended up not being the same due to some flaws in the timer.
-The Momentum mod handles this very well and has proper interpolation for startzones and endzones. See their Tumblr post here (http://momentummod.tumblr.com/post/146131743729/how-the-momentum-mod-timer-works-how-to-get-a) for an explanation -- note that the KSF timer does not do this, but it would be an excellent addition (although a lot to ask for at this point)

Now, startzones. Startzones are literally just big triggers that you stand within, and when your player hull (thanks jux) completely exits the startzone, your timer begins -- the server recognizes the transition of your player status from “in startzone” to “in zone”, and updates your timer to start running on the same tick this happens. (possibly the next tick? Not important for our purposes anyway). Sometimes, for unknown reasons, the timer does not actually update your player status when it should -- it gets delayed by one tick (or more, but that’s rare). Meaning, the server believes you’re in the startzone for one tick longer than you actually were, and your timer gets started one tick later than it should have been. This is what we call “startzone lag”, or what I’ll be calling a “false start” from now on -- since we really don’t know if lag/latency has anything to do with it.

The issue then is detecting what is and isn’t a false start. I go over this in-depth in my video on startzones, which I’ll post here as soon as it’s released. But the gist of it is, we know the maximum speeds possible for one to obtain as they leave most startzones (more on that in a minute), and if their speed exceeds this maximum speed, then we can deduce that they experienced a false start -- the excess speed comes from speed gained from airstrafing and gravity (mostly gravity -- 12 units per second per tick) on the tick that the timer erroneously dropped.

A “standard startzone” looks like this: (linked because massive pictures)

Without showtriggers_toggle:
http://i.imgur.com/Prnw0Qo.jpg

With showtriggers_toggle:
http://i.imgur.com/zXC0h98.jpg

The yellow trigger shows the startzone. Notice how the startzone lines up perfectly with the ground -- this is very important!

Now we need to talk about the command !togglevel. What this does is tells you your speed every time you interact with a trigger -- including when you exit a startzone, which is what we’re interested. More than that, it will tell you your speed as it is broken up into its horizontal (xy plane) and vertical (z axis) components. From lots of testing, we’ve found that the maximum possible speed the timer will allow you to get in the xy direction is 350 units/second -- anything greater and it seems to somehow reduce your speed back to this threshold. Additionally, on a standard startzone, the maximum possible speed one can obtain in the z direction is 316 units/second downwards (or 322 with a crouchjump). This is the maximum speed you can legitimately reach given that you must pass over the ground without bumping it, and assuming that you hold crouch as you exit the zone (to cut the ground tighter).

One last thing to keep in mind is that although !togglevel shows only the xy and z components of your speed, the timer HUD already reports your overall (xyz, or combined xy and z speeds) speed each time you exit a startzone.

So we know the maximum velocities you can reach out of a standard startzone are 350 in the xy plane and -316/-322 (no-cj/cj) along the z axis (negative because you’re traveling downwards). Because the xy plane and the z axis are perpendicular, we can use the Pythagorean theorem to calculate the xyz/overall maximum speed one can obtain out of a startzone using these values.

sqrt[ (350)^2 + (-322)^2 ] ~= 475.588 units/s with a crouchjump, or
sqrt[ (350)^2 + (-316)^2 ] ~= 471.546 units/s without a crouchjump.

From some testing with !makezone, !togglevel, !speed, and cl_showpos 1, we can prove that the timer reports a speed which is rounded down. This makes the maximum possible startzone speeds 475 u/s and 471 u/s for crouchjumping and no-crouchjumping, respectively. Thus, any records which exceed these values on a standard startzone, we can be sure are false starts and their reported times are at least one tick faster than what they should have been.

The question then is, why does any of this matter? It’s just one tick, it’s just a few extra units out of the startzone, it’s not a big deal, right?

http://i.imgur.com/ykYq3ES.jpg

This is why it matters. There are many stages like this where one tick can make or break a WRCP. There are many, many stages and bonuses (and even maps) where the top 2 times are separated by 1 tick, or tied. If the record is a false start, then rank 2 is being cheated out of a record that belongs to them.

“But if it’s just one tick/a tie, just rebeat it anyway” -- this is a ridiculous argument for two reasons. One, no one should have any obligation to have to grind for something they shouldn’t have lost in the first place. Two, in many cases, these false starts happen on very optimal stages -- not necessarily SHORT stages, but stages where there is very, very, very little (if ANY) time left to shave off.

“But if they beat the record by one tick, and they got a tick advantage because of a false start, then they would still have tied the record without the false start -- so why remove it?” Again, two reasons here. One, because everyone else who ties the true time has to play the KSF-timer lottery (see the sidenote earlier about server resolution), but the “lagger” skips this and just takes the record without having to worry about it. Two, any potential competitors for the record may tie the true record, but will never know if they would’ve beaten the record, because the “lagger” holds that tick buffer over everyone else.

“But they beat the record by 0.05 seconds (3-4 ticks) anyway, so even if they hadn’t gotten a false start, they’d still hold the record”. CORRECT, and this is a much more difficult matter. In my opinion, I believe these records should be kept until someone sets a rank2 time of +0.015 (+1 tick), and THEN removed -- but not until someone does set that true-time tie.

Hopefully this all makes sense, because now I’d like to talk about what to do about false starts. One solution is to simply add exactly 1 tick -- 0.015151515… seconds -- to a regular old 1-tick false start. This is good because it eliminates the advantage the “lagger” had and puts them in the lottery with anyone else who tied the true time. However, it does not solve the problem of a misleading !prinfo if that person still holds the record after the appropriate time is readded to their time. (note: if this were to happen, it’s very important that 0.0151515… be added to the player’s time, and NOT just 0.015, or else they actually get an advantage in the lottery.)

Another solution is to simply nuke the time. This is good because it removes any misleading !prinfo, and there’s no difference between rank 2 and rank 100 on a stage -- so they aren’t losing out on anything. However, the downside here is that they lose their chance to play in the lottery. This is my personal preferred solution.

The last question is who would enforce these things. Sacred is the only particularly active high-admin on KSF, with untouch and evolv largely unavailable. However, we know Sacred is a busy person himself, with mapping responsibilities and a life to attend to. The answer to this is, I don’t know. If KSF is willing to appoint another admin with the power to change times, someone who is willing to educate themselves and not approach situations with bias, I personally believe that would be the ideal route. But that’s not up to me, so I’d like to hear from some of the higher-ups. This is not an issue that should be ignored, lest the precedent be set that “cheated” times be acceptable.



I really hope this clears things up. Every claim I’ve made has been tested pretty thoroughly, but if I’ve made any mistakes, I’m more than willing to hear them -- I do ask for proof of course. There’s no tl;dr -- if you want to contribute to this conversation, I ask you to read the entire post to educate yourself. Thanks.

Mooster Cow
07-20-2016, 09:13 PM
.

FluX
07-20-2016, 09:21 PM
Extremely informative and helpful thread, nice work! :D

Crayz
07-20-2016, 09:34 PM
If trigger collision events can be processed late would it make more sense to not use triggers at all, and instead iterate through all player's center origin each tick to determine what zones they are/aren't touching?

Habitat
07-20-2016, 10:02 PM
teach me how to add times and ill do it

Rickzter
07-21-2016, 03:58 AM
When we tested it earlier u could get more than 350 XY and a 334 edge (Z) if u did it perfect. I admit a 334 didnt happend all the time but when you got it you could feel that u did a really good prestrafe, exiting the zone in a perfect 90° angle. People saw me get it 3 times in a row some times. (think it was skandy and morning) when i really tried for the perfect prestrafe. If its assumed to be a "false start" then it just happends WAY too often. Alot of ppl who specced me during testing will confirm.
The "best" i got was 352.xx/334

Stevo_97
07-21-2016, 08:15 AM
Really interesting to learn about the parts of the timer that don't usually have much light shed on them. As for who should make such changes and approach situations without bias I honestly think you, as the person who made this thread in the first place, should be the person appointed to the job. The only other person I can think of who might step up to the task is Crash Fort. Anyway, good job.

nemix
07-21-2016, 09:01 AM
Brilliant post beetle

Sacred
07-21-2016, 09:20 AM
See, was a good idea to post here. It's not that I don't have the time, if this would be handled via reports as usual and you just leave the according message then it wouldn't be a problem for me at all. I personally think that the "lagged" time should be added, and not entirely removed.



When we tested it earlier u could get more than 350 XY and a 334 edge (Z) if u did it perfect. I admit a 334 didnt happend all the time but when you got it you could feel that u did a really good prestrafe, exiting the zone in a perfect 90° angle. People saw me get it 3 times in a row some times. (think it was skandy and morning) when i really tried for the perfect prestrafe. If its assumed to be a "false start" then it just happends WAY too often. Alot of ppl who specced me during testing will confirm.
The "best" i got was 352.xx/334

This is really important. We need to know exactly what the numbers are, and be confident that those are correct. And as I said to you in steam, beetle, we still kind of assume that the zone is set perfectly and not 1 unit off.

Frag1337
07-21-2016, 10:24 AM
Really interesting to see those values, keep up & good job

unt0uch4bl3
07-21-2016, 01:11 PM
Interpolation such as in the momentum mod will be not possible unless we remake like ~80%+?? of the zones. Many zones are created by using triggers that are compiled into the maps. If these triggers are perfect rectangles then we can write a vmf analyzer to read the planes of these triggers to generate the dimensions of these triggers.

But even then there still remains a good amount of triggers that are not rectangles, some are spheres, some are triangles, some could be a variety of shapes.

This is not an impossible job, in fact the hardest part of this whole thing would be to remake the triggers manually and reset the times (there should not be THAT many of these). Analyzing all the VMFs would be simple once something is written to do it. (We can tell that its a perfect rectangle by analyzing the coordinates of the planes).

In fact I started on this a year or two ago but I put it on hold because there were more pressing issues to take care of.

A note about interpolation: This is still an approximation of your position/time, but it would be better than the timer lottery (Physics cannot allow us to know the exact values anyways). Timer lottery has always existed to break ties though.

----

Currently in the database the speed is saved as XYZ, I'll change it to save XY and Z separately.

Beetle179
07-21-2016, 08:15 PM
When we tested it earlier u could get more than 350 XY and a 334 edge (Z) if u did it perfect. I admit a 334 didnt happend all the time but when you got it you could feel that u did a really good prestrafe, exiting the zone in a perfect 90° angle. People saw me get it 3 times in a row some times. (think it was skandy and morning) when i really tried for the perfect prestrafe. If its assumed to be a "false start" then it just happends WAY too often. Alot of ppl who specced me during testing will confirm.
The "best" i got was 352.xx/334

1. On what stage were you testing?
2. Assume that 334 was the maximum possible z speed, as you claim. That means with a 1-tick lag, we would see 340/346 (no-cj/cj) much more frequently. However, these values are exceedingly, exceptionally rare. Moreover, whenever there is a false start of more than 1 tick, it tends to be significantly more than 1 tick -- up to 4, 5, or even more (I believe these lags are actually something entirely different and unrelated because of this). But 340/346s are almost never seen, and in my testing, I can't recall ever actually finding a 340/346. If 334 were the maximum, they would be so much more common than they are now that I think it's reasonable to throw away the 334-max hypothesis.

I plan on doing some more testing tonight, hopefully with timescaling/!speed.

Sacred
07-22-2016, 02:44 AM
Doesn't !speed change the gravity? I'd go with real timescale.

Rickzter
07-22-2016, 02:55 AM
1. On what stage were you testing?
2. Assume that 334 was the maximum possible z speed, as you claim. That means with a 1-tick lag, we would see 340/346 (no-cj/cj) much more frequently. However, these values are exceedingly, exceptionally rare. Moreover, whenever there is a false start of more than 1 tick, it tends to be significantly more than 1 tick -- up to 4, 5, or even more (I believe these lags are actually something entirely different and unrelated because of this). But 340/346s are almost never seen, and in my testing, I can't recall ever actually finding a 340/346. If 334 were the maximum, they would be so much more common than they are now that I think it's reasonable to throw away the 334-max hypothesis.

I plan on doing some more testing tonight, hopefully with timescaling/!speed.

I was able to reproduce it in most places. Omnific s1 and commine too beta b1 for example

Juxtapo
07-22-2016, 12:55 PM
Doesn't !speed change the gravity? I'd go with real timescale.

!speed changes your tickrate inversely proportional to the speed value (!speed 0.5 would make your effective tickrate 66.6*2=133t)

Beetle179
07-22-2016, 01:10 PM
I was able to reproduce it in most places. Omnific s1 and commine too beta b1 for example

Can you comment on my second point, how 340s and 346s are obscenely rare, much rarer than we know false starts are?


!speed changes your tickrate inversely proportional to the speed value (!speed 0.5 would make your effective tickrate 66.6*2=133t)

This is true and something I hadn't realized until it was pointed out to me before I started testing. I have another idea which I'll be trying pretty soon.

Rickzter
07-22-2016, 01:57 PM
340/346 occured very rarely indeed.

Considering how often 334 occured if u really try idk if it should be considered a "false start"

Kusché
07-22-2016, 02:59 PM
I was also testing how often i could get -334 z vel, and for me that happened every now and then. But while testing for like 20 minutes, -346 z startzone occured only once, whereas -334 about 10 times. Also, when i normally play a stage/bonus/map and dont focus as much on prestrafing as i did while testing, i feel i get +475 startzones MUCH less often.

Flaudgin
07-22-2016, 04:12 PM
This thread seems heavily focused on start zones, when in reality this happens with every single zone. Also it is 100% random on whether or not you leave or enter a zone 'between' ticks. Also I'm not 100% positive it is actually happening because you are 'between' ticks, since there are points where you can be +/-2 ticks in and out of zones. Based on luck you can be 4 ticks faster, since you can leave a start zone 2 ticks late (more time it registers you are in start zone) and enter the end zone 2 ticks early.

THERAPIST
07-22-2016, 04:35 PM
It's irrelevant for end zones, you would just enter them late and get a worse time.

Flaudgin
07-22-2016, 04:38 PM
It's irrelevant for end zones, you would just enter them late and get a worse time.

What I said was based off of tests done on a local server where I just held w from one zone to another, I had never left a zone outside of the +/-1-2 tick difference, but the time difference was always within 4 ticks (with 4 being the max), so there is some interaction with end zones that allow you to enter it 'early'.

Beetle179
07-22-2016, 05:07 PM
What I said was based off of tests done on a local server where I just held w from one zone to another, I had never left a zone outside of the +/-1-2 tick difference, but the time difference was always within 4 ticks (with 4 being the max), so there is some interaction with end zones that allow you to enter it 'early'.

I don't think this is true, and though I couldn't be sure why you got the results you did, I'm inclined to think it has something to do with your tests being done on a local server and on a different timer/game (CGN/CSGO timer, yes?)

It's not possible for the surftimer/server to think you've entered/exited a zone too early. Logically, it does not pass.

Furthermore, as I've pointed out, on KSF only 1-tick false starts are at all common. 2- or more tick lags are extremely, extremely rare. If you'd like to test this, one easy way is to go to surf_velocity bonus, which has a fall zone as it extends out to the sides of the platform. Jump out and s-drop repeatedly from the platform, without touching crouch (all of this just for a controlled, easily- and quickly- replicated test)... Almost every single time, you will get -436 z velocity out of zone. Occasionally, you will get a -448. However, you will never see anything less (in magnitude) than 436 (unless you accidentally leave the zone horizontally).

This test is convenient because it not only proves that false starts exist, but because of its ease of replication, it can be used to gather some data. I plan on doing some trials of this at some point to try and get a rough frequency of when 1-tick lags happen.

Flaudgin
07-22-2016, 05:21 PM
I don't think this is true, and though I couldn't be sure why you got the results you did, I'm inclined to think it has something to do with your tests being done on a local server and on a different timer/game (CGN/CSGO timer, yes?)

It's not possible for the surftimer/server to think you've entered/exited a zone too early. Logically, it does not pass.

Furthermore, as I've pointed out, on KSF only 1-tick false starts are at all common. 2- or more tick lags are extremely, extremely rare. If you'd like to test this, one easy way is to go to surf_velocity bonus, which has a fall zone as it extends out to the sides of the platform. Jump out and s-drop repeatedly from the platform, without touching crouch (all of this just for a controlled, easily- and quickly- replicated test)... Almost every single time, you will get -436 z velocity out of zone. Occasionally, you will get a -448. However, you will never see anything less (in magnitude) than 436 (unless you accidentally leave the zone horizontally).

This test is convenient because it not only proves that false starts exist, but because of its ease of replication, it can be used to gather some data. I plan on doing some trials of this at some point to try and get a rough frequency of when 1-tick lags happen.

I know it doesn't make any logical sense, I just don't see where the other 2 ticks would have come from, also since I did these tests a long time ago I don't remember how frequent the 4 tick difference happened, or if it even happened (just going off of memory). Realistically though you could gain 2 ticks by getting late end zones.

Beetle179
07-22-2016, 05:27 PM
I know it doesn't make any logical sense, I just don't see where the other 2 ticks would have come from, also since I did these tests a long time ago I don't remember how frequent the 4 tick difference happened, or if it even happened (just going off of memory). Realistically though you could gain 2 ticks by getting late end zones.

You could get false ends too, yes, but they would be detrimental (whereas false starts are beneficial) to your time. Still though, I don't think these 2-tick lags are related, because they're so ridiculously infrequent (and more often, it's not just 2 ticks, it's more than that).

horsefeathers
07-23-2016, 06:50 AM
Even if its a detriment, its still unfair and still cant be controlled by the player.

Sacred
07-23-2016, 06:59 AM
Even if its a detriment, its still unfair and still cant be controlled by the player.

But nothing to worry about right now. And not easy to detect either.

skip tracer
08-01-2016, 07:24 PM
does having your ping shoot up and back down in the middle/end of a stage affect the end time? as long as the start is legitimate. and not the kind of lag where you're warping around of course. i've never been totally sure and i'm willing to ask a potentially extremely noob question to find out

THERAPIST
08-01-2016, 10:29 PM
Lag in the middle of a run can effect time but it's much more minimal effect than if you lag while leaving the start zone.

If you warp in the demo/sourcetv then the time is not legit though.

Beetle179
08-02-2016, 10:10 PM
we showed a while ago (back in february I think) that having one ping when you leave the startzone, and a significantly (at least 10-15 or more) different ping when you enter the endzone, can mess up your time, by quite a bit. But that was a whole different issue, unrelated to this one. I could make a little writeup on it -- I know flaudgin did some testing with it on CGN, but couldn't consistently replicate exact numbers -- so we thought it was a random/unpredictable effect on your time. But after hearing some of the experiences we've had with this issue, I'm thinking that this other issue could actually be solvable. But bottom line, different issue.

They call me queer
08-11-2016, 10:22 PM
remove all interpolation
only feed the client what the server sees

input lag? yes
problem? no

ryuko
01-02-2017, 08:15 PM
wow you sure are woke my guy

cheazy
01-04-2017, 05:33 PM
Numbers on cs:go for fun:
-323.00 with cj
-316.75 without cj

sqrt[ (350)^2 + (-323.00)^2 ] ~= 476.265 units/s with a crouchjump, or
sqrt[ (350)^2 + (-316.75)^2 ] ~= 472.049 units/s without a crouchjump.

with the common "false start":
-335.50 with cj
-329.25 without cj

sqrt[ (350)^2 + (-335.50)^2 ] ~= 484.830 units/s with a crouchjump, or
sqrt[ (350)^2 + (-329.25)^2 ] ~= 480.526 units/s without a crouchjump.

The problem comes with detecting if something is a false start or not, on stages where these numbers are different. Otherwise this could just restart the player to the start of the stage if the timer detects a false start. Or add a tick to the time.