Decreasing playerbase
- iRobot
- Junk Administrator
- Posts: 3909
- Joined: Fri 06 Jan , 2012 10:37 am
- Contact:
Re: Decreasing playerbase
Then surely the issue lies with your connection itself if your ping varies so wildly?
I would be in touch with my ISP if it was that inconsistent.
I would be in touch with my ISP if it was that inconsistent.
- Ollievrthecool
- Member
- Posts: 363
- Joined: Wed 08 May , 2013 5:14 pm
- Location: England
- Contact:
Re: Decreasing playerbase
Talking of lag in connections, when i am playing ballistic, i get spikes of packet loss. You may think this is my problem but when i play on the race/assault server, it never happens. This is either a coincidence or thetr is summit wrong with the server. Also, on the note of ping comp, you say it works client side, will it effect fps issues being in the cache folder or in the system folder, because since it was added, i have continuous fps spikes as my screen freezes. Which this never happens on race/assault.
- Azarael
- UT2004 Administrator
- Posts: 5365
- Joined: Thu 11 Feb , 2010 10:52 pm
Re: Decreasing playerbase
Code: Select all
class MutPingCompensation extends Mutator;
var PlayerController LocalPlayer;
simulated function Tick(float DeltaTime)
{
local Actor A;
local float Ping;
//only active on clients
if ( Level.NetMode != NM_Client ) {
Disable('Tick');
return;
}
//return if no local controller / demo
if ( LocalPlayer == None )
LocalPlayer = Level.GetLocalPlayerController();
if ( LocalPlayer == None )
return;
else if ( LocalPlayer.IsA('DemoRecSpectator') ) {
Disable('Tick');
return;
}
//this particular var is updated on call of LongClientAdjustPosition() (possibly very frequent)
Ping = LocalPlayer.ExactPing;
//iterate through all actors capable of movement and adjust their prepivot value (offset for where they're rendered)
foreach DynamicActors(class'Actor', A) {
if ( A.bProjTarget && A.Physics != PHYS_None && A.Physics != PHYS_Rotating
&& (A.Velocity != vect(0,0,0) || A.Acceleration != vect(0,0,0))
&& A.RotationRate == rot(0,0,0) && A.bCollideActors && A.Role < ROLE_Authority
&& (Projectile(A) != None && !A.IsA('FlakShell') || Pawn(A) != None && Pawn(A).Health > 0) ) {
if ( A.bCollideWorld && (Vehicle(A) != None || A.IsA('UnrealPawn')) )
A.PrePivot = 0.5 * (A.PrePivot + PredictLocation(A, Ping, 2) - A.Location);
else
A.PrePivot = 0.5 * (A.PrePivot + PredictLocation(A, Ping) - A.Location);
}
else if ( A.PrePivot != vect(0,0,0) )
A.PrePivot = vect(0,0,0);
}
}
static simulated function vector PredictLocation(Actor Other, float PredictedTime, optional int CheckWalls)
{
local vector StartLocation, PredictedLocation, ErrorDiff;
local vector HitLocation, HitNormal;
// calculate predicted location without taking level geometry into account
if ( Other.Physics == PHYS_Falling || Other.Physics == PHYS_Karma )
PredictedLocation = Square(PredictedTime) * Other.PhysicsVolume.Gravity / 4
+ PredictedTime * Other.Velocity + Other.Location;
else {
PredictedLocation = Other.Velocity * PredictedTime + Other.Location;
// adjust direction for walking players
if ( Other.Physics == PHYS_Walking && Other.Trace(HitLocation, HitNormal,
PredictedLocation - vect(0,0,1) * VSize(Other.Velocity), PredictedLocation, False,
vect(0,0,1) * Other.CollisionHeight + vect(1,1,0) * Other.CollisionRadius) != None )
PredictedLocation = HitLocation;
}
StartLocation = Other.Location;
ErrorDiff = PredictedLocation - StartLocation;
// check for walls and adjust predicted location
while ( CheckWalls > 0 && Other.Trace(HitLocation, HitNormal, ErrorDiff + StartLocation, StartLocation,
False, vect(0,0,1) * Other.CollisionHeight + vect(1,1,0) * Other.CollisionRadius) != None ) {
// HitLocation is a point on the plane the player will most likely hit
// HitNormal is that plane's normal vector
ErrorDiff = PredictedLocation - HitLocation;
if ( HitNormal.Z < -0.7 )
PredictedLocation -= 2 * (ErrorDiff dot HitNormal) * HitNormal; // bounce off a ceiling
else
PredictedLocation -= (ErrorDiff dot HitNormal) * HitNormal; // project the predicted location onto the plane
// If the player can land on this plane, i.e. if this is the ground, then adjust the predicted location.
// (the player will most probably not run in the same direction after landing)
if ( HitNormal.Z > 0.7 && Other.Physics == PHYS_Falling )
PredictedLocation = 0.3 * PredictedLocation + 0.7 * HitLocation; // it's close enough to the real thing
StartLocation = HitLocation;
CheckWalls--;
}
return PredictedLocation;
}
Code: Select all
[PingCompensationConfig.MutPingCompensation]
bEnabled=False
Code: Select all
else if ( A.PrePivot != vect(0,0,0) )
A.PrePivot = vect(0,0,0);
- Skaldy
- V.I.P. Member
- Posts: 264
- Joined: Tue 19 Mar , 2013 4:59 pm
- Location: UK
- Contact:
Re: Decreasing playerbase
It's always interesting to see other ppl's code 
I note that it's using "LocalPlayer.ExactPing" (with an explicit comment about frequency) - perhaps some sort of smoothed or average ping would give a better feel during play. But whatever.
Many thanks for the .ini option - I'll give it a go with pleasure. I would have thought that only ppl with ping > 80 would be that bothered about having it enabled anyway.

I note that it's using "LocalPlayer.ExactPing" (with an explicit comment about frequency) - perhaps some sort of smoothed or average ping would give a better feel during play. But whatever.
Many thanks for the .ini option - I'll give it a go with pleasure. I would have thought that only ppl with ping > 80 would be that bothered about having it enabled anyway.
- Azarael
- UT2004 Administrator
- Posts: 5365
- Joined: Thu 11 Feb , 2010 10:52 pm
Re: Decreasing playerbase
I added that particular comment, since there's more than one Ping variable in UT. The NewPing variable is updated every 4 seconds, by contrast to this one.
- iRobot
- Junk Administrator
- Posts: 3909
- Joined: Fri 06 Jan , 2012 10:37 am
- Contact:
Re: Decreasing playerbase
Is disabling it likely to have any effect on those with low ping?
- Azarael
- UT2004 Administrator
- Posts: 5365
- Joined: Thu 11 Feb , 2010 10:52 pm
- Butcher
- V.I.P. Member
- Posts: 893
- Joined: Sat 15 Sep , 2012 1:31 pm
- Location: Germany
- Contact:
Re: Decreasing playerbase
Wow, thanks Aza...
Read the code, and it seems looking for an approximation. To me it looks like "You are most likely to follow the same momentum " so the position calculated is always in the same direction adding the time delay in agreement to the physics module (except when there is a blocking object as a ceiling/wall to bounce or a floor that stops you)... This is ok meanwhile you are in the air, but in the ground I avoid going in the same line
what I find not very good is this:
I look forward to see if there is any difference to it turned on or off... maybe just add a button in ballistic menu for those who want it off
... and rest that do not have issues may still use it 
Read the code, and it seems looking for an approximation. To me it looks like "You are most likely to follow the same momentum " so the position calculated is always in the same direction adding the time delay in agreement to the physics module (except when there is a blocking object as a ceiling/wall to bounce or a floor that stops you)... This is ok meanwhile you are in the air, but in the ground I avoid going in the same line
what I find not very good is this:
I avoid doing this always because while you are in the air you may not change your direction, and is easy to predict where to shoot... with this one knows where to shoot after someone has jumped or dodged and/or land...(the player will most probably not run in the same direction after landing)
I look forward to see if there is any difference to it turned on or off... maybe just add a button in ballistic menu for those who want it off


"An BW match is a test of your skill against your opponents' luck." 

- Azarael
- UT2004 Administrator
- Posts: 5365
- Joined: Thu 11 Feb , 2010 10:52 pm
Re: Decreasing playerbase
I can't give a button to turn it off in the Ballistic menu without including it in BW itself, which is not an option.
- Calypto
- Posts: 1879
- Joined: Tue 27 Dec , 2011 6:24 am
- Location: New York State
- Contact:
Re: Decreasing playerbase
Best option would be to disable it by default if players left because of "delay."
Who is online
Users browsing this forum: No registered users and 2 guests