Food for thought
#1
Everyone who lags may notice for instance when you are using a med kit or drinking a drink it takes quite a bit longer

Erything that uses a timer uses unity timescale for instance 

If(time.time > lastDrink){
//drink
}

Now normally the timescale is 1 by default lag could cause the timescale to drop maybe to 0.5(time is calculated as a float so 0=pause,1=normal,2=double)

So in theory if you increased the timescale by the amount of lag essentially you would eliminate the lag
Reply
#2
ive lagged so bad i chopped a tree 25 times for 1 FUCKING LOG lol, and it seems to lag harder as you finish choppping a single log, which in turns makes you skip a packet, which in turns DOES NOT register register the log u just chopped
Reply
#3
When I'm host, I can't chop a tree (might get 1 log every 5 minutes) and drinking takes forever.

If what you're saying is that the engine could change the time time depending on your lag (fps) and adjust accordingly so t feels more lag free then that's really interesting (disclaimer: I don't know much about unity) but would a player be able to trick the game into thinking they were lagging so that they could speed up the game, or could it flux and make the server thing they are hacking?
Reply
#4
I agree, I don't know anything about unity, but i see a potential exploit here...

i remember a mcGyver episode, where he had to get out of a locked room with a time lock on it, before it blew up.  He "exploited" the clock that was plugged into the wall by increasing the HZ of the wall power, from 60hz, which the clock was used to, to 120HZ, which the clock thought was 60hz, so it ran twice as fast, and allowed him to "speed up" time.

He escaped by the way...

I really wish that Survius could somehow, have a master clock elsewhere, that's not related to host.  That way time passes at a standard, not only when people are logged in.

Speaking of that, could that be why decay seems to be random now.  If the "x" days that take to decay are based on game time, then if a server is "running" all day and night, then would decay happen faster?
Reply
#5
Ur very right daro fps would be calculated using Time.deltaTime(the time it took for the last frame to render) using the default time class to speed up the timescale to make the game feel less laggy would indeed make the game think u were speed hacking if u went actually lagging but if your host and the lag is bad let's say you normally run 1m/'s and when your host you run 0.5m/'s then your could say the timescale was decreased to 0.5f now since the timescale technically would still be 1 but the deltaxi me would be 0.5 if u increase the timescale to 1.5f then essentially the game would feel a lot less laggy

Ive used this method in a few of my games it's quite tricky and a very complex way to tackle lag but it works like a charm
Reply
#6
The server uses a timestamp (as far as I know) to judge when things decay, doesn't use how long the server is running.

So yeah, the server would need to know the fps or something so it knows the speed the client is running so no false bans are given.
Reply
#7
If the cheat detection detects if u go over a certain speed and that's how u get banned then the best way to make the functionality would be to check the fps (Time.deltaTime <= distanceTraveled) if your traveling less distance then u should in a single frame then your lagging now u take and grab the actuall distance traveled calculate the lag and increase the timescale by the lag

To prevent a false speed hack detection unity has a call back Update () which runs every frame so if you calculate the lag every frame and adjust it that would prevent getting a false speedhack 

This would also prevent exploiting it cause even if u were to fake "lagging" the game would just correct within the next frame so it couldn't be abused
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)