Any comments about ch3@t3rs plague from DB staff would be appreciated.

an if statement to check the position distance change would probably be around 5 instructions, assuming the variables being checked are stored in registers, if they are not stored in registers (unlikely, more likely to be in cache or physical memory), then there will be extra clock cycles that are sitting idle whilst data is collected to be checked.

in the case of checking a position, generally this will be stored in the clients class data, so its already there on the servers memory, but it would have to access the data first and depending on if its in the cache or in physical ram will have an impact

but you would be wanting to measure distance over time, so first there would be a few math instructions performed on the data to get the raw value of 'how far travelled per second or whatever' ideally you would do these calculations so that it only checks the players positional data when it recieves an update from the player ... this would avoid desync issues, because it would be checking your new location sent by the player, versus the last update, and doing a simple distance/time thing. You probably would have to check it constantly because if not done in real time, then you would have to computre the path travelled as well... however the world is 3d, so then you have more complexity dealing with the math of calculating the actual distance travelled over the terrain, rather than the 2d positional change.

and then finally the actual comparison with a constant value (how far you should travel ) (ie the if statement against the calculate distance travelled)

so more overhead than you would imagine, infact quite a lot ... because on our pc's all that 3d stuff is calculated in our GPU's ... but more than likely this would be on the server CPU ... also you would probably have more than one statement, because you would first check the position, and see if it is out of bounds, and then you would probably want to check if they were in a vehicle if the first statement was true.. (but the 2nd if would be very quick to process, and if smart you would just include that in the data sent from the client (have two methods, one for when in a vehicle and one for when on foot, etc, heck one for every type of vehicle in the interests of optimization)

to put in perspective, an instruction takes one clock cycle to complete...

if you have a 2.5Ghz cpu, then each core is capable of processing up to 2500000000 instructions per second (there is a little bit of overhead for cache locking, data access times from ram, etc etc... thats the raw number if it was only doing stuff in the cpu and didnt have to access any data that wasn't in the cpu's registers)

ideally you would have a GPU in the servers, and the server code would be utilizing that for computing a lot of this stuff in parallel...

tldr; the actual if statement is very tiny and almost zero impact on the server, but the required math leading up to the if statement could be more tricky and a lot more overhead IF the data isnt checked in real time... A LOT more ... so basicly real time checking is the way, because in real time you could probably completely ignore the vertical and only compare the actual 2d change ... lets face it people dont teleport one foot :)

should be super simple to implement and very low overhead IF you performed the checks on every player update recieved by the server, but desync then becomes an issue, because then the distance travelled would suddenly be a big jump, and even thou you are calculating using the time between the two positions, you would then need to take the vertical into account...but ideally you just assume the ground is flat ... then speedhacking would only work on slopes, within reason... (you still wouldnt be able to travel on the horizontal axis more than you could on flat ground)

from what ive seen desync just is lack of updates, then u suddenly move to the new location when you sync back up... but there was a time between those syncs and so yeah it shouldnt be an issue...

P.S. im quite drunk at the moment, so if theres a lot of typos or some shit dont make sense, its cause i dont make sense at the moment hahaha

/r/h1z1 Thread Parent