From 2e816640e6c6f7886ccc5916087f83a306af86d5 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Thu, 23 Jul 2020 09:36:22 +0200 Subject: [PATCH 01/70] Remove zzViewRotation --- Classes/ST_ASMD.uc | 178 +++++++++++++++---------------- Classes/ST_Rifle.uc | 76 +++++++------- Classes/ST_ShockProj.uc | 66 +++++------- Classes/ST_ShockProjGib.uc | 38 +++---- Classes/ST_ShockRifle.uc | 162 ++++++++++++++-------------- Classes/ST_SniperRifle.uc | 94 ++++++++--------- Classes/ST_SuperShockRifle.uc | 4 +- Classes/ST_UnrealWeapons.uc | 20 ++-- Classes/ST_WildcardsWeapons.uc | 20 ++-- Classes/ST_sgShockProj.uc | 66 +++++------- Classes/ST_sgShockRifle.uc | 54 +++++----- Classes/UTPure.uc | 2 +- Classes/bbPlayer.uc | 186 ++++++++++++++------------------- 13 files changed, 458 insertions(+), 508 deletions(-) diff --git a/Classes/ST_ASMD.uc b/Classes/ST_ASMD.uc index 2d056868..eb6e3a6b 100644 --- a/Classes/ST_ASMD.uc +++ b/Classes/ST_ASMD.uc @@ -19,10 +19,10 @@ var int HitCounter; simulated function RenderOverlays(Canvas Canvas) { local bbPlayer bbP; - + Super.RenderOverlays(Canvas); yModInit(); - + bbP = bbPlayer(Owner); if (bNewNet && Role < ROLE_Authority && bbP != None) { @@ -36,11 +36,11 @@ simulated function RenderOverlays(Canvas Canvas) simulated function yModInit() { if (bbPlayer(Owner) != None && Owner.Role == ROLE_AutonomousProxy) - GV = bbPlayer(Owner).zzViewRotation; - + GV = bbPlayer(Owner).ViewRotation; + if (PlayerPawn(Owner) == None) return; - + yMod = PlayerPawn(Owner).Handedness; if (yMod != 2.0) yMod *= Default.FireOffset.Y; @@ -66,10 +66,10 @@ function inventory SpawnCopy( pawn Other ) simulated function bool ClientFire(float Value) { local bbPlayer bbP; - + if (Owner.IsA('Bot')) return Super.ClientFire(Value); - + bbP = bbPlayer(Owner); if (Role < ROLE_Authority && bbP != None && bNewNet) { @@ -106,12 +106,12 @@ simulated function NN_TraceFire() local actor zzOther; local int oRadius,oHeight; local vector zzX,zzY,zzZ,zzStartTrace,zzEndTrace,zzHitLocation,zzHitNormal; - + if (Owner.IsA('Bot')) return; - + yModInit(); - + bbP = bbPlayer(Owner); if (bbP == None) return; @@ -119,8 +119,8 @@ simulated function NN_TraceFire() // Owner.MakeNoise(Pawn(Owner).SoundDampening); GetAxes(GV,X,Y,Z); StartTrace = Owner.Location + CDO + yMod * Y + FireOffset.Z * Z; - EndTrace = StartTrace + (100000 * vector(GV)); - + EndTrace = StartTrace + (100000 * vector(GV)); + //for (P = Level.PawnList; P != None; P = P.NextPawn) // P.SetCollisionSize(P.CollisionRadius * ShockRadius / 100, P.CollisionHeight); @@ -128,7 +128,7 @@ simulated function NN_TraceFire() if (Other.IsA('Pawn')) { HitDiff = HitLocation - Other.Location; - + zzbbP = bbPlayer(Other); if (zzbbP != None) { @@ -143,15 +143,15 @@ simulated function NN_TraceFire() //bbP.xxChecked(Other != zzOther); } } - + /* zzbNN_Combo = NN_ProcessTraceHit(Other, HitLocation, HitNormal, vector(GV),Y,Z); if (zzbNN_Combo) - //bbP.xxNN_Fire(ST_TazerProj(Other).zzNN_ProjIndex, bbP.Location, bbP.Velocity, bbP.zzViewRotation, Other, HitLocation, HitDiff, true); + //bbP.xxNN_Fire(ST_TazerProj(Other).zzNN_ProjIndex, bbP.Location, bbP.Velocity, bbP.ViewRotation, Other, HitLocation, HitDiff, true); else - bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.zzViewRotation, Other, HitLocation, HitDiff, false); + bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.ViewRotation, Other, HitLocation, HitDiff, false); if (Other == bbP.zzClientTTarget) bbP.zzClientTTarget.TakeDamage(0, Pawn(Owner), HitLocation, 60000.0*vector(GV), MyDamageType); */ - + //for (P = Level.PawnList; P != None; P = P.NextPawn) // P.SetCollisionSize(P.Default.CollisionRadius, P.CollisionHeight); } @@ -165,16 +165,16 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect local class rc; local RingExplosion r; local bool zzbNN_Combo; - + if (Owner.IsA('Bot')) return false; - + if (Other==None) { HitNormal = -X; HitLocation = Owner.Location + X*100000.0; } - + if (Amp!=None) Mult = Amp.UseCharge(100); else Mult=1.0; SmokeLocation = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * 3.3 * Y + FireOffset.Z * Z * 3.0; @@ -186,7 +186,7 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect if ( NumPoints>1.0 ) SpawnEffect2(DVector, NumPoints, SmokeRotation, SmokeLocation); /* if ( TazerProjectile(Other)!=None ) - { + { AmmoType.UseAmmo(2); TazerProjectile(Other).SuperExplosion(); } */ @@ -225,13 +225,13 @@ function SpawnEffect2(Vector DVector, int NumPoints, rotator SmokeRotation, vect function Fire ( float Value ) { local bbPlayer bbP; - + if (Owner.IsA('Bot')) { Super.Fire(Value); return; } - + bbP = bbPlayer(Owner); if (bbP != None && bNewNet && Value < 1) return; @@ -244,13 +244,13 @@ function AltFire( float Value ) local vector HitLocation, HitNormal, Start; local bbPlayer bbP; //local NN_TazerProjOwnerHidden NNSP; - + if (Owner.IsA('Bot')) { Super.AltFire(Value); return; } - + bbP = bbPlayer(Owner); if (bbP != None && bNewNet && Value < 1) return; @@ -260,7 +260,7 @@ function AltFire( float Value ) if ( Owner.IsA('Bot') ) //make sure won't blow self up { - Start = Owner.Location + CalcDrawOffset() + FireOffset.Z * vect(0,0,1); + Start = Owner.Location + CalcDrawOffset() + FireOffset.Z * vect(0,0,1); if ( Pawn(Owner).Enemy != None ) HitActor = Trace(HitLocation, HitNormal, Start + 250 * Normal(Pawn(Owner).Enemy.Location - Start), Start, false, vect(12,12,12)); else @@ -270,7 +270,7 @@ function AltFire( float Value ) Global.Fire(Value); return; } - } + } if ( AmmoType != None && AmmoType.UseAmmo(1) ) { GotoState('AltFiring'); @@ -308,7 +308,7 @@ state ClientFiring simulated function bool ClientFire(float Value) { local float MinTapTime; -/* +/* if (Owner.IsA('Bot')) return Super.ClientFire(Value); */ @@ -316,7 +316,7 @@ state ClientFiring MinTapTime = 0.4; else MinTapTime = 0.2; - + if ( Level.TimeSeconds - TapTime < MinTapTime ) return false; bForceFire = bForceFire || ( bCanClientFire && (Pawn(Owner) != None) && (AmmoType.AmmoAmount > 0) ); @@ -326,7 +326,7 @@ state ClientFiring simulated function bool ClientAltFire(float Value) { local float MinTapTime; -/* +/* if (Owner.IsA('Bot')) return Super.ClientAltFire(Value); */ @@ -334,7 +334,7 @@ state ClientFiring MinTapTime = 0.4; else MinTapTime = 0.2; - + if ( Level.TimeSeconds - TapTime < MinTapTime ) return false; bForceAltFire = bForceAltFire || ( bCanClientFire && (Pawn(Owner) != None) && (AmmoType.AmmoAmount > 0) ); @@ -344,7 +344,7 @@ state ClientFiring simulated function AnimEnd() { local bool bForce, bForceAlt; - + if (Owner.IsA('Bot')) { Super.AnimEnd(); @@ -355,7 +355,7 @@ state ClientFiring bForceAlt = bForceAltFire; bForceFire = false; bForceAltFire = false; - + if ( bNewNet && Level.NetMode == NM_Client && bCanClientFire && (PlayerPawn(Owner) != None) && (AmmoType.AmmoAmount > 0) ) { if ( bForce || (Pawn(Owner).bFire != 0) ) @@ -368,7 +368,7 @@ state ClientFiring Global.ClientAltFire(0); return; } - } + } Super.AnimEnd(); } simulated function EndState() @@ -385,7 +385,7 @@ state ClientFiring } state ClientAltFiring -{ +{ simulated function AnimEnd() { Super.AnimEnd(); @@ -405,13 +405,13 @@ function Projectile ProjectileFire(class ProjClass, float ProjSpeed, local Vector Start, X,Y,Z; local PlayerPawn PlayerOwner; local bbPlayer bbP; - + if (Owner.IsA('Bot')) return Super.ProjectileFire(ProjClass, ProjSpeed, bWarn); PlayerOwner = PlayerPawn(Owner); bbP = bbPlayer(Owner); - + Owner.MakeNoise(Pawn(Owner).SoundDampening); if (bNewNet && bbP != None) { @@ -419,20 +419,20 @@ function Projectile ProjectileFire(class ProjClass, float ProjSpeed, return None; GetAxes(bbP.zzNN_ViewRot,X,Y,Z); if (Mover(bbP.Base) == None) - Start = bbP.zzNN_ClientLoc + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; + Start = bbP.zzNN_ClientLoc + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; else - Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; + Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; } else { GetAxes(Pawn(Owner).ViewRotation,X,Y,Z); - Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; + Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; } - AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, AimError, True, bWarn); + AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, AimError, True, bWarn); if ( PlayerOwner != None ) PlayerOwner.ClientInstantFlash( -0.4, vect(450, 190, 650)); - + LastFiredTime = Level.TimeSeconds; return Spawn(ProjClass,Owner,, Start,AdjustedAim); } @@ -445,38 +445,38 @@ simulated function Projectile NN_ProjectileFire(class ProjClass, flo //local ST_TazerProj ST_Proj; local int ProjIndex; local bbPlayer bbP; - + if (Owner.IsA('Bot')) return None; - + yModInit(); - + bbP = bbPlayer(Owner); if (bbP == None || (Level.TimeSeconds - LastFiredTime) < 0.4) return None; - + GetAxes(GV,X,Y,Z); - Start = Owner.Location + CDO + FireOffset.X * X + yMod * Y + FireOffset.Z * Z; + Start = Owner.Location + CDO + FireOffset.X * X + yMod * Y + FireOffset.Z * Z; if ( PlayerOwner != None ) PlayerOwner.ClientInstantFlash( -0.4, vect(450, 190, 650)); - + LastFiredTime = Level.TimeSeconds; Proj = Spawn(ProjClass,Owner,, Start,GV); //ST_Proj = ST_TazerProj(Proj); ProjIndex = bbP.xxNN_AddProj(Proj); /* if (ST_Proj != None) ST_Proj.zzNN_ProjIndex = ProjIndex; */ - bbP.xxNN_AltFire(ProjIndex, bbP.Location, bbP.Velocity, bbP.zzViewRotation); + bbP.xxNN_AltFire(ProjIndex, bbP.Location, bbP.Velocity, bbP.ViewRotation); //bbP.xxClientDemoFix(ST_Proj, Class'TazerProjectile', Start, ST_Proj.Velocity, Proj.Acceleration, GV); } simulated function bool ClientAltFire(float Value) { local bbPlayer bbP; - + if (Owner.IsA('Bot')) return Super.ClientAltFire(Value); - + bbP = bbPlayer(Owner); if (Role < ROLE_Authority && bbP != None && bNewNet) { @@ -503,7 +503,7 @@ function TraceFire( float Accuracy ) local bool bShockCombo; //local NN_TazerProjOwnerHidden NNSP; local vector NN_HitLoc, HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z; - + if (Owner.IsA('Bot')) { Super.TraceFire(Accuracy); @@ -516,31 +516,31 @@ function TraceFire( float Accuracy ) Super.TraceFire(Accuracy); return; } - + if (bbP.zzNN_HitActor != None && bbP.zzNN_HitActor.IsA('bbPlayer') && !bbPlayer(bbP.zzNN_HitActor).xxCloseEnough(bbP.zzNN_HitLoc)) bbP.zzNN_HitActor = None; - + NN_Other = bbP.zzNN_HitActor; //bShockCombo = bbP.zzbNN_Special && (NN_Other == None || NN_TazerProjOwnerHidden(NN_Other) != None && NN_Other.Owner != Owner); - + if (bShockCombo && NN_Other == None) { /* ForEach AllActors(class'NN_TazerProjOwnerHidden', NNSP) if (NNSP.zzNN_ProjIndex == bbP.zzNN_ProjIndex) NN_Other = NNSP; - + if (NN_Other == None) NN_Other = Spawn(class'NN_TazerProjOwnerHidden', Owner,, bbP.zzNN_HitLoc); else NN_Other.SetLocation(bbP.zzNN_HitLoc); - + bbP.zzNN_HitActor = NN_Other; */ return; } - + Owner.MakeNoise(bbP.SoundDampening); GetAxes(bbP.zzNN_ViewRot,X,Y,Z); - + StartTrace = Owner.Location + CalcDrawOffset() + FireOffset.Y * Y + FireOffset.Z * Z; EndTrace = StartTrace + Accuracy * (FRand() - 0.5 )* Y * 1000 + Accuracy * (FRand() - 0.5 ) * Z * 1000 ; @@ -551,13 +551,13 @@ function TraceFire( float Accuracy ) EndTrace += 100000 * Normal(Tracked.Location - StartTrace); else { - AdjustedAim = bbP.AdjustAim(1000000, StartTrace, 2.75*AimError, False, False); - EndTrace += (100000 * vector(AdjustedAim)); + AdjustedAim = bbP.AdjustAim(1000000, StartTrace, 2.75*AimError, False, False); + EndTrace += (100000 * vector(AdjustedAim)); } - + if (bbP.zzNN_HitActor != None && VSize(bbP.zzNN_HitDiff) > bbP.zzNN_HitActor.CollisionRadius + bbP.zzNN_HitActor.CollisionHeight) bbP.zzNN_HitDiff = vect(0,0,0); - + if (bbP.zzNN_HitActor != None && (bbP.zzNN_HitActor.IsA('Pawn') || bbP.zzNN_HitActor.IsA('Projectile')) && FastTrace(bbP.zzNN_HitActor.Location + bbP.zzNN_HitDiff, StartTrace)) { NN_HitLoc = bbP.zzNN_HitActor.Location + bbP.zzNN_HitDiff; @@ -568,7 +568,7 @@ function TraceFire( float Accuracy ) bbP.zzNN_HitActor = bbP.TraceShot(HitLocation,HitNormal,EndTrace,StartTrace); NN_HitLoc = bbP.zzNN_HitLoc; } - + ProcessTraceHit(bbP.zzNN_HitActor, NN_HitLoc, HitNormal, vector(AdjustedAim),Y,Z); bbP.zzNN_HitActor = None; Tracked = None; @@ -579,7 +579,7 @@ function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vect { local PlayerPawn PlayerOwner; local Pawn PawnOwner; - + if (Owner.IsA('Bot')) { Super.ProcessTraceHit(Other, HitLocation, HitNormal, X, Y, Z); @@ -598,7 +598,7 @@ function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vect if ( PlayerOwner != None ) PlayerOwner.ClientInstantFlash( -0.4, vect(450, 190, 650)); SpawnEffect(HitLocation, Owner.Location + CalcDrawOffset() + (FireOffset.X + 20) * X + FireOffset.Y * Y + FireOffset.Z * Z); - + /* if ( NN_TazerProjOwnerHidden(Other)!=None ) { AmmoType.UseAmmo(1); @@ -621,7 +621,7 @@ function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vect Spawn(class'RingExplosion5',,, HitLocation+HitNormal*8,rotator(HitNormal)); } */ - /* if ( (Other != self) && (Other != Owner) && (Other != None) ) + /* if ( (Other != self) && (Other != Owner) && (Other != None) ) { if (HitDamage > 0) Other.TakeDamage(HitDamage, PawnOwner, HitLocation, 60000.0*X, MyDamageType); @@ -645,7 +645,7 @@ simulated function DoRingExplosion5(PlayerPawn Pwner, vector HitLocation, vector { local PlayerPawn P; local Actor CR; - + if (Owner.IsA('Bot')) return; @@ -665,7 +665,7 @@ function SpawnEffect(vector HitLocation, vector SmokeLocation) local Vector DVector; local int NumPoints; local rotator SmokeRotation; - + if (Owner.IsA('Bot')) { Super.SpawnEffect(HitLocation, SmokeLocation); @@ -678,13 +678,13 @@ function SpawnEffect(vector HitLocation, vector SmokeLocation) return; SmokeRotation = rotator(DVector); SmokeRotation.roll = Rand(65535); - + if (bNewNet) Smoke = Spawn(class'NN_ShockBeamOwnerHidden',Owner,,SmokeLocation,SmokeRotation); else Smoke = Spawn(class'ShockBeam',,,SmokeLocation,SmokeRotation); Smoke.MoveAmount = DVector/NumPoints; - Smoke.NumPuffs = NumPoints - 1; + Smoke.NumPuffs = NumPoints - 1; } function SetSwitchPriority(pawn Other) @@ -709,7 +709,7 @@ simulated function AnimEnd () state NormalFire { - function Fire(float F) + function Fire(float F) { if (Owner.IsA('Bot')) { @@ -719,7 +719,7 @@ state NormalFire if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { @@ -733,7 +733,7 @@ state NormalFire state AltFiring { - function Fire(float F) + function Fire(float F) { if (Owner.IsA('Bot')) { @@ -743,7 +743,7 @@ state AltFiring if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { @@ -772,7 +772,7 @@ State ClientActive bForceAltFire = bbPlayer(Owner) == None || !bbPlayer(Owner).ClientCannotShoot(); return bForceAltFire; } - + simulated function AnimEnd() { if ( Owner == None ) @@ -780,7 +780,7 @@ State ClientActive Global.AnimEnd(); GotoState(''); } - else if ( Owner.IsA('TournamentPlayer') + else if ( Owner.IsA('TournamentPlayer') && (TournamentPlayer(Owner).PendingWeapon != None || TournamentPlayer(Owner).ClientPending != None) ) GotoState('ClientDown'); else if ( bWeaponUp ) @@ -802,7 +802,7 @@ State ClientActive state Active { - function Fire(float F) + function Fire(float F) { if (Owner.IsA('Bot')) { @@ -812,7 +812,7 @@ state Active if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { @@ -827,7 +827,7 @@ state Active auto state Pickup { ignores AnimEnd; - + simulated function Landed(Vector HitNormal) { Super(Inventory).Landed(HitNormal); @@ -850,7 +850,7 @@ simulated function PlayIdleAnim() { if ( AnimSequence == 'Fire1' && FRand()<0.2) { - Owner.PlaySound(Misc1Sound, SLOT_None, Pawn(Owner).SoundDampening*0.5); + Owner.PlaySound(Misc1Sound, SLOT_None, Pawn(Owner).SoundDampening*0.5); PlayAnim('Steam',0.1,0.4); } else if ( VSize(Owner.Velocity) > 20 ) @@ -858,12 +858,12 @@ simulated function PlayIdleAnim() if ( AnimSequence=='Still' ) LoopAnim('Sway',0.1,0.3); } - else if ( AnimSequence!='Still' ) + else if ( AnimSequence!='Still' ) { - if (FRand()<0.5) + if (FRand()<0.5) { PlayAnim('Steam',0.1,0.4); - Owner.PlaySound(Misc1Sound, SLOT_None, Pawn(Owner).SoundDampening*0.5); + Owner.PlaySound(Misc1Sound, SLOT_None, Pawn(Owner).SoundDampening*0.5); } else LoopAnim('Still',0.04,0.3); } @@ -878,7 +878,7 @@ state Idle SetTimer(0.5 + 2 * FRand(), false); Super.BeginState(); if (Pawn(Owner).bFire!=0) Fire(0.0); - if (Pawn(Owner).bAltFire!=0) AltFire(0.0); + if (Pawn(Owner).bAltFire!=0) AltFire(0.0); } function EndState() { @@ -889,8 +889,8 @@ state Idle state ComboMove { - function Fire(float F); - function AltFire(float F); + function Fire(float F); + function AltFire(float F); function Tick(float DeltaTime) { @@ -901,8 +901,8 @@ state ComboMove Finish(); return; } - if ( (Tracked == None) || Tracked.bDeleteMe - || (((Tracked.Location - Owner.Location) + if ( (Tracked == None) || Tracked.bDeleteMe + || (((Tracked.Location - Owner.Location) dot (Tracked.Location - Pawn(Owner).Enemy.Location)) >= 0) || (VSize(Tracked.Location - Pawn(Owner).Enemy.Location) < 100) ) Global.Fire(0); diff --git a/Classes/ST_Rifle.uc b/Classes/ST_Rifle.uc index 9c05e681..8fb48070 100644 --- a/Classes/ST_Rifle.uc +++ b/Classes/ST_Rifle.uc @@ -24,7 +24,7 @@ function float RateSelf( out int bUseAltMode ) { if ( dist > 2000 ) return (AIRating + 0.75); - return (AIRating + FMin(0.0001 * dist, 0.45)); + return (AIRating + FMin(0.0001 * dist, 0.45)); } } return AIRating; @@ -36,9 +36,9 @@ simulated function RenderOverlays(Canvas Canvas) local bool bPlayerOwner; local int Hand; local PlayerPawn PlayerOwner; - + Super.RenderOverlays(Canvas); - + if ( bHideWeapon || (Owner == None) ) return; @@ -137,11 +137,11 @@ simulated function bool ClientAltFire( float Value ) function Fire( float Value ) { local bbPlayer bbP; - + bbP = bbPlayer(Owner); if (bbP != None && bNewNet && Value < 1) return; - + if ( (AmmoType == None) && (AmmoName != None) ) { GiveAmmo(Pawn(Owner)); @@ -181,7 +181,7 @@ function AltFire( float Value ) state NormalFire { - function Fire(float F) + function Fire(float F) { if (Owner.IsA('Bot')) { @@ -191,7 +191,7 @@ state NormalFire if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { @@ -274,13 +274,13 @@ function Timer() bPointing = true; Pawn(targ).WarnTarget(Pawn(Owner), 200, FireDir); } - else + else { SetTimer(0.4 + 1.6 * FRand(), false); if ( (Pawn(Owner).bFire == 0) && (Pawn(Owner).bAltFire == 0) ) bPointing = false; } -} +} function Finish() { @@ -320,19 +320,19 @@ state Idle } function BeginState() { - if (Pawn(Owner).bFire!=0) Fire(0.0); + if (Pawn(Owner).bFire!=0) Fire(0.0); bPointing = false; SetTimer(0.4 + 1.6 * FRand(), false); Super.BeginState(); } function EndState() - { + { SetTimer(0.0, false); Super.EndState(); } Begin: bPointing=False; - if ( (AmmoType != None) && (AmmoType.AmmoAmount<=0) ) + if ( (AmmoType != None) && (AmmoType.AmmoAmount<=0) ) Pawn(Owner).SwitchToBestWeapon(); if ( Pawn(Owner).bFire!=0 ) Fire(0.0); Disable('AnimEnd'); @@ -383,12 +383,12 @@ simulated function NN_TraceFire() local Pawn PawnOwner; local bbPlayer bbP; local bool bHeadshot; - + if (Owner.IsA('Bot')) return; - + yModInit(); - + PawnOwner = Pawn(Owner); bbP = bbPlayer(Owner); if (bbP == None) @@ -397,13 +397,13 @@ simulated function NN_TraceFire() GetAxes(GV,X,Y,Z); StartTrace = Owner.Location + bbP.Eyeheight * vect(0,0,1); EndTrace = StartTrace + (100000 * vector(GV)); - + Other = bbP.NN_TraceShot(HitLocation,HitNormal,EndTrace,StartTrace,PawnOwner); if (Other.IsA('Pawn')) HitDiff = HitLocation - Other.Location; - + bHeadshot = NN_ProcessTraceHit(Other, HitLocation, HitNormal, X,Y,Z,yMod); - bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.zzViewRotation, Other, HitLocation, HitDiff, bHeadshot); + bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.ViewRotation, Other, HitLocation, HitDiff, bHeadshot); } simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z, float yMod) @@ -411,17 +411,17 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect local UT_Shellcase s; local Pawn PawnOwner; local float CH; - + if (Owner.IsA('Bot')) return false; PawnOwner = Pawn(Owner); s = Spawn(class'UT_ShellCase',, '', Owner.Location + CDO + 30 * X + (2.8 * yMod+5.0) * Y - Z * 1); - if ( s != None ) + if ( s != None ) { s.DrawScale = 2.0; - s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160); + s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160); } if (Other == Level || Other.IsA('Mover')) { @@ -439,13 +439,13 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect } else { CH = Other.CollisionHeight; } - + if (HitLocation.Z - Other.Location.Z > BodyHeight * CH) return true; } - + if ( !Other.bIsPawn && !Other.IsA('Carcass') ) - spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9); + spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9); } return false; } @@ -492,9 +492,9 @@ function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vect { if ( Other.bIsPawn ) Other.PlaySound(Sound 'ChunkHit',, 4.0,,100); - + if ( (bbP.zzbNN_Special || !bNewNet && - Other.bIsPawn && (HitLocation.Z - Other.Location.Z > BodyHeight * Other.CollisionHeight) + Other.bIsPawn && (HitLocation.Z - Other.Location.Z > BodyHeight * Other.CollisionHeight) && (instigator.IsA('PlayerPawn') || (instigator.IsA('Bot') && !Bot(Instigator).bNovice)) ) && !PPOther.bIsCrouching && PPOther.GetAnimGroup(PPOther.AnimSequence) != 'Ducking' ) { @@ -519,7 +519,7 @@ simulated function DoShellCase(PlayerPawn Pwner, vector HitLoc, Vector X, Vector local PlayerPawn P; local Actor CR; local UT_Shellcase s; - + if (Owner.IsA('Bot')) return; @@ -531,10 +531,10 @@ simulated function DoShellCase(PlayerPawn Pwner, vector HitLoc, Vector X, Vector CR = P.Spawn(class'UT_ShellCase',P, '', HitLoc); CR.bOnlyOwnerSee = True; s = UT_Shellcase(CR); - if ( s != None ) + if ( s != None ) { s.DrawScale = 2.0; - s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160); + s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160); } } } @@ -545,37 +545,37 @@ function TraceFire( float Accuracy ) { local bbPlayer bbP; local vector NN_HitLoc, HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z; - + if (Owner.IsA('Bot')) { Super.TraceFire(Accuracy); return; } - + bbP = bbPlayer(Owner); - + if (bbP == None || !bNewNet) { Super.TraceFire(Accuracy); return; } - + if (bbP == None) { if (bbP.zzNN_HitActor.IsA('bbPlayer') && !bbPlayer(bbP.zzNN_HitActor).xxCloseEnough(bbP.zzNN_HitLoc)) bbP.zzNN_HitActor = None; } - + Owner.MakeNoise(bbP.SoundDampening); GetAxes(bbP.zzNN_ViewRot,X,Y,Z); StartTrace = Owner.Location + bbP.Eyeheight * vect(0,0,1); - AdjustedAim = bbP.AdjustAim(1000000, StartTrace, 2*AimError, False, False); + AdjustedAim = bbP.AdjustAim(1000000, StartTrace, 2*AimError, False, False); X = vector(AdjustedAim); EndTrace = StartTrace + 100000 * X; - + if (bbP.zzNN_HitActor != None && VSize(bbP.zzNN_HitDiff) > bbP.zzNN_HitActor.CollisionRadius + bbP.zzNN_HitActor.CollisionHeight) bbP.zzNN_HitDiff = vect(0,0,0); - + if (bbP.zzNN_HitActor != None && (bbP.zzNN_HitActor.IsA('Pawn') || bbP.zzNN_HitActor.IsA('Projectile')) && FastTrace(bbP.zzNN_HitActor.Location + bbP.zzNN_HitDiff, StartTrace)) { NN_HitLoc = bbP.zzNN_HitActor.Location + bbP.zzNN_HitDiff; @@ -616,7 +616,7 @@ state Active if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { diff --git a/Classes/ST_ShockProj.uc b/Classes/ST_ShockProj.uc index 871ec364..65164673 100644 --- a/Classes/ST_ShockProj.uc +++ b/Classes/ST_ShockProj.uc @@ -14,7 +14,7 @@ var int zzNN_ProjIndex; simulated function PostBeginPlay() { Super.PostBeginPlay(); - + if (Instigator != None) StartLocation = Instigator.Location; else if (Owner != None) @@ -22,9 +22,9 @@ simulated function PostBeginPlay() } function SuperExplosion() // aka, combo. -{ +{ local bbPlayer bbP; - + bbP = bbPlayer(Owner); /* if (bbP != None && bbP.bNewNet) { @@ -40,15 +40,15 @@ function SuperExplosion() // aka, combo. } */ Spawn(Class'ut_ComboRing',,'',Location, Instigator.ViewRotation); PlayOwnedSound(ExploSound,,20.0,,2000,0.6); - - Destroy(); + + Destroy(); } function SuperDuperExplosion() // aka, combo. -{ +{ local bbPlayer bbP; local UT_SuperComboRing Ring; - + bbP = bbPlayer(Owner); /* if (bbP != None && bbP.bNewNet) { @@ -64,8 +64,8 @@ function SuperDuperExplosion() // aka, combo. } */ Ring = Spawn(Class'UT_SuperComboRing',,'',Location, Instigator.ViewRotation); PlayOwnedSound(ExploSound,,20.0,,2000,0.6); - - Destroy(); + + Destroy(); } simulated function NN_SuperExplosion(Pawn Pwner) // aka, combo. @@ -73,14 +73,10 @@ simulated function NN_SuperExplosion(Pawn Pwner) // aka, combo. local rotator Tater; local bbPlayer bbP; local UT_ComboRing Ring; - + bbP = bbPlayer(Pwner); - - if (bbP != None) - Tater = bbP.zzViewRotation; - else - Tater = Pwner.ViewRotation; - + Tater = Pwner.ViewRotation; + /* if (bbP != None && bbP.bNewNet) { if (Level.NetMode == NM_Client) @@ -99,7 +95,7 @@ simulated function NN_SuperExplosion(Pawn Pwner) // aka, combo. { bbP.xxClientDemoFix(Ring, class'ut_ComboRing', Location, Ring.Velocity, Ring.Acceleration, Tater); } - + Destroy(); } @@ -108,14 +104,10 @@ simulated function NN_SuperDuperExplosion(Pawn Pwner) // aka, combo. local rotator Tater; local bbPlayer bbP; local UT_SuperComboRing Ring; - + bbP = bbPlayer(Pwner); - - if (bbP != None) - Tater = bbP.zzViewRotation; - else - Tater = Pwner.ViewRotation; - + Tater = Pwner.ViewRotation; + /* if (bbP != None && bbP.bNewNet) { if (Level.NetMode == NM_Client) @@ -132,7 +124,7 @@ simulated function NN_SuperDuperExplosion(Pawn Pwner) // aka, combo. PlaySound(ExploSound,,20.0,,2000,0.6); if(bbP != none) bbP.xxClientDemoFix(Ring, Class'UT_SuperComboRing', Location, Ring.Velocity, Ring.Acceleration, Tater); - + Destroy(); } @@ -153,19 +145,19 @@ auto state Flying simulated function BeginState() { - Velocity = vector(Rotation) * speed; + Velocity = vector(Rotation) * speed; } } simulated function Explode(vector HitLocation, vector HitNormal) { local bbPlayer bbP; - + bbP = bbPlayer(Owner); - + if (bDeleteMe) return; - + /* if (bbP != None && bbP.bNewNet) { if (Level.NetMode == NM_Client && !IsA('NN_ShockProjOwnerHidden')) @@ -192,7 +184,7 @@ simulated function Explode(vector HitLocation, vector HitNormal) if (bbP != None) bbP.xxClientDemoFix(None, class'ut_RingExplosion',HitLocation+HitNormal*8,,, rotator(Velocity)); } - + PlayOwnedSound(ImpactSound, SLOT_Misc, 0.5,,, 0.5+FRand()); Destroy(); @@ -204,9 +196,9 @@ simulated function NN_Momentum( float DamageRadius, float Momentum, vector HitLo local float damageScale, dist; local vector dir; local bbPlayer bbP; - + bbP = bbPlayer(Owner); - + if ( bbP == None || !bbP.bNewNet || Self.IsA('NN_ShockProjOwnerHidden') || RemoteRole == ROLE_Authority ) return; @@ -216,19 +208,19 @@ simulated function NN_Momentum( float DamageRadius, float Momentum, vector HitLo { dir = Owner.Location - HitLocation; dist = FMax(1,VSize(dir)); - dir = dir/dist; + dir = dir/dist; damageScale = 1 - FMax(0,(dist - Owner.CollisionRadius)/DamageRadius); - + dir = damageScale * Momentum * dir; - + if (bbP.Physics == PHYS_None) bbP.SetMovementPhysics(); if (bbP.Physics == PHYS_Walking) dir.Z = FMax(dir.Z, 0.4 * VSize(dir)); - + dir = 0.6*dir/bbP.Mass; - bbP.AddVelocity(dir); + bbP.AddVelocity(dir); } } } \ No newline at end of file diff --git a/Classes/ST_ShockProjGib.uc b/Classes/ST_ShockProjGib.uc index c7c6bdd1..5afe56f5 100644 --- a/Classes/ST_ShockProjGib.uc +++ b/Classes/ST_ShockProjGib.uc @@ -1,9 +1,9 @@ class ST_ShockProjGib extends ST_ShockProj; function SuperExplosion() // aka, combo. -{ +{ local bbPlayer bbP; - + bbP = bbPlayer(Owner); /* if (bbP != None && bbP.bNewNet) @@ -18,18 +18,18 @@ function SuperExplosion() // aka, combo. { HurtRadius(Damage*3000, 250, MyDamageType, MomentumTransfer*2, Location ); } */ - + Spawn(Class'ut_ComboRing',,'',Location, Instigator.ViewRotation); PlayOwnedSound(ExploSound,,20.0,,2000,0.6); - - Destroy(); + + Destroy(); } function SuperDuperExplosion() // aka, combo. -{ +{ local bbPlayer bbP; local UT_SuperComboRing Ring; - + bbP = bbPlayer(Owner); /* if (bbP != None && bbP.bNewNet) @@ -47,8 +47,8 @@ function SuperDuperExplosion() // aka, combo. Ring = Spawn(Class'UT_SuperComboRing',,'',Location, Instigator.ViewRotation); PlayOwnedSound(ExploSound,,20.0,,2000,0.6); - - Destroy(); + + Destroy(); } simulated function NN_SuperExplosion(Pawn Pwner) // aka, combo. @@ -56,14 +56,10 @@ simulated function NN_SuperExplosion(Pawn Pwner) // aka, combo. local rotator Tater; local bbPlayer bbP; local UT_ComboRing Ring; - + bbP = bbPlayer(Pwner); - - if (bbP != None) - Tater = bbP.zzViewRotation; - else - Tater = Pwner.ViewRotation; - + Tater = Pwner.ViewRotation; + /* if (bbP != None && bbP.bNewNet) { if (Level.NetMode == NM_Client) @@ -82,19 +78,19 @@ simulated function NN_SuperExplosion(Pawn Pwner) // aka, combo. { bbP.xxClientDemoFix(Ring, Class'UT_ComboRing', Location, Ring.Velocity, Ring.Acceleration, Tater); } - + Destroy(); } simulated function Explode(vector HitLocation, vector HitNormal) { local bbPlayer bbP; - + bbP = bbPlayer(Owner); - + if (bDeleteMe) return; - + /* if (bbP != None && bbP.bNewNet) { if (Level.NetMode == NM_Client && !IsA('NN_ShockProjOwnerHidden')) @@ -112,7 +108,7 @@ simulated function Explode(vector HitLocation, vector HitNormal) Spawn(class'ut_RingExplosion3',,, HitLocation+HitNormal*8,rotator(HitNormal)); else Spawn(class'ut_RingExplosion',,, HitLocation+HitNormal*8,rotator(Velocity)); - + PlayOwnedSound(ImpactSound, SLOT_Misc, 0.5,,, 0.5+FRand()); Destroy(); diff --git a/Classes/ST_ShockRifle.uc b/Classes/ST_ShockRifle.uc index ba87a98d..704e9a89 100644 --- a/Classes/ST_ShockRifle.uc +++ b/Classes/ST_ShockRifle.uc @@ -18,10 +18,10 @@ var int HitCounter; simulated function RenderOverlays(Canvas Canvas) { local bbPlayer bbP; - + Super.RenderOverlays(Canvas); yModInit(); - + bbP = bbPlayer(Owner); if (bNewNet && Role < ROLE_Authority && bbP != None) { @@ -35,11 +35,11 @@ simulated function RenderOverlays(Canvas Canvas) simulated function yModInit() { if (bbPlayer(Owner) != None && Owner.Role == ROLE_AutonomousProxy) - GV = bbPlayer(Owner).zzViewRotation; - + GV = bbPlayer(Owner).ViewRotation; + if (PlayerPawn(Owner) == None) return; - + yMod = PlayerPawn(Owner).Handedness; if (yMod != 2.0) yMod *= Default.FireOffset.Y; @@ -52,10 +52,10 @@ simulated function yModInit() simulated function bool ClientFire(float Value) { local bbPlayer bbP; - + if (Owner.IsA('Bot')) return Super.ClientFire(Value); - + bbP = bbPlayer(Owner); if (Role < ROLE_Authority && bbP != None && bNewNet) { @@ -92,12 +92,12 @@ simulated function NN_TraceFire() local actor zzOther; local int oRadius,oHeight; local vector zzX,zzY,zzZ,zzStartTrace,zzEndTrace,zzHitLocation,zzHitNormal; - + if (Owner.IsA('Bot')) return; - + yModInit(); - + bbP = bbPlayer(Owner); if (bbP == None) return; @@ -105,8 +105,8 @@ simulated function NN_TraceFire() // Owner.MakeNoise(Pawn(Owner).SoundDampening); GetAxes(GV,X,Y,Z); StartTrace = Owner.Location + CDO + yMod * Y + FireOffset.Z * Z; - EndTrace = StartTrace + (100000 * vector(GV)); - + EndTrace = StartTrace + (100000 * vector(GV)); + //for (P = Level.PawnList; P != None; P = P.NextPawn) // P.SetCollisionSize(P.CollisionRadius * ShockRadius / 100, P.CollisionHeight); @@ -114,7 +114,7 @@ simulated function NN_TraceFire() if (Other.IsA('Pawn')) { HitDiff = HitLocation - Other.Location; - + zzbbP = bbPlayer(Other); if (zzbbP != None) { @@ -129,15 +129,15 @@ simulated function NN_TraceFire() //bbP.xxChecked(Other != zzOther); } } - + zzbNN_Combo = NN_ProcessTraceHit(Other, HitLocation, HitNormal, vector(GV),Y,Z); if (zzbNN_Combo) - bbP.xxNN_Fire(ST_ShockProj(Other).zzNN_ProjIndex, bbP.Location, bbP.Velocity, bbP.zzViewRotation, Other, HitLocation, HitDiff, true); + bbP.xxNN_Fire(ST_ShockProj(Other).zzNN_ProjIndex, bbP.Location, bbP.Velocity, bbP.ViewRotation, Other, HitLocation, HitDiff, true); else - bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.zzViewRotation, Other, HitLocation, HitDiff, false); + bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.ViewRotation, Other, HitLocation, HitDiff, false); if (Other == bbP.zzClientTTarget) bbP.zzClientTTarget.TakeDamage(0, Pawn(Owner), HitLocation, 60000.0*vector(GV), MyDamageType); - + //for (P = Level.PawnList; P != None; P = P.NextPawn) // P.SetCollisionSize(P.Default.CollisionRadius, P.CollisionHeight); } @@ -145,16 +145,16 @@ simulated function NN_TraceFire() simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z) { local bool zzbNN_Combo; - + if (Owner.IsA('Bot')) return false; - + if (Other==None) { HitNormal = -X; HitLocation = Owner.Location + X*100000.0; } - + NN_SpawnEffect(HitLocation, Owner.Location + CDO + (FireOffset.X + 20) * X + Y * yMod + FireOffset.Z * Z, HitNormal); if ( ST_ShockProj(Other)!=None ) @@ -177,7 +177,7 @@ simulated function NN_SpawnEffect(vector HitLocation, vector SmokeLocation, vect local Vector DVector; local int NumPoints; local rotator SmokeRotation; - + if (Owner.IsA('Bot')) return; @@ -187,7 +187,7 @@ simulated function NN_SpawnEffect(vector HitLocation, vector SmokeLocation, vect return; SmokeRotation = rotator(DVector); SmokeRotation.roll = Rand(65535); - + Smoke = Spawn(class'NN_ShockBeam',Owner,,SmokeLocation,SmokeRotation); Smoke.MoveAmount = DVector/NumPoints; Smoke.NumPuffs = NumPoints - 1; @@ -198,13 +198,13 @@ simulated function NN_SpawnEffect(vector HitLocation, vector SmokeLocation, vect function Fire ( float Value ) { local bbPlayer bbP; - + if (Owner.IsA('Bot')) { Super.Fire(Value); return; } - + bbP = bbPlayer(Owner); if (bbP != None && bNewNet && Value < 1) return; @@ -217,13 +217,13 @@ function AltFire( float Value ) local vector HitLocation, HitNormal, Start; local bbPlayer bbP; local NN_ShockProjOwnerHidden NNSP; - + if (Owner.IsA('Bot')) { Super.AltFire(Value); return; } - + bbP = bbPlayer(Owner); if (bbP != None && bNewNet && Value < 1) return; @@ -233,7 +233,7 @@ function AltFire( float Value ) if ( Owner.IsA('Bot') ) //make sure won't blow self up { - Start = Owner.Location + CalcDrawOffset() + FireOffset.Z * vect(0,0,1); + Start = Owner.Location + CalcDrawOffset() + FireOffset.Z * vect(0,0,1); if ( Pawn(Owner).Enemy != None ) HitActor = Trace(HitLocation, HitNormal, Start + 250 * Normal(Pawn(Owner).Enemy.Location - Start), Start, false, vect(12,12,12)); else @@ -243,7 +243,7 @@ function AltFire( float Value ) Global.Fire(Value); return; } - } + } if ( AmmoType != None && AmmoType.UseAmmo(1) ) { GotoState('AltFiring'); @@ -280,15 +280,15 @@ state ClientFiring simulated function bool ClientFire(float Value) { local float MinTapTime; - + if (Owner.IsA('Bot')) return Super.ClientFire(Value); - + if (bNewNet) MinTapTime = 0.4; else MinTapTime = 0.2; - + if ( Level.TimeSeconds - TapTime < MinTapTime ) return false; bForceFire = bForceFire || ( bCanClientFire && (Pawn(Owner) != None) && (AmmoType.AmmoAmount > 0) ); @@ -298,15 +298,15 @@ state ClientFiring simulated function bool ClientAltFire(float Value) { local float MinTapTime; - + if (Owner.IsA('Bot')) return Super.ClientAltFire(Value); - + if (bNewNet) MinTapTime = 0.4; else MinTapTime = 0.2; - + if ( Level.TimeSeconds - TapTime < MinTapTime ) return false; bForceAltFire = bForceAltFire || ( bCanClientFire && (Pawn(Owner) != None) && (AmmoType.AmmoAmount > 0) ); @@ -316,7 +316,7 @@ state ClientFiring simulated function AnimEnd() { local bool bForce, bForceAlt; - + if (Owner.IsA('Bot')) { Super.AnimEnd(); @@ -327,7 +327,7 @@ state ClientFiring bForceAlt = bForceAltFire; bForceFire = false; bForceAltFire = false; - + if ( bNewNet && Level.NetMode == NM_Client && bCanClientFire && (PlayerPawn(Owner) != None) && (AmmoType.AmmoAmount > 0) ) { if ( bForce || (Pawn(Owner).bFire != 0) ) @@ -340,13 +340,13 @@ state ClientFiring Global.ClientAltFire(1); return; } - } + } Super.AnimEnd(); } } state ClientAltFiring -{ +{ simulated function AnimEnd() { Super.AnimEnd(); @@ -366,13 +366,13 @@ function Projectile ProjectileFire(class ProjClass, float ProjSpeed, local Vector Start, X,Y,Z; local PlayerPawn PlayerOwner; local bbPlayer bbP; - + if (Owner.IsA('Bot')) return Super.ProjectileFire(ProjClass, ProjSpeed, bWarn); PlayerOwner = PlayerPawn(Owner); bbP = bbPlayer(Owner); - + Owner.MakeNoise(Pawn(Owner).SoundDampening); if (bNewNet && bbP != None) { @@ -380,16 +380,16 @@ function Projectile ProjectileFire(class ProjClass, float ProjSpeed, return None; GetAxes(bbP.zzNN_ViewRot,X,Y,Z); if (Mover(bbP.Base) == None) - Start = bbP.zzNN_ClientLoc + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; + Start = bbP.zzNN_ClientLoc + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; else - Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; + Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; } else { GetAxes(Pawn(Owner).ViewRotation,X,Y,Z); - Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; + Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; } - AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, AimError, True, bWarn); + AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, AimError, True, bWarn); LastFiredTime = Level.TimeSeconds; return Spawn(ProjClass,Owner,, Start,AdjustedAim); @@ -403,38 +403,38 @@ simulated function Projectile NN_ProjectileFire(class ProjClass, flo local ST_ShockProj ST_Proj; local int ProjIndex; local bbPlayer bbP; - + if (Owner.IsA('Bot')) return None; - + yModInit(); - + bbP = bbPlayer(Owner); if (bbP == None || (Level.TimeSeconds - LastFiredTime) < 0.4) return None; - + GetAxes(GV,X,Y,Z); - Start = Owner.Location + CDO + FireOffset.X * X + yMod * Y + FireOffset.Z * Z; + Start = Owner.Location + CDO + FireOffset.X * X + yMod * Y + FireOffset.Z * Z; if ( PlayerOwner != None ) PlayerOwner.ClientInstantFlash( -0.4, vect(450, 190, 650)); - + LastFiredTime = Level.TimeSeconds; Proj = Spawn(ProjClass,Owner,, Start,GV); ST_Proj = ST_ShockProj(Proj); ProjIndex = bbP.xxNN_AddProj(Proj); if (ST_Proj != None) ST_Proj.zzNN_ProjIndex = ProjIndex; - bbP.xxNN_AltFire(ProjIndex, bbP.Location, bbP.Velocity, bbP.zzViewRotation); + bbP.xxNN_AltFire(ProjIndex, bbP.Location, bbP.Velocity, bbP.ViewRotation); bbP.xxClientDemoFix(ST_Proj, Class'ShockProj', Start, ST_Proj.Velocity, Proj.Acceleration, GV); } simulated function bool ClientAltFire(float Value) { local bbPlayer bbP; - + if (Owner.IsA('Bot')) return Super.ClientAltFire(Value); - + bbP = bbPlayer(Owner); if (Role < ROLE_Authority && bbP != None && bNewNet) { @@ -461,7 +461,7 @@ function TraceFire( float Accuracy ) local bool bShockCombo; local NN_ShockProjOwnerHidden NNSP; local vector NN_HitLoc, HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z; - + if (Owner.IsA('Bot')) { Super.TraceFire(Accuracy); @@ -474,30 +474,30 @@ function TraceFire( float Accuracy ) Super.TraceFire(Accuracy); return; } - + if (bbP.zzNN_HitActor != None && bbP.zzNN_HitActor.IsA('bbPlayer') && !bbPlayer(bbP.zzNN_HitActor).xxCloseEnough(bbP.zzNN_HitLoc)) bbP.zzNN_HitActor = None; - + NN_Other = bbP.zzNN_HitActor; bShockCombo = bbP.zzbNN_Special && (NN_Other == None || NN_ShockProjOwnerHidden(NN_Other) != None && NN_Other.Owner != Owner); - + if (bShockCombo && NN_Other == None) { ForEach AllActors(class'NN_ShockProjOwnerHidden', NNSP) if (NNSP.zzNN_ProjIndex == bbP.zzNN_ProjIndex) NN_Other = NNSP; - + if (NN_Other == None) NN_Other = Spawn(class'NN_ShockProjOwnerHidden', Owner,, bbP.zzNN_HitLoc); else NN_Other.SetLocation(bbP.zzNN_HitLoc); - + bbP.zzNN_HitActor = NN_Other; } - + Owner.MakeNoise(bbP.SoundDampening); GetAxes(bbP.zzNN_ViewRot,X,Y,Z); - + StartTrace = Owner.Location + CalcDrawOffset() + FireOffset.Y * Y + FireOffset.Z * Z; EndTrace = StartTrace + Accuracy * (FRand() - 0.5 )* Y * 1000 + Accuracy * (FRand() - 0.5 ) * Z * 1000 ; @@ -508,13 +508,13 @@ function TraceFire( float Accuracy ) EndTrace += 100000 * Normal(Tracked.Location - StartTrace); else { - AdjustedAim = bbP.AdjustAim(1000000, StartTrace, 2.75*AimError, False, False); - EndTrace += (100000 * vector(AdjustedAim)); + AdjustedAim = bbP.AdjustAim(1000000, StartTrace, 2.75*AimError, False, False); + EndTrace += (100000 * vector(AdjustedAim)); } - + if (bbP.zzNN_HitActor != None && VSize(bbP.zzNN_HitDiff) > bbP.zzNN_HitActor.CollisionRadius + bbP.zzNN_HitActor.CollisionHeight) bbP.zzNN_HitDiff = vect(0,0,0); - + if (bbP.zzNN_HitActor != None && (bbP.zzNN_HitActor.IsA('Pawn') || bbP.zzNN_HitActor.IsA('Projectile')) && FastTrace(bbP.zzNN_HitActor.Location + bbP.zzNN_HitDiff, StartTrace)) { NN_HitLoc = bbP.zzNN_HitActor.Location + bbP.zzNN_HitDiff; @@ -525,7 +525,7 @@ function TraceFire( float Accuracy ) bbP.zzNN_HitActor = bbP.TraceShot(HitLocation,HitNormal,EndTrace,StartTrace); NN_HitLoc = bbP.zzNN_HitLoc; } - + ProcessTraceHit(bbP.zzNN_HitActor, NN_HitLoc, HitNormal, vector(AdjustedAim),Y,Z); bbP.zzNN_HitActor = None; Tracked = None; @@ -536,7 +536,7 @@ function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vect { local PlayerPawn PlayerOwner; local Pawn PawnOwner; - + if (Owner.IsA('Bot')) { Super.ProcessTraceHit(Other, HitLocation, HitNormal, X, Y, Z); @@ -577,7 +577,7 @@ function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vect Spawn(class'ut_RingExplosion5',,, HitLocation+HitNormal*8,rotator(HitNormal)); } - /* if ( (Other != self) && (Other != Owner) && (Other != None) ) + /* if ( (Other != self) && (Other != Owner) && (Other != None) ) { Other.TakeDamage(class'UTPure'.default.ShockDamagePri, PawnOwner, HitLocation, 60000.0*X, MyDamageType); } */ @@ -598,7 +598,7 @@ simulated function DoRingExplosion5(PlayerPawn Pwner, vector HitLocation, vector { local PlayerPawn P; local Actor CR; - + if (Owner.IsA('Bot')) return; @@ -618,7 +618,7 @@ function SpawnEffect(vector HitLocation, vector SmokeLocation) local Vector DVector; local int NumPoints; local rotator SmokeRotation; - + if (Owner.IsA('Bot')) { Super.SpawnEffect(HitLocation, SmokeLocation); @@ -631,13 +631,13 @@ function SpawnEffect(vector HitLocation, vector SmokeLocation) return; SmokeRotation = rotator(DVector); SmokeRotation.roll = Rand(65535); - + if (bNewNet) Smoke = Spawn(class'NN_ShockBeamOwnerHidden',Owner,,SmokeLocation,SmokeRotation); else Smoke = Spawn(class'ShockBeam',,,SmokeLocation,SmokeRotation); Smoke.MoveAmount = DVector/NumPoints; - Smoke.NumPuffs = NumPoints - 1; + Smoke.NumPuffs = NumPoints - 1; } function SetSwitchPriority(pawn Other) @@ -662,7 +662,7 @@ simulated function AnimEnd () state NormalFire { - function Fire(float F) + function Fire(float F) { if (Owner.IsA('Bot')) { @@ -672,7 +672,7 @@ state NormalFire if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { @@ -686,7 +686,7 @@ state NormalFire state AltFiring { - function Fire(float F) + function Fire(float F) { if (Owner.IsA('Bot')) { @@ -696,7 +696,7 @@ state AltFiring if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { @@ -725,7 +725,7 @@ State ClientActive bForceAltFire = bbPlayer(Owner) == None || !bbPlayer(Owner).ClientCannotShoot(); return bForceAltFire; } - + simulated function AnimEnd() { if ( Owner == None ) @@ -733,7 +733,7 @@ State ClientActive Global.AnimEnd(); GotoState(''); } - else if ( Owner.IsA('TournamentPlayer') + else if ( Owner.IsA('TournamentPlayer') && (TournamentPlayer(Owner).PendingWeapon != None || TournamentPlayer(Owner).ClientPending != None) ) GotoState('ClientDown'); else if ( bWeaponUp ) @@ -755,7 +755,7 @@ State ClientActive state Active { - function Fire(float F) + function Fire(float F) { if (Owner.IsA('Bot')) { @@ -765,7 +765,7 @@ state Active if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { @@ -780,7 +780,7 @@ state Active auto state Pickup { ignores AnimEnd; - + simulated function Landed(Vector HitNormal) { Super(Inventory).Landed(HitNormal); diff --git a/Classes/ST_SniperRifle.uc b/Classes/ST_SniperRifle.uc index 78e08ced..47392d4f 100644 --- a/Classes/ST_SniperRifle.uc +++ b/Classes/ST_SniperRifle.uc @@ -19,10 +19,10 @@ var int zzWin; simulated function RenderOverlays(Canvas Canvas) { local bbPlayer bbP; - + Super.RenderOverlays(Canvas); yModInit(); - + bbP = bbPlayer(Owner); if (bNewNet && Role < ROLE_Authority && bbP != None) { @@ -36,11 +36,11 @@ simulated function RenderOverlays(Canvas Canvas) simulated function yModInit() { if (bbPlayer(Owner) != None && Owner.Role == ROLE_AutonomousProxy) - GV = bbPlayer(Owner).zzViewRotation; - + GV = bbPlayer(Owner).ViewRotation; + if (PlayerPawn(Owner) == None) return; - + yMod = PlayerPawn(Owner).Handedness; if (yMod != 2.0) yMod *= Default.FireOffset.Y; @@ -53,10 +53,10 @@ simulated function yModInit() simulated function bool ClientFire(float Value) { local bbPlayer bbP; - + if (Owner.IsA('Bot')) return Super.ClientFire(Value); - + bbP = bbPlayer(Owner); if (Role < ROLE_Authority && bbP != None && bNewNet) { @@ -84,10 +84,10 @@ simulated function bool ClientFire(float Value) simulated function bool ClientAltFire( float Value ) { local bbPlayer bbP; - + if (Owner.IsA('Bot')) return Super.ClientAltFire(Value); - + bbP = bbPlayer(Owner); if (bbP.ClientCannotShoot() || bbP.Weapon != Self) return false; @@ -97,13 +97,13 @@ simulated function bool ClientAltFire( float Value ) function Fire ( float Value ) { local bbPlayer bbP; - + if (Owner.IsA('Bot')) { Super.Fire(Value); return; } - + bbP = bbPlayer(Owner); if (bbP != None && bNewNet && Value < 1) return; @@ -113,13 +113,13 @@ function Fire ( float Value ) function AltFire( float Value ) { local bbPlayer bbP; - + if (Owner.IsA('Bot')) { Super.AltFire(Value); return; } - + bbP = bbPlayer(Owner); if (bbP != None && bNewNet && Value < 1) return; @@ -143,7 +143,7 @@ State ClientActive bForceAltFire = bbPlayer(Owner) == None || !bbPlayer(Owner).ClientCannotShoot(); return bForceAltFire; } - + simulated function AnimEnd() { if ( Owner == None ) @@ -151,7 +151,7 @@ State ClientActive Global.AnimEnd(); GotoState(''); } - else if ( Owner.IsA('TournamentPlayer') + else if ( Owner.IsA('TournamentPlayer') && (TournamentPlayer(Owner).PendingWeapon != None || TournamentPlayer(Owner).ClientPending != None) ) GotoState('ClientDown'); else if ( bWeaponUp ) @@ -173,7 +173,7 @@ State ClientActive state NormalFire { - function Fire(float F) + function Fire(float F) { if (Owner.IsA('Bot')) { @@ -183,7 +183,7 @@ state NormalFire if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { @@ -202,12 +202,12 @@ simulated function NN_TraceFire() local Pawn PawnOwner; local bbPlayer bbP; local bool bHeadshot; - + if (Owner.IsA('Bot')) return; - + yModInit(); - + PawnOwner = Pawn(Owner); bbP = bbPlayer(Owner); if (bbP == None) @@ -216,13 +216,13 @@ simulated function NN_TraceFire() GetAxes(GV,X,Y,Z); StartTrace = Owner.Location + bbP.Eyeheight * vect(0,0,1); EndTrace = StartTrace + (100000 * vector(GV)); - + Other = bbP.NN_TraceShot(HitLocation,HitNormal,EndTrace,StartTrace,PawnOwner); if (Other.IsA('Pawn')) HitDiff = HitLocation - Other.Location; - + bHeadshot = NN_ProcessTraceHit(Other, HitLocation, HitNormal, X,Y,Z,yMod); - bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.zzViewRotation, Other, HitLocation, HitDiff, bHeadshot); + bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.ViewRotation, Other, HitLocation, HitDiff, bHeadshot); } simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z, float yMod) @@ -230,17 +230,17 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect local UT_Shellcase s; local Pawn PawnOwner; local float CH; - + if (Owner.IsA('Bot')) return false; PawnOwner = Pawn(Owner); s = Spawn(class'UT_ShellCase',, '', Owner.Location + CDO + 30 * X + (2.8 * yMod+5.0) * Y - Z * 1); - if ( s != None ) + if ( s != None ) { s.DrawScale = 2.0; - s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160); + s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160); } if (Other == Level || Other.IsA('Mover')) { @@ -264,13 +264,13 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect } else { CH = Other.CollisionHeight; } - + if (HitLocation.Z - Other.Location.Z > BodyHeight * CH) return true; } - + if ( !Other.bIsPawn && !Other.IsA('Carcass') ) - spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9); + spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9); } return false; } @@ -285,13 +285,13 @@ function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vect local int ArmorAmount; local inventory inv; local bbPlayer bbP; - + if (Owner.IsA('Bot')) { Super.ProcessTraceHit(Other, HitLocation, HitNormal, X, Y, Z); return; } - + bbP = bbPlayer(Owner); if (bbP == None || !bNewNet) { @@ -317,9 +317,9 @@ function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vect { if ( Other.bIsPawn ) Other.PlaySound(Sound 'ChunkHit',, 4.0,,100); - + if ( (bbP.zzbNN_Special || !bNewNet && - Other.bIsPawn && (HitLocation.Z - Other.Location.Z > BodyHeight * Other.CollisionHeight) + Other.bIsPawn && (HitLocation.Z - Other.Location.Z > BodyHeight * Other.CollisionHeight) && (instigator.IsA('PlayerPawn') || (instigator.IsA('Bot') && !Bot(Instigator).bNovice)) ) && !PPOther.bIsCrouching && PPOther.GetAnimGroup(PPOther.AnimSequence) != 'Ducking' ) { @@ -350,7 +350,7 @@ simulated function DoShellCase(PlayerPawn Pwner, vector HitLoc, Vector X, Vector local PlayerPawn P; local Actor CR; local UT_Shellcase s; - + if (Owner.IsA('Bot')) return; @@ -362,10 +362,10 @@ simulated function DoShellCase(PlayerPawn Pwner, vector HitLoc, Vector X, Vector CR = P.Spawn(class'UT_ShellCase',P, '', HitLoc); CR.bOnlyOwnerSee = True; s = UT_Shellcase(CR); - if ( s != None ) + if ( s != None ) { s.DrawScale = 2.0; - s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160); + s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160); } } } @@ -376,37 +376,37 @@ function TraceFire( float Accuracy ) { local bbPlayer bbP; local vector NN_HitLoc, HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z; - + if (Owner.IsA('Bot')) { Super.TraceFire(Accuracy); return; } - + bbP = bbPlayer(Owner); - + if (bbP == None || !bNewNet) { Super.TraceFire(Accuracy); return; } - + if (bbP == None) { if (bbP.zzNN_HitActor.IsA('bbPlayer') && !bbPlayer(bbP.zzNN_HitActor).xxCloseEnough(bbP.zzNN_HitLoc)) bbP.zzNN_HitActor = None; } - + Owner.MakeNoise(bbP.SoundDampening); GetAxes(bbP.zzNN_ViewRot,X,Y,Z); StartTrace = Owner.Location + bbP.Eyeheight * vect(0,0,1); - AdjustedAim = bbP.AdjustAim(1000000, StartTrace, 2*AimError, False, False); + AdjustedAim = bbP.AdjustAim(1000000, StartTrace, 2*AimError, False, False); X = vector(AdjustedAim); EndTrace = StartTrace + 100000 * X; - + if (bbP.zzNN_HitActor != None && VSize(bbP.zzNN_HitDiff) > bbP.zzNN_HitActor.CollisionRadius + bbP.zzNN_HitActor.CollisionHeight) bbP.zzNN_HitDiff = vect(0,0,0); - + if (bbP.zzNN_HitActor != None && (bbP.zzNN_HitActor.IsA('Pawn') || bbP.zzNN_HitActor.IsA('Projectile')) && FastTrace(bbP.zzNN_HitActor.Location + bbP.zzNN_HitDiff, StartTrace)) { NN_HitLoc = bbP.zzNN_HitActor.Location + bbP.zzNN_HitDiff; @@ -451,7 +451,7 @@ simulated function PlayFiring() else PlayAnim(FireAnims[Rand(5)], 0.5 * class'UTPure'.default.SniperSpeed + 0.5 * FireAdjust, 0.05); - if ( (PlayerPawn(Owner) != None) + if ( (PlayerPawn(Owner) != None) && (PlayerPawn(Owner).DesiredFOV == PlayerPawn(Owner).DefaultFOV) ) bMuzzleFlash++; } @@ -468,7 +468,7 @@ state Active if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { @@ -483,7 +483,7 @@ state Active auto state Pickup { ignores AnimEnd; - + simulated function Landed(Vector HitNormal) { Super(Inventory).Landed(HitNormal); diff --git a/Classes/ST_SuperShockRifle.uc b/Classes/ST_SuperShockRifle.uc index ac56308d..2197e065 100644 --- a/Classes/ST_SuperShockRifle.uc +++ b/Classes/ST_SuperShockRifle.uc @@ -47,7 +47,7 @@ simulated function RenderOverlays(Canvas Canvas) simulated function yModInit() { if (bbPlayer(Owner) != None && Owner.ROLE == ROLE_AutonomousProxy) - GV = bbPlayer(Owner).zzViewRotation; + GV = bbPlayer(Owner).ViewRotation; if (PlayerPawn(Owner) == None) return; @@ -286,7 +286,7 @@ simulated function NN_TraceFire() } NN_ProcessTraceHit(Other, HitLocation, HitNormal, vector(GV),Y,Z); - bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.zzViewRotation, Other, HitLocation, HitDiff, false); + bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.ViewRotation, Other, HitLocation, HitDiff, false); if (Other == bbP.zzClientTTarget) bbP.zzClientTTarget.TakeDamage(0, Pawn(Owner), HitLocation, 60000.0*vector(GV), MyDamageType); } diff --git a/Classes/ST_UnrealWeapons.uc b/Classes/ST_UnrealWeapons.uc index d945dbe6..93a947f7 100644 --- a/Classes/ST_UnrealWeapons.uc +++ b/Classes/ST_UnrealWeapons.uc @@ -20,10 +20,10 @@ var float yMod; simulated function RenderOverlays(Canvas Canvas) { local bbPlayer bbP; - + Super.RenderOverlays(Canvas); yModInit(); - + bbP = bbPlayer(Owner); if (bNewNet && Role < ROLE_Authority && bbP != None) { @@ -37,11 +37,11 @@ simulated function RenderOverlays(Canvas Canvas) simulated function yModInit() { if (bbPlayer(Owner) != None && Owner.Role == ROLE_AutonomousProxy) - GV = bbPlayer(Owner).zzViewRotation; - + GV = bbPlayer(Owner).ViewRotation; + if (PlayerPawn(Owner) == None) return; - + yMod = PlayerPawn(Owner).Handedness; if (yMod != 2.0) yMod *= Default.FireOffset.Y; @@ -53,7 +53,7 @@ simulated function yModInit() state Active { - function Fire(float F) + function Fire(float F) { if (Owner.IsA('Bot')) { @@ -63,7 +63,7 @@ state Active if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { @@ -92,7 +92,7 @@ State ClientActive bForceAltFire = bbPlayer(Owner) == None || !bbPlayer(Owner).ClientCannotShoot(); return bForceAltFire; } - + simulated function AnimEnd() { if ( Owner == None ) @@ -100,7 +100,7 @@ State ClientActive Global.AnimEnd(); GotoState(''); } - else if ( Owner.IsA('TournamentPlayer') + else if ( Owner.IsA('TournamentPlayer') && (TournamentPlayer(Owner).PendingWeapon != None || TournamentPlayer(Owner).ClientPending != None) ) GotoState('ClientDown'); else if ( bWeaponUp ) @@ -138,7 +138,7 @@ simulated function AnimEnd () auto state Pickup { ignores AnimEnd; - + simulated function Landed(Vector HitNormal) { Super(Inventory).Landed(HitNormal); diff --git a/Classes/ST_WildcardsWeapons.uc b/Classes/ST_WildcardsWeapons.uc index fdce0bf9..71889e0e 100644 --- a/Classes/ST_WildcardsWeapons.uc +++ b/Classes/ST_WildcardsWeapons.uc @@ -20,10 +20,10 @@ simulated function InitGraphics() simulated function RenderOverlays(Canvas Canvas) { local bbPlayer bbP; - + Super.RenderOverlays(Canvas); yModInit(); - + bbP = bbPlayer(Owner); if (bNewNet && Role < ROLE_Authority && bbP != None) { @@ -37,11 +37,11 @@ simulated function RenderOverlays(Canvas Canvas) simulated function yModInit() { if (bbPlayer(Owner) != None && Owner.Role == ROLE_AutonomousProxy) - GV = bbPlayer(Owner).zzViewRotation; - + GV = bbPlayer(Owner).ViewRotation; + if (PlayerPawn(Owner) == None) return; - + yMod = PlayerPawn(Owner).Handedness; if (yMod != 2.0) yMod *= Default.FireOffset.Y; @@ -53,7 +53,7 @@ simulated function yModInit() state Active { - function Fire(float F) + function Fire(float F) { if (Owner.IsA('Bot')) { @@ -63,7 +63,7 @@ state Active if (F > 0 && bbPlayer(Owner) != None) Global.Fire(F); } - function AltFire(float F) + function AltFire(float F) { if (Owner.IsA('Bot')) { @@ -92,7 +92,7 @@ State ClientActive bForceAltFire = bbPlayer(Owner) == None || !bbPlayer(Owner).ClientCannotShoot(); return bForceAltFire; } - + simulated function AnimEnd() { if ( Owner == None ) @@ -100,7 +100,7 @@ State ClientActive Global.AnimEnd(); GotoState(''); } - else if ( Owner.IsA('TournamentPlayer') + else if ( Owner.IsA('TournamentPlayer') && (TournamentPlayer(Owner).PendingWeapon != None || TournamentPlayer(Owner).ClientPending != None) ) GotoState('ClientDown'); else if ( bWeaponUp ) @@ -138,7 +138,7 @@ simulated function AnimEnd () auto state Pickup { ignores AnimEnd; - + simulated function Landed(Vector HitNormal) { Super(Inventory).Landed(HitNormal); diff --git a/Classes/ST_sgShockProj.uc b/Classes/ST_sgShockProj.uc index a93cb674..72ff58c2 100644 --- a/Classes/ST_sgShockProj.uc +++ b/Classes/ST_sgShockProj.uc @@ -14,7 +14,7 @@ var int zzNN_ProjIndex; simulated function PostBeginPlay() { Super.PostBeginPlay(); - + if (Instigator != None) StartLocation = Instigator.Location; else if (Owner != None) @@ -22,9 +22,9 @@ simulated function PostBeginPlay() } function SuperExplosion() // aka, combo. -{ +{ local bbPlayer bbP; - + bbP = bbPlayer(Owner); /* if (bbP != None && bbP.bNewNet) { @@ -40,15 +40,15 @@ function SuperExplosion() // aka, combo. } */ Spawn(Class'ut_ComboRing',,'',Location, Instigator.ViewRotation); PlayOwnedSound(ExploSound,,20.0,,2000,0.6); - - Destroy(); + + Destroy(); } function SuperDuperExplosion() // aka, combo. -{ +{ local bbPlayer bbP; local UT_SuperComboRing Ring; - + bbP = bbPlayer(Owner); /* if (bbP != None && bbP.bNewNet) { @@ -64,8 +64,8 @@ function SuperDuperExplosion() // aka, combo. } */ Ring = Spawn(Class'UT_SuperComboRing',,'',Location, Instigator.ViewRotation); PlayOwnedSound(ExploSound,,20.0,,2000,0.6); - - Destroy(); + + Destroy(); } simulated function NN_SuperExplosion(Pawn Pwner) // aka, combo. @@ -73,14 +73,10 @@ simulated function NN_SuperExplosion(Pawn Pwner) // aka, combo. local rotator Tater; local bbPlayer bbP; local UT_ComboRing Ring; - + bbP = bbPlayer(Pwner); - - if (bbP != None) - Tater = bbP.zzViewRotation; - else - Tater = Pwner.ViewRotation; - + Tater = Pwner.ViewRotation; + /* if (bbP != None && bbP.bNewNet) { if (Level.NetMode == NM_Client) @@ -99,7 +95,7 @@ simulated function NN_SuperExplosion(Pawn Pwner) // aka, combo. { bbP.xxClientDemoFix(Ring, class'ut_ComboRing', Location, Ring.Velocity, Ring.Acceleration, Tater); } - + Destroy(); } @@ -108,14 +104,10 @@ simulated function NN_SuperDuperExplosion(Pawn Pwner) // aka, combo. local rotator Tater; local bbPlayer bbP; local UT_SuperComboRing Ring; - + bbP = bbPlayer(Pwner); - - if (bbP != None) - Tater = bbP.zzViewRotation; - else - Tater = Pwner.ViewRotation; - + Tater = Pwner.ViewRotation; + /* if (bbP != None && bbP.bNewNet) { if (Level.NetMode == NM_Client) @@ -132,7 +124,7 @@ simulated function NN_SuperDuperExplosion(Pawn Pwner) // aka, combo. PlaySound(ExploSound,,20.0,,2000,0.6); if(bbP != none) bbP.xxClientDemoFix(Ring, Class'UT_SuperComboRing', Location, Ring.Velocity, Ring.Acceleration, Tater); - + Destroy(); } @@ -153,19 +145,19 @@ auto state Flying simulated function BeginState() { - Velocity = vector(Rotation) * speed; + Velocity = vector(Rotation) * speed; } } simulated function Explode(vector HitLocation, vector HitNormal) { local bbPlayer bbP; - + bbP = bbPlayer(Owner); - + if (bDeleteMe) return; - + /* if (bbP != None && bbP.bNewNet) { if (Level.NetMode == NM_Client && !IsA('NN_sgShockProjOwnerHidden')) @@ -192,7 +184,7 @@ simulated function Explode(vector HitLocation, vector HitNormal) if (bbP != None) bbP.xxClientDemoFix(None, class'ut_RingExplosion',HitLocation+HitNormal*8,,, rotator(Velocity)); } - + PlayOwnedSound(ImpactSound, SLOT_Misc, 0.5,,, 0.5+FRand()); Destroy(); @@ -204,9 +196,9 @@ simulated function NN_Momentum( float DamageRadius, float Momentum, vector HitLo local float damageScale, dist; local vector dir; local bbPlayer bbP; - + bbP = bbPlayer(Owner); - + if ( bbP == None || !bbP.bNewNet || Self.IsA('NN_sgShockProjOwnerHidden') || RemoteRole == ROLE_Authority ) return; @@ -216,19 +208,19 @@ simulated function NN_Momentum( float DamageRadius, float Momentum, vector HitLo { dir = Owner.Location - HitLocation; dist = FMax(1,VSize(dir)); - dir = dir/dist; + dir = dir/dist; damageScale = 1 - FMax(0,(dist - Owner.CollisionRadius)/DamageRadius); - + dir = damageScale * Momentum * dir; - + if (bbP.Physics == PHYS_None) bbP.SetMovementPhysics(); if (bbP.Physics == PHYS_Walking) dir.Z = FMax(dir.Z, 0.4 * VSize(dir)); - + dir = 0.6*dir/bbP.Mass; - bbP.AddVelocity(dir); + bbP.AddVelocity(dir); } } } \ No newline at end of file diff --git a/Classes/ST_sgShockRifle.uc b/Classes/ST_sgShockRifle.uc index a2597793..8cbb6e70 100644 --- a/Classes/ST_sgShockRifle.uc +++ b/Classes/ST_sgShockRifle.uc @@ -19,20 +19,20 @@ simulated function NN_TraceFire() local vector zzX,zzY,zzZ,zzStartTrace,zzEndTrace,zzHitLocation,zzHitNormal; yModInit(); - + bbP = bbPlayer(Owner); if (bbP == None) return; GetAxes(GV,X,Y,Z); StartTrace = Owner.Location + CDO + yMod * Y + FireOffset.Z * Z; - EndTrace = StartTrace + (100000 * vector(GV)); + EndTrace = StartTrace + (100000 * vector(GV)); Other = bbP.NN_TraceShot(HitLocation,HitNormal,EndTrace,StartTrace,Pawn(Owner)); if (Other.IsA('Pawn')) { HitDiff = HitLocation - Other.Location; - + zzbbP = bbPlayer(Other); if (zzbbP != None) { @@ -47,12 +47,12 @@ simulated function NN_TraceFire() //bbP.xxChecked(Other != zzOther); } } - + zzbNN_Combo = NN_ProcessTraceHit(Other, HitLocation, HitNormal, vector(GV),Y,Z); if (zzbNN_Combo) - bbP.xxNN_Fire(ST_sgShockProj(Other).zzNN_ProjIndex, bbP.Location, bbP.Velocity, bbP.zzViewRotation, Other, HitLocation, HitDiff, true); + bbP.xxNN_Fire(ST_sgShockProj(Other).zzNN_ProjIndex, bbP.Location, bbP.Velocity, bbP.ViewRotation, Other, HitLocation, HitDiff, true); else - bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.zzViewRotation, Other, HitLocation, HitDiff, false); + bbP.xxNN_Fire(-1, bbP.Location, bbP.Velocity, bbP.ViewRotation, Other, HitLocation, HitDiff, false); if (Other == bbP.zzClientTTarget) bbP.zzClientTTarget.TakeDamage(0, Pawn(Owner), HitLocation, 60000.0*vector(GV), MyDamageType); } @@ -66,7 +66,7 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect HitNormal = -X; HitLocation = Owner.Location + X*100000.0; } - + NN_SpawnEffect(HitLocation, Owner.Location + CDO + (FireOffset.X + 20) * X + Y * yMod + FireOffset.Z * Z, HitNormal); if ( ST_sgShockProj(Other)!=None ) @@ -99,7 +99,7 @@ function AltFire( float Value ) if ( Owner.IsA('Bot') ) { - Start = Owner.Location + CalcDrawOffset() + FireOffset.Z * vect(0,0,1); + Start = Owner.Location + CalcDrawOffset() + FireOffset.Z * vect(0,0,1); if ( Pawn(Owner).Enemy != None ) HitActor = Trace(HitLocation, HitNormal, Start + 250 * Normal(Pawn(Owner).Enemy.Location - Start), Start, false, vect(12,12,12)); else @@ -109,7 +109,7 @@ function AltFire( float Value ) Global.Fire(Value); return; } - } + } if ( AmmoType != None && AmmoType.UseAmmo(1) ) { GotoState('AltFiring'); @@ -151,23 +151,23 @@ simulated function Projectile NN_ProjectileFire(class ProjClass, flo local bbPlayer bbP; yModInit(); - + bbP = bbPlayer(Owner); if (bbP == None || (Level.TimeSeconds - LastFiredTime) < 0.4) return None; - + GetAxes(GV,X,Y,Z); - Start = Owner.Location + CDO + FireOffset.X * X + yMod * Y + FireOffset.Z * Z; + Start = Owner.Location + CDO + FireOffset.X * X + yMod * Y + FireOffset.Z * Z; if ( PlayerOwner != None ) PlayerOwner.ClientInstantFlash( -0.4, vect(450, 190, 650)); - + LastFiredTime = Level.TimeSeconds; Proj = Spawn(ProjClass,Owner,, Start,GV); ST_Proj = ST_sgShockProj(Proj); ProjIndex = bbP.xxNN_AddProj(Proj); if (ST_Proj != None) ST_Proj.zzNN_ProjIndex = ProjIndex; - bbP.xxNN_AltFire(ProjIndex, bbP.Location, bbP.Velocity, bbP.zzViewRotation); + bbP.xxNN_AltFire(ProjIndex, bbP.Location, bbP.Velocity, bbP.ViewRotation); bbP.xxClientDemoFix(ST_Proj, Class'ShockProj', Start, ST_Proj.Velocity, Proj.Acceleration, GV); } @@ -185,30 +185,30 @@ function TraceFire( float Accuracy ) Super.TraceFire(Accuracy); return; } - + if (bbP.zzNN_HitActor != None && bbP.zzNN_HitActor.IsA('bbPlayer') && !bbPlayer(bbP.zzNN_HitActor).xxCloseEnough(bbP.zzNN_HitLoc)) bbP.zzNN_HitActor = None; - + NN_Other = bbP.zzNN_HitActor; bShockCombo = bbP.zzbNN_Special && (NN_Other == None || NN_sgShockProjOwnerHidden(NN_Other) != None && NN_Other.Owner != Owner); - + if (bShockCombo && NN_Other == None) { ForEach AllActors(class'NN_sgShockProjOwnerHidden', NNSP) if (NNSP.zzNN_ProjIndex == bbP.zzNN_ProjIndex) NN_Other = NNSP; - + if (NN_Other == None) NN_Other = Spawn(class'NN_sgShockProjOwnerHidden', Owner,, bbP.zzNN_HitLoc); else NN_Other.SetLocation(bbP.zzNN_HitLoc); - + bbP.zzNN_HitActor = NN_Other; } - + Owner.MakeNoise(bbP.SoundDampening); GetAxes(bbP.zzNN_ViewRot,X,Y,Z); - + StartTrace = Owner.Location + CalcDrawOffset() + FireOffset.Y * Y + FireOffset.Z * Z; EndTrace = StartTrace + Accuracy * (FRand() - 0.5 )* Y * 1000 + Accuracy * (FRand() - 0.5 ) * Z * 1000 ; @@ -219,13 +219,13 @@ function TraceFire( float Accuracy ) EndTrace += 100000 * Normal(Tracked.Location - StartTrace); else { - AdjustedAim = bbP.AdjustAim(1000000, StartTrace, 2.75*AimError, False, False); - EndTrace += (100000 * vector(AdjustedAim)); + AdjustedAim = bbP.AdjustAim(1000000, StartTrace, 2.75*AimError, False, False); + EndTrace += (100000 * vector(AdjustedAim)); } - + if (bbP.zzNN_HitActor != None && VSize(bbP.zzNN_HitDiff) > bbP.zzNN_HitActor.CollisionRadius + bbP.zzNN_HitActor.CollisionHeight) bbP.zzNN_HitDiff = vect(0,0,0); - + if (bbP.zzNN_HitActor != None && (bbP.zzNN_HitActor.IsA('Pawn') || bbP.zzNN_HitActor.IsA('Projectile')) && FastTrace(bbP.zzNN_HitActor.Location + bbP.zzNN_HitDiff, StartTrace)) { NN_HitLoc = bbP.zzNN_HitActor.Location + bbP.zzNN_HitDiff; @@ -236,7 +236,7 @@ function TraceFire( float Accuracy ) bbP.zzNN_HitActor = bbP.TraceShot(HitLocation,HitNormal,EndTrace,StartTrace); NN_HitLoc = bbP.zzNN_HitLoc; } - + ProcessTraceHit(bbP.zzNN_HitActor, NN_HitLoc, HitNormal, vector(AdjustedAim),Y,Z); bbP.zzNN_HitActor = None; Tracked = None; @@ -283,7 +283,7 @@ function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vect Spawn(class'ut_RingExplosion5',,, HitLocation+HitNormal*8,rotator(HitNormal)); } - /* if ( (Other != self) && (Other != Owner) && (Other != None) ) + /* if ( (Other != self) && (Other != Owner) && (Other != None) ) { if (HitDamage > 0) Other.TakeDamage(HitDamage, PawnOwner, HitLocation, 60000.0*X, MyDamageType); diff --git a/Classes/UTPure.uc b/Classes/UTPure.uc index 3486d3f0..3689f0e8 100644 --- a/Classes/UTPure.uc +++ b/Classes/UTPure.uc @@ -722,7 +722,7 @@ function ModifyPlayer(Pawn Other) } else if (zzP != None) { - zzP.zzViewRotation = Other.ViewRotation; + zzP.ViewRotation = Other.ViewRotation; zzP.zzTrackFOV = TrackFOV; zzP.zzCVDelay = CenterViewDelay; zzP.zzCVDeny = !bAllowCenterView; diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index a7d27494..463423a9 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -104,7 +104,6 @@ var bbClientDemoSN zzDemoPlaybackSN; var bool bIsAlive; // Stuff -var rotator zzViewRotation; // Our special View Rotation var rotator zzLastVR; // The rotation after previous input. var float zzDesiredFOV; // Needed ? var float zzOrigFOV; // Original FOV for TrackFOV = 1 @@ -501,7 +500,6 @@ function ServerPreTeleport(Teleporter Other, Teleporter Dest, vector ClientLoc, PlayTeleportEffect(false, true, Other); SetRotation(ClientRot); ViewRotation = ClientRot; - zzViewRotation = ClientRot; PlayTeleportEffect(true, true, Dest); } @@ -754,11 +752,10 @@ function ClientSetLocation( vector zzNewLocation, rotator zzNewRotation ) (zzNewRotation.Roll == 0 && zzNewRotation == ViewRotation && (WarpZoneInfo(Region.Zone) != None || WarpZoneInfo(HeadRegion.Zone) != None || WarpZoneInfo(FootRegion.Zone) != None))) { - zzViewRotation = zzNewRotation; // mm.. - ViewRotation = zzNewRotation; // mm.. even more ! - If ( (zzViewRotation.Pitch > RotationRate.Pitch) && (zzViewRotation.Pitch < 65536 - RotationRate.Pitch) ) + ViewRotation = zzNewRotation; + If ( (ViewRotation.Pitch > RotationRate.Pitch) && (ViewRotation.Pitch < 65536 - RotationRate.Pitch) ) { - If (zzViewRotation.Pitch < 32768) + If (ViewRotation.Pitch < 32768) zzNewRotation.Pitch = RotationRate.Pitch; else zzNewRotation.Pitch = 65536 - RotationRate.Pitch; @@ -870,7 +867,6 @@ function ClientSetRotation( rotator zzNewRotation ) if (zzbCanCSL) { ViewRotation = zzNewRotation; - zzViewRotation = zzNewRotation; zzNewRotation.Pitch = 0; zzNewRotation.Roll = 0; SetRotation( zzNewRotation ); @@ -1039,7 +1035,6 @@ simulated function bool TeleporterAccept( Teleporter T, Actor Source ) SetLocation(T.Location); SetRotation(newRot); ViewRotation = newRot; - zzViewRotation = newRot; T.LastFired = Level.TimeSeconds; MoveTimer = -1.0; @@ -1074,7 +1069,7 @@ simulated function bool TeleporterAccept( Teleporter T, Actor Source ) function rotator GR() { - return zzViewRotation; + return ViewRotation; } event UpdateEyeHeight(float DeltaTime) @@ -1815,7 +1810,6 @@ function xxServerMove( ViewRotation.Pitch = ViewPitch; ViewRotation.Yaw = ViewYaw; ViewRotation.Roll = 0; - zzViewRotation = ViewRotation; SetRotation(Rot); if (ClientVel.Z < 0) @@ -2693,7 +2687,7 @@ function SendSavedMove(bbSavedMove Move, optional bbSavedMove OldMove) { RelLoc.Z, Velocity, MiscData, - ((zzViewRotation.Pitch & 0xFFFF) << 16) | (zzViewRotation.Yaw & 0xFFFF), + ((ViewRotation.Pitch & 0xFFFF) << 16) | (ViewRotation.Yaw & 0xFFFF), Base, OldMoveData1, OldMoveData2 @@ -2959,7 +2953,7 @@ function xxCalcBehindView(out vector CameraLocation, out rotator CameraRotation, local vector View,HitLocation,HitNormal; local float ViewDist; - CameraRotation = zzViewRotation; + CameraRotation = ViewRotation; View = vect(1,0,0) >> CameraRotation; if( Trace( HitLocation, HitNormal, CameraLocation - (Dist + 30) * vector(CameraRotation), CameraLocation ) != None ) ViewDist = FMin( (CameraLocation - HitLocation) Dot View, Dist ); @@ -2990,7 +2984,7 @@ event PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator if ( PTarget.bIsPlayer ) { if (bbTarg != None) - bbTarg.zzViewRotation = TargetViewRotation; + bbTarg.ViewRotation = TargetViewRotation; PTarget.ViewRotation = TargetViewRotation; } PTarget.EyeHeight = TargetEyeHeight; @@ -3022,7 +3016,7 @@ event PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator EyeHeight = zzRepVREye; } else if (zzInfoThing != None && zzInfoThing.zzPlayerCalcViewCalls == zzNull) - CameraRotation = zzViewRotation; + CameraRotation = ViewRotation; else CameraRotation = ViewRotation; CameraLocation.Z += EyeHeight; @@ -3049,14 +3043,14 @@ function ViewShake(float DeltaTime) shakeVert = (2 * FRand() - 1) * maxshake; } } - zzViewRotation.Roll = zzViewRotation.Roll & 65535; + ViewRotation.Roll = ViewRotation.Roll & 65535; if (bShakeDir) { - zzViewRotation.Roll += Int( 10 * shakemag * FMin(0.1, DeltaTime)); - bShakeDir = (zzViewRotation.Roll > 32768) || (zzViewRotation.Roll < (0.5 + FRand()) * shakemag); - if ( (zzViewRotation.Roll < 32768) && (zzViewRotation.Roll > 1.3 * shakemag) ) + ViewRotation.Roll += Int( 10 * shakemag * FMin(0.1, DeltaTime)); + bShakeDir = (ViewRotation.Roll > 32768) || (ViewRotation.Roll < (0.5 + FRand()) * shakemag); + if ( (ViewRotation.Roll < 32768) && (ViewRotation.Roll > 1.3 * shakemag) ) { - zzViewRotation.Roll = 1.3 * shakemag; + ViewRotation.Roll = 1.3 * shakemag; bShakeDir = false; } else if (FRand() < 3 * DeltaTime) @@ -3064,11 +3058,11 @@ function ViewShake(float DeltaTime) } else { - zzViewRotation.Roll -= Int( 10 * shakemag * FMin(0.1, DeltaTime)); - bShakeDir = (zzViewRotation.Roll > 32768) && (zzViewRotation.Roll < 65535 - (0.5 + FRand()) * shakemag); - if ( (zzViewRotation.Roll > 32768) && (zzViewRotation.Roll < 65535 - 1.3 * shakemag) ) + ViewRotation.Roll -= Int( 10 * shakemag * FMin(0.1, DeltaTime)); + bShakeDir = (ViewRotation.Roll > 32768) && (ViewRotation.Roll < 65535 - (0.5 + FRand()) * shakemag); + if ( (ViewRotation.Roll > 32768) && (ViewRotation.Roll < 65535 - 1.3 * shakemag) ) { - zzViewRotation.Roll = 65535 - 1.3 * shakemag; + ViewRotation.Roll = 65535 - 1.3 * shakemag; bShakeDir = true; } else if (FRand() < 3 * DeltaTime) @@ -3078,21 +3072,19 @@ function ViewShake(float DeltaTime) else { ShakeVert = 0; - zzViewRotation.Roll = zzViewRotation.Roll & 65535; - if (zzViewRotation.Roll < 32768) + ViewRotation.Roll = ViewRotation.Roll & 65535; + if (ViewRotation.Roll < 32768) { - if ( zzViewRotation.Roll > 0 ) - zzViewRotation.Roll = Max(0, zzViewRotation.Roll - (Max(zzViewRotation.Roll,500) * 10 * FMin(0.1,DeltaTime))); + if ( ViewRotation.Roll > 0 ) + ViewRotation.Roll = Max(0, ViewRotation.Roll - (Max(ViewRotation.Roll,500) * 10 * FMin(0.1,DeltaTime))); } else { - zzViewRotation.Roll += ((65536 - Max(500,zzViewRotation.Roll)) * 10 * FMin(0.1,DeltaTime)); - if ( zzViewRotation.Roll > 65534 ) - zzViewRotation.Roll = 0; + ViewRotation.Roll += ((65536 - Max(500,ViewRotation.Roll)) * 10 * FMin(0.1,DeltaTime)); + if ( ViewRotation.Roll > 65534 ) + ViewRotation.Roll = 0; } } - ViewRotation = RotRand(False); - ViewRotation.Roll = zzViewRotation.Roll; } function UpdateRotation(float DeltaTime, float maxPitch); @@ -3102,17 +3094,17 @@ function xxUpdateRotation(float DeltaTime, float maxPitch) local rotator newRotation; local float PitchDelta, YawDelta; - DesiredRotation = zzViewRotation; //save old rotation + DesiredRotation = ViewRotation; //save old rotation PitchDelta = 32.0 * DeltaTime * aLookUp + LookUpFractionalPart; - zzViewRotation.Pitch += int(PitchDelta); + ViewRotation.Pitch += int(PitchDelta); if (!bUseOldMouseInput) LookUpFractionalPart = PitchDelta - int(PitchDelta); - zzViewRotation.Pitch = Clamp((zzViewRotation.Pitch << 16 >> 16), -16384, 16383) & 0xFFFF; + ViewRotation.Pitch = Clamp((ViewRotation.Pitch << 16 >> 16), -16384, 16383) & 0xFFFF; YawDelta = 32.0 * DeltaTime * aTurn + TurnFractionalPart; - zzViewRotation.Yaw += int(YawDelta); + ViewRotation.Yaw += int(YawDelta); if (!bUseOldMouseInput) TurnFractionalPart = YawDelta - int(YawDelta); @@ -3120,11 +3112,11 @@ function xxUpdateRotation(float DeltaTime, float maxPitch) ViewFlash(deltaTime); newRotation = Rotation; - newRotation.Yaw = zzViewRotation.Yaw; - newRotation.Pitch = zzViewRotation.Pitch; + newRotation.Yaw = ViewRotation.Yaw; + newRotation.Pitch = ViewRotation.Pitch; If ( (newRotation.Pitch > maxPitch * RotationRate.Pitch) && (newRotation.Pitch < 65536 - maxPitch * RotationRate.Pitch) ) { - If (zzViewRotation.Pitch < 32768) + If (ViewRotation.Pitch < 32768) newRotation.Pitch = maxPitch * RotationRate.Pitch; else newRotation.Pitch = 65536 - maxPitch * RotationRate.Pitch; @@ -3133,7 +3125,7 @@ function xxUpdateRotation(float DeltaTime, float maxPitch) if (!zzbRepVRData) { - xxReplicateVRToDemo(zzViewRotation.Yaw, zzViewRotation.Pitch, EyeHeight); + xxReplicateVRToDemo(ViewRotation.Yaw, ViewRotation.Pitch, EyeHeight); zzbRepVRData = False; // When xxReplicateVRToDemo is executed, this var is set to true } } @@ -3842,8 +3834,6 @@ state FeigningDeath xxUpdateRotation(DeltaTime, 1); SetRotation(currentRot); - ViewRotation = zzViewRotation; - if ( Role < ROLE_Authority ) // then save this move and replicate it xxReplicateMove(DeltaTime, NewAccel, DODGE_None, Rot(0,0,0)); else @@ -3928,7 +3918,7 @@ state PlayerSwimming local vector X,Y,Z, NewAccel; local float Speed2D; - GetAxes(zzViewRotation,X,Y,Z); + GetAxes(ViewRotation,X,Y,Z); aForward *= 0.2; aStrafe *= 0.1; @@ -3950,8 +3940,6 @@ state PlayerSwimming oldRotation = Rotation; xxUpdateRotation(DeltaTime, 2); - ViewRotation = zzViewRotation; - if ( Role < ROLE_Authority ) // then save this move and replicate it xxReplicateMove(DeltaTime, NewAccel, DODGE_None, OldRotation - Rotation); else @@ -4010,8 +3998,6 @@ state PlayerFlying // Update rotation. xxUpdateRotation(DeltaTime, 2); - ViewRotation = zzViewRotation; - if ( Role < ROLE_Authority ) // then save this move and replicate it xxReplicateMove(DeltaTime, Acceleration, DODGE_None, rot(0,0,0)); else @@ -4035,7 +4021,7 @@ state CheatFlying { local vector X,Y,Z; - GetAxes(zzViewRotation,X,Y,Z); + GetAxes(ViewRotation,X,Y,Z); aForward *= 0.1; aStrafe *= 0.1; @@ -4047,8 +4033,6 @@ state CheatFlying xxUpdateRotation(DeltaTime, 1); - ViewRotation = zzViewRotation; - if ( Role < ROLE_Authority ) // then save this move and replicate it xxReplicateMove(DeltaTime, Acceleration, DODGE_None, rot(0,0,0)); else @@ -4191,15 +4175,15 @@ ignores SeePlayer, HearNoise, Bump; if ( !bKeyboardLook && (bLook == 0) ) { if ( bLookUpStairs ) - zzViewRotation.Pitch = FindStairRotation(deltaTime); + ViewRotation.Pitch = FindStairRotation(deltaTime); else if ( bCenterView ) { - zzViewRotation.Pitch = zzViewRotation.Pitch & 65535; - if (zzViewRotation.Pitch > 32768) - zzViewRotation.Pitch -= 65536; - zzViewRotation.Pitch = zzViewRotation.Pitch * (1 - 12 * FMin(0.0833, deltaTime)); - if ( Abs(zzViewRotation.Pitch) < 1000 ) - zzViewRotation.Pitch = 0; + ViewRotation.Pitch = ViewRotation.Pitch & 65535; + if (ViewRotation.Pitch > 32768) + ViewRotation.Pitch -= 65536; + ViewRotation.Pitch = ViewRotation.Pitch * (1 - 12 * FMin(0.0833, deltaTime)); + if ( Abs(ViewRotation.Pitch) < 1000 ) + ViewRotation.Pitch = 0; } } @@ -4226,8 +4210,6 @@ ignores SeePlayer, HearNoise, Bump; else bSaveJump = false; - ViewRotation = zzViewRotation; - if ( Role < ROLE_Authority ) // then save this move and replicate it xxReplicateMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation); else @@ -4317,7 +4299,7 @@ state PlayerWaiting { local vector X,Y,Z; - GetAxes(zzViewRotation,X,Y,Z); + GetAxes(ViewRotation,X,Y,Z); aForward *= 0.12; // 0.1 aStrafe *= 0.12; @@ -4329,8 +4311,6 @@ state PlayerWaiting xxUpdateRotation(DeltaTime, 1); - ViewRotation = zzViewRotation; - if ( Role < ROLE_Authority ) // then save this move and replicate it xxReplicateMove(DeltaTime, Acceleration, DODGE_None, rot(0,0,0)); else @@ -4689,7 +4669,7 @@ state PlayerSpectating { local vector X,Y,Z; - GetAxes(zzViewRotation,X,Y,Z); + GetAxes(ViewRotation,X,Y,Z); aForward *= 0.1; aStrafe *= 0.1; @@ -4701,8 +4681,6 @@ state PlayerSpectating xxUpdateRotation(DeltaTime, 1); - ViewRotation = zzViewRotation; - if ( Role < ROLE_Authority ) // then save this move and replicate it xxReplicateMove(DeltaTime, Acceleration, DODGE_None, rot(0,0,0)); else @@ -4727,13 +4705,12 @@ state PlayerWaking ViewFlash(deltaTime * 0.5); if ( TimerRate == 0 ) { - zzViewRotation.Pitch -= DeltaTime * 12000; - if ( zzViewRotation.Pitch < 0 ) + ViewRotation.Pitch -= DeltaTime * 12000; + if ( ViewRotation.Pitch < 0 ) { - zzViewRotation.Pitch = 0; + ViewRotation.Pitch = 0; GotoState('PlayerWalking'); } - ViewRotation.Pitch = zzViewRotation.Pitch; } if ( Role < ROLE_Authority ) // then save this move and replicate it @@ -4747,7 +4724,6 @@ state PlayerWaking zzbForceUpdate = false; if ( bWokeUp ) { - zzViewRotation.Pitch = 0; ViewRotation.Pitch = 0; SetTimer(0, false); return; @@ -4849,25 +4825,23 @@ state Dying Fire(0); bPressedJump = false; } - GetAxes(zzViewRotation,X,Y,Z); + GetAxes(ViewRotation,X,Y,Z); // Update view rotation. aLookup *= 0.24; aTurn *= 0.24; - zzViewRotation.Yaw += 32.0 * DeltaTime * aTurn; - zzViewRotation.Pitch += 32.0 * DeltaTime * aLookUp; - zzViewRotation.Pitch = zzViewRotation.Pitch & 65535; - If ((zzViewRotation.Pitch > 18000) && (zzViewRotation.Pitch < 49152)) + ViewRotation.Yaw += 32.0 * DeltaTime * aTurn; + ViewRotation.Pitch += 32.0 * DeltaTime * aLookUp; + ViewRotation.Pitch = ViewRotation.Pitch & 65535; + If ((ViewRotation.Pitch > 18000) && (ViewRotation.Pitch < 49152)) { If (aLookUp > 0) - zzViewRotation.Pitch = 18000; + ViewRotation.Pitch = 18000; else - zzViewRotation.Pitch = 49152; + ViewRotation.Pitch = 49152; } - ViewRotation = zzViewRotation; } ViewShake(DeltaTime); ViewFlash(DeltaTime); - ViewRotation = zzViewRotation; } function xxServerMove @@ -4917,11 +4891,11 @@ state Dying //fixme - try to pick view with killer visible //fixme - also try varying starting pitch - zzViewRotation.Pitch = 56000; + ViewRotation.Pitch = 56000; tries = 0; besttry = 0; bestdist = 0.0; - startYaw = zzViewRotation.Yaw; + startYaw = ViewRotation.Yaw; for (tries=0; tries<16; tries++) { @@ -4933,13 +4907,12 @@ state Dying bestdist = newdist; besttry = tries; } - zzViewRotation.Yaw += 4096; + ViewRotation.Yaw += 4096; } if (zzInfoThing != None) zzInfoThing.zzPlayerCalcViewCalls = 1; - zzViewRotation.Yaw = startYaw + besttry * 4096; - ViewRotation.Yaw = zzViewRotation.Yaw; + ViewRotation.Yaw = startYaw + besttry * 4096; } function EndState() @@ -4982,28 +4955,27 @@ ignores SeePlayer, HearNoise, KilledBy, Bump, HitWall, HeadZoneChange, FootZoneC { local vector X,Y,Z; - GetAxes(zzViewRotation,X,Y,Z); + GetAxes(ViewRotation,X,Y,Z); // Update view rotation. if ( !bFixedCamera ) { aLookup *= 0.24; aTurn *= 0.24; - zzViewRotation.Yaw += 32.0 * DeltaTime * aTurn; - zzViewRotation.Pitch += 32.0 * DeltaTime * aLookUp; - zzViewRotation.Pitch = zzViewRotation.Pitch & 65535; - If ((zzViewRotation.Pitch > 18000) && (zzViewRotation.Pitch < 49152)) + ViewRotation.Yaw += 32.0 * DeltaTime * aTurn; + ViewRotation.Pitch += 32.0 * DeltaTime * aLookUp; + ViewRotation.Pitch = ViewRotation.Pitch & 65535; + If ((ViewRotation.Pitch > 18000) && (ViewRotation.Pitch < 49152)) { If (aLookUp > 0) - zzViewRotation.Pitch = 18000; + ViewRotation.Pitch = 18000; else - zzViewRotation.Pitch = 49152; + ViewRotation.Pitch = 49152; } } else if ( ViewTarget != None ) - zzViewRotation = ViewTarget.Rotation; + ViewRotation = ViewTarget.Rotation; - ViewRotation = zzViewRotation; ViewShake(DeltaTime); ViewFlash(DeltaTime); @@ -5043,7 +5015,7 @@ ignores SeePlayer, HearNoise, KilledBy, Bump, HitWall, HeadZoneChange, FootZoneC ClientLocZ, ClientVel, MiscData, - ((zzViewRotation.Pitch & 0xFFFF) << 16) | (zzViewRotation.Yaw & 0xFFFF), + ((ViewRotation.Pitch & 0xFFFF) << 16) | (ViewRotation.Yaw & 0xFFFF), ClientBase, OldMoveData1, OldMoveData2); @@ -5058,11 +5030,11 @@ ignores SeePlayer, HearNoise, KilledBy, Bump, HitWall, HeadZoneChange, FootZoneC local int startYaw; local actor ViewActor; - zzViewRotation.Pitch = 56000; + ViewRotation.Pitch = 56000; tries = 0; besttry = 0; bestdist = 0.0; - startYaw = zzViewRotation.Yaw; + startYaw = ViewRotation.Yaw; for (tries=0; tries<16; tries++) { @@ -5077,12 +5049,12 @@ ignores SeePlayer, HearNoise, KilledBy, Bump, HitWall, HeadZoneChange, FootZoneC bestdist = newdist; besttry = tries; } - zzViewRotation.Yaw += 4096; + ViewRotation.Yaw += 4096; } if (zzInfoThing != None) zzInfoThing.zzPlayerCalcViewCalls = 1; - zzViewRotation.Yaw = startYaw + besttry * 4096; + ViewRotation.Yaw = startYaw + besttry * 4096; } } @@ -5110,11 +5082,11 @@ function PlayWaiting() else { BaseEyeHeight = Default.BaseEyeHeight; - zzViewRotation.Pitch = zzViewRotation.Pitch & 65535; - If ( (zzViewRotation.Pitch > RotationRate.Pitch) - && (zzViewRotation.Pitch < 65536 - RotationRate.Pitch) ) + ViewRotation.Pitch = ViewRotation.Pitch & 65535; + If ( (ViewRotation.Pitch > RotationRate.Pitch) + && (ViewRotation.Pitch < 65536 - RotationRate.Pitch) ) { - If (zzViewRotation.Pitch < 32768) + If (ViewRotation.Pitch < 32768) { if ( (Weapon == None) || (Weapon.Mass < 20) ) { TweenAnim('AimUpSm', 0.3); @@ -5194,7 +5166,7 @@ function PlayHit(float Damage, vector HitLocation, name damageType, vector Momen if (damageType == 'Drowned') { bub = spawn(class 'Bubble1',,, Location - + 0.7 * CollisionRadius * vector(zzViewRotation) + 0.3 * EyeHeight * vect(0,0,1)); + + 0.7 * CollisionRadius * vector(ViewRotation) + 0.3 * EyeHeight * vect(0,0,1)); if (bub != None) bub.DrawScale = FRand()*0.06+0.04; } @@ -5658,7 +5630,7 @@ event PreRender( canvas zzCanvas ) zzbBadCanvas = zzbBadCanvas || (zzCanvas != None && zzCanvas.Class != Class'Canvas'); - zzLastVR = zzViewRotation; + zzLastVR = ViewRotation; if (Role < ROLE_Authority) xxAttachConsole(); @@ -5753,8 +5725,6 @@ event PostRender( canvas zzCanvas ) ViewRotation.Roll = 0; EyeHeight = zzRepVREye; } - else - ViewRotation = zzViewRotation; xxHideItems(); @@ -5798,7 +5768,7 @@ event PostRender( canvas zzCanvas ) } } - zzbVRChanged = zzbVRChanged || (zzViewRotation != zzLastVR); + zzbVRChanged = zzbVRChanged || (ViewRotation != zzLastVR); if (bDrawDebugData) { xxDrawDebugData(zzCanvas, 10, 120); @@ -5968,7 +5938,7 @@ simulated function xxDrawDebugData(canvas zzC, float zzx, float zzY) { zzC.DrawColor = ChallengeHud(MyHud).WhiteColor; zzC.SetPos(zzx,zzY); zzC.Font = ChallengeHud(MyHud).MyFonts.GetSmallFont(zzC.ClipX); - zzC.DrawText("ViewRot:"@zzViewRotation); + zzC.DrawText("ViewRot:"@ViewRotation); zzC.SetPos(zzx, zzY + 20); zzC.DrawText("NewAccel:"@debugNewAccel); zzC.SetPos(zzx, zzY + 40); From 3569e097680318cabe8a260ff05ccffa118cd327 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Thu, 23 Jul 2020 23:16:19 +0200 Subject: [PATCH 02/70] Remove Teleporter Replacement Code Netcode can deal with teleporters just fine, no need to mess with them. --- Classes/DisablePortals.uc | 14 -- Classes/NN_Teleporter.uc | 32 ---- Classes/UTPure.uc | 2 - Classes/VTFix.uc | 41 ----- Classes/VisibleTeleporterFixRI.uc | 75 --------- Classes/bbPlayer.uc | 254 +----------------------------- 6 files changed, 4 insertions(+), 414 deletions(-) delete mode 100644 Classes/DisablePortals.uc delete mode 100644 Classes/NN_Teleporter.uc delete mode 100644 Classes/VTFix.uc delete mode 100644 Classes/VisibleTeleporterFixRI.uc diff --git a/Classes/DisablePortals.uc b/Classes/DisablePortals.uc deleted file mode 100644 index e3f8dda0..00000000 --- a/Classes/DisablePortals.uc +++ /dev/null @@ -1,14 +0,0 @@ -class DisablePortals extends Mutator; - -function Tick( float Delta ) -{ - local UTPure UTP; - - ForEach AllActors(class'UTPure', UTP) - { - Log("NewNet Portals is Disabled!"); - UTP.DisablePortals = true; - UTP.default.DisablePortals = true; - Disable('Tick'); - } -} \ No newline at end of file diff --git a/Classes/NN_Teleporter.uc b/Classes/NN_Teleporter.uc deleted file mode 100644 index 1190ec4d..00000000 --- a/Classes/NN_Teleporter.uc +++ /dev/null @@ -1,32 +0,0 @@ -class NN_Teleporter extends Teleporter; - -var rotator zzRotation; -var name zzTag; -var name zzEvent; -var name zzAttachTag; - -var bool zzbEnabled; // Teleporter is turned on; -var string zzURL; -var name zzProductRequired; -var bool zzbChangesVelocity; // Set velocity to TargetVelocity. -var bool zzbChangesYaw; // Sets yaw to teleporter's Rotation.Yaw -var bool zzbReversesX; // Reverses X-component of velocity. -var bool zzbReversesY; // Reverses Y-component of velocity. -var bool zzbReversesZ; // Reverses Z-component of velocity. -var vector zzTargetVelocity; // If bChangesVelocity, set target's velocity to this. - -replication -{ - reliable if( Role==ROLE_Authority ) - zzRotation, zzTag, zzEvent, zzAttachTag, - zzbEnabled, zzURL, zzProductRequired, zzbChangesVelocity, zzbChangesYaw, zzbReversesX, zzbReversesY, zzbReversesZ, zzTargetVelocity; -} - -simulated function Touch( actor Other ) -{ -} - -defaultProperties { - bStatic=false - bAlwaysRelevant=true -} \ No newline at end of file diff --git a/Classes/UTPure.uc b/Classes/UTPure.uc index 3689f0e8..2a52e65b 100644 --- a/Classes/UTPure.uc +++ b/Classes/UTPure.uc @@ -146,8 +146,6 @@ function PreBeginPlay() if (NNAnnouncer) Spawn(class'NNAnnouncerSA'); - Spawn(class'VTFix'); - class'bbPlayer'.Default.HitSound = DefaultHitSound; class'bbPlayer'.Default.TeamHitSound = DefaultTeamHitSound; class'bbCHSpectator'.Default.HitSound = DefaultHitSound; diff --git a/Classes/VTFix.uc b/Classes/VTFix.uc deleted file mode 100644 index cdf3aba4..00000000 --- a/Classes/VTFix.uc +++ /dev/null @@ -1,41 +0,0 @@ -class VTFix expands Mutator; - -CONST IC=class'VisibleTeleporterFixRI'; - -function Tick(float dt) -{ - spawn(class'VisibleTeleporterFixRI'); - DelSelf(); - Disable('Tick'); -} - -function DelSelf() -{ - local Mutator M, PrevM; - local bool bFound; - - - for(M=Level.Game.BaseMutator; M!=None; M=M.NextMutator ) - { - if( M == Self ) - { - bFound = True; - break; - } - PrevM = M; - } - if( bFound ) - { - if( PrevM != None ) - PrevM.NextMutator = NextMutator; - else - Level.Game.BaseMutator = NextMutator; - } - destroy(); - return; -} - -defaultproperties -{ - RemoteRole=None -} \ No newline at end of file diff --git a/Classes/VisibleTeleporterFixRI.uc b/Classes/VisibleTeleporterFixRI.uc deleted file mode 100644 index f5162a49..00000000 --- a/Classes/VisibleTeleporterFixRI.uc +++ /dev/null @@ -1,75 +0,0 @@ -//================================================================================ -// VisibleTeleporterFixRI. -//================================================================================ -class VisibleTeleporterFixRI extends ReplicationInfo; - -var VisibleTeleporter Tele[64]; -var name TeleTag[64]; -var int TeleCount; - -replication -{ - unreliable if ( Role == ROLE_Authority ) - Tele,TeleTag,TeleCount; -} - -function PreBeginPlay () -{ - local VisibleTeleporter t; - local rotator newRot; - - foreach AllActors(Class'VisibleTeleporter',t) - { - t.bAlwaysRelevant = True; - t.bChangesYaw = False; - Tele[TeleCount] = t; - TeleTag[TeleCount] = t.Tag; - TeleCount++; - if ( TeleCount == 64 ) - break; - } -} - -function AddTele (VisibleTeleporter t) -{ - if ( TeleCount >= 64 ) - return; - Tele[TeleCount] = t; - TeleTag[TeleCount] = t.Tag; - TeleCount++; -} - -simulated function Tick (float F) -{ - local int i; - - if ( Level.NetMode == NM_Client ) - { - for (i = 0; i < TeleCount; i++) - { - if ( (Tele[i] == None) || (Tele[i].Tag == TeleTag[i]) ) - return; - Tele[i].Tag = TeleTag[i]; - } - return; - } - - for (i = 0; i < TeleCount; i++) - { - if ( (Tele[i] == None) && (TeleCount > 0) ) - { - Tele[i] = Tele[TeleCount - 1]; - TeleTag[i] = TeleTag[TeleCount - 1]; - TeleCount--; - } - if ( (Tele[i] != None) && (TeleTag[i] != Tele[i].Tag) ) - TeleTag[i] = Tele[i].Tag; - } - return; -} - -defaultproperties -{ - RemoteRole=ROLE_SimulatedProxy - NetUpdateFrequency=2.00 -} \ No newline at end of file diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 463423a9..72524156 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -113,7 +113,7 @@ var bool zzbBadGuy; // BadGuy! (Avoid kick spamming) var int zzOldForceSettingsLevel; // Kept to see if things change. var float zzThrownTime, zzSwitchedTime; var Weapon zzThrownWeapon; -var int zzRecentDmgGiven, zzRecentTeamDmgGiven, TeleRadius, PortalRadius, TriggerRadius; +var int zzRecentDmgGiven, zzRecentTeamDmgGiven, TeleRadius; var name zzDefaultWeapon; var float zzLastHitSound, zzLastTeamHitSound; var float zzFRandVals[47]; // Let's use a prime number ;) @@ -126,9 +126,6 @@ var actor zzNN_HitActor, zzOldBase; var Vector zzNN_HitLoc, zzClientHitNormal, zzClientHitLocation, zzNN_HitDiff, zzNN_HitLocLast, zzNN_HitNormalLast, zzNN_ClientLoc, zzNN_ClientVel; var bool zzbIsWarmingUp, zzbFakeUpdate, zzbForceUpdate, zzbOnMover, zzbNN_Special, zzbNN_ReleasedFire, zzbNN_ReleasedAltFire; var float zzNN_Accuracy, zzLastStuffUpdate, zzNextTimeTime, zzLastFallVelZ, zzLastClientErr, zzForceUpdateUntil, zzIgnoreUpdateUntil, zzLastLocDiff, zzSpawnedTime; -var Teleporter LastPortal, LastPortalDest; -var Trigger zzLastTrigger; -var float LastPortalTime, zzLastTriggerTime; var TournamentWeapon zzGrappling; var float zzGrappleTime; var Weapon zzKilledWithWeapon; @@ -255,7 +252,6 @@ var TranslocatorTarget zzClientTTarget, TTarget; var float LastTick, AvgTickDiff; var bool MMSupport; -var bool DisablePortals; var bool SetPendingWeapon; // Net Updates @@ -360,8 +356,8 @@ replication xxExplodeOther, xxSetNetUpdateRate, xxServerAddVelocity, xxNN_Fire, xxNN_AltFire; reliable if ((Role < ROLE_Authority) && !bClientDemoRecording) - xxNN_ProjExplode, xxNN_TeleFrag, xxNN_TransFrag, - xxNN_ReleaseFire, xxNN_ReleaseAltFire, xxNN_MoveTTarget, ServerPreTeleport; + xxNN_ProjExplode, xxNN_TransFrag, + xxNN_ReleaseFire, xxNN_ReleaseAltFire, xxNN_MoveTTarget; // Server->Client unreliable if (Role == ROLE_Authority && bViewTarget) @@ -393,11 +389,6 @@ exec function Ghost() Super.Ghost(); } -simulated function xxSetPortals(bool DP) -{ - DisablePortals = DP; -} - function string ParseDelimited(string Text, string Delimiter, int Count, optional bool bToEndOfLine) { local string Result; @@ -444,9 +435,7 @@ simulated function Touch( actor Other ) ClientMessage(Package); } - if (Other.IsA('Teleporter') && Other.Class.Name != 'NN_Teleporter' || - Other.IsA('Kicker') && Other.Class.Name != 'Kicker' - ) { + if (Other.IsA('Kicker') && Other.Class.Name != 'Kicker') { zzForceUpdateUntil = Level.TimeSeconds + 0.15 + float(Other.GetPropertyText("ToggleTime")); zzbForceUpdate = true; } @@ -476,67 +465,6 @@ simulated function bool xxNewMoveSmooth(vector NewLoc) return Move(Delta); } -function ServerPreTeleport(Teleporter Other, Teleporter Dest, vector ClientLoc, rotator ClientRot, vector ClientVel) -{ - local bool bUnblocked; - - if (Other == None || Dest == None || VSize(Dest.Location - ClientLoc) > TeleRadius || Level.NetMode == NM_Client || IsInState('Dying') || Mesh == None) - return; - - if (bBlockPlayers) - { - SetCollision(bCollideActors, bBlockActors, false); - zzDisabledPlayerCollision++; - bUnblocked = true; - } - - if (!xxNewSetLocation(ClientLoc, ClientVel)) - { - if (bUnblocked) - zzDisabledPlayerCollision--; - return; - } - - PlayTeleportEffect(false, true, Other); - SetRotation(ClientRot); - ViewRotation = ClientRot; - PlayTeleportEffect(true, true, Dest); -} - -function PlayTeleportEffect( optional bool bOut, optional bool bSound, optional Teleporter Portal ) -{ - local UTTeleportEffect PTE; - local DeathMatchPlus DMP; - local vector nLoc; - local rotator nRot; - - if (Mesh == None) - return; - - DMP = DeathMatchPlus(Level.Game); - if (DMP == None || !bNewNet) { - Level.Game.PlayTeleportEffect(Self, bOut, bSound); - return; - } - - if (Portal == None) - { - nLoc = Location; - nRot = Rotation; - } - else - { - nLoc = Portal.Location; - nRot = Portal.Rotation; - } - if ( bSound ) - { - PTE = Spawn(class'UTTeleportEffect',Self,, nLoc, nRot); - PTE.Initialize(Self, bOut); - PTE.PlaySound(sound'Resp2A',, 10.0); - } -} - simulated function xxClientKicker( float KCollisionRadius, float KCollisionHeight, float KLocationX, float KLocationY, float KLocationZ, int KRotationYaw, int KRotationPitch, int KRotationRoll, name KTag, name KEvent, name KAttachTag, vector KKickVelocity, name KKickedClasses, bool KbKillVelocity, bool KbRandomize ) { local Actor A; @@ -703,9 +631,6 @@ event Possess() TeleRadius = zzUTPure.Default.TeleRadius; xxSetTeleRadius(TeleRadius); - xxSetPortals(DisablePortals); - DisablePortals = zzUTPure.Default.DisablePortals; - DefaultHitSound = zzUTPure.Default.DefaultHitSound; DefaultTeamHitSound = zzUTPure.Default.DefaultTeamHitSound; bForceDefaultHitSounds = zzUTPure.Default.bForceDefaultHitSounds; @@ -935,138 +860,6 @@ simulated function xxFinishAce( string zzS ) } } -simulated event bool PreTeleport( Teleporter zzInTeleporter ) -{ - local Teleporter Dest; - - if (Level.NetMode == NM_Client && zzInTeleporter != LastPortal) - { - LastPortal = zzInTeleporter; - LastPortalTime = Level.TimeSeconds + 0.2; - Dest = TeleporterTouch(zzInTeleporter); - if (Dest != None) - ServerPreTeleport(zzInTeleporter, Dest, Location, Rotation, Velocity); - return true; - } - zzTP = zzInTeleporter; - zzTPE = zzTP.Event; - zzTP.Event = 'UTPure'; - Tag = 'UTPure'; - return True; -} - -event Trigger( Actor zzOther, Pawn zzEventInstigator ) -{ - local Actor zzA; - - // Only way we get triggered is from Teleport - if (zzTP != None) - { - zzTP.Event = zzTPE; - zzTP = None; - Tag = ''; - // Be nice and call std event - zzViewRotation = Rotation; - ViewRotation = Rotation; - if (zzTPE != '') - foreach AllActors( class 'Actor', zzA, zzTPE ) - zzA.Trigger( zzOther, zzEventInstigator ); - } -} - -// Teleporter was touched by an actor. -simulated function Teleporter TeleporterTouch( Teleporter T ) -{ - local Teleporter Dest; - local int i; - local Actor A; - - if ( !T.bEnabled ) - return Dest; - - if( (InStr( T.URL, "/" ) >= 0) || (InStr( T.URL, "#" ) >= 0) ) - { - // Teleport to a level on the net. - Level.Game.SendPlayer(Self, T.URL); - } - else - { - // Teleport to a random teleporter in this local level, if more than one pick random. - - foreach AllActors( class 'Teleporter', Dest ) - if( string(Dest.tag)~=T.URL && Dest!=T ) - i++; - i = rand(i); - foreach AllActors( class 'Teleporter', Dest ) - if( string(Dest.tag)~=T.URL && Dest!=T && i-- == 0 ) - break; - if( Dest != None ) - { - // Teleport the actor into the other teleporter. - T.PlayTeleportEffect( Self, false); - TeleporterAccept( Dest, T ); - if (T.Event != '') - foreach AllActors( class 'Actor', A, T.Event ) - A.Trigger( Self, Self.Instigator ); - } - } - return Dest; -} - -// Accept an actor that has teleported in. -simulated function bool TeleporterAccept( Teleporter T, Actor Source ) -{ - local rotator newRot, oldRot; - local int oldYaw; - local float mag; - local vector oldDir; - local pawn P; - local VisibleTeleporter VT; - - T.Disable('Touch'); - newRot = Rotation; - if (T.bChangesYaw) - { - oldRot = Rotation; - newRot.Yaw = T.Rotation.Yaw; - if ( Source != None ) - newRot.Yaw += (32768 + Rotation.Yaw - Source.Rotation.Yaw); - } - SetLocation(T.Location); - SetRotation(newRot); - ViewRotation = newRot; - - T.LastFired = Level.TimeSeconds; - MoveTimer = -1.0; - MoveTarget = T; - T.PlayTeleportEffect( Self, false); - T.Enable('Touch'); - - if (T.bChangesVelocity) - Velocity = T.TargetVelocity; - else - { - if ( T.bChangesYaw ) - { - if ( Physics == PHYS_Walking ) - OldRot.Pitch = 0; - oldDir = vector(OldRot); - mag = Velocity Dot oldDir; - Velocity = Velocity - mag * oldDir + mag * vector(Rotation); - } - if ( T.bReversesX ) - Velocity.X *= -1.0; - if ( T.bReversesY ) - Velocity.Y *= -1.0; - if ( T.bReversesZ ) - Velocity.Z *= -1.0; - } - foreach VisibleCollidingActors( class 'Pawn', P, CollisionRadius * TeleRadius / 100, Location ) - if ( P != Self && (!GameReplicationInfo.bTeamGame || PlayerReplicationInfo.Team != P.PlayerReplicationInfo.Team) && ((VSize(P.Location - Location)) < ((P.CollisionRadius + CollisionRadius) * CollisionHeight)) ) - xxNN_TeleFrag(T, P); - return true; -} - function rotator GR() { return ViewRotation; @@ -2413,12 +2206,6 @@ simulated function vector GetVector( BetterVector SomeVector ) // I understand that you are bitter, but you'll feel better if you listen to me. // Doing good things will make you feel good. -function xxNN_TeleFrag( Teleporter Tele, Pawn Other ) -{ - if (!IsInState('Dying') && !Other.IsInState('Dying') && !xxGarbageLocation(Other) && (!Other.IsA('bbPlayer') || VSize(Other.Location - Tele.Location) < TeleRadius)) - Other.GibbedBy(Self); -} - function xxNN_TransFrag( Pawn Other ) { if (!IsInState('Dying') && !Other.IsInState('Dying') && !xxGarbageLocation(Other) && (!Other.IsA('bbPlayer') || VSize(Other.Location - TTarget.Location) < TeleRadius)) @@ -5359,7 +5146,6 @@ function xxPlayerTickEvents() xxGetDemoPlaybackSpec(); xxCheckForKickers(); - xxCheckForPortals(); if (zzClientTTarget != None) xxServerReceiveStuff( zzClientTTarget.Location, zzClientTTarget.Velocity ); @@ -5405,36 +5191,6 @@ function xxPlayerTickEvents() } } -simulated function xxCheckForPortals() -{ - local Teleporter T, Closest; - local float CurrentTime, ClosestDist, Dist; - - if (IsInState('Dying') || Mesh == None) - return; - - CurrentTime = Level.TimeSeconds; - ClosestDist = 2048; - ForEach RadiusActors(class'Teleporter', T, PortalRadius) - { - Dist = VSize(T.Location - Location); - if (Dist > 0 && Dist < ClosestDist) - { - ClosestDist = Dist; - Closest = T; - } - } - if (Closest == None) - { - LastPortal = None; - LastPortalDest = None; - } - else if (LastPortal == None && LastPortalDest == None && CurrentTime - LastPortalTime > 0.2) - { - PreTeleport(Closest); - } -} - simulated function xxCheckForKickers() { local Kicker K; @@ -7933,8 +7689,6 @@ defaultproperties DemoMask="%l_[%y_%m_%d_%t]_[%c]_%e" HUDInfo=1 TeleRadius=210 - PortalRadius=50 - TriggerRadius=50 FRVI_length=47 VRVI_length=17 NN_ProjLength=256 From 2ccf64de5af536efdf980b9e2c474f0ff744c941 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Fri, 24 Jul 2020 18:22:46 +0200 Subject: [PATCH 03/70] Further decrease likelihood of unsuccessful dodges --- Classes/bbPlayer.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 72524156..254819f7 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1625,8 +1625,8 @@ function xxServerMove( SimStep = DeltaTime / float(MergeCount + 1); - if (SimStep < 0.005) { - MergeCount = int(DeltaTime * 200); + if (SimStep < 0.004) { + MergeCount = int(DeltaTime * 125); SimStep = DeltaTime / float(MergeCount + 1); } From d9b54e936c977a142af60a311536d19051401b8b Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Fri, 24 Jul 2020 18:23:17 +0200 Subject: [PATCH 04/70] Cleanup --- Classes/UTPure.uc | 1 - Classes/bbPlayer.uc | 2 -- 2 files changed, 3 deletions(-) diff --git a/Classes/UTPure.uc b/Classes/UTPure.uc index 2a52e65b..2901133f 100644 --- a/Classes/UTPure.uc +++ b/Classes/UTPure.uc @@ -127,7 +127,6 @@ function PreBeginPlay() local GameInfo GI; local string n; local int XC_Version; - local Kicker K; XC_Version = int(ConsoleCommand("get ini:engine.engine.gameengine XC_Version")); if ( XC_Version >= 11 ) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 254819f7..a63f7ae0 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -184,8 +184,6 @@ var bool zzbRenderHUD; // Do not start rendering HUD until logo has been displa var bool zzbLogoDone; // Are we done with the logo ? var float zzLogoStart; // Start of logo display -var Teleporter zzTP; // Temp Teleporter holder -var name zzTPE; // Teleporter previous Event var int zzSMCnt; // ServerMove Count var bool bMenuFixed; // Fixed Menu item var float zzCVTO; // CenterView Time out. From 32e5877a5ad13adb9e74ae6c3224f00ce69998a1 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Fri, 24 Jul 2020 18:46:44 +0200 Subject: [PATCH 05/70] Bind minimum movement simulation delta to NetUpdateRate --- Classes/bbPlayer.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index a63f7ae0..60773276 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1623,8 +1623,8 @@ function xxServerMove( SimStep = DeltaTime / float(MergeCount + 1); - if (SimStep < 0.004) { - MergeCount = int(DeltaTime * 125); + if (SimStep < (1.0 / zzUTPure.MaxNetUpdateRate)) { + MergeCount = int(DeltaTime * zzUTPure.MaxNetUpdateRate * 0.5); SimStep = DeltaTime / float(MergeCount + 1); } From ed8557d0ad4a6047cf9d8ed44d0f183bd368f0e9 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 25 Jul 2020 13:57:24 +0200 Subject: [PATCH 06/70] Follow Killer with DeathCam --- Classes/bbPlayer.uc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 60773276..89738328 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -288,6 +288,7 @@ var globalconfig bool bUseOldMouseInput; var transient float TurnFractionalPart, LookUpFractionalPart; var float TimeDead; +var Pawn LastKiller; replication { @@ -305,7 +306,7 @@ replication unreliable if ( bNetOwner && Role == ROLE_Authority ) zzTrackFOV, zzCVDeny, zzCVDelay, zzMinimumNetspeed, zzMaximumNetspeed, zzWaitTime,zzAntiTimerList,zzAntiTimerListCount,zzAntiTimerListState, - zzStat; + zzStat, LastKiller; // Server->Client reliable if ( bNetOwner && Role == ROLE_Authority ) @@ -3465,6 +3466,7 @@ function Died(pawn Killer, name damageType, vector HitLocation) if ( RemoteRole == ROLE_AutonomousProxy ) ClientDying(DamageType, HitLocation); + LastKiller = Killer; GotoState('Dying'); } @@ -4572,6 +4574,7 @@ state Dying event PlayerTick( float DeltaTime ) { + local rotator TargetRotation, DeltaRotation; if (Level.Pauser != "") { TimeDead += (DeltaTime / Level.TimeDilation); // counting real time, undo dilation } @@ -4579,6 +4582,12 @@ state Dying xxPlayerTickEvents(); zzTick = DeltaTime; Super.PlayerTick(DeltaTime); + + if (TimeDead < 2 && LastKiller != none) { + TargetRotation = rotator(LastKiller.Location - Location); + DeltaRotation = Normalize(TargetRotation - ViewRotation); + ViewRotation = Normalize(ViewRotation + DeltaRotation * (1 - Exp(-2.5 * DeltaTime))); + } } simulated function BeginState() @@ -4706,6 +4715,7 @@ state Dying Super.EndState(); LastKillTime = 0; bJustRespawned = true; + LastKiller = none; } } From 8ba97772a06c87ac71a4a3aaea6fd22b6a132e1d Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 25 Jul 2020 13:58:28 +0200 Subject: [PATCH 07/70] Dont try to find some arbitrary yaw, just stick with last known yaw --- Classes/bbPlayer.uc | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 89738328..7bd7b42c 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -4677,36 +4677,18 @@ state Dying { local vector cameraLoc; local rotator cameraRot; - local int tries, besttry; - local float bestdist, newdist; - local int startYaw; local actor ViewActor; //fixme - try to pick view with killer visible //fixme - also try varying starting pitch ViewRotation.Pitch = 56000; - tries = 0; - besttry = 0; - bestdist = 0.0; - startYaw = ViewRotation.Yaw; - for (tries=0; tries<16; tries++) - { - cameraLoc = Location; - PlayerCalcView(ViewActor, cameraLoc, cameraRot); - newdist = VSize(cameraLoc - Location); - if (newdist > bestdist) - { - bestdist = newdist; - besttry = tries; - } - ViewRotation.Yaw += 4096; - } + cameraLoc = Location; + PlayerCalcView(ViewActor, cameraLoc, cameraRot); + if (zzInfoThing != None) zzInfoThing.zzPlayerCalcViewCalls = 1; - - ViewRotation.Yaw = startYaw + besttry * 4096; } function EndState() From 599c8566dcf4d8b7e936305404ff579b4abe719a Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 25 Jul 2020 13:59:18 +0200 Subject: [PATCH 08/70] Add bLogClientMessages --- Classes/bbPlayer.uc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 7bd7b42c..3862e463 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -39,6 +39,7 @@ var globalconfig int BeamOriginMode; var globalconfig float DesiredNetUpdateRate; var globalconfig bool bNoSmoothing; var globalconfig bool bNoOwnFootsteps; +var globalconfig bool bLogClientMessages; var Sound playedHitSound; var(Sounds) Sound cHitSound[16]; @@ -810,6 +811,8 @@ event ClientMessage( coerce string zzS, optional Name zzType, optional bool zzbB xxClientDemoMessage(zzS); Super.ClientMessage(zzS, zzType, zzbBeep); zzPrevClientMessage = ""; + if (bLogClientMessages) + Log(zzS, zzType); } simulated function xxCheckAce() @@ -7700,4 +7703,5 @@ defaultproperties bDrawDebugData=False DesiredNetUpdateRate=100.0 TimeBetweenNetUpdates=0.01 + bLogClientMessages=true } From b599d25f31ee2b666a75ff3a128d5fc8f571ab0e Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 25 Jul 2020 13:59:59 +0200 Subject: [PATCH 09/70] Show State Name for all players --- Classes/bbPlayer.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 3862e463..9cc7a51c 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -5737,7 +5737,7 @@ simulated function xxDrawDebugData(canvas zzC, float zzx, float zzY) { y = zzY + 20; foreach AllActors(class'Pawn', P) { zzC.SetPos(zzx+500, y); - zzC.DrawText("Player"$P.PlayerReplicationInfo.PlayerID@"Physics:"@P.Physics@"Anim:"@P.AnimSequence); + zzC.DrawText("Player"$P.PlayerReplicationInfo.PlayerID@"State:"@GetStateName()@"Physics:"@P.Physics@"Anim:"@P.AnimSequence); y += 20; } zzC.SetPos(zzx+20, zzY + 460); From 40e68b39af277598bf878cd8be8261a59bb701d9 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 25 Jul 2020 14:07:50 +0200 Subject: [PATCH 10/70] Actually Enable the Warp Control Code --- Classes/UTPure.uc | 4 ++ Classes/bbPlayer.uc | 92 +++++++++++++++++++++++++-------------------- 2 files changed, 55 insertions(+), 41 deletions(-) diff --git a/Classes/UTPure.uc b/Classes/UTPure.uc index 2901133f..5cb8af7c 100644 --- a/Classes/UTPure.uc +++ b/Classes/UTPure.uc @@ -496,6 +496,10 @@ event Tick(float zzDelta) zzbP.xxServerCheater("SK"); if (zzbDoShot) zzbP.xxClientDoEndShot(); + + if ((Level.NetMode == NM_DedicatedServer) || + (Level.NetMode == NM_ListenServer && zzbP.Role < ROLE_Authority)) + zzbP.ServerTick(zzDelta); } else { diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 9cc7a51c..1d836582 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -256,8 +256,7 @@ var bool SetPendingWeapon; // Net Updates var float MaxPosErrorFactor; var float TimeBetweenNetUpdates; -var float OldServerTimeStamp; -var float OldClientTimeStamp; +var float ExtrapolationDelta; var bool bExtrapolatedLastUpdate; var vector SavedLocation; var vector SavedVelocity; @@ -328,7 +327,8 @@ replication // Server->Client debug data unreliable if ( Role == ROLE_Authority && bDrawDebugData && RemoteRole == ROLE_AutonomousProxy ) clientLastUpdateTime, clientForcedPosition, debugClientPing, debugNumOfForcedUpdates, - debugPlayerServerLocation, debugClientbMoveSmooth, debugClientForceUpdate, debugClientLocError; + debugPlayerServerLocation, debugClientbMoveSmooth, debugClientForceUpdate, debugClientLocError, + ExtrapolationDelta; //Server->Client function reliable.. no demo propogate! .. bNetOwner? ... reliable if ( RemoteRole == ROLE_AutonomousProxy && !bDemoRecording ) @@ -1414,6 +1414,15 @@ function xxSetPendingWeapon(Weapon W) PendingWeapon = W; } +function UndoExtrapolation() { + if (bExtrapolatedLastUpdate) { + bExtrapolatedLastUpdate = false; + xxNewMoveSmooth(SavedLocation); + Velocity = SavedVelocity; + Acceleration = SavedAcceleration; + } +} + function EDodgeDir GetDodgeDir(int dir) { switch(dir) { case 0: return DODGE_None; @@ -1464,13 +1473,14 @@ function OldServerMove(float TimeStamp, int OldMoveData1, int OldMoveData2) { Accel.Y = (OldMoveData2 << 16 >> 16) * 0.1; Accel.Z = (OldMoveData2 >> 16) * 0.1; + UndoExtrapolation(); MoveAutonomous(OldTimeStamp - CurrentTimeStamp, OldRun, OldDuck, OldJump, DodgeMove, Accel, rot(0,0,0)); CurrentTimeStamp = OldTimeStamp - 0.001; } function xxServerMove( float TimeStamp, - float FrameTime, + float MoveDeltaTime, float AccelX, float AccelY, float AccelZ, @@ -1571,10 +1581,12 @@ function xxServerMove( ServerDeltaTime = Level.TimeSeconds - ServerTimeStamp; if (ServerDeltaTime > 0.5) - ServerDeltaTime = FMin(ServerDeltaTime, FrameTime); + ServerDeltaTime = FMin(ServerDeltaTime, MoveDeltaTime); DeltaTime = TimeStamp - CurrentTimeStamp; if (DeltaTime > 0.5) - DeltaTime = FMin(DeltaTime, FrameTime); + DeltaTime = FMin(DeltaTime, MoveDeltaTime); + + ExtrapolationDelta += (ServerDeltaTime - DeltaTime); if ( ServerTimeStamp > 0 ) { // allow 1% error @@ -1618,12 +1630,7 @@ function xxServerMove( // Predict new position if ((Level.Pauser == "") && (DeltaTime > 0)) { - if (bExtrapolatedLastUpdate) { - bExtrapolatedLastUpdate = false; - xxNewMoveSmooth(SavedLocation); - Velocity = SavedVelocity; - Acceleration = SavedAcceleration; - } + UndoExtrapolation(); SimStep = DeltaTime / float(MergeCount + 1); @@ -3562,6 +3569,8 @@ simulated function CheckHitSound() PlayTeamHitSound(0); } +event ServerTick(float DeltaTime); + /** STATES * @Author: spect * @Date: 2020-02-19 02:13:05 @@ -3573,7 +3582,7 @@ state FeigningDeath function xxServerMove ( float TimeStamp, - float FrameTime, + float MoveDeltaTime, float AccelX, float AccelY, float AccelZ, @@ -3590,7 +3599,7 @@ state FeigningDeath { Global.xxServerMove( TimeStamp, - FrameTime, + MoveDeltaTime, AccelX, AccelY, AccelZ, @@ -4007,42 +4016,38 @@ ignores SeePlayer, HearNoise, Bump; bPressedJump = bSaveJump; } - event PlayerTick( float DeltaTime ) - { + event ServerTick(float DeltaTime) { local float TimeSinceLastUpdate; local float ProcessTime; - local float ClientDelta; - local float ServerDelta; - - zzbCanCSL = zzFalse; - xxPlayerTickEvents(); - zzTick = DeltaTime; - Super.PlayerTick(DeltaTime); - - if (Role < ROLE_Authority || Level.NetMode != NM_DedicatedServer) - return; TimeSinceLastUpdate = Level.TimeSeconds - ServerTimeStamp; + ProcessTime = TimeSinceLastUpdate - class'UTPure'.default.MaxJitterTime; - if (TimeSinceLastUpdate > class'UTPure'.default.MaxJitterTime && bJustRespawned == false) { - MoveAutonomous(TimeSinceLastUpdate, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); - CurrentTimeStamp += TimeSinceLastUpdate; - ServerTimeStamp += TimeSinceLastUpdate; + if (ProcessTime >= DeltaTime && bJustRespawned == false) { + UndoExtrapolation(); + //ClientMessage("["$Level.TimeSeconds$"]"@self@"JitterFix"@TimeSinceLastUpdate@ProcessTime@Role@RemoteRole, 'IGPlus', true); + MoveAutonomous(ProcessTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); + CurrentTimeStamp += ProcessTime; + ServerTimeStamp += ProcessTime; } - ServerDelta = ServerTimeStamp - OldServerTimeStamp; - ClientDelta = CurrentTimeStamp - OldClientTimeStamp; - - if (ServerDelta > 1.5*ClientDelta) { + if (bExtrapolatedLastUpdate == false && ExtrapolationDelta > DeltaTime) { + //ClientMessage("["$Level.TimeSeconds$"]"@self@"Extrapolation", 'IGPlus', true); bExtrapolatedLastUpdate = true; SavedLocation = Location; SavedVelocity = Velocity; SavedAcceleration = Acceleration; - MoveAutonomous(ServerDelta - ClientDelta, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); + MoveAutonomous(ExtrapolationDelta, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); } + ExtrapolationDelta *= Exp(-0.125 * DeltaTime); + } - OldServerTimeStamp = ServerTimeStamp; - OldClientTimeStamp = CurrentTimeStamp; + event PlayerTick( float DeltaTime ) + { + zzbCanCSL = zzFalse; + xxPlayerTickEvents(); + zzTick = DeltaTime; + Super.PlayerTick(DeltaTime); } function BeginState() @@ -4644,7 +4649,7 @@ state Dying function xxServerMove ( float TimeStamp, - float FrameTime, + float MoveDeltaTime, float AccelX, float AccelY, float AccelZ, @@ -4661,7 +4666,7 @@ state Dying { Global.xxServerMove( TimeStamp, - FrameTime, + MoveDeltaTime, AccelX, AccelY, AccelZ, @@ -4713,6 +4718,7 @@ state CountdownDying extends Dying function EndState() { Self.bBehindView = false; ServerReStartPlayer(); + bJustRespawned = true; } } @@ -4769,7 +4775,7 @@ ignores SeePlayer, HearNoise, KilledBy, Bump, HitWall, HeadZoneChange, FootZoneC function xxServerMove ( float TimeStamp, - float FrameTime, + float MoveDeltaTime, float AccelX, float AccelY, float AccelZ, @@ -4786,7 +4792,7 @@ ignores SeePlayer, HearNoise, KilledBy, Bump, HitWall, HeadZoneChange, FootZoneC { Global.xxServerMove( TimeStamp, - FrameTime, + MoveDeltaTime, AccelX, AccelY, AccelZ, @@ -5748,6 +5754,9 @@ simulated function xxDrawDebugData(canvas zzC, float zzx, float zzY) { else zzC.DrawText("Velocity:"@vect(0,0,0)@"State:"); + zzC.SetPos(zzx, zzY + 500); + zzC.DrawText("ExtrapolationDelta:"@ExtrapolationDelta); + zzC.Style = ERenderStyle.STY_Normal; } @@ -7704,4 +7713,5 @@ defaultproperties DesiredNetUpdateRate=100.0 TimeBetweenNetUpdates=0.01 bLogClientMessages=true + bJustRespawned=true } From dd95a8b6d5108326192aa2c95919a1a86cdff455 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 25 Jul 2020 14:08:18 +0200 Subject: [PATCH 11/70] Sync Server and Client Physics --- Classes/bbPlayer.uc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 1d836582..d6055412 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1524,7 +1524,8 @@ function xxServerMove( local bool NewbRun; local bool NewbDuck; local bool NewbJumpStatus; - local eDodgeDir DodgeMove; + local EDodgeDir DodgeMove; + local EPhysics ClientPhysics; local byte ClientRoll; local int MergeCount; @@ -1559,6 +1560,7 @@ function xxServerMove( NewbDuck = (MiscData & 0x20000) != 0; NewbJumpStatus = (MiscData & 0x10000) != 0; DodgeMove = GetDodgeDir((MiscData >> 8) & 0xF); + ClientPhysics = GetPhysics((MiscData >> 12) & 0xF); ClientRoll = (MiscData & 0xFF); if (ClientBase == none) @@ -1726,7 +1728,7 @@ function xxServerMove( LastUpdateTime = ServerTimeStamp; clientLastUpdateTime = LastUpdateTime; - if (zzForceUpdateUntil > 0 || (zzIgnoreUpdateUntil == 0 && ClientLocErr > MaxPosError)) { + if (zzForceUpdateUntil > 0 || (zzIgnoreUpdateUntil == 0 && (ClientLocErr > MaxPosError || ClientPhysics != Physics))) { zzbForceUpdate = true; if (ServerTimeStamp > zzForceUpdateUntil) zzForceUpdateUntil = 0; From bbd098cb54f267069bb3cd1be44f5345a3bbdff9 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 25 Jul 2020 20:57:44 +0200 Subject: [PATCH 12/70] Make Crouching Hitbox A Cylinder --- Classes/bbPlayer.uc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 6263d05b..2786226a 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -2968,7 +2968,8 @@ simulated function bool ClientAdjustHitLocation(out vector HitLocation, vector T local vector delta; TraceDir = Normal(TraceDir); - HitLocation = HitLocation + 0.33 * CollisionRadius * TraceDir; // default value is 0.4 + // The following line leads to a rounded edge of the top of the crouching hitbox + //HitLocation = HitLocation + 0.33 * CollisionRadius * TraceDir; // newnet value is 0.4 // default is 0.5 if ( (GetAnimGroup(AnimSequence) == 'Ducking') && (AnimFrame > -0.03) ) { From 7735736bd80ed8662752edcc001787928539e846 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 25 Jul 2020 21:25:31 +0200 Subject: [PATCH 13/70] Jitter Correction Should Be Extrapolated --- Classes/bbPlayer.uc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 2786226a..5335f4aa 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -4029,14 +4029,13 @@ ignores SeePlayer, HearNoise, Bump; if (ProcessTime >= DeltaTime && bJustRespawned == false) { UndoExtrapolation(); - //ClientMessage("["$Level.TimeSeconds$"]"@self@"JitterFix"@TimeSinceLastUpdate@ProcessTime@Role@RemoteRole, 'IGPlus', true); MoveAutonomous(ProcessTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); CurrentTimeStamp += ProcessTime; ServerTimeStamp += ProcessTime; + ExtrapolationDelta = class'UTPure'.default.MaxJitterTime; } if (bExtrapolatedLastUpdate == false && ExtrapolationDelta > DeltaTime) { - //ClientMessage("["$Level.TimeSeconds$"]"@self@"Extrapolation", 'IGPlus', true); bExtrapolatedLastUpdate = true; SavedLocation = Location; SavedVelocity = Velocity; From a27cfb904c445fcd9fe966553115ab371dd09bdf Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 26 Jul 2020 02:39:25 +0200 Subject: [PATCH 14/70] Add bEnableServerExtrapolation Switch If enabled the server will extrapolate outdated positions given to it by clients. --- Classes/UTPure.uc | 4 +++- Classes/bbPlayer.uc | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Classes/UTPure.uc b/Classes/UTPure.uc index 74adedbe..850956dd 100644 --- a/Classes/UTPure.uc +++ b/Classes/UTPure.uc @@ -85,6 +85,7 @@ var localized config int MaxHitError; var localized config float MaxJitterTime; var localized config float MinNetUpdateRate; var localized config float MaxNetUpdateRate; +var localized config bool bEnableServerExtrapolation; var localized config bool ShowTouchedPackage; var name zzDefaultWeapons[8]; var string zzDefaultPackages[8]; @@ -1407,5 +1408,6 @@ defaultproperties MinNetUpdateRate=60.0 MaxNetUpdateRate=250.0 ShowTouchedPackage=False - MaxTradeTimeMargin=0.1; + MaxTradeTimeMargin=0.1 + bEnableServerExtrapolation=true } diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 5335f4aa..ed7b5bed 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -4035,7 +4035,9 @@ ignores SeePlayer, HearNoise, Bump; ExtrapolationDelta = class'UTPure'.default.MaxJitterTime; } - if (bExtrapolatedLastUpdate == false && ExtrapolationDelta > DeltaTime) { + if (class'UTPure'.default.bEnableServerExtrapolation && + bExtrapolatedLastUpdate == false && ExtrapolationDelta > DeltaTime + ) { bExtrapolatedLastUpdate = true; SavedLocation = Location; SavedVelocity = Velocity; From 9afdba380a4382883b65c5bef4d557c00980b1fe Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 26 Jul 2020 02:42:29 +0200 Subject: [PATCH 15/70] Add bEnableJitterBounding Switch If enabled the server will generate an update for clients that havent sent an update within more than MaxJitterTime. --- Classes/UTPure.uc | 2 ++ Classes/bbPlayer.uc | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Classes/UTPure.uc b/Classes/UTPure.uc index 850956dd..44e15b9d 100644 --- a/Classes/UTPure.uc +++ b/Classes/UTPure.uc @@ -86,6 +86,7 @@ var localized config float MaxJitterTime; var localized config float MinNetUpdateRate; var localized config float MaxNetUpdateRate; var localized config bool bEnableServerExtrapolation; +var localized config bool bEnableJitterBounding; var localized config bool ShowTouchedPackage; var name zzDefaultWeapons[8]; var string zzDefaultPackages[8]; @@ -1410,4 +1411,5 @@ defaultproperties ShowTouchedPackage=False MaxTradeTimeMargin=0.1 bEnableServerExtrapolation=true + bEnableJitterBounding=true } diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index ed7b5bed..324bf0ee 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -4027,7 +4027,9 @@ ignores SeePlayer, HearNoise, Bump; TimeSinceLastUpdate = Level.TimeSeconds - ServerTimeStamp; ProcessTime = TimeSinceLastUpdate - class'UTPure'.default.MaxJitterTime; - if (ProcessTime >= DeltaTime && bJustRespawned == false) { + if (class'UTPure'.default.bEnableJitterBounding && + ProcessTime >= DeltaTime && bJustRespawned == false + ) { UndoExtrapolation(); MoveAutonomous(ProcessTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); CurrentTimeStamp += ProcessTime; From 506421e3fe6d3c0080d0ee404f962f39c9791ad5 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 26 Jul 2020 02:44:52 +0200 Subject: [PATCH 16/70] Add bEnableKillCam Switch If enabled your camera will turn to your killer for the first two seconds while dead. --- Classes/bbPlayer.uc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 324bf0ee..3b635b38 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -40,6 +40,7 @@ var globalconfig float DesiredNetUpdateRate; var globalconfig bool bNoSmoothing; var globalconfig bool bNoOwnFootsteps; var globalconfig bool bLogClientMessages; +var globalconfig bool bEnableKillCam; var Sound playedHitSound; var(Sounds) Sound cHitSound[16]; @@ -4598,10 +4599,10 @@ state Dying zzTick = DeltaTime; Super.PlayerTick(DeltaTime); - if (TimeDead < 2 && LastKiller != none) { + if (bEnableKillCam && TimeDead < 2 && LastKiller != none) { TargetRotation = rotator(LastKiller.Location - Location); DeltaRotation = Normalize(TargetRotation - ViewRotation); - ViewRotation = Normalize(ViewRotation + DeltaRotation * (1 - Exp(-2.5 * DeltaTime))); + ViewRotation = Normalize(ViewRotation + DeltaRotation * (1 - Exp(-3.0 * DeltaTime))); } } @@ -7734,5 +7735,6 @@ defaultproperties DesiredNetUpdateRate=100.0 TimeBetweenNetUpdates=0.01 bLogClientMessages=true + bEnableKillCam=true bJustRespawned=true } From 51418508a1f9aa65c151b40a32923ae74527c8df Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 26 Jul 2020 02:45:51 +0200 Subject: [PATCH 17/70] Extrapolation Decays More Quickly --- Classes/bbPlayer.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 3b635b38..4044b04c 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -4047,7 +4047,7 @@ ignores SeePlayer, HearNoise, Bump; SavedAcceleration = Acceleration; MoveAutonomous(ExtrapolationDelta, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); } - ExtrapolationDelta *= Exp(-0.125 * DeltaTime); + ExtrapolationDelta *= Exp(-0.25 * DeltaTime); } event PlayerTick( float DeltaTime ) From 7d8c845e0627adfab859a80bd31806f1b7a3a049 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 26 Jul 2020 14:55:45 +0200 Subject: [PATCH 18/70] Fix MaxTradeTimeMargin and KillCam Timelimit --- Classes/bbPlayer.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 4044b04c..7787d6d2 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -4591,7 +4591,7 @@ state Dying event PlayerTick( float DeltaTime ) { local rotator TargetRotation, DeltaRotation; - if (Level.Pauser != "") { + if (Level.Pauser == "") { TimeDead += (DeltaTime / Level.TimeDilation); // counting real time, undo dilation } zzbCanCSL = zzFalse; From b74c930cfc04e07e350b640c362b510878aa7900 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 26 Jul 2020 14:56:20 +0200 Subject: [PATCH 19/70] Dont change pitch for kill cam --- Classes/bbPlayer.uc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 7787d6d2..bf018ea3 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -4698,10 +4698,12 @@ state Dying //fixme - try to pick view with killer visible //fixme - also try varying starting pitch - ViewRotation.Pitch = 56000; + if (bEnableKillCam == false) { + ViewRotation.Pitch = 56000; - cameraLoc = Location; - PlayerCalcView(ViewActor, cameraLoc, cameraRot); + cameraLoc = Location; + PlayerCalcView(ViewActor, cameraLoc, cameraRot); + } if (zzInfoThing != None) zzInfoThing.zzPlayerCalcViewCalls = 1; From 950dfc85f28953a994644600f82c4b20de53d86c Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 27 Jul 2020 10:11:53 +0200 Subject: [PATCH 20/70] Introduce RealTimeDead to track undiluted/unpaused time while dead --- .gitignore | 1 + Classes/bbPlayer.uc | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e4110cc5..57582038 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.old *.old2 *.bat +*.sftpbatch *.uc_ig make.ini *.uc_nn diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index bf018ea3..7ed16c7a 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -290,6 +290,7 @@ var globalconfig bool bUseOldMouseInput; var transient float TurnFractionalPart, LookUpFractionalPart; var float TimeDead; +var float RealTimeDead; var Pawn LastKiller; replication @@ -4550,7 +4551,7 @@ state Dying SetPause(False); return; } - if( Weapon != None && TimeDead < class'UTPure'.default.MaxTradeTimeMargin) + if( Weapon != None && RealTimeDead < class'UTPure'.default.MaxTradeTimeMargin) { Weapon.bPointing = true; Weapon.Fire(F); @@ -4591,9 +4592,11 @@ state Dying event PlayerTick( float DeltaTime ) { local rotator TargetRotation, DeltaRotation; - if (Level.Pauser == "") { - TimeDead += (DeltaTime / Level.TimeDilation); // counting real time, undo dilation - } + + RealTimeDead += (DeltaTime / Level.TimeDilation); // counting real time, undo dilation + if (Level.Pauser == "") + TimeDead += DeltaTime; + zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = DeltaTime; @@ -4622,6 +4625,7 @@ state Dying Super.BeginState(); LastKillTime = LKT; TimeDead = 0.0; + RealTimeDead = 0.0; } function PlayerMove(float DeltaTime) From ed3caa8eccdb73352447e3d1d400fcb0127c9701 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 29 Jul 2020 19:29:48 +0200 Subject: [PATCH 21/70] Dont force client Physics --- Classes/bbPlayer.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 7ed16c7a..fa1f6a46 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1731,7 +1731,7 @@ function xxServerMove( LastUpdateTime = ServerTimeStamp; clientLastUpdateTime = LastUpdateTime; - if (zzForceUpdateUntil > 0 || (zzIgnoreUpdateUntil == 0 && (ClientLocErr > MaxPosError || ClientPhysics != Physics))) { + if (zzForceUpdateUntil > 0 || (zzIgnoreUpdateUntil == 0 && ClientLocErr > MaxPosError)) { zzbForceUpdate = true; if (ServerTimeStamp > zzForceUpdateUntil) zzForceUpdateUntil = 0; From 6f28932008c0d3757a9575401d04b556fb3297f5 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 29 Jul 2020 19:30:18 +0200 Subject: [PATCH 22/70] Add SetKillCamEnabled command --- Classes/bbPlayer.uc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index fa1f6a46..292f59ec 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -6576,6 +6576,15 @@ function xxServerSetMinDodgeClickTime(float f) MinDodgeClickTime = f; } +exec function SetKillCamEnabled(bool b) { + bEnableKillCam = b; + SaveConfig(); + if (b) + ClientMessage("KillCam enabled!", 'IGPlus'); + else + ClientMessage("KillCam disabled!", 'IGPlus'); +} + exec function EndShot(optional bool b) { bDoEndShot = b; From 1bb26a20e3ad1fee5f0e709815527c023485aa8c Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Thu, 30 Jul 2020 22:03:19 +0200 Subject: [PATCH 23/70] Convert leading spaces to tabs --- Classes/bbPlayer.uc | 374 ++++++++++++++++++++++---------------------- 1 file changed, 187 insertions(+), 187 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 292f59ec..bfcb4f3a 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -299,8 +299,8 @@ replication unreliable if ( bClientDemoRecording ) xxReplicateVRToDemo, xxClientDemoMessage, xxClientLogToDemo, xxDemoSpawnSSRBeam; - reliable if (bClientDemoRecording && !bClientDemoNetFunc) - xxClientDemoFix, xxClientDemoBolt; + reliable if (bClientDemoRecording && !bClientDemoNetFunc) + xxClientDemoFix, xxClientDemoBolt; reliable if ((Role == ROLE_Authority) && !bClientDemoRecording) xxNN_ClientProjExplode; @@ -677,8 +677,8 @@ function ClientSetLocation( vector zzNewLocation, rotator zzNewRotation ) { local SavedMove M; if (zzbCanCSL || - (zzNewRotation.Roll == 0 && zzNewRotation == ViewRotation && - (WarpZoneInfo(Region.Zone) != None || WarpZoneInfo(HeadRegion.Zone) != None || WarpZoneInfo(FootRegion.Zone) != None))) + (zzNewRotation.Roll == 0 && zzNewRotation == ViewRotation && + (WarpZoneInfo(Region.Zone) != None || WarpZoneInfo(HeadRegion.Zone) != None || WarpZoneInfo(FootRegion.Zone) != None))) { ViewRotation = zzNewRotation; If ( (ViewRotation.Pitch > RotationRate.Pitch) && (ViewRotation.Pitch < 65536 - RotationRate.Pitch) ) @@ -1241,8 +1241,8 @@ simulated function xxPureCAP(float TimeStamp, name newState, EPhysics newPhysics DeltaLoc = CurrentMove.SavedLocation - NewLoc; DeltaLoc.Z = FMax(Abs(DeltaLoc.Z) - MaxStepHeight, 0); if ((DeltaLoc dot DeltaLoc) < 9 && - // VSize(CurrentMove.SavedVelocity - NewVelocity) < 3 && // stijn: UE2 also checked velocity but honestly there isn't really any point in doing that... - IsInState(newState)) + // VSize(CurrentMove.SavedVelocity - NewVelocity) < 3 && // stijn: UE2 also checked velocity but honestly there isn't really any point in doing that... + IsInState(newState)) { debugNumOfIgnoredForceUpdates += 1; CurrentMove.Clear2(); @@ -1251,7 +1251,7 @@ simulated function xxPureCAP(float TimeStamp, name newState, EPhysics newPhysics // ok, this is a serious adjustment. Proceed CurrentMove.Clear2(); break; - } + } CurrentMove.Clear2(); CurrentMove = bbSavedMove(SavedMoves); } @@ -1693,21 +1693,21 @@ function xxServerMove( PlayerReplicationInfo.Ping = int(ConsoleCommand("GETPING")); if (SetPendingWeapon) { - xxSetPendingWeapon(PendingWeapon); - zzPendingWeapon = PendingWeapon; - } else { - if (MMSupport) { - xxSetPendingWeapon(PendingWeapon); - zzPendingWeapon = PendingWeapon; - } else { - if (zzPendingWeapon != PendingWeapon) { - xxSetPendingWeapon(PendingWeapon); - zzPendingWeapon = PendingWeapon; - if (PendingWeapon != None && PendingWeapon.Owner == Self && Weapon != None && !Weapon.IsInState('DownWeapon')) - Weapon.GotoState('DownWeapon'); - } - } - } + xxSetPendingWeapon(PendingWeapon); + zzPendingWeapon = PendingWeapon; + } else { + if (MMSupport) { + xxSetPendingWeapon(PendingWeapon); + zzPendingWeapon = PendingWeapon; + } else { + if (zzPendingWeapon != PendingWeapon) { + xxSetPendingWeapon(PendingWeapon); + zzPendingWeapon = PendingWeapon; + if (PendingWeapon != None && PendingWeapon.Owner == Self && Weapon != None && !Weapon.IsInState('DownWeapon')) + Weapon.GotoState('DownWeapon'); + } + } + } if (zzDisabledPlayerCollision > 0) { zzDisabledPlayerCollision--; @@ -2942,7 +2942,7 @@ function xxReplicateVRToDemo(int zzYaw, int zzPitch, float zzEye) function SendVoiceMessage(PlayerReplicationInfo Sender, PlayerReplicationInfo Recipient, name messagetype, byte messageID, name broadcasttype) { if (Sender == PlayerReplicationInfo) - super.SendVoiceMessage(PlayerReplicationInfo, Recipient, MessageType, MessageID,broadcasttype); //lame anti-cheat :P + super.SendVoiceMessage(PlayerReplicationInfo, Recipient, MessageType, MessageID,broadcasttype); //lame anti-cheat :P } function ServerTaunt(name Sequence ) @@ -3660,7 +3660,7 @@ state FeigningDeath Super.BeginState(); // Stop weapon firing - //UsAaR33: prevent weapon from firing (brought on by missing bchangedweapon checks) + //UsAaR33: prevent weapon from firing (brought on by missing bchangedweapon checks) if (zzbNoMultiWeapon && Weapon != none && (baltfire>0||bfire>0) ) { //could only be true on server zzOldbfire=bfire; @@ -3850,28 +3850,28 @@ state PlayerWalking ignores SeePlayer, HearNoise, Bump; simulated function Dodge(eDodgeDir DodgeMove) - { - local vector X,Y,Z; - - if ( bIsCrouching || (Physics != PHYS_Walking) ) - return; - - GetAxes(Rotation,X,Y,Z); - if (DodgeMove == DODGE_Forward) - Velocity = 1.5*GroundSpeed*X + (Velocity Dot Y)*Y; - else if (DodgeMove == DODGE_Back) - Velocity = -1.5*GroundSpeed*X + (Velocity Dot Y)*Y; - else if (DodgeMove == DODGE_Left) - Velocity = 1.5*GroundSpeed*Y + (Velocity Dot X)*X; - else if (DodgeMove == DODGE_Right) - Velocity = -1.5*GroundSpeed*Y + (Velocity Dot X)*X; - - Velocity.Z = 160; - PlayOwnedSound(JumpSound, SLOT_Talk, 1.0, true, 800, 1.0 ); - PlayDodge(DodgeMove); - DodgeDir = DODGE_Active; - SetPhysics(PHYS_Falling); - } + { + local vector X,Y,Z; + + if ( bIsCrouching || (Physics != PHYS_Walking) ) + return; + + GetAxes(Rotation,X,Y,Z); + if (DodgeMove == DODGE_Forward) + Velocity = 1.5*GroundSpeed*X + (Velocity Dot Y)*Y; + else if (DodgeMove == DODGE_Back) + Velocity = -1.5*GroundSpeed*X + (Velocity Dot Y)*Y; + else if (DodgeMove == DODGE_Left) + Velocity = 1.5*GroundSpeed*Y + (Velocity Dot X)*X; + else if (DodgeMove == DODGE_Right) + Velocity = -1.5*GroundSpeed*Y + (Velocity Dot X)*X; + + Velocity.Z = 160; + PlayOwnedSound(JumpSound, SLOT_Talk, 1.0, true, 800, 1.0 ); + PlayDodge(DodgeMove); + DodgeDir = DODGE_Active; + SetPhysics(PHYS_Falling); + } function PlayerMove( float DeltaTime ) { @@ -4150,53 +4150,53 @@ state PlayerWaiting simulated function PlayTurning() { - BaseEyeHeight = Default.BaseEyeHeight; - if ( (Weapon == None) || (Weapon.Mass < 20) ) - PlayAnim('TurnSM', 0.3, 0.055); - else - PlayAnim('TurnLG', 0.3, 0.055); + BaseEyeHeight = Default.BaseEyeHeight; + if ( (Weapon == None) || (Weapon.Mass < 20) ) + PlayAnim('TurnSM', 0.3, 0.055); + else + PlayAnim('TurnLG', 0.3, 0.055); } simulated function TweenToWalking(float tweentime) { - BaseEyeHeight = Default.BaseEyeHeight; - if (Weapon == None) - LoopAnim('Walk', 1.15, 0.001); - else if ( Weapon.bPointing || (CarriedDecoration != None) ) - { - if (Weapon.Mass < 20) - LoopAnim('WalkSMFR', 1.15, 0.001); - else - LoopAnim('WalkLGFR', 1.15, 0.001); - } - else - { - if (Weapon.Mass < 20) - LoopAnim('WalkSM', 1.15, 0.001); - else - LoopAnim('WalkLG', 1.15, 0.001); - } + BaseEyeHeight = Default.BaseEyeHeight; + if (Weapon == None) + LoopAnim('Walk', 1.15, 0.001); + else if ( Weapon.bPointing || (CarriedDecoration != None) ) + { + if (Weapon.Mass < 20) + LoopAnim('WalkSMFR', 1.15, 0.001); + else + LoopAnim('WalkLGFR', 1.15, 0.001); + } + else + { + if (Weapon.Mass < 20) + LoopAnim('WalkSM', 1.15, 0.001); + else + LoopAnim('WalkLG', 1.15, 0.001); + } } simulated function PlayWalking() { - BaseEyeHeight = Default.BaseEyeHeight; - if (Weapon == None) - LoopAnim('Walk', 1.3, 0.055); - else if ( Weapon.bPointing || (CarriedDecoration != None) ) - { - if (Weapon.Mass < 20) - LoopAnim('WalkSMFR', 1.15, 0.055); - else - LoopAnim('WalkLGFR', 1.15, 0.055); - } - else - { - if (Weapon.Mass < 20) - LoopAnim('WalkSM', 1.15, 0.055); - else - LoopAnim('WalkLG', 1.15, 0.055); - } + BaseEyeHeight = Default.BaseEyeHeight; + if (Weapon == None) + LoopAnim('Walk', 1.3, 0.055); + else if ( Weapon.bPointing || (CarriedDecoration != None) ) + { + if (Weapon.Mass < 20) + LoopAnim('WalkSMFR', 1.15, 0.055); + else + LoopAnim('WalkLGFR', 1.15, 0.055); + } + else + { + if (Weapon.Mass < 20) + LoopAnim('WalkSM', 1.15, 0.055); + else + LoopAnim('WalkLG', 1.15, 0.055); + } } simulated function PlayerPawn GetLocalPlayer() { @@ -4230,80 +4230,80 @@ simulated function PlayDodge(eDodgeDir DodgeMove) simulated function TweenToRunning(float tweentime) { - local vector X,Y,Z, Dir; + local vector X,Y,Z, Dir; - BaseEyeHeight = Default.BaseEyeHeight; - if (bIsWalking) - { - TweenToWalking(0); // 0? yeah, it doesn't matter, check above - return; - } + BaseEyeHeight = Default.BaseEyeHeight; + if (bIsWalking) + { + TweenToWalking(0); // 0? yeah, it doesn't matter, check above + return; + } - GetAxes(Rotation, X,Y,Z); - Dir = Normal(Acceleration); - if ( (Dir Dot X < 0.75) && (Dir != vect(0,0,0)) ) - { - // strafing or backing up - if ( Dir Dot X < -0.75 ) - PlayAnim('BackRun', 1.1, 0.055); - else if ( Dir Dot Y > 0 ) - PlayAnim('StrafeR', 1.1, 0.055); - else - PlayAnim('StrafeL', 1.1, 0.055); - } - else if (Weapon == None) - PlayAnim('RunSM', 1.1, 0.055); - else if ( Weapon.bPointing ) - { - if (Weapon.Mass < 20) - PlayAnim('RunSMFR', 1.1, 0.055); - else - PlayAnim('RunLGFR', 1.1, 0.055); - } - else - { - if (Weapon.Mass < 20) - PlayAnim('RunSM', 1.1, 0.055); - else - PlayAnim('RunLG', 1.1, 0.055); - } + GetAxes(Rotation, X,Y,Z); + Dir = Normal(Acceleration); + if ( (Dir Dot X < 0.75) && (Dir != vect(0,0,0)) ) + { + // strafing or backing up + if ( Dir Dot X < -0.75 ) + PlayAnim('BackRun', 1.1, 0.055); + else if ( Dir Dot Y > 0 ) + PlayAnim('StrafeR', 1.1, 0.055); + else + PlayAnim('StrafeL', 1.1, 0.055); + } + else if (Weapon == None) + PlayAnim('RunSM', 1.1, 0.055); + else if ( Weapon.bPointing ) + { + if (Weapon.Mass < 20) + PlayAnim('RunSMFR', 1.1, 0.055); + else + PlayAnim('RunLGFR', 1.1, 0.055); + } + else + { + if (Weapon.Mass < 20) + PlayAnim('RunSM', 1.1, 0.055); + else + PlayAnim('RunLG', 1.1, 0.055); + } } simulated function PlayRunning() { - local vector X,Y,Z, Dir; + local vector X,Y,Z, Dir; - BaseEyeHeight = Default.BaseEyeHeight; + BaseEyeHeight = Default.BaseEyeHeight; - // determine facing direction - GetAxes(Rotation, X,Y,Z); - Dir = Normal(Acceleration); - if ( (Dir Dot X < 0.75) && (Dir != vect(0,0,0)) ) - { - // strafing or backing up - if ( Dir Dot X < -0.75 ) - LoopAnim('BackRun', 1.1); - else if ( Dir Dot Y > 0 ) - LoopAnim('StrafeR', 1.1); - else - LoopAnim('StrafeL', 1.1); - } - else if (Weapon == None) - LoopAnim('RunSM', 1.1); - else if ( Weapon.bPointing ) - { - if (Weapon.Mass < 20) - LoopAnim('RunSMFR', 1.1); - else - LoopAnim('RunLGFR', 1.1); - } - else - { - if (Weapon.Mass < 20) - LoopAnim('RunSM', 1.1); - else - LoopAnim('RunLG', 1.1); - } + // determine facing direction + GetAxes(Rotation, X,Y,Z); + Dir = Normal(Acceleration); + if ( (Dir Dot X < 0.75) && (Dir != vect(0,0,0)) ) + { + // strafing or backing up + if ( Dir Dot X < -0.75 ) + LoopAnim('BackRun', 1.1); + else if ( Dir Dot Y > 0 ) + LoopAnim('StrafeR', 1.1); + else + LoopAnim('StrafeL', 1.1); + } + else if (Weapon == None) + LoopAnim('RunSM', 1.1); + else if ( Weapon.bPointing ) + { + if (Weapon.Mass < 20) + LoopAnim('RunSMFR', 1.1); + else + LoopAnim('RunLGFR', 1.1); + } + else + { + if (Weapon.Mass < 20) + LoopAnim('RunSM', 1.1); + else + LoopAnim('RunLG', 1.1); + } } function xxServerSetReadyToPlay() @@ -4612,20 +4612,20 @@ state Dying simulated function BeginState() { local bbPlayer bbP; - local float LKT; + local float LKT; bClientIsWalking = false; - bJumpStatus = false; + bJumpStatus = false; bIsAlive = false; - zzIgnoreUpdateUntil = 0; - if (zzClientTTarget != None) - zzClientTTarget.Destroy(); + zzIgnoreUpdateUntil = 0; + if (zzClientTTarget != None) + zzClientTTarget.Destroy(); - LKT = LastKillTime; - Super.BeginState(); - LastKillTime = LKT; - TimeDead = 0.0; - RealTimeDead = 0.0; + LKT = LastKillTime; + Super.BeginState(); + LastKillTime = LKT; + TimeDead = 0.0; + RealTimeDead = 0.0; } function PlayerMove(float DeltaTime) @@ -5060,7 +5060,7 @@ function xxDoShot() simulated function bool ClientCannotShoot(optional Weapon W, optional byte Mode, optional bool bIgnoreFireTime) { - local bool bCant; + local bool bCant; local float Diff; local name WeapState; @@ -5090,7 +5090,7 @@ simulated function bool ClientCannotShoot(optional Weapon W, optional byte Mode, else bCant = true; } - else if (Weapon.IsInState('ClientDown')) + else if (Weapon.IsInState('ClientDown')) { bCant = true; } @@ -5106,7 +5106,7 @@ simulated function bool ClientCannotShoot(optional Weapon W, optional byte Mode, else bCant = true; } - if (IsInState('Dying')) + if (IsInState('Dying')) { bCant = true; } @@ -5218,10 +5218,10 @@ simulated function xxCheckForKickers() static function setForcedSkin(Actor SkinActor, int selectedSkin, bool bTeamGame, int TeamNum) { local string suffix; /** - * @Author: spect - * @Date: 2020-02-21 01:17:00 - * @Desc: Sets the selected forced skin client side - */ + * @Author: spect + * @Date: 2020-02-21 01:17:00 + * @Desc: Sets the selected forced skin client side + */ if (selectedSkin > 17) selectedSkin = 12; @@ -5426,8 +5426,8 @@ event PreRender( canvas zzCanvas ) if (zzPRI == None) continue; if (zzPRI != PlayerReplicationInfo && - (!GameReplicationInfo.bTeamGame || zzPRI.Team != PlayerReplicationInfo.Team) - ) { + (!GameReplicationInfo.bTeamGame || zzPRI.Team != PlayerReplicationInfo.Team) + ) { zzPRI.PlayerLocation = PlayerReplicationInfo.PlayerLocation; zzPRI.PlayerZone = None; } @@ -5586,7 +5586,7 @@ simulated function xxClientAcceptMutator(string zzClass, float zzv) for (zzi2 = 0; zzi2 < zzHMCnt; zzi2++) // Check if HUDMut is already in { if (zzHudMutes[zzi2] != None && - string(zzHudMutes[zzi2].Class) == zzClass) + string(zzHudMutes[zzi2].Class) == zzClass) { zzHudMutes[zzi2].Destroy(); break; @@ -5811,7 +5811,7 @@ simulated function xxAttachConsole() } else { - zzbBadConsole = zzTrue; + zzbBadConsole = zzTrue; } } } @@ -6002,23 +6002,23 @@ static function bool xxValidSP(string zzSkinName, string zzMeshName, optional Ac //Attempt to use XC_Engine natives if ( bbPlayer(SkinActor) != none && SkinActor.Role == ROLE_Authority ) { - XC_Version = int(SkinActor.ConsoleCommand("get ini:Unreali.SkaarjPlayer XC_Version")); - if ( XC_Version >= 13 ) - { - if ( !bbPlayer(SkinActor).IsInPackageMap( zzPackName, true) ) - return false; - return (Left(zzPackName, Len(zzMeshName)) ~= zzMeshName && !(Right(zzSkinName,2) ~= "t_")); - } + XC_Version = int(SkinActor.ConsoleCommand("get ini:Unreali.SkaarjPlayer XC_Version")); + if ( XC_Version >= 13 ) + { + if ( !bbPlayer(SkinActor).IsInPackageMap( zzPackName, true) ) + return false; + return (Left(zzPackName, Len(zzMeshName)) ~= zzMeshName && !(Right(zzSkinName,2) ~= "t_")); + } } //Extra pass before potentially crash code if ( zzPackName ~= "BOTPACK" || zzPackName ~= "UNREALI" || zzPackName ~= "UNREALSHARE" || zzPackName ~= "INSTAGIBPLUS") - return false; + return false; if (Default.zzMyPacks == "") Default.zzMyPacks = Caps(SkinActor.ConsoleCommand("get ini:engine.engine.gameengine serverpackages")); //Can still crash a server if ( Instr(Default.zzMyPacks, Chr(34)$zzPackName$Chr(34)) == -1 ) return false; - return (Left(zzPackName, Len(zzMeshName)) ~= zzMeshName && !(Right(zzSkinName,2) ~= "t_")); + return (Left(zzPackName, Len(zzMeshName)) ~= zzMeshName && !(Right(zzSkinName,2) ~= "t_")); } function xxSet(string zzS, byte zzNetMode) @@ -7148,7 +7148,7 @@ exec function TeamSay( string Msg ) } else if (cmd ~= "%P" && GameReplicationInfo.IsA('CTFReplicationInfo')) //CTF only { - // Figure out Posture. + // Figure out Posture. for (zzi=0; zzi < 4; zzi++) { @@ -7333,9 +7333,9 @@ simulated function xxClientDemoBolt(Actor A, optional Vector V, optional Rotator xxGetDemoPlaybackSpec(); if (A == none) return; - A.SetLocation(V); - A.SetRotation(R); - PBolt(A).CheckBeam(X, Delta); + A.SetLocation(V); + A.SetRotation(R); + PBolt(A).CheckBeam(X, Delta); } // AUTODEMO CODE @@ -7743,8 +7743,8 @@ defaultproperties sHitSound(1)="UnrealShare.StingerFire" cShockBeam=1 BeamScale=0.45 - BeamFadeCurve=4 - BeamDuration=0.75 + BeamFadeCurve=4 + BeamDuration=0.75 bIsFinishedLoading=False bDrawDebugData=False DesiredNetUpdateRate=100.0 From 993d60e894dd37ab8b29ba2fc5eac6d1b0bf1b46 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Thu, 30 Jul 2020 22:05:08 +0200 Subject: [PATCH 24/70] UndoExtrapolation can now reset to more locations --- Classes/bbPlayer.uc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index bfcb4f3a..e7db7174 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1418,9 +1418,26 @@ function xxSetPendingWeapon(Weapon W) } function UndoExtrapolation() { + local vector OldLoc; + local Decoration Carried; if (bExtrapolatedLastUpdate) { bExtrapolatedLastUpdate = false; - xxNewMoveSmooth(SavedLocation); + + if (xxNewMoveSmooth(SavedLocation) == false && OtherPawnAtLocation(SavedLocation) == false) { + Carried = CarriedDecoration; + OldLoc = Location; + + bCanTeleport = false; + xxNewSetLocation(SavedLocation, SavedVelocity); + bCanTeleport = true; + + if (Carried != None) { + CarriedDecoration = Carried; + CarriedDecoration.SetLocation(SavedLocation + CarriedDecoration.Location - OldLoc); + CarriedDecoration.SetPhysics(PHYS_None); + CarriedDecoration.SetBase(self); + } + } Velocity = SavedVelocity; Acceleration = SavedAcceleration; } From d70614a14fb4943310a21500e369c4e4c9b2d6cb Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Thu, 30 Jul 2020 22:06:36 +0200 Subject: [PATCH 25/70] Track average DeltaTime over the last roughly 100 Ticks --- Classes/bbPlayer.uc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index e7db7174..68d10380 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -289,6 +289,7 @@ var float EyeHeightOffset; var globalconfig bool bUseOldMouseInput; var transient float TurnFractionalPart, LookUpFractionalPart; +var float AverageServerDeltaTime; var float TimeDead; var float RealTimeDead; var Pawn LastKiller; @@ -3592,7 +3593,9 @@ simulated function CheckHitSound() PlayTeamHitSound(0); } -event ServerTick(float DeltaTime); +event ServerTick(float DeltaTime) { + AverageServerDeltaTime = (AverageServerDeltaTime*99 + DeltaTime) * 0.01; +} /** STATES * @Author: spect @@ -4066,6 +4069,8 @@ ignores SeePlayer, HearNoise, Bump; MoveAutonomous(ExtrapolationDelta, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); } ExtrapolationDelta *= Exp(-0.25 * DeltaTime); + + global.ServerTick(DeltaTime); } event PlayerTick( float DeltaTime ) From fa06136c74fdea1dc35002ed05c71d79d70d1849 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Thu, 30 Jul 2020 22:08:25 +0200 Subject: [PATCH 26/70] Estimate who shot first and guarantee kill for whoever shot first --- Classes/bbPlayer.uc | 51 ++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 68d10380..b0512d79 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -4563,25 +4563,38 @@ state PlayerWaking state Dying { - exec function Fire( optional float F ) - { - if (Level.NetMode == NM_DedicatedServer && Role == ROLE_Authority) { - bJustFired = true; - if( bShowMenu || (Level.Pauser != "") ) - { - if ( !bShowMenu && (Level.Pauser == PlayerReplicationInfo.PlayerName) ) - SetPause(False); - return; - } - if( Weapon != None && RealTimeDead < class'UTPure'.default.MaxTradeTimeMargin) - { - Weapon.bPointing = true; - Weapon.Fire(F); - } - } else { - super.Fire(F); - } - } + exec function Fire( optional float F ) + { + local float TradeTimeMargin; + if ((Level.NetMode == NM_DedicatedServer) || + (Level.NetMode == NM_ListenServer && RemoteRole == ROLE_AutonomousProxy) + ) { + bJustFired = true; + if( bShowMenu || (Level.Pauser != "") ) + { + if ( !bShowMenu && (Level.Pauser == PlayerReplicationInfo.PlayerName) ) + SetPause(False); + return; + } + if( Weapon != None) { + TradeTimeMargin = class'UTPure'.default.MaxTradeTimeMargin; + if (bbPlayer(zzNN_HitActor) != none) { + TradeTimeMargin = FMin( + TradeTimeMargin, + (AverageServerDeltaTime/Level.TimeDilation + + 0.001 * (PlayerReplicationInfo.Ping - bbPlayer(zzNN_HitActor).PlayerReplicationInfo.Ping)) + ); + } + if (RealTimeDead < TradeTimeMargin) + { + Weapon.bPointing = true; + Weapon.Fire(F); + } + } + } else { + super.Fire(F); + } + } function ServerReStartPlayer() { From f24369c713601dc623583cbba58876cabe5646d4 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Fri, 31 Jul 2020 07:57:57 +0200 Subject: [PATCH 27/70] Fix OtherPawnAtLocation --- Classes/bbPlayer.uc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index b0512d79..3839b6e6 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1820,19 +1820,19 @@ function xxServerMove( } function bool OtherPawnAtLocation(vector Loc) { - local bbPlayer P; + local Pawn P; local vector RadiusDelta; local float HeightDelta; - foreach RadiusActors(class'bbPlayer', P, 2*(CollisionRadius+CollisionHeight)) { + foreach RadiusActors(class'Pawn', P, 2*(CollisionRadius+CollisionHeight)) { if (P == self) continue; if (P.Health <= 0) continue; RadiusDelta = vect(1,1,0) * (P.Location - Loc); - if ((RadiusDelta dot RadiusDelta) > CollisionRadius * CollisionRadius) continue; + if (VSize(RadiusDelta) >= 2*CollisionRadius) continue; HeightDelta = P.Location.Z - Loc.Z; - if (Abs(HeightDelta) > CollisionHeight) continue; + if (Abs(HeightDelta) >= 2*CollisionHeight) continue; return true; } From 774b4b3b78225bf26bd69cb9c33542af87b96ebe Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Fri, 31 Jul 2020 07:59:56 +0200 Subject: [PATCH 28/70] Capture Extrapolated Position with xxRememberPosition --- Classes/bbPlayer.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 3839b6e6..745ed495 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1816,7 +1816,6 @@ function xxServerMove( zzLastClientErr = 0; } xxFakeCAP(TimeStamp); - xxRememberPosition(); } function bool OtherPawnAtLocation(vector Loc) { @@ -3595,6 +3594,7 @@ simulated function CheckHitSound() event ServerTick(float DeltaTime) { AverageServerDeltaTime = (AverageServerDeltaTime*99 + DeltaTime) * 0.01; + xxRememberPosition(); } /** STATES From 16c26aa295264fa94e12868e74203d4640201e6f Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Fri, 31 Jul 2020 08:00:20 +0200 Subject: [PATCH 29/70] Clean up Combo code in SSR --- Classes/ST_SuperShockRifle.uc | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/Classes/ST_SuperShockRifle.uc b/Classes/ST_SuperShockRifle.uc index 2197e065..169a8069 100644 --- a/Classes/ST_SuperShockRifle.uc +++ b/Classes/ST_SuperShockRifle.uc @@ -376,22 +376,6 @@ function TraceFire( float Accuracy ) bbP.zzNN_HitActor = None; NN_Other = bbP.zzNN_HitActor; - bbPP = bbPlayer(NN_Other); - bShockCombo = bbP.zzbNN_Special && (NN_Other == None || NN_ShockProjOwnerHidden(NN_Other) != None && NN_Other.Owner != Owner); - - if (bShockCombo && NN_Other == None) - { - ForEach AllActors(class'NN_ShockProjOwnerHidden', NNSP) - if (NNSP.zzNN_ProjIndex == bbP.zzNN_ProjIndex) - NN_Other = NNSP; - - if (NN_Other == None) - NN_Other = Spawn(class'NN_ShockProjOwnerHidden', Owner,, bbP.zzNN_HitLoc); - else - NN_Other.SetLocation(bbP.zzNN_HitLoc); - - bbP.zzNN_HitActor = NN_Other; - } Owner.MakeNoise(bbP.SoundDampening); GetAxes(bbP.zzNN_ViewRot,X,Y,Z); @@ -453,21 +437,7 @@ function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vect zzSmokeOffset = CalcDrawOffset() + (FireOffset.X + 20) * X + FireOffset.Y * Y + FireOffset.Z * Z; SpawnEffect(HitLocation, Owner.Location + zzSmokeOffset); - if ( NN_ShockProjOwnerHidden(Other)!=None ) - { - Other.SetOwner(Owner); - NN_ShockProjOwnerHidden(Other).SuperDuperExplosion(); - return; - } - else if ( ST_ShockProj(Other)!=None ) - { - ST_ShockProj(Other).SuperDuperExplosion(); - return; - } - else - { - Spawn(class'NN_UT_Superring2OwnerHidden',Owner,, HitLocation+HitNormal*8,rotator(HitNormal)); - } + Spawn(class'NN_UT_Superring2OwnerHidden',Owner,, HitLocation+HitNormal*8,rotator(HitNormal)); if ( (Other != self) && (Other != Owner) && (Other != None) ) { From 7808b1e99a4305e75ce94d9491a20bea79dcc8e5 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Fri, 31 Jul 2020 08:01:10 +0200 Subject: [PATCH 30/70] Use code similar to that of xxServerMove for undoing extrapolation --- Classes/bbPlayer.uc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 745ed495..e0adbe02 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1424,7 +1424,9 @@ function UndoExtrapolation() { if (bExtrapolatedLastUpdate) { bExtrapolatedLastUpdate = false; - if (xxNewMoveSmooth(SavedLocation) == false && OtherPawnAtLocation(SavedLocation) == false) { + if (FastTrace(SavedLocation)) { + xxNewMoveSmooth(SavedLocation); + } else { Carried = CarriedDecoration; OldLoc = Location; From 8d3a5b686e23582781ebb10e1b98213a59b0563e Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Fri, 31 Jul 2020 08:01:43 +0200 Subject: [PATCH 31/70] Use Default Settings Variable --- Classes/bbPlayer.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index e0adbe02..8cf03c29 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1659,8 +1659,8 @@ function xxServerMove( SimStep = DeltaTime / float(MergeCount + 1); - if (SimStep < (1.0 / zzUTPure.MaxNetUpdateRate)) { - MergeCount = int(DeltaTime * zzUTPure.MaxNetUpdateRate * 0.5); + if (SimStep < (1.0 / class'UTPure'.default.MaxNetUpdateRate)) { + MergeCount = int(DeltaTime * class'UTPure'.default.MaxNetUpdateRate * 0.5); SimStep = DeltaTime / float(MergeCount + 1); } From 697c1d3a1e0c291b9a21ca20295b3dce6d9b2464 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Fri, 31 Jul 2020 19:46:57 +0200 Subject: [PATCH 32/70] Remove unused variable --- Classes/bbPlayer.uc | 2 -- 1 file changed, 2 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 8cf03c29..e65e7f45 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -256,7 +256,6 @@ var bool MMSupport; var bool SetPendingWeapon; // Net Updates -var float MaxPosErrorFactor; var float TimeBetweenNetUpdates; var float ExtrapolationDelta; var bool bExtrapolatedLastUpdate; @@ -541,7 +540,6 @@ event PostBeginPlay() } SetPendingWeapon = class'UTPure'.Default.SetPendingWeapon; - MaxPosErrorFactor = class'UTPure'.default.MaxJitterTime * class'UTPure'.default.MaxJitterTime; PlayerReplicationInfo.NetUpdateFrequency = 10; } From 100ec8adc252492db10cba6e2c70061253d56b22 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 1 Aug 2020 00:01:51 +0200 Subject: [PATCH 33/70] Add documentation for server settings --- README.md | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/README.md b/README.md index 25e0852d..ec303668 100644 --- a/README.md +++ b/README.md @@ -58,3 +58,127 @@ As spectator, you may need to add 'mutate pure' + command (mutate pureshowtickra Deaod - For the support and pointers when I got stuck, without him I don't think I could've finished this so fast.
UT99 Community - For their endless patience, support and help testing and reporting bugs.
Epic - For not open sourcing a 20 year old game running on their 20 year old engine. + +# Settings + +## Server Settings +Server settings can be found inside InstaGibPlus.ini. + +### HeadshotDamage (float, default: 100) +Controls how much damage a headshot with the sniper rifle deals. +### SniperSpeed (float, default: 1) +Controls sniper rifle reload time, higher values lead to less time between shots. +### SniperDamagePri (float, default: 60) +Controls damage of body hits by sniper rifle. +### SetPendingWeapon (bool, default: False) +??? +### NNAnnouncer (bool, default: False) +Whether to automatically add an announcer for multi-kills, or not. +### bUTPureEnabled (bool, default: True) +Big switch to enable/disable IG+. +### Advertise (int, default: 1) +Controls whether to add a tag to the server's name. +- `1` - Add tag at the beginning of the server's name +- `2` - Add tag at the end of the server's name +- anything else - Dont advertise +### AdvertiseMsg (int, default: 1) +Controls the tag to add to the server's name +- `0` - `[CSHP]` +- `1` - `[IG+]` +- anything else - `[PWND]` +### bAllowCenterView (bool, default: False) +Whether to allow use of the bSnapLevel button or not. +### CenterViewDelay (float, default: 1) +If bAllowCenterView is True, controls how much time has to pass between uses of bSnapLevel. +### bAllowBehindView (bool, default: False) +Whether to allow 3rd Person perspective or not. +### TrackFOV (int, default: 0) +Controls how strictly the FOV is checked. +- `1` - very strict, no zooming with sniper +- `2` - looser, zooming with sniper possible +- anything else - no restrictions +### bAllowMultiWeapon (bool, default: False) +Whether to allow the multi-weapon bug to be (ab)used +### bFastTeams (bool, default: True) +Whether to allow the use of `mutate FixTeams`, `mutate NextTeam`, and `mutate ChangeTeam ` or not. `True` enables the use of these commands, `False` disables. +### bUseClickboard (bool, default: True) +Enables a set of alternative scoreboards that show the ready-status for players before the match has started. +### MinClientRate (int, default: 10000) +The server will force clients to use at least this netspeed. +### bAdvancedTeamSay (bool, default: True) +Whether to allow the use of advanced TeamSay or not. +Advanced TeamSay allows showing game-information in your chat messages, by replacing the following with the corresponding information: +- `%H` -> " Health" +- `%h` -> "%" +- `%W` -> "" or "Empty hands" +- `%A` -> "Shieldbelt and Armor" or " Armor" +- `%a` -> "SB A" or "A" +- `%P`, `%p` -> Current CTF objective +### ForceSettingsLevel (int, default: 2) +When to check that default settings for all objects are correct client-side. +- `0` and below -> never +- `1` -> once after PostNetBeginPlay +- `2` -> in addition, every time a new object is spawned +- `3` and above -> in addition, once every 5000 server-ticks on average +### bNoLockdown (bool, default: True) +Whether to have lockdown when players get hit by mini/pulse or not. +- `True` -> don't allow lockdown +- `False` -> allow lockdown +### bWarmup (bool, default: True) +Whether to allow warmup in tournament games or not. +### bCoaches (bool, default: False) +Whether to allow spectators to coach teams in tournament games or not. +### bAutoPause (bool, default: True) +Whether to automatically pause the game in tournament games or not. +### ForceModels (int, default: 1) +Force models mode. +- `1` -> Client controlled +- `2` -> Forced on +- anything else -> Disabled +### ImprovedHUD (int, default: 1) +Enable various HUD improvements. Depends on PureClickBoard mutator (set [bUseClickboard](#buseclickboard) to `True`, or add mutator through configuration). +- `1` -> Show boots, Clock +- `2` -> In addition, show enhanced team info +- anything else -> dont show anything +### bDelayedPickupSpawn (bool, default: False) +Enable or disable delayed first pickup spawn. +### bTellSpectators (bool, default: False) +Enable or disable telling spectators of reason for kicks. +### PlayerPacks (string\[8\], default: Empty) +Config list of supported player packs +### DefaultHitSound (int, default: 2) +HitSound for enemy damage to use when forcing clients (see [bForceDefaultHitSounds](bforcedefaulthitsounds)). +### DefaultTeamHitSound (int, default: 3) +HitSound for friendly fire to use when forcing clients (see [bForceDefaultHitSounds](bforcedefaulthitsounds)). +### bForceDefaultHitSounds (bool, default: False) +Force clients to use a specific HitSound. +### TeleRadius (int, default: 210) +Radius within which to telefrag enemies using translocator. +### ThrowVelocity (int, default: 750) +Horizontal speed with which to throw weapons. +### bForceDemo (bool, default: False) +Forces clients to do demos. +### MinPosError (float, default: 100) +Unused. Intended to be minimum squared distance error for updating clients. +### MaxPosError (float, default: 3000) +Unused. Intended to be maximum squared distance error for updating clients. +### MaxHitError (float, default: 10000) +Distance to any position over the last 500ms for hits to be counted. +### ShowTouchedPackage (bool, default: False) +Send package-names of touched actors to clients when those clients touch the actors. +### ExcludeMapsForKickers (string\[128\], default: Empty) +List of map names (with or without .unr) for maps that should not have their Kickers replaced with NN_Kickers. +### MaxJitterTime (float, default 0.1) +Maximum time between updates by clients that's tolerated by IG+. If a client exceeds this time and [bEnableJitterBounding](#benablejitterbounding) is `True` an update is generated for the client. Guideline setting is half the maximum supported ping. +### MinNetUpdateRate (float, default: 60) +Minimum frequency of client updates for server. +### MaxNetUpdateRate (float, default: 250) +Maximum frequency of client updates for server. +### MaxClientRate (int, default: 25000) +Maximum netspeed allowed for clients. +### MaxTradeTimeMargin (float, default: 0.1) +Maximum time after death (on server) that players can still fire their weapons. +### bEnableServerExtrapolation (bool, default: True) +If enabled the server will extrapolate client movement when the client's movement updates are too far behind the server's timepoint. +### bEnableJitterBounding (bool, default: True) +If enabled the server will generate movement updates for clients that havent sent updates in a while. \ No newline at end of file From b8d657a8a0a1c5d436818330e18ca95328d49c44 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 1 Aug 2020 00:09:29 +0200 Subject: [PATCH 34/70] Adjust default MaxJitterTime --- Classes/UTPure.uc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/UTPure.uc b/Classes/UTPure.uc index 44e15b9d..6e287caf 100644 --- a/Classes/UTPure.uc +++ b/Classes/UTPure.uc @@ -1405,11 +1405,11 @@ defaultproperties MinPosError=100 MaxPosError=3000 MaxHitError=10000 - MaxJitterTime=0.040 + MaxJitterTime=0.1 MinNetUpdateRate=60.0 MaxNetUpdateRate=250.0 ShowTouchedPackage=False MaxTradeTimeMargin=0.1 - bEnableServerExtrapolation=true - bEnableJitterBounding=true + bEnableServerExtrapolation=True + bEnableJitterBounding=True } From 7ea0942fb12ccd43ff361004c5dee55f219736b1 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 1 Aug 2020 00:11:56 +0200 Subject: [PATCH 35/70] Fix links --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ec303668..7e81617b 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ Force models mode. - `2` -> Forced on - anything else -> Disabled ### ImprovedHUD (int, default: 1) -Enable various HUD improvements. Depends on PureClickBoard mutator (set [bUseClickboard](#buseclickboard) to `True`, or add mutator through configuration). +Enable various HUD improvements. Depends on PureClickBoard mutator (set [bUseClickboard](#buseclickboard-bool-default-true) to `True`, or add mutator through configuration). - `1` -> Show boots, Clock - `2` -> In addition, show enhanced team info - anything else -> dont show anything @@ -147,9 +147,9 @@ Enable or disable telling spectators of reason for kicks. ### PlayerPacks (string\[8\], default: Empty) Config list of supported player packs ### DefaultHitSound (int, default: 2) -HitSound for enemy damage to use when forcing clients (see [bForceDefaultHitSounds](bforcedefaulthitsounds)). +HitSound for enemy damage to use when forcing clients (see [bForceDefaultHitSounds](bforcedefaulthitsounds-bool-default-false)). ### DefaultTeamHitSound (int, default: 3) -HitSound for friendly fire to use when forcing clients (see [bForceDefaultHitSounds](bforcedefaulthitsounds)). +HitSound for friendly fire to use when forcing clients (see [bForceDefaultHitSounds](bforcedefaulthitsounds-bool-default-false)). ### bForceDefaultHitSounds (bool, default: False) Force clients to use a specific HitSound. ### TeleRadius (int, default: 210) @@ -169,7 +169,7 @@ Send package-names of touched actors to clients when those clients touch the act ### ExcludeMapsForKickers (string\[128\], default: Empty) List of map names (with or without .unr) for maps that should not have their Kickers replaced with NN_Kickers. ### MaxJitterTime (float, default 0.1) -Maximum time between updates by clients that's tolerated by IG+. If a client exceeds this time and [bEnableJitterBounding](#benablejitterbounding) is `True` an update is generated for the client. Guideline setting is half the maximum supported ping. +Maximum time between updates by clients that's tolerated by IG+. If a client exceeds this time and [bEnableJitterBounding](#benablejitterbounding-bool-default-true) is `True` an update is generated for the client. Guideline setting is half the maximum supported ping. ### MinNetUpdateRate (float, default: 60) Minimum frequency of client updates for server. ### MaxNetUpdateRate (float, default: 250) From ccfad14fa4c73ad039285626cc3022ebdbb727fb Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 1 Aug 2020 00:12:35 +0200 Subject: [PATCH 36/70] More link fixing --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7e81617b..2ca376e0 100644 --- a/README.md +++ b/README.md @@ -147,9 +147,9 @@ Enable or disable telling spectators of reason for kicks. ### PlayerPacks (string\[8\], default: Empty) Config list of supported player packs ### DefaultHitSound (int, default: 2) -HitSound for enemy damage to use when forcing clients (see [bForceDefaultHitSounds](bforcedefaulthitsounds-bool-default-false)). +HitSound for enemy damage to use when forcing clients (see [bForceDefaultHitSounds](#bforcedefaulthitsounds-bool-default-false)). ### DefaultTeamHitSound (int, default: 3) -HitSound for friendly fire to use when forcing clients (see [bForceDefaultHitSounds](bforcedefaulthitsounds-bool-default-false)). +HitSound for friendly fire to use when forcing clients (see [bForceDefaultHitSounds](#bforcedefaulthitsounds-bool-default-false)). ### bForceDefaultHitSounds (bool, default: False) Force clients to use a specific HitSound. ### TeleRadius (int, default: 210) From 966a7aa35e45d74be06062df98fd16a0ffdd5988 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 2 Aug 2020 02:21:21 +0200 Subject: [PATCH 37/70] Prepare 3H --- Classes/UTPure.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/UTPure.uc b/Classes/UTPure.uc index 6e287caf..6ad605fe 100644 --- a/Classes/UTPure.uc +++ b/Classes/UTPure.uc @@ -1397,8 +1397,8 @@ defaultproperties ConsoleName="InstaGib+ Console" VersionStr="InstaGib+ Final" LongVersion="RC " - ThisVer="3G" - NiceVer="3G" + ThisVer="3H" + NiceVer="3H" BADminText="Not allowed - Log in as admin!" bAlwaysTick=True NNAnnouncer=True From 13a8ad4262e2d67709133b255540e552e6cdad22 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 2 Aug 2020 21:18:48 +0200 Subject: [PATCH 38/70] IG and SA are mutators, not gamemodes --- Classes/ST_Mutator.uc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Classes/ST_Mutator.uc b/Classes/ST_Mutator.uc index f6472236..4cc7a6db 100644 --- a/Classes/ST_Mutator.uc +++ b/Classes/ST_Mutator.uc @@ -320,9 +320,7 @@ function ModifyPlayer(Pawn Other) function bool AlwaysKeep(Actor Other) { - if (((Level.Game.IsA('NewNetIG') || Level.Game.IsA('NewNetTG') - || Level.Game.IsA('NewNetSDOM')) && Other.IsA('NN_Armor2') - || Other.IsA('NN_ThighPads'))) + if (Level.Game.IsA('NewNetSDOM') && (Other.IsA('NN_Armor2') || Other.IsA('NN_ThighPads'))) return true; return Super.AlwaysKeep(Other); @@ -330,9 +328,7 @@ function bool AlwaysKeep(Actor Other) function bool CheckReplacement(Actor Other, out byte bSuperRelevant) { - if (Level.Game.IsA('NewNetIG') || - Level.Game.IsA('NewNetTG') || - Level.Game.IsA('NewNetSDOM')) + if (Level.Game.IsA('NewNetSDOM')) { if ( Other.IsA('Armor2') || Other.IsA('Armor') ) { From 65d0784c912727cfe7f426f6809dffe8e0ed9411 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 2 Aug 2020 21:19:10 +0200 Subject: [PATCH 39/70] Fix PreFix determination --- Classes/ST_Mutator.uc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/ST_Mutator.uc b/Classes/ST_Mutator.uc index 4cc7a6db..4009c975 100644 --- a/Classes/ST_Mutator.uc +++ b/Classes/ST_Mutator.uc @@ -332,11 +332,11 @@ function bool CheckReplacement(Actor Other, out byte bSuperRelevant) { if ( Other.IsA('Armor2') || Other.IsA('Armor') ) { - ReplaceWith( Other, Prefix$"NN_Armor2" ); + ReplaceWith( Other, PreFix$"NN_Armor2" ); return false; } else if ( Other.IsA('ThighPads') || Other.IsA('KevlarSuit') ) { - ReplaceWith( Other, Prefix$"NN_ThighPads" ); + ReplaceWith( Other, PreFix$"NN_ThighPads" ); return false; } } @@ -378,8 +378,9 @@ function PreBeginPlay() DMP.BotConfig = Spawn(DMP.BotConfigType); } bTranslocatorGame = DMP.bUseTranslocator; - SelfName = string(self); + SelfName = string(self.Class); PreFix = Left(SelfName, InStr(SelfName, ".") + 1); + Log("ST_Mutator determined prefix="$PreFix, 'IGPlus'); /* Level.Game.RegisterMessageMutator(Self); Class'bbCHSpectator'.Default.cStat = Class'ST_PureStatsSpec'; */ Super.PreBeginPlay(); @@ -477,6 +478,5 @@ function bool ReplaceWith(actor Other, string aClassName) defaultproperties { - Prefix="UN" DefaultWeapon=Class'ST_ImpactHammer' } \ No newline at end of file From 8f64fb8c8e664c3a0ceb7d462220f0c8462f879f Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 2 Aug 2020 21:19:32 +0200 Subject: [PATCH 40/70] Fix lagging on bouncers --- Classes/bbPlayer.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index e65e7f45..b1c4d721 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -438,7 +438,7 @@ simulated function Touch( actor Other ) ClientMessage(Package); } - if (Other.IsA('Kicker') && Other.Class.Name != 'Kicker') { + if (Other.IsA('Kicker') && Other.Class.Name != 'NN_Kicker' && Other.Class.Name != 'Kicker') { zzForceUpdateUntil = Level.TimeSeconds + 0.15 + float(Other.GetPropertyText("ToggleTime")); zzbForceUpdate = true; } From ce2b921c4b3c2897a79f9ff3677f0fad07a4f753 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 3 Aug 2020 10:38:22 +0200 Subject: [PATCH 41/70] Make trading restrictions work --- Classes/bbPlayer.uc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index b1c4d721..0a5ee5b4 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1979,15 +1979,13 @@ exec function Fire( optional float F ) } xxEnableCarcasses(); - if (!bNewNet || !xxWeaponIsNewNet()) - { + if (!bNewNet || !xxWeaponIsNewNet()) { if (xxCanFire()) Super.Fire(F); - } - else if (Role < ROLE_Authority) - { + } else if (Role < ROLE_Authority) Weapon.ClientFire(1); - } + else + Super.Fire(F); xxDisableCarcasses(); } @@ -2027,7 +2025,7 @@ function xxNN_Fire( int ProjIndex, vector ClientLoc, vector ClientVel, rotator V } else if (xxCanFire()) { - Super.Fire(1); + Fire(1); } zzNN_HitActor = None; zzbNN_Special = false; @@ -4582,7 +4580,7 @@ state Dying TradeTimeMargin = FMin( TradeTimeMargin, (AverageServerDeltaTime/Level.TimeDilation + - 0.001 * (PlayerReplicationInfo.Ping - bbPlayer(zzNN_HitActor).PlayerReplicationInfo.Ping)) + 0.0005 * (PlayerReplicationInfo.Ping - bbPlayer(zzNN_HitActor).PlayerReplicationInfo.Ping)) ); } if (RealTimeDead < TradeTimeMargin) @@ -4624,6 +4622,14 @@ state Dying } + event ServerTick(float DeltaTime) { + RealTimeDead += (DeltaTime / Level.TimeDilation); // counting real time, undo dilation + if (Level.Pauser == "") + TimeDead += DeltaTime; + + global.ServerTick(DeltaTime); + } + event PlayerTick( float DeltaTime ) { local rotator TargetRotation, DeltaRotation; From a3557e9eb8701af6455912c546108a1c149d692d Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 5 Aug 2020 11:04:28 +0200 Subject: [PATCH 42/70] Shuffle Path that Fire() takes Server-side --- Classes/bbPlayer.uc | 51 +++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 0a5ee5b4..ed78b875 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1993,6 +1993,7 @@ function xxNN_Fire( int ProjIndex, vector ClientLoc, vector ClientVel, rotator V { local ImpactHammer IH; local bbPlayer bbP; + local float TradeTimeMargin; if (!bNewNet || !xxWeaponIsNewNet() || Role < ROLE_Authority) return; @@ -2025,7 +2026,22 @@ function xxNN_Fire( int ProjIndex, vector ClientLoc, vector ClientVel, rotator V } else if (xxCanFire()) { - Fire(1); + if (IsInState('Dying')) { + TradeTimeMargin = class'UTPure'.default.MaxTradeTimeMargin; + if (bbPlayer(LastKiller) != none) { + TradeTimeMargin = FMin( + TradeTimeMargin, + (AverageServerDeltaTime/Level.TimeDilation + + 0.0005 * (PlayerReplicationInfo.Ping - bbPlayer(LastKiller).PlayerReplicationInfo.Ping)) + ); + } + if (RealTimeDead < TradeTimeMargin) { + Log("["$Level.TimeSeconds$"] Traded! TradeTimeMargin="$TradeTimeMargin@"RealTimeDead="$RealTimeDead, 'IGPlus'); + Super.Fire(1); + } + } else { + Super.Fire(1); + } } zzNN_HitActor = None; zzbNN_Special = false; @@ -4561,39 +4577,6 @@ state PlayerWaking state Dying { - exec function Fire( optional float F ) - { - local float TradeTimeMargin; - if ((Level.NetMode == NM_DedicatedServer) || - (Level.NetMode == NM_ListenServer && RemoteRole == ROLE_AutonomousProxy) - ) { - bJustFired = true; - if( bShowMenu || (Level.Pauser != "") ) - { - if ( !bShowMenu && (Level.Pauser == PlayerReplicationInfo.PlayerName) ) - SetPause(False); - return; - } - if( Weapon != None) { - TradeTimeMargin = class'UTPure'.default.MaxTradeTimeMargin; - if (bbPlayer(zzNN_HitActor) != none) { - TradeTimeMargin = FMin( - TradeTimeMargin, - (AverageServerDeltaTime/Level.TimeDilation + - 0.0005 * (PlayerReplicationInfo.Ping - bbPlayer(zzNN_HitActor).PlayerReplicationInfo.Ping)) - ); - } - if (RealTimeDead < TradeTimeMargin) - { - Weapon.bPointing = true; - Weapon.Fire(F); - } - } - } else { - super.Fire(F); - } - } - function ServerReStartPlayer() { if ( Level.NetMode == NM_Client || bFrozen && (TimerRate>0.0) ) From bef73516f320a79fd16ce87aed244c83514c44b5 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 5 Aug 2020 11:25:22 +0200 Subject: [PATCH 43/70] Add Log message when TimeMargin is exceeded. --- Classes/bbPlayer.uc | 1 + 1 file changed, 1 insertion(+) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index ed78b875..e2db9205 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1622,6 +1622,7 @@ function xxServerMove( else MaxTimeMargin = 0.5; DeltaTime = 0; + Log("["$Level.TimeSeconds$"]"@PlayerReplicationInfo.PlayerName@"MaxTimeMargin exceeded ("$TimeMargin$")", 'IGPlus'); } } From f225b0d99bca72c54609f5ced98ce728792b518e Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 5 Aug 2020 11:48:42 +0200 Subject: [PATCH 44/70] Dont carry Extrapolation over into next Life --- Classes/bbPlayer.uc | 1 + 1 file changed, 1 insertion(+) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index e2db9205..436f0e58 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -4106,6 +4106,7 @@ ignores SeePlayer, HearNoise, Bump; bIsTurning = false; bPressedJump = false; bIsAlive = true; + bExtrapolatedLastUpdate = false; if (Physics != PHYS_Falling) SetPhysics(PHYS_Walking); if ( !IsAnimating() ) PlayWaiting(); From 12363b3400ec2b8bbadebe648016c04362099523 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 5 Aug 2020 11:51:52 +0200 Subject: [PATCH 45/70] Dont correct player positions while game is paused --- Classes/bbPlayer.uc | 52 +++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 436f0e58..0450e580 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -276,6 +276,7 @@ var int CompressedViewRotation; // Compressed Pitch/Yaw // +----------------+----------------+ var bool bWasDodging; +var bool bWasPaused; const NumLastAddVelocityTimeStamps=4; var float LastAddVelocityTimeStamp[4]; @@ -1549,6 +1550,7 @@ function xxServerMove( local EPhysics ClientPhysics; local byte ClientRoll; local int MergeCount; + local bool bClientPaused; if (bDeleteMe) return; @@ -1576,6 +1578,7 @@ function xxServerMove( ClientLoc.Y = ClientLocY; ClientLoc.Z = ClientLocZ; + bClientPaused = (MiscData & 0x01000000) != 0; MergeCount = (MiscData >> 19) & 0x1F; NewbRun = (MiscData & 0x40000) != 0; NewbDuck = (MiscData & 0x20000) != 0; @@ -1653,7 +1656,7 @@ function xxServerMove( ClientVelCalc.Z = FMax(ClientVel.Z, Velocity.Z); // Predict new position - if ((Level.Pauser == "") && (DeltaTime > 0)) { + if ((Level.Pauser == "") && bClientPaused == false && (DeltaTime > 0)) { UndoExtrapolation(); SimStep = DeltaTime / float(MergeCount + 1); @@ -1670,6 +1673,8 @@ function xxServerMove( } // Important input is usually the cause for buffer breakup, so it happens last on the client. MoveAutonomous(SimStep, NewbRun, NewbDuck, NewbPressedJump, DodgeMove, Accel, DeltaRot); + + bWasPaused = false; } // HACK @@ -2490,6 +2495,7 @@ function SendSavedMove(bbSavedMove Move, optional bbSavedMove OldMove) { else RelLoc = Location - Base.Location; + if (Level.Pauser != "") MiscData = MiscData | 0x01000000; MiscData = MiscData | ((Move.MergeCount & 0x1F) << 19); if (Move.bRun) MiscData = MiscData | 0x40000; if (Move.bDuck) MiscData = MiscData | 0x20000; @@ -4061,29 +4067,33 @@ ignores SeePlayer, HearNoise, Bump; local float TimeSinceLastUpdate; local float ProcessTime; - TimeSinceLastUpdate = Level.TimeSeconds - ServerTimeStamp; - ProcessTime = TimeSinceLastUpdate - class'UTPure'.default.MaxJitterTime; + if (Level.Pauser == "" && !bWasPaused) { + TimeSinceLastUpdate = Level.TimeSeconds - ServerTimeStamp; + ProcessTime = TimeSinceLastUpdate - class'UTPure'.default.MaxJitterTime; - if (class'UTPure'.default.bEnableJitterBounding && - ProcessTime >= DeltaTime && bJustRespawned == false - ) { - UndoExtrapolation(); - MoveAutonomous(ProcessTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); - CurrentTimeStamp += ProcessTime; - ServerTimeStamp += ProcessTime; - ExtrapolationDelta = class'UTPure'.default.MaxJitterTime; - } + if (class'UTPure'.default.bEnableJitterBounding && + ProcessTime > AverageServerDeltaTime && bJustRespawned == false + ) { + UndoExtrapolation(); + MoveAutonomous(ProcessTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); + CurrentTimeStamp += ProcessTime; + ServerTimeStamp += ProcessTime; + ExtrapolationDelta = class'UTPure'.default.MaxJitterTime; + } - if (class'UTPure'.default.bEnableServerExtrapolation && - bExtrapolatedLastUpdate == false && ExtrapolationDelta > DeltaTime - ) { - bExtrapolatedLastUpdate = true; - SavedLocation = Location; - SavedVelocity = Velocity; - SavedAcceleration = Acceleration; - MoveAutonomous(ExtrapolationDelta, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); + if (class'UTPure'.default.bEnableServerExtrapolation && + bExtrapolatedLastUpdate == false && ExtrapolationDelta > AverageServerDeltaTime + ) { + bExtrapolatedLastUpdate = true; + SavedLocation = Location; + SavedVelocity = Velocity; + SavedAcceleration = Acceleration; + MoveAutonomous(ExtrapolationDelta, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); + } + ExtrapolationDelta *= Exp(-2.0 * DeltaTime); + } else { + bWasPaused = true; } - ExtrapolationDelta *= Exp(-0.25 * DeltaTime); global.ServerTick(DeltaTime); } From 7d9d3457c7d59e24207c7eaf4df9bf63eba25fb1 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 5 Aug 2020 11:52:29 +0200 Subject: [PATCH 46/70] Rate-Limit FakeCAP calls --- Classes/bbPlayer.uc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 0450e580..362c5360 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1787,7 +1787,7 @@ function xxServerMove( else xxCAP(TimeStamp, zzMyState, Physics, ClientLoc.X, ClientLoc.Y, ClientLoc.Z, Velocity.X, Velocity.Y, Velocity.Z, Base); - LastCAPTime = CurrentTimeStamp + FClamp(PlayerReplicationInfo.Ping*0.001, 0, 0.5); + LastCAPTime = ServerTimeStamp; zzLastClientErr = 0; xxRememberPosition(); return; @@ -1821,7 +1821,11 @@ function xxServerMove( zzLastClientErr = 0; } - xxFakeCAP(TimeStamp); + + if (ServerTimeStamp - LastCAPTime > 0.1) { + xxFakeCAP(TimeStamp); + LastCAPTime = ServerTimeStamp; + } } function bool OtherPawnAtLocation(vector Loc) { From 4d71476da4137b16706ac8bb4fcd71aa76dac514 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 5 Aug 2020 11:54:27 +0200 Subject: [PATCH 47/70] Increase Maximum time for single ServerMove call --- Classes/bbPlayer.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 362c5360..ac371224 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1606,10 +1606,10 @@ function xxServerMove( bJumpStatus = NewbJumpStatus; ServerDeltaTime = Level.TimeSeconds - ServerTimeStamp; - if (ServerDeltaTime > 0.5) + if (ServerDeltaTime > 0.9) ServerDeltaTime = FMin(ServerDeltaTime, MoveDeltaTime); DeltaTime = TimeStamp - CurrentTimeStamp; - if (DeltaTime > 0.5) + if (DeltaTime > 0.9) DeltaTime = FMin(DeltaTime, MoveDeltaTime); ExtrapolationDelta += (ServerDeltaTime - DeltaTime); From 80cd945277ee63d4658f3eb554b951c32e638465 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 5 Aug 2020 11:55:14 +0200 Subject: [PATCH 48/70] Cleanup --- Classes/ST_SniperRifle.uc | 12 ------------ Classes/bbPlayer.uc | 1 - 2 files changed, 13 deletions(-) diff --git a/Classes/ST_SniperRifle.uc b/Classes/ST_SniperRifle.uc index 47392d4f..3bdbd640 100644 --- a/Classes/ST_SniperRifle.uc +++ b/Classes/ST_SniperRifle.uc @@ -247,12 +247,6 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect Spawn(class'UT_HeavyWallHitEffect',,, HitLocation+HitNormal, Rotator(HitNormal)); if (bbPlayer(Owner) != None) bbPlayer(Owner).xxClientDemoFix(None, class'UT_HeavyWallHitEffect', HitLocation+HitNormal,,, Rotator(HitNormal)); - //if (Other.IsA('Mover')) { - // if (HitDamage > 0) - // bbPlayer(Owner).xxMover_TakeDamage(Mover(Other), HitDamage, Pawn(Owner), HitLocation, 30000.0 * X, MyDamageType); - // else - // bbPlayer(Owner).xxMover_TakeDamage(Mover(Other), class'UTPure'.default.SniperDamagePri, Pawn(Owner), HitLocation, 30000.0 * X, MyDamageType); - //} } else if ( (Other != self) && (Other != Owner) && (Other != None) ) { @@ -391,12 +385,6 @@ function TraceFire( float Accuracy ) return; } - if (bbP == None) - { - if (bbP.zzNN_HitActor.IsA('bbPlayer') && !bbPlayer(bbP.zzNN_HitActor).xxCloseEnough(bbP.zzNN_HitLoc)) - bbP.zzNN_HitActor = None; - } - Owner.MakeNoise(bbP.SoundDampening); GetAxes(bbP.zzNN_ViewRot,X,Y,Z); StartTrace = Owner.Location + bbP.Eyeheight * vect(0,0,1); diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index ac371224..3109a51a 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -521,7 +521,6 @@ simulated function xxClientKicker( float KCollisionRadius, float KCollisionHeigh event PostBeginPlay() { local int i; - local Arena NewNetIG; for (i = 0; i < FRVI_length; i++) zzFRandVals[i] = FRand(); From 976e3852189d0b4a8f3872b07d3932de975740dc Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 5 Aug 2020 11:56:04 +0200 Subject: [PATCH 49/70] Dont spawn ShellCase for every player --- Classes/ST_SniperRifle.uc | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Classes/ST_SniperRifle.uc b/Classes/ST_SniperRifle.uc index 3bdbd640..8508cba1 100644 --- a/Classes/ST_SniperRifle.uc +++ b/Classes/ST_SniperRifle.uc @@ -241,6 +241,7 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect { s.DrawScale = 2.0; s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160); + s.RemoteRole = ROLE_None; } if (Other == Level || Other.IsA('Mover')) { @@ -349,19 +350,10 @@ simulated function DoShellCase(PlayerPawn Pwner, vector HitLoc, Vector X, Vector return; if (RemoteRole < ROLE_Authority) { - //for (P = Level.PawnList; P != None; P = P.NextPawn) - ForEach AllActors(class'PlayerPawn', P) - { - if (P != Pwner) { - CR = P.Spawn(class'UT_ShellCase',P, '', HitLoc); - CR.bOnlyOwnerSee = True; - s = UT_Shellcase(CR); - if ( s != None ) - { - s.DrawScale = 2.0; - s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160); - } - } + s = Spawn(class'NN_UT_ShellCaseOwnerHidden', Pwner,, HitLoc); + if ( s != None ) { + s.DrawScale = 2.0; + s.Eject(((FRand()*0.3+0.4)*X + (FRand()*0.2+0.2)*Y + (FRand()*0.3+1.0) * Z)*160); } } } From 4d6e2337bb1545b338a8d7e0d7c8b76b5ad5ad88 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 5 Aug 2020 11:59:30 +0200 Subject: [PATCH 50/70] Clean up Headshot code and allow more headshots from below --- Classes/ST_SniperRifle.uc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Classes/ST_SniperRifle.uc b/Classes/ST_SniperRifle.uc index 8508cba1..99e15b28 100644 --- a/Classes/ST_SniperRifle.uc +++ b/Classes/ST_SniperRifle.uc @@ -229,7 +229,6 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect { local UT_Shellcase s; local Pawn PawnOwner; - local float CH; if (Owner.IsA('Bot')) return false; @@ -254,13 +253,11 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect if ( Other.bIsPawn ) { if ((Other.GetAnimGroup(Other.AnimSequence) == 'Ducking') && (Other.AnimFrame > -0.03)) { - CH = 0.3 * Other.CollisionHeight; return false; // disable crouching headshot - } else { - CH = Other.CollisionHeight; } - if (HitLocation.Z - Other.Location.Z > BodyHeight * CH) + HitLocation += Normal(X+Y+Z) * (Other.CollisionRadius * 0.5); + if (HitLocation.Z - Other.Location.Z > BodyHeight * Other.CollisionHeight) return true; } From 6ab4f5ad073143f01716440b5b18c67810a4bae4 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Fri, 7 Aug 2020 17:58:29 +0200 Subject: [PATCH 51/70] Add FakeCAPInterval setting --- Classes/bbPlayer.uc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 3109a51a..15c17af6 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -41,6 +41,7 @@ var globalconfig bool bNoSmoothing; var globalconfig bool bNoOwnFootsteps; var globalconfig bool bLogClientMessages; var globalconfig bool bEnableKillCam; +var globalconfig float FakeCAPInterval; // Send a FakeCAP after no CAP has been sent for this amount of time var Sound playedHitSound; var(Sounds) Sound cHitSound[16]; @@ -326,7 +327,7 @@ replication // Client->Server debug data reliable if ( Role == ROLE_AutonomousProxy ) - bDrawDebugData; + bDrawDebugData, FakeCAPInterval; // Server->Client debug data unreliable if ( Role == ROLE_Authority && bDrawDebugData && RemoteRole == ROLE_AutonomousProxy ) @@ -1821,7 +1822,7 @@ function xxServerMove( zzLastClientErr = 0; } - if (ServerTimeStamp - LastCAPTime > 0.1) { + if (ServerTimeStamp - LastCAPTime > FakeCAPInterval) { xxFakeCAP(TimeStamp); LastCAPTime = ServerTimeStamp; } @@ -7788,7 +7789,8 @@ defaultproperties bDrawDebugData=False DesiredNetUpdateRate=100.0 TimeBetweenNetUpdates=0.01 - bLogClientMessages=true - bEnableKillCam=true - bJustRespawned=true + bLogClientMessages=True + bEnableKillCam=False + bJustRespawned=True + FakeCAPInterval=0.1 } From 43e2f9a076aad29951ce224dfa7d99f0da50734a Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 8 Aug 2020 21:40:26 +0200 Subject: [PATCH 52/70] Make Client Settings version independent --- Classes/ClientSettings.uc | 79 +++++++ Classes/ST_SuperShockRifle.uc | 4 +- Classes/UTPure.uc | 5 - Classes/bbCHSpectator.uc | 105 +++++----- Classes/bbPlayer.uc | 383 ++++++++++++---------------------- 5 files changed, 270 insertions(+), 306 deletions(-) create mode 100644 Classes/ClientSettings.uc diff --git a/Classes/ClientSettings.uc b/Classes/ClientSettings.uc new file mode 100644 index 00000000..30843666 --- /dev/null +++ b/Classes/ClientSettings.uc @@ -0,0 +1,79 @@ +class ClientSettings extends Object + config(InstaGibPlus) + perobjectconfig; + +struct PIDControllerSettings { + var() float p; + var() float i; + var() float d; +}; + +var config bool bForceModels; // if Client wishes models forced to his own. (default false) +var config int HitSound; // if Client wishes hitsounds (default 2, must be enabled on server) +var config int TeamHitSound; // if Client wishes team hitsounds (default 3, must be enabled on server) +var config bool bDisableForceHitSounds; +var config bool bTeamInfo; // if Client wants extra team info. +var config bool bDoEndShot; // if Client wants Screenshot at end of match. +var config bool bAutoDemo; // if Client wants demo or not. +var config bool bShootDead; +var config string DemoMask; // The options for creating demo filename. +var config string DemoPath; // The path for creating the demo. +var config string DemoChar; // Character to use instead of illegal ones. +var config int DesiredSkin; +var config int DesiredSkinFemale; +var config int DesiredTeamSkin; +var config int DesiredTeamSkinFemale; +var config bool bEnableHitSounds; +var config int selectedHitSound; +var config string sHitSound[16]; +var config int cShockBeam; +var config float BeamScale; +var config float BeamFadeCurve; +var config float BeamDuration; +var config int BeamOriginMode; +var config float DesiredNetUpdateRate; +var config bool bNoSmoothing; +var config bool bNoOwnFootsteps; +var config bool bLogClientMessages; +var config bool bEnableKillCam; +var config float FakeCAPInterval; // Send a FakeCAP after no CAP has been sent for this amount of time +var config float MinDodgeClickTime; // Minimum time between two presses of the same direction for them to count as a dodge +var config bool bUseOldMouseInput; +var config PIDControllerSettings SmoothVRController; + +defaultproperties +{ + bForceModels=False + HitSound=2 + TeamHitSound=3 + bDisableForceHitSounds=False + bTeamInfo=True + bDoEndShot=False + bAutoDemo=False + bShootDead=False + DemoMask="%l_[%y_%m_%d_%t]_[%c]_%e" + DemoPath="" + DemoChar="" + DesiredSkin=9 + DesiredSkinFemale=0 + DesiredTeamSkin=9 + DesiredTeamSkinFemale=0 + bEnableHitSounds=True + selectedHitSound=0 + sHitSound(0)="InstaGibPlus.UTPure.HitSound" + sHitSound(1)="UnrealShare.StingerFire" + cShockBeam=1 + BeamScale=0.45 + BeamFadeCurve=4 + BeamDuration=0.75 + BeamOriginMode=0 + DesiredNetUpdateRate=100.0 + bNoSmoothing=False + bNoOwnFootsteps=False + bLogClientMessages=True + bEnableKillCam=False + FakeCAPInterval=0.1 + MinDodgeClickTime=0 + bUseOldMouseInput=False + SmoothVRController=(p=0.09,i=0.05,d=0.00) +} \ No newline at end of file diff --git a/Classes/ST_SuperShockRifle.uc b/Classes/ST_SuperShockRifle.uc index 169a8069..b067af8e 100644 --- a/Classes/ST_SuperShockRifle.uc +++ b/Classes/ST_SuperShockRifle.uc @@ -318,7 +318,7 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect bbP = bbPlayer(Owner); if (Other.isA('Pawn')) { - if (bbP.bEnableHitSounds) { + if (bbP.Settings.bEnableHitSounds) { if (!bbP.GameReplicationInfo.bTeamGame || bbPlayer(Other).PlayerReplicationInfo.Team != bbP.PlayerReplicationInfo.Team) { //Log("Hitsound:"@bbP.playedHitSound); bbP.ClientPlaySound(bbP.playedHitSound); @@ -326,7 +326,7 @@ simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vect } } - if (bbPlayer(Owner).cShockBeam == 2) { + if (bbPlayer(Owner).Settings.cShockBeam == 2) { if (bbPlayer(Owner).PlayerReplicationInfo.Team == 1) { Spawn(class'ut_RingExplosion',,, HitLocation+HitNormal*8,rotator(HitNormal)); a = Spawn(class'EnergyImpact'); diff --git a/Classes/UTPure.uc b/Classes/UTPure.uc index 6ad605fe..021681d1 100644 --- a/Classes/UTPure.uc +++ b/Classes/UTPure.uc @@ -148,11 +148,6 @@ function PreBeginPlay() if (NNAnnouncer) Spawn(class'NNAnnouncerSA'); - class'bbPlayer'.Default.HitSound = DefaultHitSound; - class'bbPlayer'.Default.TeamHitSound = DefaultTeamHitSound; - class'bbCHSpectator'.Default.HitSound = DefaultHitSound; - class'bbCHSpectator'.Default.TeamHitSound = DefaultTeamHitSound; - if (zzDMP.HUDType == Class'ChallengeDominationHUD') zzDMP.HUDType = Class'PureDOMHUD'; else if (zzDMP.HUDType == Class'ChallengeCTFHUD') diff --git a/Classes/bbCHSpectator.uc b/Classes/bbCHSpectator.uc index 54f55ec7..22744dbc 100644 --- a/Classes/bbCHSpectator.uc +++ b/Classes/bbCHSpectator.uc @@ -39,10 +39,6 @@ var UTPure zzUTPure; var PureStats Stat; // For player stats var Class cStat; // The class to use -// HitSounds -var globalconfig int HitSound; // if Client wishes hitsounds (default 2, must be enabled on server) -var globalconfig int TeamHitSound; // if Client wishes team hitsounds (default 3, must be enabled on server) -var globalconfig bool bDisableForceHitSounds; var int zzRecentDmgGiven, zzRecentTeamDmgGiven; var float zzLastHitSound, zzLastTeamHitSound, zzNextTimeTime; var int DefaultHitSound, DefaultTeamHitSound; @@ -63,9 +59,8 @@ var PIDController PitchController; var PIDController YawController; var rotator LastRotation; -var globalconfig float Kp; -var globalconfig float Ki; -var globalconfig float Kd; +var Object ClientSettingsHelper; +var ClientSettings Settings; replication { @@ -74,7 +69,7 @@ replication Stat; // Client -> Server reliable if (ROLE < ROLE_Authority) - ShowStats, xxServerSetHitSounds, xxServerSetTeamHitSounds; //, xxServerActivateMover; + ShowStats; //, xxServerActivateMover; unreliable if (RemoteRole == ROLE_AutonomousProxy) NewCAP; @@ -100,13 +95,13 @@ simulated function xxClientSpawnSSRBeamInternal(vector HitLocation, vector Smoke SmokeRotation = rotator(DVector); SmokeRotation.roll = Rand(65535); - if (class'bbPlayer'.default.cShockBeam == 3) return; + if (Settings.cShockBeam == 3) return; Smoke = Spawn(class'ClientSuperShockBeam',O,, SmokeLocation, SmokeRotation); if (Smoke == none) return; MoveAmount = DVector / NumPoints; - if (class'bbPlayer'.default.cShockBeam == 1) { + if (Settings.cShockBeam == 1) { Smoke.SetProperties( -1, 1, @@ -115,21 +110,21 @@ simulated function xxClientSpawnSSRBeamInternal(vector HitLocation, vector Smoke MoveAmount, NumPoints - 1); - } else if (class'bbPlayer'.default.cShockBeam == 2) { + } else if (Settings.cShockBeam == 2) { Smoke.SetProperties( PlayerPawn(O).PlayerReplicationInfo.Team, - class'bbPlayer'.default.BeamScale, - class'bbPlayer'.default.BeamFadeCurve, - class'bbPlayer'.default.BeamDuration, + Settings.BeamScale, + Settings.BeamFadeCurve, + Settings.BeamDuration, MoveAmount, NumPoints - 1); - } else if (class'bbPlayer'.default.cShockBeam == 4) { + } else if (Settings.cShockBeam == 4) { Smoke.SetProperties( PlayerPawn(O).PlayerReplicationInfo.Team, - class'bbPlayer'.default.BeamScale, - class'bbPlayer'.default.BeamFadeCurve, - class'bbPlayer'.default.BeamDuration, + Settings.BeamScale, + Settings.BeamFadeCurve, + Settings.BeamDuration, MoveAmount, 0); @@ -139,9 +134,9 @@ simulated function xxClientSpawnSSRBeamInternal(vector HitLocation, vector Smoke if (Smoke == None) break; Smoke.SetProperties( PlayerPawn(O).PlayerReplicationInfo.Team, - class'bbPlayer'.default.BeamScale, - class'bbPlayer'.default.BeamFadeCurve, - class'bbPlayer'.default.BeamDuration, + Settings.BeamScale, + Settings.BeamFadeCurve, + Settings.BeamDuration, MoveAmount, 0); } @@ -209,7 +204,10 @@ function int TickPID(out PIDController C, float DeltaTime, int Error) { Derivative = (Error - C.PrevErr) / DeltaTime; C.PrevErr = Error; - return NormRotDiff(Kp * Error + Ki * C.Integral + Kd * Derivative); + return NormRotDiff( + Settings.SmoothVRController.p * Error + + Settings.SmoothVRController.i * C.Integral + + Settings.SmoothVRController.d * Derivative); } function xxPlayerTickEvents() @@ -217,16 +215,6 @@ function xxPlayerTickEvents() CheckHitSound(); } -function xxServerSetHitSounds(int b) -{ - HitSound = b; -} - -function xxServerSetTeamHitSounds(int b) -{ - TeamHitSound = b; -} - simulated function xxSetHitSounds(int DHS, int DTHS, bool bFDHS) { DefaultHitSound = DHS; @@ -248,19 +236,17 @@ event Possess() if ( Level.Netmode == NM_Client ) { // Only do this for clients. - xxServerSetHitSounds(HitSound); - xxServerSetTeamHitSounds(TeamHitSound); } else { DefaultHitSound = zzUTPure.Default.DefaultHitSound; DefaultTeamHitSound = zzUTPure.Default.DefaultTeamHitSound; bForceDefaultHitSounds = zzUTPure.Default.bForceDefaultHitSounds; - //xxSetHitSounds(DefaultHitSound, DefaultTeamHitSound, bForceDefaultHitSounds); + xxSetHitSounds(DefaultHitSound, DefaultTeamHitSound, bForceDefaultHitSounds); GameReplicationInfo.RemainingTime = DeathMatchPlus(Level.Game).RemainingTime; GameReplicationInfo.ElapsedTime = DeathMatchPlus(Level.Game).ElapsedTime; - //xxSetTimes(GameReplicationInfo.RemainingTime, GameReplicationInfo.ElapsedTime); + xxSetTimes(GameReplicationInfo.RemainingTime, GameReplicationInfo.ElapsedTime); } Super.Possess(); } @@ -419,6 +405,9 @@ event PlayerTick( float DeltaTime ) event PostBeginPlay() { + local bbPlayer P; + local bbCHSpectator S; + ForEach AllActors(Class'UTPure', zzUTPure) break; @@ -426,6 +415,23 @@ event PostBeginPlay() Stat = Spawn(cStat, Self); Super.PostBeginPlay(); + + foreach AllActors(class'bbPlayer', P) + if (P.Settings != none) { + Settings = P.Settings; + break; + } + + foreach AllActors(class'bbCHSpectator', S) + if (S.Settings != none) { + Settings = S.Settings; + break; + } + + if (Settings == none) { + ClientSettingsHelper = new(self) class'Object'; + Settings = new(ClientSettingsHelper, 'ClientSettings') class'ClientSettings'; + } } event PostRender( canvas Canvas ) @@ -839,10 +845,10 @@ simulated function PlayHitSound(int Dmg) Pitch = FClamp(42/zzRecentDmgGiven, 0.22, 3.2); zzRecentDmgGiven = 0; - if (bForceDefaultHitSounds && !bDisableForceHitSounds) + if (bForceDefaultHitSounds && !Settings.bDisableForceHitSounds) HS = DefaultHitSound; else - HS = HitSound; + HS = Settings.HitSound; if (HS == 1) SoundPlayer.PlaySound(Sound'UnrealShare.StingerFire', SLOT_None, 255.0, True); @@ -878,10 +884,10 @@ simulated function PlayTeamHitSound(int Dmg) Pitch = FClamp(42/zzRecentTeamDmgGiven, 0.22, 3.2); zzRecentTeamDmgGiven = 0; - if (bForceDefaultHitSounds && !bDisableForceHitSounds) + if (bForceDefaultHitSounds && !Settings.bDisableForceHitSounds) HS = DefaultTeamHitSound; else - HS = TeamHitSound; + HS = Settings.TeamHitSound; if (HS == 1) SoundPlayer.PlaySound(Sound'UnrealShare.StingerFire', SLOT_None, 255.0, True); @@ -917,12 +923,12 @@ event ReceiveLocalizedMessage( class Message, optional int Sw, opt if (GameReplicationInfo != None && GameReplicationInfo.bTeamGame && RelatedPRI_2 != None && RelatedPRI_1.Team == RelatedPRI_2.Team) { - if (TeamHitSound > 0) + if (Settings.TeamHitSound > 0) Sw = -1*Sw; else return; } - else if (HitSound == 0) + else if (Settings.HitSound == 0) return; } @@ -931,9 +937,8 @@ event ReceiveLocalizedMessage( class Message, optional int Sw, opt exec function HitSounds(int b) { - HitSound = b; - xxServerSetHitSounds(b); - SaveConfig(); + Settings.HitSound = b; + Settings.SaveConfig(); if (b == 0) ClientMessage("HitSounds: Off"); else if (b == 1) @@ -946,9 +951,8 @@ exec function HitSounds(int b) exec function TeamHitSounds(int b) { - TeamHitSound = b; - xxServerSetTeamHitSounds(b); - SaveConfig(); + Settings.TeamHitSound = b; + Settings.SaveConfig(); if (b == 0) ClientMessage("TeamHitSounds: Off"); else if (b == 1) @@ -990,9 +994,4 @@ exec function ShowStats() defaultproperties { - HitSound=2 - TeamHitSound=3 - Kp=0.09 - Ki=0.05 - Kd=0.00 } diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 15c17af6..cc4404a9 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -12,36 +12,6 @@ class bbPlayer extends TournamentPlayer var int bReason; // Client Config var bool bNewNet; // if Client wants new or old netcode. (default true) -var globalconfig bool bNoRevert; // if Client does not want the Revert to Previous Weapon option on Translocator. (default true) -var globalconfig bool bForceModels; // if Client wishes models forced to his own. (default false) -var globalconfig int HitSound; // if Client wishes hitsounds (default 2, must be enabled on server) -var globalconfig int TeamHitSound; // if Client wishes team hitsounds (default 3, must be enabled on server) -var globalconfig bool bDisableForceHitSounds; -var globalconfig bool bTeamInfo; // if Client wants extra team info. -var globalconfig bool bDoEndShot; // if Client wants Screenshot at end of match. -var globalconfig bool bAutoDemo; // if Client wants demo or not. -var globalconfig bool bShootDead; -var globalconfig bool bNoDeemerToIG; -var globalconfig bool bNoSwitchWeapon4; -var globalconfig string DemoMask; // The options for creating demo filename. -var globalconfig string DemoPath; // The path for creating the demo. -var globalconfig string DemoChar; // Character to use instead of illegal ones. -var globalconfig int desiredSkin; -var globalconfig int desiredSkinFemale; -var globalConfig int desiredTeamSkin; -var globalconfig int desiredTeamSkinFemale; -var globalconfig bool bEnableHitSounds; -var globalconfig int selectedHitSound; -var globalconfig string sHitSound[16]; -var globalconfig int cShockBeam; -var globalconfig float BeamScale; -var globalconfig int BeamOriginMode; -var globalconfig float DesiredNetUpdateRate; -var globalconfig bool bNoSmoothing; -var globalconfig bool bNoOwnFootsteps; -var globalconfig bool bLogClientMessages; -var globalconfig bool bEnableKillCam; -var globalconfig float FakeCAPInterval; // Send a FakeCAP after no CAP has been sent for this amount of time var Sound playedHitSound; var(Sounds) Sound cHitSound[16]; @@ -119,8 +89,6 @@ var Weapon zzThrownWeapon; var int zzRecentDmgGiven, zzRecentTeamDmgGiven, TeleRadius; var name zzDefaultWeapon; var float zzLastHitSound, zzLastTeamHitSound; -var float zzFRandVals[47]; // Let's use a prime number ;) -var vector zzVRandVals[17]; // Let's use a prime number ;) var Projectile zzNN_Projectiles[256]; var vector zzNN_ProjLocations[256]; var int zzFRVI, zzNN_FRVI, FRVI_length, zzVRVI, zzNN_VRVI, VRVI_length, zzNN_ProjIndex, NN_ProjLength, zzEdgeCount, zzCheckedCount; @@ -156,8 +124,6 @@ var float LastCAPTime; // ServerTime when last CAP was sent var vector oldClientLoc; var decoration carriedFlag; -var globalconfig float MinDodgeClickTime; -var float zzLastTimeForward, zzLastTimeBack, zzLastTimeLeft, zzLastTimeRight; struct MoveInfo { var float Delta; @@ -246,7 +212,6 @@ var PureStatMutator zzStatMut; // The mutator that receives special calls var PureLevelBase PureLevel; // And Level. var PurePlayer PurePlayer; // And player. -//var PurexxLinker PureLinker; var bool bDeterminedLocalPlayer; var PlayerPawn LocalPlayer; @@ -258,6 +223,7 @@ var bool SetPendingWeapon; // Net Updates var float TimeBetweenNetUpdates; +var float FakeCAPInterval; // Send a FakeCAP after no CAP has been sent for this amount of time var float ExtrapolationDelta; var bool bExtrapolatedLastUpdate; var vector SavedLocation; @@ -265,8 +231,6 @@ var vector SavedVelocity; var vector SavedAcceleration; // SSR Beam -var byte BeamFadeCurve; -var float BeamDuration; var float LastSSRBeamCreated; // @@ -287,7 +251,7 @@ var float OldShakeVert; var float OldBaseEyeHeight; var float EyeHeightOffset; -var globalconfig bool bUseOldMouseInput; +var transient float zzLastTimeForward, zzLastTimeBack, zzLastTimeLeft, zzLastTimeRight; var transient float TurnFractionalPart, LookUpFractionalPart; var float AverageServerDeltaTime; @@ -295,6 +259,9 @@ var float TimeDead; var float RealTimeDead; var Pawn LastKiller; +var Object ClientSettingsHelper; +var ClientSettings Settings; + replication { // Client->Demo @@ -320,7 +287,7 @@ replication // Server->Client reliable if ( Role == ROLE_Authority ) - zzbForceModels, bIsAlive, bClientIsWalking, zzbIsWarmingUp, zzFRandVals, zzVRandVals, + zzbForceModels, bIsAlive, bClientIsWalking, zzbIsWarmingUp, xxNN_MoveClientTTarget, xxSetPendingWeapon, SetPendingWeapon, xxSetTeleRadius, xxSetDefaultWeapon, xxSetSniperSpeed, xxSetHitSounds, xxSetTimes, xxClientKicker, TimeBetweenNetUpdates, xxClientSpawnSSRBeam; @@ -354,8 +321,8 @@ replication // Client->Server reliable if ( Role < ROLE_Authority ) xxServerCheckMutator, xxSet, - xxServerReceiveMenuItems,xxServerSetNoRevert,xxServerSetReadyToPlay, Hold, Go, - xxServerSetForceModels, xxServerSetHitSounds, xxServerSetTeamHitSounds, xxServerDisableForceHitSounds, xxServerSetMinDodgeClickTime, xxServerSetTeamInfo, ShowStats, + xxServerReceiveMenuItems, xxServerSetReadyToPlay, Hold, Go, + xxServerSetForceModels, xxServerSetMinDodgeClickTime, xxServerSetTeamInfo, ShowStats, xxServerAckScreenshot, xxServerReceiveConsole, xxServerReceiveKeys, xxServerReceiveINT, xxServerReceiveStuff, xxSendHeadshotToSpecs, xxSendDeathMessageToSpecs, xxSendMultiKillToSpecs, xxSendSpreeToSpecs, xxServerDemoReply, xxExplodeOther, xxSetNetUpdateRate, xxServerAddVelocity, xxNN_Fire, xxNN_AltFire, DropFlag; @@ -521,14 +488,8 @@ simulated function xxClientKicker( float KCollisionRadius, float KCollisionHeigh event PostBeginPlay() { - local int i; - - for (i = 0; i < FRVI_length; i++) - zzFRandVals[i] = FRand(); - - for (i = 0; i < VRVI_length; i++) - zzVRandVals[i] = VRand()*10000; - + local bbPlayer P; + local bbCHSpectator S; Super.PostBeginPlay(); @@ -542,6 +503,23 @@ event PostBeginPlay() SetPendingWeapon = class'UTPure'.Default.SetPendingWeapon; PlayerReplicationInfo.NetUpdateFrequency = 10; + + foreach AllActors(class'bbPlayer', P) + if (P.Settings != none) { + Settings = P.Settings; + break; + } + + foreach AllActors(class'bbCHSpectator', S) + if (S.Settings != none) { + Settings = S.Settings; + break; + } + + if (Settings == none) { + ClientSettingsHelper = new(self) class'Object'; + Settings = new(ClientSettingsHelper, 'ClientSettings') class'ClientSettings'; + } } // called after PostBeginPlay on net client @@ -588,16 +566,11 @@ event Possess() Log("Possessed PlayerPawn (bbPlayer) by InstaGib Plus"); zzTrue = !zzFalse; zzInfoThing = Spawn(Class'PureInfo'); - playedHitSound = loadHitSound(selectedHitSound); - SetNetUpdateRate(DesiredNetUpdateRate); - xxServerSetNoRevert(bNoRevert); - xxServerSetForceModels(bForceModels); - xxServerSetHitSounds(HitSound); - xxServerSetTeamHitSounds(TeamHitSound); - if (bDisableForceHitSounds) - xxServerDisableForceHitSounds(); - xxServerSetTeamInfo(bTeamInfo); - xxServerSetMinDodgeClickTime(MinDodgeClickTime); + playedHitSound = loadHitSound(Settings.selectedHitSound); + SetNetUpdateRate(Settings.DesiredNetUpdateRate); + xxServerSetForceModels(Settings.bForceModels); + xxServerSetTeamInfo(Settings.bTeamInfo); + xxServerSetMinDodgeClickTime(Settings.MinDodgeClickTime); if (class'UTPlayerClientWindow'.default.PlayerSetupClass != class'UTPureSetupScrollClient') class'UTPlayerClientWindow'.default.PlayerSetupClass = class'UTPureSetupScrollClient'; // This blocks silly set commands by kicking player, after resetting them. @@ -628,6 +601,7 @@ event Possess() xxServerCheater(chr(90)$chr(69)); // ZE } SetPropertyText("PureLevel", GetPropertyText("xLevel")); + FakeCAPInterval = Settings.FakeCAPInterval; } else { @@ -726,12 +700,12 @@ event ReceiveLocalizedMessage( class Message, optional int Sw, opt if (GameReplicationInfo.bTeamGame && RelatedPRI_1.Team == RelatedPRI_2.Team) { - if (TeamHitSound > 0) + if (Settings.TeamHitSound > 0) Sw = -1*Sw; else return; } - else if (HitSound == 0) + else if (Settings.HitSound == 0) return; } else if (ClassIsChildOf(Message, class'DecapitationMessage')) @@ -814,7 +788,7 @@ event ClientMessage( coerce string zzS, optional Name zzType, optional bool zzbB xxClientDemoMessage(zzS); Super.ClientMessage(zzS, zzType, zzbBeep); zzPrevClientMessage = ""; - if (bLogClientMessages) + if (Settings.bLogClientMessages) Log(zzS, zzType); } @@ -981,7 +955,7 @@ event PlayerInput( float DeltaTime ) AbsSmoothX = SmoothMouseX; AbsSmoothY = SmoothMouseY; - if (bNoSmoothing) { + if (Settings.bNoSmoothing) { SmoothMouseX = aMouseX; SmoothMouseY = aMouseY; BorrowedMouseX = 0; @@ -1955,7 +1929,7 @@ simulated function xxEnableCarcasses() { local Carcass C; - if (!bShootDead) + if (!Settings.bShootDead) return; ForEach AllActors(class'Carcass', C) @@ -1970,7 +1944,7 @@ simulated function xxDisableCarcasses() { local Carcass C; - if (!bShootDead) + if (!Settings.bShootDead) return; ForEach AllActors(class'Carcass', C) @@ -2603,7 +2577,7 @@ exec function ThrowWeapon() } simulated function Sound loadHitSound(int c) { - cHitSound[c] = Sound(DynamicLoadObject(sHitSound[c], class'Sound')); + cHitSound[c] = Sound(DynamicLoadObject(Settings.sHitSound[c], class'Sound')); return cHitSound[c]; } @@ -2670,8 +2644,8 @@ exec function enableDebugData(bool b) { } exec function enableHitSounds(bool b) { - bEnableHitSounds = b; - SaveConfig(); + Settings.bEnableHitSounds = b; + Settings.SaveConfig(); if (b) { ClientMessage("Hitsounds: on"); reconnectClient(); @@ -2697,8 +2671,8 @@ exec function setForcedSkins(int maleSkin, int femaleSkin) { return; } - desiredSkin = maleSkin - 1; - desiredSkinFemale = femaleSkin - 1; + Settings.desiredSkin = maleSkin - 1; + Settings.desiredSkinFemale = femaleSkin - 1; SaveConfig(); ClientMessage("Forced enemy skin set!"); } @@ -2719,16 +2693,16 @@ exec function setForcedTeamSkins(int maleSkin, int femaleSkin) { return; } - desiredTeamSkin = maleSkin - 1; - desiredTeamSkinFemale = femaleSkin - 1; + Settings.desiredTeamSkin = maleSkin - 1; + Settings.desiredTeamSkinFemale = femaleSkin - 1; SaveConfig(); ClientMessage("Forced team skin set!"); } exec function setHitSound(int hs) { if (hs >= 0 && hs <= 16) { - selectedHitSound = hs; - SaveConfig(); + Settings.selectedHitSound = hs; + Settings.SaveConfig(); ClientMessage("Hitsound set!"); reconnectClient(); } else { @@ -2739,8 +2713,8 @@ exec function setHitSound(int hs) { exec function setShockBeam(int sb) { if (sb > 0 && sb <= 4) { - cShockBeam = sb; - SaveConfig(); + Settings.cShockBeam = sb; + Settings.SaveConfig(); ClientMessage("Shock beam set!"); } else ClientMessage("Please input a value between 1 and 4"); @@ -2748,8 +2722,8 @@ exec function setShockBeam(int sb) { exec function setBeamScale(float bs) { if (bs >= 0.1 && bs <= 1.0) { - BeamScale = bs; - SaveConfig(); + Settings.BeamScale = bs; + Settings.SaveConfig(); ClientMessage("Beam scale set!"); } else ClientMessage("Please input a value between 0.1 and 1.0"); @@ -2780,15 +2754,15 @@ exec function listSkins() { exec function myIgSettings() { ClientMessage("Your IG+ client settings:"); - ClientMessage("Hitsounds:"@bEnableHitSounds); + ClientMessage("Hitsounds:"@Settings.bEnableHitSounds); ClientMessage("Forced Models:"@zzbForceModels); - ClientMessage("Current Enemy Forced Model:"@forcedModelToString(desiredSkin)); - ClientMessage("Current Enemy Female Forced Model:"@forcedModelToString(desiredSkinFemale)); - ClientMessage("Current Team Forced Model:"@forcedModelToString(desiredTeamSkin)); - ClientMessage("Current Team Female Forced Model:"@forcedModelToString(desiredTeamSkinFemale)); + ClientMessage("Current Enemy Forced Model:"@forcedModelToString(Settings.desiredSkin)); + ClientMessage("Current Enemy Female Forced Model:"@forcedModelToString(Settings.desiredSkinFemale)); + ClientMessage("Current Team Forced Model:"@forcedModelToString(Settings.desiredTeamSkin)); + ClientMessage("Current Team Female Forced Model:"@forcedModelToString(Settings.desiredTeamSkinFemale)); ClientMessage("Current selected hit sound:"@playedHitSound); - ClientMessage("Current Shock Beam:"@cShockBeam); - ClientMessage("Current Beam Scale:"@BeamScale); + ClientMessage("Current Shock Beam:"@Settings.cShockBeam); + ClientMessage("Current Beam Scale:"@Settings.BeamScale); } function xxCalcBehindView(out vector CameraLocation, out rotator CameraRotation, float Dist) @@ -2941,14 +2915,14 @@ function xxUpdateRotation(float DeltaTime, float maxPitch) PitchDelta = 32.0 * DeltaTime * aLookUp + LookUpFractionalPart; ViewRotation.Pitch += int(PitchDelta); - if (!bUseOldMouseInput) + if (!Settings.bUseOldMouseInput) LookUpFractionalPart = PitchDelta - int(PitchDelta); ViewRotation.Pitch = Clamp((ViewRotation.Pitch << 16 >> 16), -16384, 16383) & 0xFFFF; YawDelta = 32.0 * DeltaTime * aTurn + TurnFractionalPart; ViewRotation.Yaw += int(YawDelta); - if (!bUseOldMouseInput) + if (!Settings.bUseOldMouseInput) TurnFractionalPart = YawDelta - int(YawDelta); ViewShake(deltaTime); // ViewRotation is fuked in here. @@ -3552,10 +3526,10 @@ simulated function PlayHitSound(int Dmg) Pitch = FClamp(42/zzRecentDmgGiven, 0.22, 3.2); zzRecentDmgGiven = 0; - if (bForceDefaultHitSounds && !bDisableForceHitSounds) + if (bForceDefaultHitSounds && !Settings.bDisableForceHitSounds) HS = DefaultHitSound; else - HS = HitSound; + HS = Settings.HitSound; if (HS == 1) SoundPlayer.PlaySound(Sound'UnrealShare.StingerFire', SLOT_None, 255.0, True); @@ -3591,10 +3565,10 @@ simulated function PlayTeamHitSound(int Dmg) Pitch = FClamp(42/zzRecentTeamDmgGiven, 0.22, 3.2); zzRecentTeamDmgGiven = 0; - if (bForceDefaultHitSounds && !bDisableForceHitSounds) + if (bForceDefaultHitSounds && !Settings.bDisableForceHitSounds) HS = DefaultTeamHitSound; else - HS = TeamHitSound; + HS = Settings.TeamHitSound; if (HS == 1) SoundPlayer.PlaySound(Sound'UnrealShare.StingerFire', SLOT_None, 255.0, True); @@ -3960,28 +3934,28 @@ ignores SeePlayer, HearNoise, Bump; if (bEdgeForward && bWasForward) { - if (Now - zzLastTimeForward > MinDodgeClickTime) { + if (Now - zzLastTimeForward > Settings.MinDodgeClickTime) { DodgeDir = DODGE_Forward; zzLastTimeForward = Now; } } else if (bEdgeBack && bWasBack) { - if (Now - zzLastTimeBack > MinDodgeClickTime) { + if (Now - zzLastTimeBack > Settings.MinDodgeClickTime) { DodgeDir = DODGE_Back; zzLastTimeBack = Now; } } else if (bEdgeLeft && bWasLeft) { - if (Now - zzLastTimeLeft > MinDodgeClickTime) { + if (Now - zzLastTimeLeft > Settings.MinDodgeClickTime) { DodgeDir = DODGE_Left; zzLastTimeLeft = Now; } } else if (bEdgeRight && bWasRight) { - if (Now - zzLastTimeRight > MinDodgeClickTime) { + if (Now - zzLastTimeRight > Settings.MinDodgeClickTime) { DodgeDir = DODGE_Right; zzLastTimeRight = Now; } @@ -4642,7 +4616,7 @@ state Dying zzTick = DeltaTime; Super.PlayerTick(DeltaTime); - if (bEnableKillCam && TimeDead < 2 && LastKiller != none) { + if (Settings.bEnableKillCam && TimeDead < 2 && LastKiller != none) { TargetRotation = rotator(LastKiller.Location - Location); DeltaRotation = Normalize(TargetRotation - ViewRotation); ViewRotation = Normalize(ViewRotation + DeltaRotation * (1 - Exp(-3.0 * DeltaTime))); @@ -4742,7 +4716,7 @@ state Dying //fixme - try to pick view with killer visible //fixme - also try varying starting pitch - if (bEnableKillCam == false) { + if (Settings.bEnableKillCam == false) { ViewRotation.Pitch = 56000; cameraLoc = Location; @@ -5054,7 +5028,7 @@ function PlayHit(float Damage, vector HitLocation, name damageType, vector Momen simulated function FootStepping() { - if (Level.NetMode != NM_DedicatedServer && bNoOwnFootsteps) + if (Level.NetMode != NM_DedicatedServer && Settings.bNoOwnFootsteps) if (Role >= ROLE_AutonomousProxy || GetLocalPlayer().ViewTarget == self) return; @@ -5239,7 +5213,7 @@ function xxPlayerTickEvents() if (PureLevel != None) // Why would this be None?! { zzbDemoRecording = PureLevel.zzDemoRecDriver != None; - if (!zzbDemoRecording && zzbGameStarted && (zzbForceDemo || bAutoDemo && zzUTPure.zzDMP.CountDown < 1)) + if (!zzbDemoRecording && zzbGameStarted && (zzbForceDemo || Settings.bAutoDemo && zzUTPure.zzDMP.CountDown < 1)) xxClientDemoRec(); } } @@ -5486,15 +5460,15 @@ event PreRender( canvas zzCanvas ) // force skins if (GameReplicationInfo.bTeamGame && zzPRI.Team == Self.PlayerReplicationInfo.Team) { if (zzPRI.bIsFemale) { - skin = desiredTeamSkinFemale; + skin = Settings.desiredTeamSkinFemale; } else { - skin = desiredTeamSkin; + skin = Settings.desiredTeamSkin; } } else { if (zzPRI.bIsFemale) { - skin = desiredSkinFemale; + skin = Settings.desiredSkinFemale; } else { - skin = desiredSkin; + skin = Settings.desiredSkin; } } setForcedSkin(zzPRI.Owner, skin, GameReplicationInfo.bTeamGame, zzPRI.Team); @@ -5502,14 +5476,14 @@ event PreRender( canvas zzCanvas ) // fix up Flip animation if (zzPRI.Owner.AnimSequence == 'Flip') { if (GameReplicationInfo.bTeamGame && PlayerReplicationInfo.Team == zzPRI.Team) { - if (class'bbPlayer'.default.DesiredTeamSkinFemale > 8 && zzPRI.bIsFemale) + if (Settings.DesiredTeamSkinFemale > 8 && zzPRI.bIsFemale) zzPRI.Owner.AnimRate = 1.35*1.55 * FMax(0.35, zzPRI.Owner.Region.Zone.ZoneGravity.Z/zzPRI.Owner.Region.Zone.Default.ZoneGravity.Z); - else if (class'bbPlayer'.default.DesiredTeamSkin <= 8 && zzPRI.bIsFemale == false) + else if (Settings.DesiredTeamSkin <= 8 && zzPRI.bIsFemale == false) zzPRI.Owner.AnimRate = 1.35/1.55 * FMax(0.35, zzPRI.Owner.Region.Zone.ZoneGravity.Z/zzPRI.Owner.Region.Zone.Default.ZoneGravity.Z); } else { - if (class'bbPlayer'.default.DesiredSkinFemale > 8 && zzPRI.bIsFemale) + if (Settings.DesiredSkinFemale > 8 && zzPRI.bIsFemale) zzPRI.Owner.AnimRate = 1.35*1.55 * FMax(0.35, zzPRI.Owner.Region.Zone.ZoneGravity.Z/zzPRI.Owner.Region.Zone.Default.ZoneGravity.Z); - else if (class'bbPlayer'.default.DesiredSkin <= 8 && zzPRI.bIsFemale == false) + else if (Settings.DesiredSkin <= 8 && zzPRI.bIsFemale == false) zzPRI.Owner.AnimRate = 1.35/1.55 * FMax(0.35, zzPRI.Owner.Region.Zone.ZoneGravity.Z/zzPRI.Owner.Region.Zone.Default.ZoneGravity.Z); } } @@ -5785,7 +5759,7 @@ simulated function xxDrawDebugData(canvas zzC, float zzx, float zzY) { zzC.SetPos(zzx, zzY + 360); zzC.DrawText("finishedLoading?:"@bIsFinishedLoading); zzC.SetPos(zzx, zzY + 380); - zzC.DrawText("NetUpdateRate:"@DesiredNetUpdateRate); + zzC.DrawText("NetUpdateRate:"@Settings.DesiredNetUpdateRate); zzC.SetPos(zzx, zzY + 400); zzC.DrawText("UpdatedPosition:"@clientForcedPosition); zzC.SetPos(zzx+20, zzY + 420); @@ -6081,7 +6055,7 @@ function xxClientSet(string zzS) simulated function xxClientDoEndShot() { - if (bDoEndShot) + if (Settings.bDoEndShot) { bShowScores = True; zzbDoScreenshot = True; @@ -6351,14 +6325,6 @@ exec function Sens(float F) ClientMessage("Sensitivity :"@F); } -exec function NoRevert(bool b) -{ - bNoRevert = b; - xxServerSetNoRevert(b); - SaveConfig(); - ClientMessage("NoRevert :"@bNoRevert); -} - exec function ForceModels(bool b) { @@ -6368,11 +6334,11 @@ exec function ForceModels(bool b) * @Desc: Console command to force models client side */ - bForceModels = b; + Settings.bForceModels = b; xxServerSetForceModels(b); - SaveConfig(); - ClientMessage("ForceModels :"@bForceModels); - if (!bForceModels) { + Settings.SaveConfig(); + ClientMessage("ForceModels :"@b); + if (!b) { ClientMessage("You will be reconnected in 3 seconds..."); SetTimer(5, false); bReason = 1; @@ -6386,9 +6352,8 @@ simulated function reconnectClient() { exec function HitSounds(int b) { - HitSound = b; - xxServerSetHitSounds(b); - SaveConfig(); + Settings.HitSound = b; + Settings.SaveConfig(); if (b == 0) ClientMessage("HitSounds: Off"); else if (b == 1) @@ -6401,9 +6366,8 @@ exec function HitSounds(int b) exec function TeamHitSounds(int b) { - TeamHitSound = b; - xxServerSetTeamHitSounds(b); - SaveConfig(); + Settings.TeamHitSound = b; + Settings.SaveConfig(); if (b == 0) ClientMessage("TeamHitSounds: Off"); else if (b == 1) @@ -6416,62 +6380,42 @@ exec function TeamHitSounds(int b) exec function DisableForceHitSounds() { - bDisableForceHitSounds = true; - xxServerDisableForceHitSounds(); - SaveConfig(); - ClientMessage("bDisableForceHitSounds:"@bDisableForceHitSounds); + Settings.bDisableForceHitSounds = true; + Settings.SaveConfig(); + ClientMessage("bDisableForceHitSounds: True"); } exec function MyHitsounds() { - bDisableForceHitSounds = true; - xxServerDisableForceHitSounds(); - SaveConfig(); - ClientMessage("bDisableForceHitSounds:"@bDisableForceHitSounds); + Settings.bDisableForceHitSounds = true; + Settings.SaveConfig(); + ClientMessage("bDisableForceHitSounds: True"); } exec function TeamInfo(bool b) { - bTeamInfo = b; + Settings.bTeamInfo = b; xxServerSetTeamInfo(b); - SaveConfig(); - ClientMessage("TeamInfo :"@bTeamInfo); + Settings.SaveConfig(); + ClientMessage("TeamInfo :"@b); } exec function mdct( float f ) { - MinDodgeClickTime = f; - xxServerSetMinDodgeClickTime(MinDodgeClickTime); - SaveConfig(); - ClientMessage("MinDodgeClickTime:"@MinDodgeClickTime); + SetMinDodgeClickTime(f); } exec function SetMinDodgeClickTime( float f ) { - MinDodgeClickTime = f; - xxServerSetMinDodgeClickTime(MinDodgeClickTime); - SaveConfig(); - ClientMessage("MinDodgeClickTime:"@MinDodgeClickTime); -} - -exec function NoDeemerToIG(bool b) -{ - bNoDeemerToIG = b; - SaveConfig(); - ClientMessage("GetWeapon WarheadLauncher doesn't get IG rifle:"@bNoDeemerToIG); -} - -exec function NoSwitchWeapon4(bool b) -{ - bNoSwitchWeapon4 = b; - SaveConfig(); - ClientMessage("GetWeapon ShockRifle doesn't trigger SwitchWeapon 4:"@bNoSwitchWeapon4); + Settings.MinDodgeClickTime = f; + Settings.SaveConfig(); + ClientMessage("MinDodgeClickTime:"@f); } exec function SetMouseSmoothing(bool b) { - bNoSmoothing = !b; - SaveConfig(); + Settings.bNoSmoothing = !b; + Settings.SaveConfig(); if (b) ClientMessage("Mouse Smoothing enabled!"); else ClientMessage("Mouse Smoothing disabled!"); } @@ -6488,7 +6432,7 @@ simulated function xxClientSpawnSSRBeamInternal(vector HitLocation, vector Smoke if (Level.NetMode == NM_DedicatedServer) return; - if (BeamOriginMode == 1) { + if (Settings.BeamOriginMode == 1) { // Show beam originating from its Owner OriginLocation = Owner.Location + SmokeOffset; } else { @@ -6502,13 +6446,13 @@ simulated function xxClientSpawnSSRBeamInternal(vector HitLocation, vector Smoke SmokeRotation = rotator(DVector); SmokeRotation.roll = Rand(65535); - if (cShockBeam == 3) return; + if (Settings.cShockBeam == 3) return; Smoke = Spawn(class'ClientSuperShockBeam',O,, OriginLocation, SmokeRotation); if (Smoke == none) return; MoveAmount = DVector / NumPoints; - if (cShockBeam == 1) { + if (Settings.cShockBeam == 1) { Smoke.SetProperties( -1, 1, @@ -6517,21 +6461,21 @@ simulated function xxClientSpawnSSRBeamInternal(vector HitLocation, vector Smoke MoveAmount, NumPoints - 1); - } else if (cShockBeam == 2) { + } else if (Settings.cShockBeam == 2) { Smoke.SetProperties( PlayerPawn(O).PlayerReplicationInfo.Team, - BeamScale, - BeamFadeCurve, - BeamDuration, + Settings.BeamScale, + Settings.BeamFadeCurve, + Settings.BeamDuration, MoveAmount, NumPoints - 1); - } else if (cShockBeam == 4) { + } else if (Settings.cShockBeam == 4) { Smoke.SetProperties( PlayerPawn(O).PlayerReplicationInfo.Team, - BeamScale, - BeamFadeCurve, - BeamDuration, + Settings.BeamScale, + Settings.BeamFadeCurve, + Settings.BeamDuration, MoveAmount, 0); @@ -6541,9 +6485,9 @@ simulated function xxClientSpawnSSRBeamInternal(vector HitLocation, vector Smoke if (Smoke == None) break; Smoke.SetProperties( PlayerPawn(O).PlayerReplicationInfo.Team, - BeamScale, - BeamFadeCurve, - BeamDuration, + Settings.BeamScale, + Settings.BeamFadeCurve, + Settings.BeamDuration, MoveAmount, 0); } @@ -6563,11 +6507,6 @@ simulated function xxDemoSpawnSSRBeam(vector HitLocation, vector SmokeLocation, xxClientSpawnSSRBeamInternal(HitLocation, SmokeLocation, SmokeOffset, O); } -function xxServerSetNoRevert(bool b) -{ - bNoRevert = b; -} - function xxServerSetForceModels(bool b) { local int zzPureSetting; @@ -6583,21 +6522,6 @@ function xxServerSetForceModels(bool b) zzbForceModels = False; } -function xxServerSetHitSounds(int b) -{ - HitSound = b; -} - -function xxServerSetTeamHitSounds(int b) -{ - TeamHitSound = b; -} - -function xxServerDisableForceHitSounds() -{ - bDisableForceHitSounds = true; -} - function xxServerSetTeamInfo(bool b) { if (zzUTPure != None && zzUTPure.ImprovedHUD > 0) @@ -6613,12 +6537,12 @@ function xxServerSetTeamInfo(bool b) function xxServerSetMinDodgeClickTime(float f) { - MinDodgeClickTime = f; + Settings.MinDodgeClickTime = f; } exec function SetKillCamEnabled(bool b) { - bEnableKillCam = b; - SaveConfig(); + Settings.bEnableKillCam = b; + Settings.SaveConfig(); if (b) ClientMessage("KillCam enabled!", 'IGPlus'); else @@ -6627,9 +6551,9 @@ exec function SetKillCamEnabled(bool b) { exec function EndShot(optional bool b) { - bDoEndShot = b; + Settings.bDoEndShot = b; ClientMessage("Screenshot at end of match:"@b); - SaveConfig(); + Settings.SaveConfig(); } exec function Hold() @@ -7319,16 +7243,6 @@ function xxCleanAvars() aUp = zzNull; } -function float GetFRV(int Index) -{ - return zzFRandVals[Index]; -} - -function vector GetVRV(int Index) -{ - return zzVRandVals[Index]; -} - simulated function xxGetDemoPlaybackSpec() { local Pawn P; @@ -7587,24 +7501,24 @@ function string xxCreateDemoName(string zzDemoName) zzDemoName = Mid(zzDemoName, zzx + 2); } - return DemoPath $ xxFixFileName(result $ zzDemoName, DemoChar); + return Settings.DemoPath $ xxFixFileName(result $ zzDemoName, Settings.DemoChar); } exec function AutoDemo(bool zzb) { - bAutoDemo = zzb; + Settings.bAutoDemo = zzb; ClientMessage("Record demos automatically after countdown:"@zzb); - SaveConfig(); + Settings.SaveConfig(); } exec function ShootDead() { - bShootDead = !bShootDead; - if (bShootDead) + Settings.bShootDead = !Settings.bShootDead; + if (Settings.bShootDead) ClientMessage("Shooting carcasses enabled."); else ClientMessage("Shooting carcasses disabled."); - SaveConfig(); + Settings.SaveConfig(); } exec function SetDemoMask(optional string zzMask) @@ -7613,11 +7527,11 @@ exec function SetDemoMask(optional string zzMask) if (zzMask != "") { - DemoMask = zzMask; - SaveConfig(); + Settings.DemoMask = zzMask; + Settings.SaveConfig(); } - ClientMessage("Current demo mask:"@DemoMask); + ClientMessage("Current demo mask:"@Settings.DemoMask); } exec function DemoStart() @@ -7635,7 +7549,7 @@ simulated function xxClientDemoRec() { local string zzS; - zzS = ConsoleCommand("DemoRec"@xxCreateDemoName(DemoMask)); + zzS = ConsoleCommand("DemoRec"@xxCreateDemoName(Settings.DemoMask)); ClientMessage(zzS); if (zzbForceDemo) xxServerDemoReply(zzS); @@ -7648,9 +7562,9 @@ function xxSetNetUpdateRate(float NewVal, int netspeed) { } exec function SetNetUpdateRate(float NewVal) { - DesiredNetUpdateRate = NewVal; + Settings.DesiredNetUpdateRate = NewVal; xxSetNetUpdateRate(NewVal, Player.CurrentNetSpeed); - SaveConfig(); + Settings.SaveConfig(); } function xxServerDemoReply(string zzS) @@ -7761,36 +7675,13 @@ defaultproperties { bAlwaysRelevant=True bNewNet=True - bNoRevert=True - HitSound=2 - TeamHitSound=3 - bTeamInfo=True - DemoMask="%l_[%y_%m_%d_%t]_[%c]_%e" HUDInfo=1 TeleRadius=210 - FRVI_length=47 - VRVI_length=17 NN_ProjLength=256 bIsAlpha=False - desiredSkin=9 - desiredSkinFemale=0 - desiredTeamSkin=9 - desiredTeamSkinFemale=0 - bEnableHitSounds=True - selectedHitSound=0 bIsPatch469=False - sHitSound(0)="InstaGibPlus.UTPure.HitSound" - sHitSound(1)="UnrealShare.StingerFire" - cShockBeam=1 - BeamScale=0.45 - BeamFadeCurve=4 - BeamDuration=0.75 bIsFinishedLoading=False bDrawDebugData=False - DesiredNetUpdateRate=100.0 TimeBetweenNetUpdates=0.01 - bLogClientMessages=True - bEnableKillCam=False - bJustRespawned=True FakeCAPInterval=0.1 } From 1518de1aa6442a4349190e01d63c39b9598467c0 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sat, 8 Aug 2020 21:40:53 +0200 Subject: [PATCH 53/70] bbSavedMoves dont need to be replicated --- Classes/bbSavedMove.uc | 1 + 1 file changed, 1 insertion(+) diff --git a/Classes/bbSavedMove.uc b/Classes/bbSavedMove.uc index b4cdcec2..78c30cc5 100644 --- a/Classes/bbSavedMove.uc +++ b/Classes/bbSavedMove.uc @@ -19,4 +19,5 @@ function Clear2() { defaultproperties { bHidden=True + RemoteRole=ROLE_None } From 46f449282e903b3c61ee361cb65a34f5239e9101 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 9 Aug 2020 09:56:21 +0200 Subject: [PATCH 54/70] Remove custom console --- Classes/PureSuperDuperUberConsole.uc | 121 ++------------ Classes/bbCHSpectator.uc | 76 +++------ Classes/bbPlayer.uc | 241 ++++++++++----------------- 3 files changed, 133 insertions(+), 305 deletions(-) diff --git a/Classes/PureSuperDuperUberConsole.uc b/Classes/PureSuperDuperUberConsole.uc index 7db45b6a..1bc633d4 100644 --- a/Classes/PureSuperDuperUberConsole.uc +++ b/Classes/PureSuperDuperUberConsole.uc @@ -45,10 +45,18 @@ event PostRender( canvas zzC ) //Log("Console.PostRender"); - if (zzMyState==1) - xxWindowPostRender(zzC); - else - { + if (zzMyState==1) { + if( bTimeDemo ) + { + TimeDemoCalc(); + TimeDemoRender( zzC ); + } + + if(Root != None) + Root.bUWindowActive = True; + + RenderUWindow( zzC ); + } else { if(bNoDrawWorld) { zzC.SetPos(0,0); @@ -109,32 +117,13 @@ event PostRender( canvas zzC ) // RenderUWindow(zzC); } - - zzbb = bbPlayer(ViewPort.Actor); - if (zzbb != None) - { - zzbb.zzbCanCSL = zzbb.zzTrue; //allow csl. - zzbb.zzbConsoleInvalid = zzbb.zzFalse; - zzbb.zzCannibal = zzC; - zzbb.zzCanOldFont = zzC.Font; - zzbb.zzCanOldStyle = zzC.Style; - } } final function xxWindowPostRender(canvas zzCanvas) { //UWindow.postrender // Log("Console.WindowPostRender"); - if( bTimeDemo ) - { - TimeDemoCalc(); - TimeDemoRender( zzCanvas ); - } - - if(Root != None) - Root.bUWindowActive = True; - - RenderUWindow( zzCanvas ); + } event bool KeyType( EInputKey Key ) @@ -176,25 +165,12 @@ event NotifyLevelChange() } event bool KeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta ) -{ -// local bool zzretval; - // If any KeyEvent is received, adopt bShowMenu tracking of Execs - return xxKeyEvent(Key, Action, Delta); -} - -final function bool xxKeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta ) { local byte zzk; local bbPlayer zzbbP; zzbbP = bbPlayer(ViewPort.Actor); - // Stop FireBots (TraceBots) - if (zzbbP != None && zzbbP.zzbCanCSL) - { - zzbbP.zzbStoppingTraceBot = zzbbP.zzTrue; - zzbbP.xxStopTracebot(); - } - + if (zzMyState!=0) { if (zzMyState==1&&Key!=IK_F9) //exception for screenshot. @@ -249,7 +225,7 @@ final function bool xxKeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta if (zzMyState==2) //emulates global key event. return xxTypingKeyEvent(Key,Action,Delta); - return False; + return False; } final function bool xxWinKeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta ) @@ -453,20 +429,10 @@ final function bool xxTypingKeyEvent( EInputKey Key, EInputAction Action, FLOAT } return true; } -/* -function bool ConsoleCommand( coerce string S ) -{ - Log("ConsoleCommand"@S@bbPlayer(ViewPort.Actor).zzbCanCSL); - return bbPlayer(ViewPort.Actor).zzbCanCSL && Super.ConsoleCommand(S); -} -*/ // Called each rendering iteration to update any time-based display. event Tick( float Delta ) { -// Log("Console.Tick"); -// local rotator zzVR; - // Tick is //Console (probably not needed though): @@ -1263,61 +1229,13 @@ exec function BanID(string ID) { ViewPort.Actor.Mutate("BanID"@ID); } //============================================================================= /* 2001-08-28 : DB : Fixed BDBMapVote Bug (there might still be some) - : VR Checking of MenuCmd, ShowObjective + : VR Checking of MenuCmd, ShowObjective : Capturing LaunchUWindow/CloseUWindow 2001-06-1 USA : (no idea what month you are on DB): - : implamented complete no state console + : implamented complete no state console 2001-12-02 DB : Set as PureConsole */ -exec simulated function GetWeapon(class NewWeaponClass ) -{ - if (ViewPort != None && ViewPort.Actor != None) { - bbPlayer(ViewPort.Actor).zzSwitchedTime = ViewPort.Actor.Level.TimeSeconds; - ViewPort.Actor.GetWeapon(NewWeaponClass); - } -} - -exec simulated function SwitchWeapon(byte F) -{ - if (ViewPort != None && ViewPort.Actor != None) { - bbPlayer(ViewPort.Actor).zzSwitchedTime = ViewPort.Actor.Level.TimeSeconds; - ViewPort.Actor.SwitchWeapon(F); - } -} - -exec simulated function PrevWeapon() -{ - if (ViewPort != None && ViewPort.Actor != None) { - bbPlayer(ViewPort.Actor).zzSwitchedTime = ViewPort.Actor.Level.TimeSeconds; - ViewPort.Actor.PrevWeapon(); - } -} - -exec simulated function NextWeapon() -{ - if (ViewPort != None && ViewPort.Actor != None) { - bbPlayer(ViewPort.Actor).zzSwitchedTime = ViewPort.Actor.Level.TimeSeconds; - ViewPort.Actor.NextWeapon(); - } -} - -exec simulated function SwitchToBestWeapon() -{ - if (ViewPort != None && ViewPort.Actor != None) { - bbPlayer(ViewPort.Actor).zzSwitchedTime = ViewPort.Actor.Level.TimeSeconds; - ViewPort.Actor.SwitchToBestWeapon(); - } -} - -exec function ThrowWeapon() -{ - if (ViewPort != None && ViewPort.Actor != None && !ViewPort.Actor.Weapon.bTossedOut && !bbPlayer(ViewPort.Actor).xxUsingDefaultWeapon()) { - bbPlayer(ViewPort.Actor).zzSwitchedTime = ViewPort.Actor.Level.TimeSeconds; - ViewPort.Actor.ThrowWeapon(); - } -} - exec function ShowScores() { if (bbPlayer(ViewPort.Actor) != None) @@ -1347,8 +1265,3 @@ exec function Version() else if (bbCHSpectator(ViewPort.Actor) != None) bbCHSpectator(ViewPort.Actor).ClientMessage(class'UTPure'.Default.VersionStr@class'UTPure'.Default.LongVersion$class'UTPure'.Default.NiceVer); } - -defaultproperties -{ - Ello="g0v" -} diff --git a/Classes/bbCHSpectator.uc b/Classes/bbCHSpectator.uc index 22744dbc..8e97fd81 100644 --- a/Classes/bbCHSpectator.uc +++ b/Classes/bbCHSpectator.uc @@ -4,30 +4,6 @@ class bbCHSpectator expands CHSpectator; -// TNSe -// RC5p: -// Added: Ignore Speech & ShowInventory, to avoid server CPU Spike -// Added: ViewRotation.Roll = 0 to avoid problems with headshot when viewing in-eyes. -// RC5T: -// Added: Antispam for ViewClass/ViewPlayer/ViewPlayerNum -// Added: ShowPath to the ignores list in CheatFlying -// Fixed: exec function Jump accessed None -// Added: GotoState('CheatFlying') in PlayerWalking & PlayerSwimming -// RC5v: -// Added: Profile() to the ignoring. -// Added: New DoViewPlayerNum/DoViewClass to avoid server crashes. -// RC5y: -// Fixed: Teleport code to use ProcessMove instead of PlayerTick. -// RC54: -// Added: Anti-adminlogin bruteforce. -// RC55: -// Added: Spec leaves server notifies. (Destroyed()) -// Added: Pause bug fix (Scoreboard/Time/HUD) -// RC7A: -// Changed: Removed the Destroyed() part, seems to crash clients on mapswitch (?) -// Added: Specfix into pure. (PlayerCalcView) - IN PROGRESS -// Fixed: 'FindFlag' should now work with some ascii names on linux too. - // AntiSpam var float zzLastView1,zzLastView2; var int zzAdminLoginTries; @@ -264,32 +240,32 @@ event PreRender( canvas zzCanvas ) // ================================================================================== simulated function xxAttachConsole() { - local PureSuperDuperUberConsole c; - local UTConsole oldc; - - if (zzMyConsole == None) - { - zzMyConsole = PureSuperDuperUberConsole(Player.Console); - if (zzMyConsole == None) - { - //zzbLogoDone = False; - Player.Console.Disable('Tick'); - c = New(None) class'PureSuperDuperUberConsole'; - if (c != None) - { - oldc = UTConsole(Player.Console); - c.zzOldConsole = oldc; - Player.Console = c; - zzMyConsole = c; - zzMyConsole.xxGetValues(); //copy all values from old console to new - } - else - { - zzbBadConsole = zzTrue; - } - } - } - zzbBadConsole = (Player.Console.Class != Class'PureSuperDuperUberConsole'); + // local PureSuperDuperUberConsole c; + // local UTConsole oldc; + + // if (zzMyConsole == None) + // { + // zzMyConsole = PureSuperDuperUberConsole(Player.Console); + // if (zzMyConsole == None) + // { + // //zzbLogoDone = False; + // Player.Console.Disable('Tick'); + // c = New(None) class'PureSuperDuperUberConsole'; + // if (c != None) + // { + // oldc = UTConsole(Player.Console); + // c.zzOldConsole = oldc; + // Player.Console = c; + // zzMyConsole = c; + // zzMyConsole.xxGetValues(); //copy all values from old console to new + // } + // else + // { + // zzbBadConsole = zzTrue; + // } + // } + // } + // zzbBadConsole = (Player.Console.Class != Class'PureSuperDuperUberConsole'); } auto state InvalidState diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index cc4404a9..d72431a3 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -16,7 +16,7 @@ var Sound playedHitSound; var(Sounds) Sound cHitSound[16]; // Replicated settings Client -> Server -var bool zzbConsoleInvalid; // Should always be false on server. +// var bool zzbConsoleInvalid; // Should always be false on server. var bool zzbStoppingTraceBot; // True while stopping Trace Bot var int zzNetspeed; // The netspeed this client is using var bool zzbForcedTick; // True on server if Tick was forced (Called more than once) @@ -84,7 +84,7 @@ var string FakeClass; // Class that the model replaces var string zzMyPacks; // Defined only for defaults var bool zzbBadGuy; // BadGuy! (Avoid kick spamming) var int zzOldForceSettingsLevel; // Kept to see if things change. -var float zzThrownTime, zzSwitchedTime; +var float zzThrownTime; var Weapon zzThrownWeapon; var int zzRecentDmgGiven, zzRecentTeamDmgGiven, TeleRadius; var name zzDefaultWeapon; @@ -157,15 +157,15 @@ var float zzLogoStart; // Start of logo display var int zzSMCnt; // ServerMove Count var bool bMenuFixed; // Fixed Menu item var float zzCVTO; // CenterView Time out. -var bool zzbCanCSL; // Console sets this to true if they are allowed to CSL +//var bool zzbCanCSL; // Console sets this to true if they are allowed to CSL // Consoles & Canvas -var Console zzOldConsole; -var PureSuperDuperUberConsole zzMyConsole; +//var Console zzOldConsole; +//var PureSuperDuperUberConsole zzMyConsole; var bool zzbBadConsole; -var Canvas zzCannibal; // Old console -var font zzCanOldFont; // Canvas messing checks -var byte zzCanOldStyle; // And more +// var Canvas zzCannibal; // Old console +// var font zzCanOldFont; // Canvas messing checks +// var byte zzCanOldStyle; // And more // Anti Timing Variables var Inventory zzAntiTimerList[32]; @@ -315,7 +315,7 @@ replication // Client->Server unreliable if ( Role < ROLE_Authority ) bIsFinishedLoading, xxServerCheater, xxServerMove, - zzbConsoleInvalid, zzFalse, zzTrue, zzNetspeed, zzbBadConsole, zzbBadCanvas, zzbVRChanged, + zzFalse, zzTrue, zzNetspeed, zzbBadConsole, zzbBadCanvas, zzbVRChanged, zzbStoppingTraceBot, zzbForcedTick, zzbDemoRecording, zzbBadLighting, zzClientTD; // Client->Server @@ -495,7 +495,6 @@ event PostBeginPlay() if ( Level.NetMode != NM_Client ) { - zzbCanCSL = True; zzMinimumNetspeed = Class'UTPure'.Default.MinClientRate; zzMaximumNetspeed = Class'UTPure'.Default.MaxClientRate; zzWaitTime = 5.0; @@ -650,37 +649,33 @@ function Timer() { function ClientSetLocation( vector zzNewLocation, rotator zzNewRotation ) { local SavedMove M; - if (zzbCanCSL || - (zzNewRotation.Roll == 0 && zzNewRotation == ViewRotation && - (WarpZoneInfo(Region.Zone) != None || WarpZoneInfo(HeadRegion.Zone) != None || WarpZoneInfo(FootRegion.Zone) != None))) + + ViewRotation = zzNewRotation; + If ( (ViewRotation.Pitch > RotationRate.Pitch) && (ViewRotation.Pitch < 65536 - RotationRate.Pitch) ) { - ViewRotation = zzNewRotation; - If ( (ViewRotation.Pitch > RotationRate.Pitch) && (ViewRotation.Pitch < 65536 - RotationRate.Pitch) ) - { - If (ViewRotation.Pitch < 32768) - zzNewRotation.Pitch = RotationRate.Pitch; - else - zzNewRotation.Pitch = 65536 - RotationRate.Pitch; - } - zzNewRotation.Roll = 0; - SetRotation( zzNewRotation ); - SetLocation( zzNewLocation ); - - // Clean up moves - if (PendingMove != none) { - PendingMove.NextMove = FreeMoves; - PendingMove.Clear(); - FreeMoves = PendingMove; - PendingMove = none; - } + If (ViewRotation.Pitch < 32768) + zzNewRotation.Pitch = RotationRate.Pitch; + else + zzNewRotation.Pitch = 65536 - RotationRate.Pitch; + } + zzNewRotation.Roll = 0; + SetRotation( zzNewRotation ); + SetLocation( zzNewLocation ); - while(SavedMoves != none) { - M = SavedMoves; - SavedMoves = M.NextMove; - M.NextMove = FreeMoves; - M.Clear(); - FreeMoves = M; - } + // Clean up moves + if (PendingMove != none) { + PendingMove.NextMove = FreeMoves; + PendingMove.Clear(); + FreeMoves = PendingMove; + PendingMove = none; + } + + while(SavedMoves != none) { + M = SavedMoves; + SavedMoves = M.NextMove; + M.NextMove = FreeMoves; + M.Clear(); + FreeMoves = M; } } @@ -759,22 +754,10 @@ function xxSendSpreeToSpecs(optional int Sw, optional PlayerReplicationInfo Rela event PlayerTick( float Time ) { - zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = Time; } -function ClientSetRotation( rotator zzNewRotation ) -{ - if (zzbCanCSL) - { - ViewRotation = zzNewRotation; - zzNewRotation.Pitch = 0; - zzNewRotation.Roll = 0; - SetRotation( zzNewRotation ); - } -} - simulated function xxClientDemoMessage(string zzS) { if (zzS == zzPrevClientMessage) @@ -3667,7 +3650,6 @@ state FeigningDeath event PlayerTick( float DeltaTime ) { - zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = DeltaTime; Super.PlayerTick(DeltaTime); @@ -3730,7 +3712,6 @@ state PlayerSwimming event PlayerTick( float DeltaTime ) { - zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = DeltaTime; Super.PlayerTick(DeltaTime); @@ -3801,7 +3782,6 @@ state PlayerFlying { event PlayerTick( float DeltaTime ) { - zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = DeltaTime; Super.PlayerTick(DeltaTime); @@ -3835,7 +3815,6 @@ state CheatFlying { event PlayerTick( float DeltaTime ) { - zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = DeltaTime; Super.PlayerTick(DeltaTime); @@ -4078,7 +4057,6 @@ ignores SeePlayer, HearNoise, Bump; event PlayerTick( float DeltaTime ) { - zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = DeltaTime; Super.PlayerTick(DeltaTime); @@ -4119,7 +4097,6 @@ state PlayerWaiting { event PlayerTick( float DeltaTime ) { - zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = DeltaTime; Super.PlayerTick(DeltaTime); @@ -4489,7 +4466,6 @@ state PlayerSpectating { event PlayerTick( float DeltaTime ) { - zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = DeltaTime; Super.PlayerTick(DeltaTime); @@ -4524,7 +4500,6 @@ state PlayerWaking event PlayerTick( float DeltaTime ) { - zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = DeltaTime; Super.PlayerTick(DeltaTime); @@ -4611,7 +4586,6 @@ state Dying if (Level.Pauser == "") TimeDead += DeltaTime; - zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = DeltaTime; Super.PlayerTick(DeltaTime); @@ -4759,7 +4733,6 @@ ignores SeePlayer, HearNoise, KilledBy, Bump, HitWall, HeadZoneChange, FootZoneC event PlayerTick( float DeltaTime ) { - zzbCanCSL = zzFalse; xxPlayerTickEvents(); zzTick = DeltaTime; Super.PlayerTick(DeltaTime); @@ -5078,11 +5051,6 @@ simulated function bool ClientCannotShoot(optional Weapon W, optional byte Mode, local float Diff; local name WeapState; - if (zzSwitchedTime > 0) - { - Weapon.bChangeWeapon = true; - bCant = true; - } Diff = Level.TimeSeconds - zzSpawnedTime; if (Diff < 1) { @@ -5165,9 +5133,6 @@ function xxPlayerTickEvents() zzbInitialized = true; } - if (zzSwitchedTime > 0 && CurrentTime - zzSwitchedTime > float(PlayerReplicationInfo.Ping)/499) - zzSwitchedTime = 0; - if (Player.CurrentNetSpeed != 0 && CurrentTime - zzLastStuffUpdate > 500.0/Player.CurrentNetSpeed) { xxGetDemoPlaybackSpec(); @@ -5184,13 +5149,6 @@ function xxPlayerTickEvents() if (zzbIsWarmingUp) ClearProgressMessages(); - if (zzCannibal != None) - { - if ((zzCannibal.Font != zzCanOldFont) || (zzCannibal.Style != zzCanOldStyle)) - { - xxServerCheater("HA"); - } - } if (zzbReportScreenshot) xxDoShot(); @@ -5409,8 +5367,6 @@ event PreRender( canvas zzCanvas ) zzbDemoRecording = PureLevel != None && PureLevel.zzDemoRecDriver != None; - zzbConsoleInvalid = zzTrue; - zzbBadCanvas = zzbBadCanvas || (zzCanvas != None && zzCanvas.Class != Class'Canvas'); zzLastVR = ViewRotation; @@ -5799,39 +5755,39 @@ exec function PureLogo() // ================================================================================== simulated function xxAttachConsole() { - local PureSuperDuperUberConsole c; - local UTConsole oldc; - - if (Player.Actor != Self) - xxServerCheater("VA"); - - if (zzMyConsole == None) - { - zzMyConsole = PureSuperDuperUberConsole(Player.Console); - if (zzMyConsole == None) - { - // Initialize Logo Display - zzbLogoDone = False; - // - Player.Console.Disable('Tick'); - c = New(None) class'PureSuperDuperUberConsole'; - if (c != None) - { - oldc = UTConsole(Player.Console); - c.zzOldConsole = oldc; - Player.Console = c; - zzMyConsole = c; - zzMyConsole.xxGetValues(); //copy all values from old console to new - } - else - { - zzbBadConsole = zzTrue; - } - } - } - // Do not use ELSE or it wont work correctly - - zzbBadConsole = (Player.Console.Class != Class'PureSuperDuperUberConsole'); + // local PureSuperDuperUberConsole c; + // local UTConsole oldc; + + // if (Player.Actor != Self) + // xxServerCheater("VA"); + + // if (zzMyConsole == None) + // { + // zzMyConsole = PureSuperDuperUberConsole(Player.Console); + // if (zzMyConsole == None) + // { + // // Initialize Logo Display + // zzbLogoDone = False; + // // + // Player.Console.Disable('Tick'); + // c = New(None) class'PureSuperDuperUberConsole'; + // if (c != None) + // { + // oldc = UTConsole(Player.Console); + // c.zzOldConsole = oldc; + // Player.Console = c; + // zzMyConsole = c; + // zzMyConsole.xxGetValues(); //copy all values from old console to new + // } + // else + // { + // zzbBadConsole = zzTrue; + // } + // } + // } + // // Do not use ELSE or it wont work correctly + + // zzbBadConsole = (Player.Console.Class != Class'PureSuperDuperUberConsole'); } function xxServerCheater(string zzCode) @@ -5905,42 +5861,38 @@ function xxServerCheater(string zzCode) // ================================================================================== simulated function xxCheatFound(string zzCode) { - local UTConsole zzcon; + local UTConsole C; if (zzbBadGuy) return; zzbBadGuy = True; - if (zzMyConsole == None || zzcon == None) - return; - - zzMyConsole.xxRevert(); - zzcon = zzMyConsole.zzOldConsole; - zzcon.AddString( "=====================================================================" ); - zzcon.AddString( " UTPure has detected an impurity hiding in your client!" ); - zzcon.AddString( " ID:"@zzCode ); - zzcon.AddString( "=====================================================================" ); - zzcon.AddString( "Because of this you have been removed from the" ); - zzcon.AddString( "server. Fair play is important, remove the impurity" ); - zzcon.AddString( "and you can return!"); - zzcon.AddString( " "); - zzcon.AddString( "If you feel this was in error, please contact the admin" ); - zzcon.AddString( "at: "$GameReplicationInfo.AdminEmail); - zzcon.AddString( " "); - zzcon.AddString( "Please visit http://forums.utpure.com" ); - zzcon.AddString( "You can read info regarding what UTPure is and maybe find a fix there!" ); + C = UTConsole(Player.Console); + C.AddString( "=====================================================================" ); + C.AddString( " UTPure has detected an impurity hiding in your client!" ); + C.AddString( " ID:"@zzCode ); + C.AddString( "=====================================================================" ); + C.AddString( "Because of this you have been removed from the" ); + C.AddString( "server. Fair play is important, remove the impurity" ); + C.AddString( "and you can return!"); + C.AddString( " "); + C.AddString( "If you feel this was in error, please contact the admin" ); + C.AddString( "at: "$GameReplicationInfo.AdminEmail); + C.AddString( " "); + C.AddString( "Please visit http://forums.utpure.com" ); + C.AddString( "You can read info regarding what UTPure is and maybe find a fix there!" ); if (int(Level.EngineVersion) < 436) { - zzcon.AddString(" "); - zzcon.AddString("You currently have UT version"@Level.EngineVersion$"!"); - zzcon.AddString("In order to play on this server, you must have version 436 or greater!"); - zzcon.AddString("To download newest patch, go to: http://unreal.epicgames.com/Downloads.htm"); + C.AddString(" "); + C.AddString("You currently have UT version"@Level.EngineVersion$"!"); + C.AddString("In order to play on this server, you must have version 436 or greater!"); + C.AddString("To download newest patch, go to: http://unreal.epicgames.com/Downloads.htm"); } - zzcon.bQuickKeyEnable = True; - zzcon.LaunchUWindow(); - zzcon.ShowConsole(); + C.bQuickKeyEnable = True; + C.LaunchUWindow(); + C.ShowConsole(); } simulated function String GetItemName( string FullName ) // Originally not Simulated .. wtf! @@ -7219,20 +7171,7 @@ function Typing( bool bTyping ) function bool xxCanFire() { - return (Role==ROLE_Authority || (Role Date: Sun, 9 Aug 2020 13:11:21 +0200 Subject: [PATCH 55/70] Fix ClientSettings --- Classes/bbCHSpectator.uc | 47 ++++++++++++++++++++++++---------------- Classes/bbPlayer.uc | 40 ++++++++++++++++++++-------------- 2 files changed, 52 insertions(+), 35 deletions(-) diff --git a/Classes/bbCHSpectator.uc b/Classes/bbCHSpectator.uc index 22744dbc..c6d9d85a 100644 --- a/Classes/bbCHSpectator.uc +++ b/Classes/bbCHSpectator.uc @@ -230,10 +230,37 @@ simulated function xxSetTimes(int RemainingTime, int ElapsedTime) GameReplicationInfo.ElapsedTime = ElapsedTime; } +function InitSettings() { + local bbPlayer P; + local bbCHSpectator S; + + if (Settings != none) return; + + foreach AllActors(class'bbPlayer', P) + if (P.Settings != none) { + Settings = P.Settings; + break; + } + + foreach AllActors(class'bbCHSpectator', S) + if (S.Settings != none) { + Settings = S.Settings; + break; + } + + if (Settings == none) { + ClientSettingsHelper = new(self, 'InstaGibPlus') class'Object'; + Settings = new(ClientSettingsHelper, 'ClientSettings') class'ClientSettings'; + Log("Loaded Settings!", 'IGPlus'); + } +} + event Possess() { local Mover M; + InitSettings(); + if ( Level.Netmode == NM_Client ) { // Only do this for clients. } @@ -405,9 +432,6 @@ event PlayerTick( float DeltaTime ) event PostBeginPlay() { - local bbPlayer P; - local bbCHSpectator S; - ForEach AllActors(Class'UTPure', zzUTPure) break; @@ -416,22 +440,7 @@ event PostBeginPlay() Super.PostBeginPlay(); - foreach AllActors(class'bbPlayer', P) - if (P.Settings != none) { - Settings = P.Settings; - break; - } - - foreach AllActors(class'bbCHSpectator', S) - if (S.Settings != none) { - Settings = S.Settings; - break; - } - - if (Settings == none) { - ClientSettingsHelper = new(self) class'Object'; - Settings = new(ClientSettingsHelper, 'ClientSettings') class'ClientSettings'; - } + InitSettings(); } event PostRender( canvas Canvas ) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index cc4404a9..a83bfa8e 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -486,23 +486,11 @@ simulated function xxClientKicker( float KCollisionRadius, float KCollisionHeigh } } -event PostBeginPlay() -{ +function InitSettings() { local bbPlayer P; local bbCHSpectator S; - Super.PostBeginPlay(); - - if ( Level.NetMode != NM_Client ) - { - zzbCanCSL = True; - zzMinimumNetspeed = Class'UTPure'.Default.MinClientRate; - zzMaximumNetspeed = Class'UTPure'.Default.MaxClientRate; - zzWaitTime = 5.0; - } - SetPendingWeapon = class'UTPure'.Default.SetPendingWeapon; - - PlayerReplicationInfo.NetUpdateFrequency = 10; + if (Settings != none) return; foreach AllActors(class'bbPlayer', P) if (P.Settings != none) { @@ -517,11 +505,29 @@ event PostBeginPlay() } if (Settings == none) { - ClientSettingsHelper = new(self) class'Object'; - Settings = new(ClientSettingsHelper, 'ClientSettings') class'ClientSettings'; + ClientSettingsHelper = new(self, 'InstaGibPlus') class'Object'; // object name = INI file name + Settings = new(ClientSettingsHelper, 'ClientSettings') class'ClientSettings'; // object name = Section name + Log("Loaded Settings!", 'IGPlus'); } } +event PostBeginPlay() +{ + Super.PostBeginPlay(); + InitSettings(); + + if ( Level.NetMode != NM_Client ) + { + zzbCanCSL = True; + zzMinimumNetspeed = Class'UTPure'.Default.MinClientRate; + zzMaximumNetspeed = Class'UTPure'.Default.MaxClientRate; + zzWaitTime = 5.0; + } + SetPendingWeapon = class'UTPure'.Default.SetPendingWeapon; + + PlayerReplicationInfo.NetUpdateFrequency = 10; +} + // called after PostBeginPlay on net client simulated event PostNetBeginPlay() { @@ -560,6 +566,8 @@ event Possess() local int TimeLimitSeconds, clientFPS; local bbPlayer zzPP; + InitSettings(); + if ( Level.Netmode == NM_Client ) { // Only do this for clients. SetTimer(3, false); From 6704a6b09c09613bfa17a3a4d4d461cd0879a510 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 9 Aug 2020 15:58:35 +0200 Subject: [PATCH 56/70] Remove Vestiges of Custom Console, fix Demos for Spectators --- Classes/PureSuperDuperConsole.uc | 47 - Classes/PureSuperDuperUberConsole.uc | 1267 -------------------------- Classes/bbCHSpectator.uc | 56 +- Classes/bbPlayer.uc | 63 +- 4 files changed, 23 insertions(+), 1410 deletions(-) delete mode 100644 Classes/PureSuperDuperConsole.uc delete mode 100644 Classes/PureSuperDuperUberConsole.uc diff --git a/Classes/PureSuperDuperConsole.uc b/Classes/PureSuperDuperConsole.uc deleted file mode 100644 index 6d5cbf8b..00000000 --- a/Classes/PureSuperDuperConsole.uc +++ /dev/null @@ -1,47 +0,0 @@ -// =============================================================== -// UTPureRC6B.PureSuperDuperConsole: put your comment here - -// Created by UClasses - (C) 2000-2001 by meltdown@thirdtower.com -// =============================================================== - -class PureSuperDuperConsole extends UTConsole; - -event PreRender( canvas zzCanvas); //never used. -event PostRender( canvas zzC ); - -event bool KeyType( EInputKey Key ); -event bool KeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta ); - -event Tick( float Delta ); - -function ShowConsole(); -function HideConsole(); - -function DrawConsoleView( Canvas C ); -function DrawSingleView( Canvas C ); - -exec function TimeDemo(bool bEnabled, optional bool bSaveToFile); -function TimeDemoRender( Canvas C ); -function StartTimeDemo(); -function StopTimeDemo(); -function PrintTimeDemoResult(); -function TimeDemoCalc(); - -function LaunchUWindow(); -function CloseUWindow(); - -function RenderUWindow( canvas Canvas ); - -exec function MenuCmd(int Menu, int Item); -exec function ShowObjectives(); - -function DrawLevelAction( canvas C ); -function PrintActionMessage( Canvas C, string BigMessage ); - -function CreateMessage(); -function ShowMessage(); -function HideMessage(); - -defaultproperties -{ -} diff --git a/Classes/PureSuperDuperUberConsole.uc b/Classes/PureSuperDuperUberConsole.uc deleted file mode 100644 index 1bc633d4..00000000 --- a/Classes/PureSuperDuperUberConsole.uc +++ /dev/null @@ -1,1267 +0,0 @@ -//============================================================================= -// CSHPSuperDuperUberConsole -// -// This is our custom console class. It allows us to control the VR and the -// easiest route to drawing on the canvas. -// -// (c) 2001, Midnight Interactive -//============================================================================= - -// TNSe -// 5b2: -// Added: some checks for accessed none... -// 5c: -// Added: 3 execs (ShowIPs, ShowNetSpeeds, ShowTickrate) -// 5T: -// Added: ConsoleCommand is only allowed during zzbCanCSL ... Temp disabled. -// Added: MessageWindow.HideWindow() in UWindowRender to avoid EzRadar. -// 5w: -// Added: Replaced the code MessageWindow.HideWindow() with the actual code behind it. - -// 6B: -// Changed: added PureSuperDuperConsole to remove Tick() ;) - -// 7D: -// Added: functionality to check for Canvas Activity between PostRender & PreRender. - -// UsAaR33 -// Added: bbPlayer.zzbCanCSL in PostRender() to avoid CSL/CSR haxx0ring -// 5e: -// Fixed: A possible accessed None in xxRevert() - -class PureSuperDuperUberConsole extends PureSuperDuperConsole; - -var UTConsole zzOldConsole; -var int zzMyState; // 0=global state 1=UWINDOW 2=Typing -var bool bForcedStats; -var string Ello; - -event PreRender( canvas zzC); - -event PostRender( canvas zzC ) -{ - local int YStart, YEnd; - local bbPlayer zzbb; - - //Log("Console.PostRender"); - - if (zzMyState==1) { - if( bTimeDemo ) - { - TimeDemoCalc(); - TimeDemoRender( zzC ); - } - - if(Root != None) - Root.bUWindowActive = True; - - RenderUWindow( zzC ); - } else { - if(bNoDrawWorld) - { - zzC.SetPos(0,0); - zzC.DrawPattern( Texture'Border', zzC.ClipX, zzC.ClipY, 1.0 ); - } - - if( bTimeDemo ) - { - TimeDemoCalc(); - TimeDemoRender( zzC ); - } - - // call overridable "level action" rendering code to draw the "big message" - DrawLevelAction( zzC ); - - // If the console has changed since the previous frame, draw it. - if ( ConsoleLines > 0 ) - { - zzC.SetOrigin(0.0, ConsoleLines - FrameY*0.6); - zzC.SetPos(0.0, 0.0); - zzC.DrawTile( ConBackground, FrameX, FrameY*0.6, zzC.CurX, zzC.CurY, FrameX, FrameY ); - } - - // Draw border. - if ( BorderLines > 0 || BorderPixels > 0 ) - { - YStart = BorderLines + ConsoleLines; - YEnd = FrameY - BorderLines; - if ( BorderLines > 0 ) - { - zzC.SetOrigin(0.0, 0.0); - zzC.SetPos(0.0, 0.0); - zzC.DrawPattern( Border, FrameX, BorderLines, 1.0 ); - zzC.SetPos(0.0, YEnd); - zzC.DrawPattern( Border, FrameX, BorderLines, 1.0 ); - } - if ( BorderPixels > 0 ) - { - zzC.SetOrigin(0.0, 0.0); - zzC.SetPos(0.0, YStart); - zzC.DrawPattern( Border, BorderPixels, YEnd - YStart, 1.0 ); - zzC.SetPos( FrameX - BorderPixels, YStart ); - zzC.DrawPattern( Border, BorderPixels, YEnd - YStart, 1.0 ); - } - } - - // Draw console text. - zzC.SetOrigin(0.0, 0.0); - if ( ConsoleLines > 0 ) - DrawConsoleView( zzC ); - else - DrawSingleView( zzC ); - - //global: - - //UT CONSOLE: -// if(bShowSpeech || bShowMessage) -// RenderUWindow(zzC); - - } -} - -final function xxWindowPostRender(canvas zzCanvas) -{ //UWindow.postrender - -// Log("Console.WindowPostRender"); - -} - -event bool KeyType( EInputKey Key ) -{ - if (zzMyState==0) - return false; - - if (zzMyState==1) - { - if (root==none) - return false; - - Root.WindowEvent(WM_KeyType, None, MouseX, MouseY, Key); - return True; - } - - if ( bNoStuff ) - { - bNoStuff = false; - return true; - } - - if( Key>=0x20 && Key<0x100 && Key!=Asc("~") && Key!=Asc("`") ) - { - TypedStr = TypedStr $ Chr(Key); - Scrollback=0; - return true; - } - -} - -//unlinker: -event NotifyLevelChange() -{ - // Unhook ourselves - xxRevert(); -// Log("UTPure Console UnHooked"); //@@removeline - zzOldConsole.NotifyLevelChange(); //call notify on old console. -} - -event bool KeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta ) -{ - local byte zzk; - local bbPlayer zzbbP; - - zzbbP = bbPlayer(ViewPort.Actor); - - if (zzMyState!=0) - { - if (zzMyState==1&&Key!=IK_F9) //exception for screenshot. - return xxWinKeyEvent(Key,Action,Delta); - if (zzMyState==2&&Key==IK_Escape) - return xxTypingKeyEvent(Key,Action,Delta); - } - - //UT console: - if( Action!=IST_Press ) - return false; - - if( Key==SpeechKey ) - { - if ( !bShowSpeech && !bTyping ) - { - ShowSpeech(); - bQuickKeyEnable = True; - LaunchUWindow(); - } - return true; - } - - //wiped one as it is for ladder - //from Window Console: - zzk = Key; - switch(Action) - { - case IST_Press: - switch(zzk) - { - case EInputKey.IK_Escape: - if (bLocked) - return true; - - bQuickKeyEnable = False; - LaunchUWindow(); - return true; - - case ConsoleKey: - if (bLocked) - return true; - - bQuickKeyEnable = True; - LaunchUWindow(); - if(!bShowConsole) - ShowConsole(); - return true; - } - break; - } - if (zzMyState==2) //emulates global key event. - return xxTypingKeyEvent(Key,Action,Delta); - - return False; -} - -final function bool xxWinKeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta ) -{ - local byte zzk; -//UTconsole: - if(Action==IST_Release && Key==SpeechKey) - { - if (bShowSpeech) - HideSpeech(); - return True; - } - - if ( bShowSpeech && (SpeechWindow != None) ) - { - - //forward input to speech window - if ( SpeechWindow.KeyEvent(Key, Action, Delta) ) - return true; - } -//WINDOWCONSOLE: - zzk = Key; - - switch (Action) - { - case IST_Release: - switch (zzk) - { - case EInputKey.IK_LeftMouse: - if(Root != None) - Root.WindowEvent(WM_LMouseUp, None, MouseX, MouseY, zzk); - break; - case EInputKey.IK_RightMouse: - if(Root != None) - Root.WindowEvent(WM_RMouseUp, None, MouseX, MouseY, zzk); - break; - case EInputKey.IK_MiddleMouse: - if(Root != None) - Root.WindowEvent(WM_MMouseUp, None, MouseX, MouseY, zzk); - break; - default: - if(Root != None) - Root.WindowEvent(WM_KeyUp, None, MouseX, MouseY, zzk); - break; - } - break; - - case IST_Press: - switch (zzk) - { - case ConsoleKey: - if (bShowConsole) - { - HideConsole(); - if(bQuickKeyEnable) - CloseUWindow(); - } - else - { - if(Root.bAllowConsole) - ShowConsole(); - else - Root.WindowEvent(WM_KeyDown, None, MouseX, MouseY, zzk); - } - break; - - case EInputKey.IK_Escape: - if(Root != None) - Root.CloseActiveWindow(); - break; - case EInputKey.IK_LeftMouse: - if(Root != None) - Root.WindowEvent(WM_LMouseDown, None, MouseX, MouseY, zzk); - break; - case EInputKey.IK_RightMouse: - if(Root != None) - Root.WindowEvent(WM_RMouseDown, None, MouseX, MouseY, zzk); - break; - case EInputKey.IK_MiddleMouse: - if(Root != None) - Root.WindowEvent(WM_MMouseDown, None, MouseX, MouseY, zzk); - break; - default: - if(Root != None) - Root.WindowEvent(WM_KeyDown, None, MouseX, MouseY, zzk); - break; - } - break; - case IST_Axis: - switch (Key) - { - case IK_MouseX: - MouseX = MouseX + (MouseScale * Delta); - break; - case IK_MouseY: - MouseY = MouseY - (MouseScale * Delta); - break; - } - default: - break; - } - return true; -} - -//typing state: (engine.console) -final function bool xxTypingKeyEvent( EInputKey Key, EInputAction Action, FLOAT Delta ) -{ - local string Temp; - bNoStuff = false; - if( Key==IK_Escape ) - { - if( Scrollback!=0 ) - { - Scrollback=0; - } - else if( TypedStr!="" ) - { - TypedStr=""; - } - else - { - ConsoleDest=0.0; - bTyping = false; - Viewport.Actor.Typing(bTyping); - zzMyState=0; - } - Scrollback=0; - } - else if( Key==IK_Enter ) - { - if( Scrollback!=0 ) - { - Scrollback=0; - } - else - { - if( TypedStr!="" ) - { - // Print to console. - if( ConsoleLines!=0 ) - Message( None, "(>" @ TypedStr, 'Console' ); - // Update history buffer. - History[HistoryCur++ % MaxHistory] = TypedStr; - if( HistoryCur > HistoryBot ) - HistoryBot++; - if( HistoryCur - HistoryTop >= MaxHistory ) - HistoryTop = HistoryCur - MaxHistory + 1; - - // Make a local copy of the string. - Temp=TypedStr; - TypedStr=""; - if( !ConsoleCommand( Temp ) ) - Message( None, Localize("Errors","Exec","Core"), 'Console' ); - - Message( None, "", 'Console' ); - } - if( ConsoleDest==0.0 ) - { - zzMyState=0; - bTyping = false; - Viewport.Actor.Typing(false); - } - //log("Console leaving Typing"); - - Scrollback=0; - } - } - else if( Key==IK_Up ) - { - if( HistoryCur > HistoryTop ) - { - History[HistoryCur % MaxHistory] = TypedStr; - TypedStr = History[--HistoryCur % MaxHistory]; - } - Scrollback=0; - } - else if( Key==IK_Down ) - { - History[HistoryCur % MaxHistory] = TypedStr; - if( HistoryCur < HistoryBot ) - TypedStr = History[++HistoryCur % MaxHistory]; - else - TypedStr=""; - Scrollback=0; - } - else if( Key==IK_PageUp ) - { - if( ++Scrollback >= MaxLines ) - Scrollback = MaxLines-1; - } - else if( Key==IK_PageDown ) - { - if( --Scrollback < 0 ) - Scrollback = 0; - } - else if( Key==IK_Backspace || Key==IK_Left ) - { - if( Len(TypedStr)>0 ) - TypedStr = Left(TypedStr,Len(TypedStr)-1); - Scrollback = 0; - } - return true; -} - -// Called each rendering iteration to update any time-based display. -event Tick( float Delta ) -{ - // Tick is - - //Console (probably not needed though): - MsgTickTime += Delta; - - // Slide console up or down. - if( ConsolePos < ConsoleDest ) - ConsolePos = FMin(ConsolePos+Delta,ConsoleDest); - else if( ConsolePos > ConsoleDest ) - ConsolePos = FMax(ConsolePos-Delta,ConsoleDest); - - // Update status message. - if( ((MsgTime-=Delta) <= 0.0) && (TextLines > 0) ) - TextLines--; - - //WindowConsole: - if(bLevelChange && Root != None && string(Viewport.Actor.Level) != OldLevel) - { - OldLevel = string(Viewport.Actor.Level); - // if this is Entry, we could be falling through to another level... - if(Viewport.Actor.Level != Viewport.Actor.GetEntryLevel()) - bLevelChange = False; - Root.NotifyAfterLevelChange(); - } - - //UTconsole: - if ( Root != None && (bShowMessage ||zzMyState==1)) - { - Root.DoTick( Delta ); //an aimbot may potentially exist here. - } - //UTconsole.Uwindow: - if (zzMyState==0&&root!=none&&viewport.actor.Song == None) - if ( FRand() < 0.5 ) - viewport.actor.ClientSetMusic( Music(DynamicLoadObject("Skyward.Skyward", class'Music')), 0, 0, MTRAN_Fade ); - else if ( FRand() < 0.5 ) - viewport.actor.ClientSetMusic( Music(DynamicLoadObject("Foregone.Foregone", class'Music')), 0, 0, MTRAN_Fade ); - else if ( FRand() < 0.5 ) - viewport.actor.ClientSetMusic( Music(DynamicLoadObject("Nether.Nether", class'Music')), 0, 0, MTRAN_Fade ); - else if ( FRand() < 0.5 ) - viewport.actor.ClientSetMusic( Music(DynamicLoadObject("Course.Course", class'Music')), 0, 0, MTRAN_Fade ); - else - viewport.actor.ClientSetMusic( Music(DynamicLoadObject("Mech8.Mech8", class'Music')), 0, 0, MTRAN_Fade ); -} - -final function xxGetValues() //initial only -{ - local int i; - local UWindowList zzList; - - ConsoleWindow = zzOldConsole.ConsoleWindow; - ViewPort = zzOldConsole.ViewPort; - - if (zzOldConsole.Root != None) - { - Root = zzOldConsole.Root; - Root.Console = Self; - } - else - { - Root = None; - } - - SpeechWindow = zzOldConsole.SpeechWindow; - MessageWindow = zzOldConsole.MessageWindow; - bTyping = zzOldConsole.bTyping; - TypedStr = zzOldConsole.TypedStr; - bShowSpeech = zzOldConsole.bShowSpeech; - bCreatedRoot = zzOldConsole.bCreatedRoot; - bshowconsole = zzOldConsole.bshowconsole; - MouseX= zzOldConsole.MouseX; - MouseY= zzOldConsole.MouseY; - bUWindowType= zzOldConsole.bUWindowType; - bUWindowActive=zzOldConsole.bUWindowActive; - bLocked=zzOldConsole.bLocked; - bQuickKeyEnable=zzOldConsole.bQuickKeyEnable; - showdesktop=zzOldConsole.showdesktop; - // added by DB - bTimeDemo=zzOldConsole.bTimeDemo; - bSaveTimeDemoToFile=zzOldConsole.bSaveTimeDemoToFile; - // copy history - HistoryCur = zzOldConsole.HistoryCur; - HistoryTop = zzOldConsole.HistoryTop; - //added by UsA: this may be needed? - bLevelChange=zzOldConsole.bLevelChange; - OldLevel=zzOldConsole.OldLevel; - RootWindow=zzOldConsole.RootWindow; - for (i = 0; i 0 && (!Viewport.Actor.bShowMenu || Viewport.Actor.bShowScores) ) - { - J = TopLine; - I = 0; - while ((I < 4) && (J >= 0)) - { - if ((MsgText[J] != "") && (MsgTick[J] > 0.0) && (MsgTick[J] > MsgTickTime) ) - { - if (MsgType[J] == 'Say') - ShortMessages[I] = MsgPlayer[J]$":"@MsgText[J]; - else - ShortMessages[I] = MsgText[J]; - I++; - } - J--; - } - - J = 0; - C.Font = C.MedFont; - for ( I = 0; I < 4; I++ ) - { - if (ShortMessages[3 - I] != "") - { - C.SetPos(4, 2 + (10 * J) + (10 * ExtraSpace)); - C.StrLen( ShortMessages[3 - I], XL, YL ); - C.DrawText( ShortMessages[3 - I], false ); - if ( YL == 18.0 ) - ExtraSpace++; - J++; - } - } - } -} - -//TD overloads (prevent a superclass console bot from abusing): -exec function TimeDemo(bool bEnabled, optional bool bSaveToFile) -{ - bSaveTimeDemoToFile = bSaveToFile; - if(bEnabled) - StartTimeDemo(); - else - StopTimeDemo(); -} - -function TimeDemoRender( Canvas C ) -{ - local string AText, LText; - local float W, H; - if( TimeDemoFont == None ) - TimeDemoFont = class'FontInfo'.Static.GetStaticSmallFont(C.ClipX); - - C.Font = TimeDemoFont; - C.DrawColor.R = 255; - C.DrawColor.G = 255; - C.DrawColor.B = 255; - - AText = AvgText @ FormatFloat(FrameCount / (Viewport.Actor.GetEntryLevel().TimeSeconds - StartTime - ExtraTime)); - LText = LastSecText @ FormatFloat(LastSecFPS); - - C.TextSize(AText, W, H); - C.SetPos(C.ClipX - W, 0.3*C.ClipY); - C.DrawText(AText); - C.TextSize(LText, W, H); - C.SetPos(C.ClipX - W, 0.3*C.ClipY+H); - C.DrawText(LText); -} - -function StartTimeDemo() -{ - TimeDemoFont = None; - if(bTimeDemo) - return; - bTimeDemo = True; - bStartTimeDemo = True; -} - -function StopTimeDemo() -{ - if(!bTimeDemo) - return; - bTimeDemo = False; - PrintTimeDemoResult(); -} - -function PrintTimeDemoResult() -{ - local LevelInfo Entry; - local float Avg; - local float Delta; - local string AvgString; - local string Temp; - - Entry = Viewport.Actor.GetEntryLevel(); - - Delta = Entry.TimeSeconds - StartTime - ExtraTime; - if(Delta <= 0) - Avg = 0; - else - Avg = FrameCount / Delta; - - AvgString = string(FrameCount)@FramesText@FormatFloat(delta)@SecondsText@MinText@FormatFloat(MinFPS)@MaxText@FormatFloat(MaxFPS)@AvgText@FormatFloat(Avg)@fpsText$"."; - Viewport.Actor.ClientMessage(AvgString); - Log(AvgString); - if(bSaveTimeDemoToFile) - { - Temp = - FormatFloat(Avg) $ " Unreal "$ Viewport.Actor.Level.EngineVersion $ Chr(13) $ Chr(10) $ - FormatFloat(MinFPS) $ " Min"$ Chr(13) $ Chr(10) $ - FormatFloat(MaxFPS) $ " Max"$ Chr(13) $ Chr(10); - - SaveTimeDemo(Temp); - } -} - -function TimeDemoCalc() -{ - local LevelInfo Entry; - local float Delta; - Entry = Viewport.Actor.GetEntryLevel(); - - if( bRestartTimeDemo ) - { - StopTimeDemo(); - StartTimeDemo(); - bRestartTimeDemo = False; - } - - if( bStartTimeDemo ) - { - bStartTimeDemo = False; - StartTime = Entry.TimeSeconds; - ExtraTime = 0; - LastFrameTime = StartTime; - LastSecondStartTime = StartTime; - FrameCount = 0; - LastSecondFrameCount = 0; - MinFPS = 0; - MaxFPS = 0; - LastSecFPS = 0; - return; - } - - Delta = Entry.TimeSeconds - LastFrameTime; - - // If delta time is more than a half of a second, ignore frame entirely (precaching, loading etc) - if( Delta > 0.5 ) - { - ExtraTime += Delta; - LastSecondStartTime = Entry.TimeSeconds; - LastSecondFrameCount = 0; - LastFrameTime = Entry.TimeSeconds; - return; - } - - FrameCount++; - LastSecondFrameCount++; - - if( Entry.TimeSeconds - LastSecondStartTime > 1) - { - LastSecFPS = LastSecondFrameCount / (Entry.TimeSeconds - LastSecondStartTime); - if( MinFPS == 0 || LastSecFPS < MinFPS ) - MinFPS = LastSecFPS; - if( LastSecFPS > MaxFPS ) - MaxFPS = LastSecFPS; - LastSecondFrameCount = 0; - LastSecondStartTime = Entry.TimeSeconds; - } - - LastFrameTime = Entry.TimeSeconds; -} - -//window state holders: -function LaunchUWindow() -{ - Viewport.bSuspendPrecaching = True; - bUWindowActive = !bQuickKeyEnable; - Viewport.bShowWindowsMouse = True; - - if(bQuickKeyEnable) - bNoDrawWorld = False; - else - { - if(Viewport.Actor.Level.NetMode == NM_Standalone) - Viewport.Actor.SetPause( True ); - bNoDrawWorld = ShowDesktop; - } - if(Root != None) - Root.bWindowVisible = True; - if (zzMyState==2){ //check typing! - bTyping = false; - Viewport.Actor.Typing(bTyping); - } - zzMyState=1; -} -function CloseUWindow() -{ - if(!bQuickKeyEnable) - Viewport.Actor.SetPause( False ); - - bNoDrawWorld = False; - bQuickKeyEnable = False; - bUWindowActive = False; - Viewport.bShowWindowsMouse = False; - - if(Root != None) - Root.bWindowVisible = False; - zzMyState=0; - Viewport.bSuspendPrecaching = False; -} - - -function RenderUWindow( canvas zzCanvas ) -{ - local UWindowWindow NewFocusWindow; - zzCanvas.bNoSmooth = True; - zzCanvas.Z = 1; - zzCanvas.Style = 1; - zzCanvas.DrawColor.r = 255; - zzCanvas.DrawColor.g = 255; - zzCanvas.DrawColor.b = 255; - - if(Viewport.bWindowsMouseAvailable && Root != None) - { - MouseX = Viewport.WindowsMouseX/Root.GUIScale; - MouseY = Viewport.WindowsMouseY/Root.GUIScale; - } - - if(!bCreatedRoot) - CreateRootWindow(zzCanvas); - - Root.bWindowVisible = True; - Root.bUWindowActive = bUWindowActive; - Root.bQuickKeyEnable = bQuickKeyEnable; - - if(zzCanvas.ClipX != OldClipX || zzCanvas.ClipY != OldClipY) - { - OldClipX = zzCanvas.ClipX; - OldClipY = zzCanvas.ClipY; - - Root.WinTop = 0; - Root.WinLeft = 0; - Root.WinWidth = zzCanvas.ClipX / Root.GUIScale; - Root.WinHeight = zzCanvas.ClipY / Root.GUIScale; - - Root.RealWidth = zzCanvas.ClipX; - Root.RealHeight = zzCanvas.ClipY; - - Root.ClippingRegion.X = 0; - Root.ClippingRegion.Y = 0; - Root.ClippingRegion.W = Root.WinWidth; - Root.ClippingRegion.H = Root.WinHeight; - - Root.Resized(); - } - - if(MouseX > Root.WinWidth) MouseX = Root.WinWidth; - if(MouseY > Root.WinHeight) MouseY = Root.WinHeight; - if(MouseX < 0) MouseX = 0; - if(MouseY < 0) MouseY = 0; - - - // Check for keyboard focus - NewFocusWindow = Root.CheckKeyFocusWindow(); - - if(NewFocusWindow != Root.KeyFocusWindow) - { - Root.KeyFocusWindow.KeyFocusExit(); - Root.KeyFocusWindow = NewFocusWindow; - Root.KeyFocusWindow.KeyFocusEnter(); - } - - - Root.MoveMouse(MouseX, MouseY); -// MessageWindow.WindowHidden(); -// MessageWindow.ParentWindow.HideChildWindow(MessageWindow); -// MessageWindow = None; // Stop EzRadar. Dumb DarkByte didn't want this :( - Root.WindowEvent(WM_Paint, zzCanvas, MouseX, MouseY, 0); - if(bUWindowActive || bQuickKeyEnable) - Root.DrawMouse(zzCanvas); -} - -event Message( PlayerReplicationInfo PRI, coerce string Msg, name N ) -{ - local string OutText; - if( Msg!="" ) - { - TopLine = (TopLine+1) % MaxLines; - NumLines = Min(NumLines+1,MaxLines-1); - MsgType[TopLine] = N; - MsgTime = 6.0; - TextLines++; - MsgText[TopLine] = Msg; - MsgPlayer[TopLine] = PRI; - MsgTick[TopLine] = MsgTickTime + MsgTime; - } - - if ( Viewport.Actor == None ) - return; - - if( Msg!="" ) - { - if (( MsgType[TopLine] == 'Say' ) || ( MsgType[TopLine] == 'TeamSay' )) - OutText = MsgPlayer[TopLine].PlayerName$": "$MsgText[TopLine]; - else - OutText = MsgText[TopLine]; - if (ConsoleWindow != None) - UWindowConsoleClientWindow(ConsoleWindow.ClientArea).TextArea.AddText(OutText); - } -} - -event AddString( coerce string Msg ) -{ - if( Msg!="" ) - { - TopLine = (TopLine+1) % MaxLines; - NumLines = Min(NumLines+1,MaxLines-1); - MsgType[TopLine] = 'Event'; - MsgTime = 6.0; - TextLines++; - MsgText[TopLine] = Msg; - MsgPlayer[TopLine] = None; - MsgTick[TopLine] = MsgTickTime + MsgTime; - - if (ConsoleWindow != None) - UWindowConsoleClientWindow(ConsoleWindow.ClientArea).TextArea.AddText(Msg); - } -} - -function UpdateHistory() -{ - // Update history buffer. - History[HistoryCur++ % MaxHistory] = TypedStr; - if( HistoryCur > HistoryBot ) - HistoryBot++; - if( HistoryCur - HistoryTop >= MaxHistory ) - HistoryTop = HistoryCur - MaxHistory + 1; -} - -function HistoryUp() -{ - if( HistoryCur > HistoryTop ) - { - History[HistoryCur % MaxHistory] = TypedStr; - TypedStr = History[--HistoryCur % MaxHistory]; - } -} - -function HistoryDown() -{ - History[HistoryCur % MaxHistory] = TypedStr; - if( HistoryCur < HistoryBot ) - TypedStr = History[++HistoryCur % MaxHistory]; - else - TypedStr=""; -} -exec function MenuCmd(int Menu, int Item) -{ - if (bLocked||zzMyState!=0) - return; - bQuickKeyEnable = False; - LaunchUWindow(); - if(!bCreatedRoot) - CreateRootWindow(None); - UMenuRootWindow(Root).MenuBar.MenuCmd(Menu, Item); -} - -exec function ShowObjectives() -{ - local GameReplicationInfo GRI; - local class AssaultClass, GameClass; - - // Keep testing Locally... - if(!bCreatedRoot) - CreateRootWindow(None); - //import saving? - AssaultClass = class(DynamicLoadObject("Botpack.Assault", class'Class')); - //I really don't like this. But I don't want to risk screwing something up: - foreach viewport.actor.AllActors(class'GameReplicationInfo', GRI) - { - GameClass = class(DynamicLoadObject(GRI.GameClass, class'Class')); - if ( ClassIsChildOf(GameClass, AssaultClass) ) - { - bLocked = True; - bNoDrawWorld = True; - UMenuRootWindow(Root).MenuBar.HideWindow(); - LaunchUWindow(); - Root.CreateWindow(class(DynamicLoadObject("UTMenu.InGameObjectives", class'Class')), 100, 100, 100, 100); - } - } -} -//prevent abuse of this function: - -function DrawLevelAction( canvas C ) -{ - local string BigMessage; - - if ( (Viewport.Actor.Level.Pauser != "") && (Viewport.Actor.Level.LevelAction == LEVACT_None) ) - { - C.Font = C.MedFont; - BigMessage = PausedMessage@"by"@Viewport.Actor.Level.Pauser; // Add pauser name? - xxPrintActionMessage(C, BigMessage); - return; - } - if ( (Viewport.Actor.Level.LevelAction == LEVACT_None) - || Viewport.Actor.bShowMenu ) - { - BigMessage = ""; - return; - } - else if ( Viewport.Actor.Level.LevelAction == LEVACT_Loading ) - BigMessage = LoadingMessage; - else if ( Viewport.Actor.Level.LevelAction == LEVACT_Saving ) - BigMessage = SavingMessage; - else if ( Viewport.Actor.Level.LevelAction == LEVACT_Connecting ) - BigMessage = ConnectingMessage; - else if ( Viewport.Actor.Level.LevelAction == LEVACT_Precaching ) - BigMessage = PrecachingMessage; - - if ( BigMessage != "" ) - { - C.Style = 1; - C.Font = C.LargeFont; - xxPrintActionMessage(C, BigMessage); - } -} - -function xxPrintActionMessage( Canvas C, string BigMessage ) -{ - local float XL, YL; - local class FC; - - FC = Class(DynamicLoadObject(class'ChallengeHUD'.default.FontInfoClass, class'Class')); - - if ( Len(BigMessage) > 10 ) - C.Font = FC.Static.GetStaticBigFont(C.ClipX); - else - C.Font = FC.Static.GetStaticHugeFont(C.ClipX); - C.bCenter = false; - C.StrLen( BigMessage, XL, YL ); - C.SetPos(FrameX/2 - XL/2 + 1, (FrameY/3)*2 - YL/2 + 1); - C.DrawColor.R = 0; - C.DrawColor.G = 0; - C.DrawColor.B = 0; - C.DrawText( BigMessage, false ); - C.SetPos(FrameX/2 - XL/2, (FrameY/3)*2 - YL/2); - C.DrawColor.R = 0; - C.DrawColor.G = 0; - C.DrawColor.B = 255; - C.DrawText( BigMessage, false ); -} - -function CreateMessage() -{ -// Log("CreateMessagE()"); - MessageWindow = MessageWindow(Root.CreateWindow(Class'MessageWindow', 100, 100, 200, 200)); - MessageWindow.bLeaveOnScreen = True; - MessageWindow.HideWindow(); -} - -function ShowMessage() -{ -// Log("ShowMessage()"@bbPlayer(ViewPort.Actor).zzbCanCSL); - if (MessageWindow != None) - { - bWasShowingMessage = False; - bShowMessage = True; - MessageWindow.ShowWindow(); - } -} - -function HideMessage() -{ -// Log("HideMessage()"@bbPlayer(ViewPort.Actor).zzbCanCSL); - if (MessageWindow != None) - { - bShowMessage = False; - MessageWindow.HideWindow(); - } -} - -//not-mutate execs. why not? -exec function PureHelp() { viewport.actor.mutate("PurePlayerHelp"); } -exec function CheatInfo() { viewport.actor.mutate("CheatInfo"); } -exec function CheatTest() { viewport.actor.mutate("CheatTest"); } -exec function FixTeams() { viewport.actor.mutate("FixTeams"); } -exec function NextTeam() { viewport.actor.mutate("NextTeam"); } -exec function ChangeTeam(string newteam) { viewport.actor.mutate("ChangeTeam"@newteam); } -// for my div-info -exec function ShowNetSpeeds() { ViewPort.Actor.Mutate("PureShowNetSpeeds"); } -exec function ShowIPs() { ViewPort.Actor.Mutate("PureShowIPs"); } -exec function ShowTickrate() { ViewPort.Actor.Mutate("PureShowTickrate"); } -exec function ShowDemos() { ViewPort.Actor.Mutate("PureShowDemos"); } -// Helpers -exec function ShowID() { ViewPort.Actor.Mutate("ShowID"); } -exec function KickID(string ID) { ViewPort.Actor.Mutate("KickID"@ID); } -exec function BanID(string ID) { ViewPort.Actor.Mutate("BanID"@ID); } - -//============================================================================= -// History: -//============================================================================= -/* -2001-08-28 : DB : Fixed BDBMapVote Bug (there might still be some) - : VR Checking of MenuCmd, ShowObjective - : Capturing LaunchUWindow/CloseUWindow -2001-06-1 USA : (no idea what month you are on DB): - : implamented complete no state console -2001-12-02 DB : Set as PureConsole - */ - -exec function ShowScores() -{ - if (bbPlayer(ViewPort.Actor) != None) - { - bbPlayer(ViewPort.Actor).ShowScores(); - if (!bForcedStats) - { - bbPlayer(ViewPort.Actor).ConsoleCommand("mutate smartctf forcestats"); - bForcedStats = true; - } - } - else if (bbCHSpectator(ViewPort.Actor) != None) - { - bbCHSpectator(ViewPort.Actor).ShowScores(); - if (!bForcedStats) - { - bbCHSpectator(ViewPort.Actor).ConsoleCommand("mutate smartctf forcestats"); - bForcedStats = true; - } - } -} - -exec function Version() -{ - if (bbPlayer(ViewPort.Actor) != None) - bbPlayer(ViewPort.Actor).ClientMessage(class'UTPure'.Default.VersionStr@class'UTPure'.Default.LongVersion$class'UTPure'.Default.NiceVer); - else if (bbCHSpectator(ViewPort.Actor) != None) - bbCHSpectator(ViewPort.Actor).ClientMessage(class'UTPure'.Default.VersionStr@class'UTPure'.Default.LongVersion$class'UTPure'.Default.NiceVer); -} diff --git a/Classes/bbCHSpectator.uc b/Classes/bbCHSpectator.uc index 851c9016..77a8ed7a 100644 --- a/Classes/bbCHSpectator.uc +++ b/Classes/bbCHSpectator.uc @@ -21,7 +21,6 @@ var int DefaultHitSound, DefaultTeamHitSound; var bool bForceDefaultHitSounds; var bool zzbInitialized; -var PureSuperDuperUberConsole zzMyConsole; var bool zzbBadConsole; var bool zzTrue,zzFalse; // True & False @@ -53,6 +52,9 @@ replication // Server->Client reliable if ( Role == ROLE_Authority ) xxSetHitSounds, xxSetTimes, xxReceivePosition, xxClientSpawnSSRBeam; //, xxClientActivateMover; + + unreliable if (bClientDemoRecording) + DemoInitSettings; } simulated function xxClientSpawnSSRBeamInternal(vector HitLocation, vector SmokeLocation, vector SmokeOffset, actor O) { @@ -188,6 +190,7 @@ function int TickPID(out PIDController C, float DeltaTime, int Error) { function xxPlayerTickEvents() { + DemoInitSettings(); CheckHitSound(); } @@ -231,6 +234,10 @@ function InitSettings() { } } +function DemoInitSettings() { + InitSettings(); +} + event Possess() { local Mover M; @@ -254,47 +261,6 @@ event Possess() Super.Possess(); } -event PreRender( canvas zzCanvas ) -{ - if (Role < ROLE_Authority) - xxAttachConsole(); - - Super.PreRender(zzCanvas); -} - -// ================================================================================== -// AttachConsole - Adds our console -// ================================================================================== -simulated function xxAttachConsole() -{ - // local PureSuperDuperUberConsole c; - // local UTConsole oldc; - - // if (zzMyConsole == None) - // { - // zzMyConsole = PureSuperDuperUberConsole(Player.Console); - // if (zzMyConsole == None) - // { - // //zzbLogoDone = False; - // Player.Console.Disable('Tick'); - // c = New(None) class'PureSuperDuperUberConsole'; - // if (c != None) - // { - // oldc = UTConsole(Player.Console); - // c.zzOldConsole = oldc; - // Player.Console = c; - // zzMyConsole = c; - // zzMyConsole.xxGetValues(); //copy all values from old console to new - // } - // else - // { - // zzbBadConsole = zzTrue; - // } - // } - // } - // zzbBadConsole = (Player.Console.Class != Class'PureSuperDuperUberConsole'); -} - auto state InvalidState { event PlayerTick( float DeltaTime ) @@ -419,6 +385,12 @@ event PostBeginPlay() InitSettings(); } +event PostNetBeginPlay() { + super.PostNetBeginPlay(); + + InitSettings(); +} + event PostRender( canvas Canvas ) { local GameReplicationInfo GRI; diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index c4b707cb..6c315b86 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -266,7 +266,7 @@ replication { // Client->Demo unreliable if ( bClientDemoRecording ) - xxReplicateVRToDemo, xxClientDemoMessage, xxClientLogToDemo, xxDemoSpawnSSRBeam; + xxReplicateVRToDemo, xxClientDemoMessage, xxClientLogToDemo, xxDemoSpawnSSRBeam, DemoInitSettings; reliable if (bClientDemoRecording && !bClientDemoNetFunc) xxClientDemoFix, xxClientDemoBolt; @@ -511,6 +511,10 @@ function InitSettings() { } } +function DemoInitSettings() { + InitSettings(); +} + event PostBeginPlay() { Super.PostBeginPlay(); @@ -530,6 +534,7 @@ event PostBeginPlay() // called after PostBeginPlay on net client simulated event PostNetBeginPlay() { + InitSettings(); if ( Role != ROLE_SimulatedProxy ) // Other players are Simulated, local player is Autonomous or Authority (if listen server which pure doesn't support anyway :P) { @@ -657,7 +662,7 @@ function Timer() { function ClientSetLocation( vector zzNewLocation, rotator zzNewRotation ) { local SavedMove M; - + ViewRotation = zzNewRotation; If ( (ViewRotation.Pitch > RotationRate.Pitch) && (ViewRotation.Pitch < 65536 - RotationRate.Pitch) ) { @@ -5072,14 +5077,6 @@ simulated function bool ClientCannotShoot(optional Weapon W, optional byte Mode, PendingWeapon.bChangeWeapon = false; bCant = true; } - else if (!Weapon.bWeaponUp) - { - WeapState = Weapon.GetStateName(); - if (WeapState == 'ClientFiring' || WeapState == 'ClientAltFiring' || WeapState == 'Idle' || WeapState == '' || WeapState == Weapon.Class.Name || Weapon.AnimSequence == 'Still') - Weapon.bWeaponUp = true; - else - bCant = true; - } else if (Weapon.IsInState('ClientDown')) { bCant = true; @@ -5102,7 +5099,7 @@ simulated function bool ClientCannotShoot(optional Weapon W, optional byte Mode, } else if (!bCant) { - bCant = (Player == None) || (PureSuperDuperConsole(Player.Console) == None); + bCant = (Player == None); } else if (!bCant && (Weapon != None) && Weapon.IsInState('ClientActive')) { @@ -5132,6 +5129,7 @@ function xxPlayerTickEvents() CurrentTime = Level.TimeSeconds; + DemoInitSettings(); CheckHitSound(); if (Level.NetMode == NM_Client) @@ -5379,9 +5377,6 @@ event PreRender( canvas zzCanvas ) zzLastVR = ViewRotation; - if (Role < ROLE_Authority) - xxAttachConsole(); - if (Role < ROLE_Authority) if (!zzbRenderHUD) Super.PreRender(lmaoCanvas); @@ -5758,46 +5753,6 @@ exec function PureLogo() zzLogoStart = Level.TimeSeconds; } -// ================================================================================== -// AttachConsole - Adds our console -// ================================================================================== -simulated function xxAttachConsole() -{ - // local PureSuperDuperUberConsole c; - // local UTConsole oldc; - - // if (Player.Actor != Self) - // xxServerCheater("VA"); - - // if (zzMyConsole == None) - // { - // zzMyConsole = PureSuperDuperUberConsole(Player.Console); - // if (zzMyConsole == None) - // { - // // Initialize Logo Display - // zzbLogoDone = False; - // // - // Player.Console.Disable('Tick'); - // c = New(None) class'PureSuperDuperUberConsole'; - // if (c != None) - // { - // oldc = UTConsole(Player.Console); - // c.zzOldConsole = oldc; - // Player.Console = c; - // zzMyConsole = c; - // zzMyConsole.xxGetValues(); //copy all values from old console to new - // } - // else - // { - // zzbBadConsole = zzTrue; - // } - // } - // } - // // Do not use ELSE or it wont work correctly - - // zzbBadConsole = (Player.Console.Class != Class'PureSuperDuperUberConsole'); -} - function xxServerCheater(string zzCode) { local string zzS; From b02014c8aa3e3c31fe3e3e7fe4ef1468a366dabe Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Sun, 9 Aug 2020 20:05:50 +0200 Subject: [PATCH 57/70] Rename to IG+ 4 --- Classes/UTPure.uc | 12 +++++------- Classes/bbPlayer.uc | 4 +--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Classes/UTPure.uc b/Classes/UTPure.uc index 021681d1..c48eef85 100644 --- a/Classes/UTPure.uc +++ b/Classes/UTPure.uc @@ -65,7 +65,6 @@ var string VersionStr; // Holds the version code from VUC++ var string LongVersion; // Holds the version code from VUC++ var string ThisVer; // Holds the version letters var string NiceVer; // Holds the version letters (no underscore) -var string ConsoleName; // Set console system name var string BADminText; // Text to give players that want admin commands without being admin. var bool bDidEndWarn; // True if screenshot warning has been sent to players. var bool bDidShot; @@ -1389,16 +1388,15 @@ defaultproperties DefaultTeamHitSound=3 TeleRadius=210 ThrowVelocity=750 - ConsoleName="InstaGib+ Console" - VersionStr="InstaGib+ Final" - LongVersion="RC " - ThisVer="3H" - NiceVer="3H" + VersionStr="IG+ " + LongVersion="" + ThisVer="4" + NiceVer="4" BADminText="Not allowed - Log in as admin!" bAlwaysTick=True NNAnnouncer=True MinPosError=100 - MaxPosError=3000 + MaxPosError=1000 MaxHitError=10000 MaxJitterTime=0.1 MinNetUpdateRate=60.0 diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 6c315b86..c2b467e2 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -5593,11 +5593,9 @@ simulated function xxDrawLogo(canvas zzC, float zzx, float zzY, float zzFadeValu zzC.DrawColor = ChallengeHud(MyHud).CyanColor * zzFadeValue; zzC.SetPos(zzx+70,zzY+8); zzC.Font = ChallengeHud(MyHud).MyFonts.GetBigFont(zzC.ClipX); - zzC.DrawText("InstaGib+"); + zzC.DrawText(class'UTPure'.default.VersionStr$class'UTPure'.default.NiceVer); zzC.SetPos(zzx+70,zzY+35); zzC.Font = ChallengeHud(MyHud).MyFonts.GetBigFont(zzC.ClipX); - zzC.DrawText(class'UTPure'.default.LongVersion$class'UTPure'.default.NiceVer); - zzC.SetPos(zzx+70,zzY+62); if (zzbDoScreenshot) zzC.DrawText(PlayerReplicationInfo.PlayerName@zzMagicCode); else From cd4fa4ca3d2f5d7dadc96583137c942a8ae2bc9c Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 10 Aug 2020 03:05:02 +0200 Subject: [PATCH 58/70] Mark InitSettings as simulated. --- Classes/bbCHSpectator.uc | 10 +--------- Classes/bbPlayer.uc | 9 ++------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Classes/bbCHSpectator.uc b/Classes/bbCHSpectator.uc index 77a8ed7a..daddbb0a 100644 --- a/Classes/bbCHSpectator.uc +++ b/Classes/bbCHSpectator.uc @@ -52,9 +52,6 @@ replication // Server->Client reliable if ( Role == ROLE_Authority ) xxSetHitSounds, xxSetTimes, xxReceivePosition, xxClientSpawnSSRBeam; //, xxClientActivateMover; - - unreliable if (bClientDemoRecording) - DemoInitSettings; } simulated function xxClientSpawnSSRBeamInternal(vector HitLocation, vector SmokeLocation, vector SmokeOffset, actor O) { @@ -190,7 +187,6 @@ function int TickPID(out PIDController C, float DeltaTime, int Error) { function xxPlayerTickEvents() { - DemoInitSettings(); CheckHitSound(); } @@ -209,7 +205,7 @@ simulated function xxSetTimes(int RemainingTime, int ElapsedTime) GameReplicationInfo.ElapsedTime = ElapsedTime; } -function InitSettings() { +simulated function InitSettings() { local bbPlayer P; local bbCHSpectator S; @@ -234,10 +230,6 @@ function InitSettings() { } } -function DemoInitSettings() { - InitSettings(); -} - event Possess() { local Mover M; diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index c2b467e2..49ea1198 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -266,7 +266,7 @@ replication { // Client->Demo unreliable if ( bClientDemoRecording ) - xxReplicateVRToDemo, xxClientDemoMessage, xxClientLogToDemo, xxDemoSpawnSSRBeam, DemoInitSettings; + xxReplicateVRToDemo, xxClientDemoMessage, xxClientLogToDemo, xxDemoSpawnSSRBeam; reliable if (bClientDemoRecording && !bClientDemoNetFunc) xxClientDemoFix, xxClientDemoBolt; @@ -486,7 +486,7 @@ simulated function xxClientKicker( float KCollisionRadius, float KCollisionHeigh } } -function InitSettings() { +simulated function InitSettings() { local bbPlayer P; local bbCHSpectator S; @@ -511,10 +511,6 @@ function InitSettings() { } } -function DemoInitSettings() { - InitSettings(); -} - event PostBeginPlay() { Super.PostBeginPlay(); @@ -5129,7 +5125,6 @@ function xxPlayerTickEvents() CurrentTime = Level.TimeSeconds; - DemoInitSettings(); CheckHitSound(); if (Level.NetMode == NM_Client) From 3327a5b09c498b6c2c34397ddb898991b9c36232 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 10 Aug 2020 03:05:26 +0200 Subject: [PATCH 59/70] Fix Up FootStepping --- Classes/bbPlayer.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 49ea1198..e45df762 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -5010,7 +5010,7 @@ function PlayHit(float Damage, vector HitLocation, name damageType, vector Momen simulated function FootStepping() { - if (Level.NetMode != NM_DedicatedServer && Settings.bNoOwnFootsteps) + if (Settings != none && Settings.bNoOwnFootsteps) if (Role >= ROLE_AutonomousProxy || GetLocalPlayer().ViewTarget == self) return; From 14ca7a64a8f13c8dac9c32686d8faedc92ae1228 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 10 Aug 2020 03:06:55 +0200 Subject: [PATCH 60/70] Extrapolation uses AverageServerDeltaTime Steps --- Classes/bbPlayer.uc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index e45df762..86ad4224 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -4032,6 +4032,9 @@ ignores SeePlayer, HearNoise, Bump; event ServerTick(float DeltaTime) { local float TimeSinceLastUpdate; local float ProcessTime; + local float SimTime; + local int i; + local int SimSteps; if (Level.Pauser == "" && !bWasPaused) { TimeSinceLastUpdate = Level.TimeSeconds - ServerTimeStamp; @@ -4051,10 +4054,15 @@ ignores SeePlayer, HearNoise, Bump; bExtrapolatedLastUpdate == false && ExtrapolationDelta > AverageServerDeltaTime ) { bExtrapolatedLastUpdate = true; + SavedLocation = Location; SavedVelocity = Velocity; SavedAcceleration = Acceleration; - MoveAutonomous(ExtrapolationDelta, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); + + SimSteps = int(ExtrapolationDelta / AverageServerDeltaTime); + SimTime = ExtrapolationDelta / SimSteps; + for (i = 0; i < SimSteps; i += 1) + MoveAutonomous(SimTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); } ExtrapolationDelta *= Exp(-2.0 * DeltaTime); } else { From c1539ac23e14bb486eb621bcb663bd5a81fd60a2 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 10 Aug 2020 19:37:18 +0200 Subject: [PATCH 61/70] Add Client Settings to ReadMe --- README.md | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 110 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2ca376e0..aa1dba07 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,14 @@ Different Shock beam types.
Extract the zipped files to your system folder.
Remove any mention in your ServerPackages and ServerActors of TimTim's NewNet or Deepu's Ultimate NewNet.
Add the following lines to your server's UnrealTournament.ini under [Engine.GameEngine]:

-ServerPackages=InstaGibPlus
-ServerActors=InstaGibPlus.NewNetServer
-ServerActors=InstaGibPlus.PureStats
+ServerPackages=InstaGibPlus4
+ServerActors=InstaGibPlus4.NewNetServer
+ServerActors=InstaGibPlus4.PureStats
It is highly recommended to set your server's tickrate to 100. # Usage -If you want to make sure InstaGib+ is loaded every map you can also add under [Engine.GameEngine]:

-ServerActors=InstaGibPlus.NewNetIG

-otherwise make sure the mutator InstaGibPlus.NewNetIG is loaded via your map vote configuration or during server launch.

+For InstaGib, make sure the mutator InstaGibPlus4.NewNetIG is loaded via your map vote configuration or during server launch.

InstaGib+ has minimal weapons code and will load the default UT weapons if the NewNetIG mutator is not loaded, so it is absolutely unusable in normal weapons, make sure to use it only if your objective is to play or to run an InstaGib centered server.

When connected to the server type 'mutate playerhelp' in the console to view the available commands and options. @@ -61,6 +59,112 @@ As spectator, you may need to add 'mutate pure' + command (mutate pureshowtickra # Settings +## Client Settings + +### bForceModels (bool, default: False) +If set to `True`, forces all other players to use fixed models and skins (see DesiredSkin settings). +If set to `False`, all players will show as their chosen model and skin. +### DesiredSkin (int, default: 9) +### DesiredSkinFemale (int, default: 0) +### DesiredTeamSkin (int, default: 9) +### DesiredTeamSkinFemale (int, default: 0) + +### HitSound (int, default: 2) +Plays the specified sound when the server detects you dealing damage to enemies. +### TeamHitSound (int, default: 3) +Plays the specified sound when the server detects you dealing damage to teammates. +### bDisableForceHitSounds (bool, default: False) +If `False`, server can override HitSound and TeamHitSound. +If `True`, server can not override HitSound and TeamHitSound. + +### bEnableHitSounds (bool, default: True) +If `True`, plays a sound when a weapon you fire hits an enemy on your client. +If `False`, no sound is played. +### selectedHitSound (int, default: 0) +Index into sHitSound array for the sound to play. +### sHitSound (string\[16\]) +Specifies sounds that can be played. + +### bDoEndShot (bool, default: False) +If `True`, automatically create a screenshot at the end of a match. +If `False`, no screenshot is automatically created. +### bAutoDemo (bool, default: False) +If `True`, automatically start recording a demo when the game starts. +### DemoMask (string) +Template for the name of the demo started because of [bAutoDemo](#bautodemo-bool-default-false). +The following (case-insensitive) placeholders will be replaced with match-specific details: +- `%E` -> Name of the map file +- `%F` -> Title of the map +- `%D` -> Day (two digits) +- `%M` -> Month (two digits) +- `%Y` -> Year +- `%H` -> Hour +- `%N` -> Minute +- `%T` -> Combined Hour and Minute (two digits each) +- `%C` -> Clan Tags (detected by determining common prefix of all players on a team, or "Unknown") +- `%L` -> Name of the recording player +- `%%` -> Replaced with a single % +### DemoPath (string) +Prefix for name of the demo started because of [bAutoDemo](#bautodemo-bool-default-false). +### DemoChar (string) +Characters filesystems can not handle are replaced with this. + +### bTeamInfo (bool, default: True) +if Client wants extra team info. +### bShootDead (bool, default: False) +If `True`, client shots can collide with carcasses from dead players. +If `False`, client shots will not collide with carcasses. + +### cShockBeam (int, default: 1) +The style of beam to use for the SuperShockRifle. +- `1` -> Default beam +- `2` -> Team colored beam that looks like a projectile +- `3` -> No beam at all +- `4` -> Team colored, instant beam +### BeamScale (float, default: 0.45) +Visuals for the beam are scaled with this factor +### BeamFadeCurve (float, default: 4.0) +Exponent of the polynomial curve the beam's visuals decay with +### BeamDuration (float, default: 0.75) +The time the beam's visuals decay over. +### BeamOriginMode (int, default: 0) +- `0` -> Originates where the player was when the shot was fired +- `1` -> Originates at an offset from where the player is on your screen. + +### bNoOwnFootsteps (bool, default: False) +If `True`, footstep sounds are not played for your own footsteps. +If `False`, your own footstep sounds will be played. +### DesiredNetUpdateRate (float, default: 100) +How often you want your client to update the server on your movement. The server places upper and lower limits on this (see [MinNetUpdateRate](#minnetupdaterate-float-default), [MaxNetUpdateRate](#maxnetupdaterate-float-default)), and the actual update rate will never exceed your netspeed divided by 100. + +This is here to provide players with constrained upload bandwidth a way to reduce the required upload bandwidth at the expense of greater susceptibility to packet loss, and glitches arising from it. + +Players with high upload bandwidth can set this to a high value to lessen the impact of packet loss. +### FakeCAPInterval (float, defaul: 0.1) +Tells the server to send an acknowledgement of your movement updates (see [DesiredNetUpdateRate](#desirednetupdaterate-float-default)) after this amount of time has passed since the last acknowledgement. This saves download bandwidth and lessens server load. + +Smaller values (closer to 0) result in acknowledgements being sent more frequently, negative values send an acknowledgement for every movement update. +Higher values result in less frequent acknowledgements which can result in degraded client performance (FPS), or even crashes. +### bNoSmoothing (bool, default: False) +The default mouse input smoothing algorithm always smears input over at least two frames, half the input being applied on one frame, the other half on the next frame. If set to `True`, the game will always apply all input on the current frame. If set to `False`, the default algorithm will be used. + +This is a backport from UT99 client version 469, where the equivalent setting is called bNoMouseSmoothing. +### bLogClientMessages (bool, default: True) +Causes all ClientMessages to be logged, if set to `True` +### bEnableKillCam (bool, default: False) +KillCam follows the player that killed you for two seconds. +### MinDodgeClickTime (float, default: 0.0) +Minimum time between two presses of the same direction for them to count as a dodge. +### bUseOldMouseInput (bool, default: False) +The old mouse input processing algorithm discards the fractional part before turning the view according to the mouse input. The new algorithm preserves fractional rotation across frames. + +A players view is defined by yaw and pitch, which are quantized to 65536 degrees (a circle has 65536 degrees instead of 360). If a players mouse input sensitivity is set such that the players mouse input can result in some fraction of a degree, that fractional part must be discarded before the view is changed. The new algorithm preserves that fractional part and adds it to the next mouse input. + +If `True`, two successive inputs of 1.5° change in yaw result in a 2° turn (int(1.5) + int(1.5) = 1 + 1 = 2). +If `False`, two successive inputs of 1.5° change in yaw result in a 3° turn. +### SmoothVRController (PIDControllerSettings, default: (p=0.09,i=0.05,d=0.00)) +This holds the PID settings for the controller thats smoothing the view of players youre spectating as a spectator (see [PID controller](https://en.wikipedia.org/wiki/PID_controller)). + ## Server Settings Server settings can be found inside InstaGibPlus.ini. From 8c10d90424e46476aa267efec0beacf66d5fb19c Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 10 Aug 2020 19:37:56 +0200 Subject: [PATCH 62/70] Remove reference to unused package. --- Classes/UTPure.uc | 2 -- 1 file changed, 2 deletions(-) diff --git a/Classes/UTPure.uc b/Classes/UTPure.uc index c48eef85..a2d0e915 100644 --- a/Classes/UTPure.uc +++ b/Classes/UTPure.uc @@ -7,8 +7,6 @@ class UTPure extends Mutator config(InstaGibPlus); #exec Audio Import FILE=Sounds\HitSound.wav Name=HitSound #exec Audio Import FILE=Sounds\HitSoundFriendly.wav Name=HitSoundFriendly -#exec OBJ LOAD FILE=Pack\ShockRifle.utx PACKAGE=InstaGibPlus.ShockRifle - var ModifyLoginHandler NextMLH; // Link list of handlers var localized config float HeadshotDamage; From 6dfe3265629a229d336186f618fbb83f5677046c Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 10 Aug 2020 20:36:18 +0200 Subject: [PATCH 63/70] Make sure References to HitSounds are updated alongside packages --- Classes/ClientSettings.uc | 19 +++++++++++++++++-- Classes/bbCHSpectator.uc | 1 + Classes/bbPlayer.uc | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Classes/ClientSettings.uc b/Classes/ClientSettings.uc index 30843666..bc2f2db1 100644 --- a/Classes/ClientSettings.uc +++ b/Classes/ClientSettings.uc @@ -34,13 +34,28 @@ var config int BeamOriginMode; var config float DesiredNetUpdateRate; var config bool bNoSmoothing; var config bool bNoOwnFootsteps; -var config bool bLogClientMessages; +var config bool bLogClientMessages; var config bool bEnableKillCam; var config float FakeCAPInterval; // Send a FakeCAP after no CAP has been sent for this amount of time var config float MinDodgeClickTime; // Minimum time between two presses of the same direction for them to count as a dodge var config bool bUseOldMouseInput; var config PIDControllerSettings SmoothVRController; +simulated function CheckConfig() { + local int i; + local int p; + local string PackageName; + + PackageName = string(self.Class); + PackageName = Left(PackageName, InStr(PackageName, ".")); + + for (i = 0; i < 16; i += 1) + if (Left(sHitSound[i], 12) ~= "InstaGibPlus") + sHitSound[i] = PackageName$Mid(sHitSound[i], InStr(sHitSound[i], ".")); + + SaveConfig(); +} + defaultproperties { bForceModels=False @@ -60,7 +75,7 @@ defaultproperties DesiredTeamSkinFemale=0 bEnableHitSounds=True selectedHitSound=0 - sHitSound(0)="InstaGibPlus.UTPure.HitSound" + sHitSound(0)="InstaGibPlus4.HitSound" sHitSound(1)="UnrealShare.StingerFire" cShockBeam=1 BeamScale=0.45 diff --git a/Classes/bbCHSpectator.uc b/Classes/bbCHSpectator.uc index daddbb0a..650f7040 100644 --- a/Classes/bbCHSpectator.uc +++ b/Classes/bbCHSpectator.uc @@ -226,6 +226,7 @@ simulated function InitSettings() { if (Settings == none) { ClientSettingsHelper = new(self, 'InstaGibPlus') class'Object'; Settings = new(ClientSettingsHelper, 'ClientSettings') class'ClientSettings'; + Settings.CheckConfig(); Log("Loaded Settings!", 'IGPlus'); } } diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 86ad4224..4e072027 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -507,6 +507,7 @@ simulated function InitSettings() { if (Settings == none) { ClientSettingsHelper = new(self, 'InstaGibPlus') class'Object'; // object name = INI file name Settings = new(ClientSettingsHelper, 'ClientSettings') class'ClientSettings'; // object name = Section name + Settings.CheckConfig(); Log("Loaded Settings!", 'IGPlus'); } } From 1627d02d3a0887d399c028265d26d8a2ffa6149f Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 10 Aug 2020 20:36:46 +0200 Subject: [PATCH 64/70] Add client-side hitsound for sniper --- Classes/ST_SniperRifle.uc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Classes/ST_SniperRifle.uc b/Classes/ST_SniperRifle.uc index 99e15b28..4580fc75 100644 --- a/Classes/ST_SniperRifle.uc +++ b/Classes/ST_SniperRifle.uc @@ -228,12 +228,20 @@ simulated function NN_TraceFire() simulated function bool NN_ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z, float yMod) { local UT_Shellcase s; - local Pawn PawnOwner; + local bbPlayer O; if (Owner.IsA('Bot')) return false; - PawnOwner = Pawn(Owner); + O = bbPlayer(Owner); + + if (Other.isA('Pawn')) { + if (O.Settings.bEnableHitSounds) { + if (!O.GameReplicationInfo.bTeamGame || PlayerPawn(Other).PlayerReplicationInfo.Team != O.PlayerReplicationInfo.Team) { + O.ClientPlaySound(O.playedHitSound); + } + } + } s = Spawn(class'UT_ShellCase',, '', Owner.Location + CDO + 30 * X + (2.8 * yMod+5.0) * Y - Z * 1); if ( s != None ) From dc7072f7104fc5dab7ee614b3c0779e7e967c391 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Tue, 11 Aug 2020 02:02:10 +0200 Subject: [PATCH 65/70] Fix links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa1dba07..fe31cc69 100644 --- a/README.md +++ b/README.md @@ -135,13 +135,13 @@ The time the beam's visuals decay over. If `True`, footstep sounds are not played for your own footsteps. If `False`, your own footstep sounds will be played. ### DesiredNetUpdateRate (float, default: 100) -How often you want your client to update the server on your movement. The server places upper and lower limits on this (see [MinNetUpdateRate](#minnetupdaterate-float-default), [MaxNetUpdateRate](#maxnetupdaterate-float-default)), and the actual update rate will never exceed your netspeed divided by 100. +How often you want your client to update the server on your movement. The server places upper and lower limits on this (see [MinNetUpdateRate](#minnetupdaterate-float-default-60), [MaxNetUpdateRate](#maxnetupdaterate-float-default-250)), and the actual update rate will never exceed your netspeed divided by 100. This is here to provide players with constrained upload bandwidth a way to reduce the required upload bandwidth at the expense of greater susceptibility to packet loss, and glitches arising from it. Players with high upload bandwidth can set this to a high value to lessen the impact of packet loss. ### FakeCAPInterval (float, defaul: 0.1) -Tells the server to send an acknowledgement of your movement updates (see [DesiredNetUpdateRate](#desirednetupdaterate-float-default)) after this amount of time has passed since the last acknowledgement. This saves download bandwidth and lessens server load. +Tells the server to send an acknowledgement of your movement updates (see [DesiredNetUpdateRate](#desirednetupdaterate-float-default-100)) after this amount of time has passed since the last acknowledgement. This saves download bandwidth and lessens server load. Smaller values (closer to 0) result in acknowledgements being sent more frequently, negative values send an acknowledgement for every movement update. Higher values result in less frequent acknowledgements which can result in degraded client performance (FPS), or even crashes. From e9b4318b5484985f85ca96179145606fee9cc66f Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Tue, 11 Aug 2020 02:07:59 +0200 Subject: [PATCH 66/70] Add List of skins --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index fe31cc69..641104c5 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,26 @@ As spectator, you may need to add 'mutate pure' + command (mutate pureshowtickra ### bForceModels (bool, default: False) If set to `True`, forces all other players to use fixed models and skins (see DesiredSkin settings). If set to `False`, all players will show as their chosen model and skin. +#### List of Skins +Note that these numbers only apply when editing INI settings +- `0` - Class: Female Commando, Skin: Aphex, Face: Idina +- `1` - Class: Female Commando, Skin: Commando, Face: Anna +- `2` - Class: Female Commando, Skin: Mercenary, Face: Jayce +- `3` - Class: Female Commando, Skin: Necris, Face: Cryss +- `4` - Class: Female Soldier, Skin: Marine, Face: Annaka +- `5` - Class: Female Soldier, Skin: Metal Guard, Face: Isis +- `6` - Class: Female Soldier, Skin: Soldier, Face: Lauren +- `7` - Class: Female Soldier, Skin: Venom, Face: Athena +- `8` - Class: Female Soldier, Skin: War Machine, Face: Cathode +- `9` - Class: Male Commando, Skin: Commando, Face: Blake +- `10` - Class: Male Commando, Skin: Mercenary, Face: Boris +- `11` - Class: Male Commando, Skin: Necris, Face: Grail +- `12` - Class: Male Soldier, Skin: Marine, Face: Malcolm +- `13` - Class: Male Soldier, Skin: Metal Guard, Face: Drake +- `14` - Class: Male Soldier, Skin: RawSteel, Face: Arkon +- `15` - Class: Male Soldier, Skin: Soldier, Face: Brock +- `16` - Class: Male Soldier, Skin: War Machine, Face: Matrix +- `17` - Class: Boss, Skin: Boss, Face: Xan ### DesiredSkin (int, default: 9) ### DesiredSkinFemale (int, default: 0) ### DesiredTeamSkin (int, default: 9) From df6335a782da7f8faa382ef0e10b65bbbb662c9a Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Tue, 11 Aug 2020 02:10:53 +0200 Subject: [PATCH 67/70] use ordered lists --- README.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 641104c5..6f1617e8 100644 --- a/README.md +++ b/README.md @@ -66,24 +66,24 @@ If set to `True`, forces all other players to use fixed models and skins (see De If set to `False`, all players will show as their chosen model and skin. #### List of Skins Note that these numbers only apply when editing INI settings -- `0` - Class: Female Commando, Skin: Aphex, Face: Idina -- `1` - Class: Female Commando, Skin: Commando, Face: Anna -- `2` - Class: Female Commando, Skin: Mercenary, Face: Jayce -- `3` - Class: Female Commando, Skin: Necris, Face: Cryss -- `4` - Class: Female Soldier, Skin: Marine, Face: Annaka -- `5` - Class: Female Soldier, Skin: Metal Guard, Face: Isis -- `6` - Class: Female Soldier, Skin: Soldier, Face: Lauren -- `7` - Class: Female Soldier, Skin: Venom, Face: Athena -- `8` - Class: Female Soldier, Skin: War Machine, Face: Cathode -- `9` - Class: Male Commando, Skin: Commando, Face: Blake -- `10` - Class: Male Commando, Skin: Mercenary, Face: Boris -- `11` - Class: Male Commando, Skin: Necris, Face: Grail -- `12` - Class: Male Soldier, Skin: Marine, Face: Malcolm -- `13` - Class: Male Soldier, Skin: Metal Guard, Face: Drake -- `14` - Class: Male Soldier, Skin: RawSteel, Face: Arkon -- `15` - Class: Male Soldier, Skin: Soldier, Face: Brock -- `16` - Class: Male Soldier, Skin: War Machine, Face: Matrix -- `17` - Class: Boss, Skin: Boss, Face: Xan +0. - Class: Female Commando, Skin: Aphex, Face: Idina +1. - Class: Female Commando, Skin: Commando, Face: Anna +2. - Class: Female Commando, Skin: Mercenary, Face: Jayce +3. - Class: Female Commando, Skin: Necris, Face: Cryss +4. - Class: Female Soldier, Skin: Marine, Face: Annaka +5. - Class: Female Soldier, Skin: Metal Guard, Face: Isis +6. - Class: Female Soldier, Skin: Soldier, Face: Lauren +7. - Class: Female Soldier, Skin: Venom, Face: Athena +8. - Class: Female Soldier, Skin: War Machine, Face: Cathode +9. - Class: Male Commando, Skin: Commando, Face: Blake +10. - Class: Male Commando, Skin: Mercenary, Face: Boris +11. - Class: Male Commando, Skin: Necris, Face: Grail +12. - Class: Male Soldier, Skin: Marine, Face: Malcolm +13. - Class: Male Soldier, Skin: Metal Guard, Face: Drake +14. - Class: Male Soldier, Skin: RawSteel, Face: Arkon +15. - Class: Male Soldier, Skin: Soldier, Face: Brock +16. - Class: Male Soldier, Skin: War Machine, Face: Matrix +17. - Class: Boss, Skin: Boss, Face: Xan ### DesiredSkin (int, default: 9) ### DesiredSkinFemale (int, default: 0) ### DesiredTeamSkin (int, default: 9) @@ -137,10 +137,10 @@ If `False`, client shots will not collide with carcasses. ### cShockBeam (int, default: 1) The style of beam to use for the SuperShockRifle. -- `1` -> Default beam -- `2` -> Team colored beam that looks like a projectile -- `3` -> No beam at all -- `4` -> Team colored, instant beam +1. Default beam +2. Team colored beam that looks like a projectile +3. No beam at all +4. Team colored, instant beam ### BeamScale (float, default: 0.45) Visuals for the beam are scaled with this factor ### BeamFadeCurve (float, default: 4.0) @@ -148,8 +148,8 @@ Exponent of the polynomial curve the beam's visuals decay with ### BeamDuration (float, default: 0.75) The time the beam's visuals decay over. ### BeamOriginMode (int, default: 0) -- `0` -> Originates where the player was when the shot was fired -- `1` -> Originates at an offset from where the player is on your screen. +0. Originates where the player was when the shot was fired +1. Originates at an offset from where the player is on your screen. ### bNoOwnFootsteps (bool, default: False) If `True`, footstep sounds are not played for your own footsteps. From c07686c13a45a24b6f5ad05ae8b671af239744fb Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Tue, 11 Aug 2020 02:14:43 +0200 Subject: [PATCH 68/70] Fix list of skins --- README.md | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 6f1617e8..df256932 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ InstaGib+ has minimal weapons code and will load the default UT weapons if the N When connected to the server type 'mutate playerhelp' in the console to view the available commands and options. # InstaGib Plus Player Commands: - + - ForceModels x (0 = Off, 1 = On. Default = 0) - The models will be forced to the model you select. - TeamInfo x (0 = Off, 1 = On, Default = 1) - MyIGSettings (Displays your current IG+ settings) @@ -66,24 +66,25 @@ If set to `True`, forces all other players to use fixed models and skins (see De If set to `False`, all players will show as their chosen model and skin. #### List of Skins Note that these numbers only apply when editing INI settings -0. - Class: Female Commando, Skin: Aphex, Face: Idina -1. - Class: Female Commando, Skin: Commando, Face: Anna -2. - Class: Female Commando, Skin: Mercenary, Face: Jayce -3. - Class: Female Commando, Skin: Necris, Face: Cryss -4. - Class: Female Soldier, Skin: Marine, Face: Annaka -5. - Class: Female Soldier, Skin: Metal Guard, Face: Isis -6. - Class: Female Soldier, Skin: Soldier, Face: Lauren -7. - Class: Female Soldier, Skin: Venom, Face: Athena -8. - Class: Female Soldier, Skin: War Machine, Face: Cathode -9. - Class: Male Commando, Skin: Commando, Face: Blake -10. - Class: Male Commando, Skin: Mercenary, Face: Boris -11. - Class: Male Commando, Skin: Necris, Face: Grail -12. - Class: Male Soldier, Skin: Marine, Face: Malcolm -13. - Class: Male Soldier, Skin: Metal Guard, Face: Drake -14. - Class: Male Soldier, Skin: RawSteel, Face: Arkon -15. - Class: Male Soldier, Skin: Soldier, Face: Brock -16. - Class: Male Soldier, Skin: War Machine, Face: Matrix -17. - Class: Boss, Skin: Boss, Face: Xan + +0. Class: Female Commando, Skin: Aphex, Face: Idina +1. Class: Female Commando, Skin: Commando, Face: Anna +2. Class: Female Commando, Skin: Mercenary, Face: Jayce +3. Class: Female Commando, Skin: Necris, Face: Cryss +4. Class: Female Soldier, Skin: Marine, Face: Annaka +5. Class: Female Soldier, Skin: Metal Guard, Face: Isis +6. Class: Female Soldier, Skin: Soldier, Face: Lauren +7. Class: Female Soldier, Skin: Venom, Face: Athena +8. Class: Female Soldier, Skin: War Machine, Face: Cathode +9. Class: Male Commando, Skin: Commando, Face: Blake +10. Class: Male Commando, Skin: Mercenary, Face: Boris +11. Class: Male Commando, Skin: Necris, Face: Grail +12. Class: Male Soldier, Skin: Marine, Face: Malcolm +13. Class: Male Soldier, Skin: Metal Guard, Face: Drake +14. Class: Male Soldier, Skin: RawSteel, Face: Arkon +15. Class: Male Soldier, Skin: Soldier, Face: Brock +16. Class: Male Soldier, Skin: War Machine, Face: Matrix +17. Class: Boss, Skin: Boss, Face: Xan ### DesiredSkin (int, default: 9) ### DesiredSkinFemale (int, default: 0) ### DesiredTeamSkin (int, default: 9) From 53af05fb0b6eeedca948ea3bb1cc7ffa39dc16fd Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 12 Aug 2020 04:53:17 +0200 Subject: [PATCH 69/70] Decouple bEnableJitterBounding from bEnableServerExtrapolation --- Classes/bbPlayer.uc | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index 4e072027..a58d1ab5 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1384,6 +1384,22 @@ function xxSetPendingWeapon(Weapon W) PendingWeapon = W; } +/** + * Splits a large DeltaTime into chunks reasonable enough for MoveAutonomous, + * so players dont warp through walls + */ +function SimMoveAutonomous(float DeltaTime) { + local int SimSteps; + local float SimTime; + + SimSteps = Max(1, int(DeltaTime / AverageServerDeltaTime)); // handle (DeltaTime < AverageServerDeltaTime) + SimTime = DeltaTime / SimSteps; + while(SimSteps > 0) { + MoveAutonomous(SimTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); + SimSteps--; + } +} + function UndoExtrapolation() { local vector OldLoc; local Decoration Carried; @@ -4033,9 +4049,6 @@ ignores SeePlayer, HearNoise, Bump; event ServerTick(float DeltaTime) { local float TimeSinceLastUpdate; local float ProcessTime; - local float SimTime; - local int i; - local int SimSteps; if (Level.Pauser == "" && !bWasPaused) { TimeSinceLastUpdate = Level.TimeSeconds - ServerTimeStamp; @@ -4044,11 +4057,17 @@ ignores SeePlayer, HearNoise, Bump; if (class'UTPure'.default.bEnableJitterBounding && ProcessTime > AverageServerDeltaTime && bJustRespawned == false ) { - UndoExtrapolation(); - MoveAutonomous(ProcessTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); - CurrentTimeStamp += ProcessTime; - ServerTimeStamp += ProcessTime; - ExtrapolationDelta = class'UTPure'.default.MaxJitterTime; + if (class'UTPure'.default.bEnableServerExtrapolation) { + UndoExtrapolation(); + MoveAutonomous(ProcessTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); + CurrentTimeStamp += ProcessTime; + ServerTimeStamp += ProcessTime; + ExtrapolationDelta = class'UTPure'.default.MaxJitterTime; + } else { + SimMoveAutonomous(TimeSinceLastUpdate); + CurrentTimeStamp += TimeSinceLastUpdate; + ServerTimeStamp += TimeSinceLastUpdate; + } } if (class'UTPure'.default.bEnableServerExtrapolation && @@ -4060,10 +4079,7 @@ ignores SeePlayer, HearNoise, Bump; SavedVelocity = Velocity; SavedAcceleration = Acceleration; - SimSteps = int(ExtrapolationDelta / AverageServerDeltaTime); - SimTime = ExtrapolationDelta / SimSteps; - for (i = 0; i < SimSteps; i += 1) - MoveAutonomous(SimTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); + SimMoveAutonomous(ExtrapolationDelta); } ExtrapolationDelta *= Exp(-2.0 * DeltaTime); } else { From 95fe356a40738a20156d189f06e59078c5c831c3 Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Wed, 12 Aug 2020 22:58:03 +0200 Subject: [PATCH 70/70] Add warp compensation to swimming state --- Classes/bbPlayer.uc | 85 ++++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 39 deletions(-) diff --git a/Classes/bbPlayer.uc b/Classes/bbPlayer.uc index a58d1ab5..fe0b839d 100644 --- a/Classes/bbPlayer.uc +++ b/Classes/bbPlayer.uc @@ -1400,6 +1400,47 @@ function SimMoveAutonomous(float DeltaTime) { } } +function WarpCompensation(float DeltaTime) { + local float TimeSinceLastUpdate; + local float ProcessTime; + + if (Level.Pauser == "" && !bWasPaused) { + TimeSinceLastUpdate = Level.TimeSeconds - ServerTimeStamp; + ProcessTime = TimeSinceLastUpdate - class'UTPure'.default.MaxJitterTime; + + if (class'UTPure'.default.bEnableJitterBounding && + ProcessTime > AverageServerDeltaTime && bJustRespawned == false + ) { + if (class'UTPure'.default.bEnableServerExtrapolation) { + UndoExtrapolation(); + MoveAutonomous(ProcessTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); + CurrentTimeStamp += ProcessTime; + ServerTimeStamp += ProcessTime; + ExtrapolationDelta = class'UTPure'.default.MaxJitterTime; + } else { + SimMoveAutonomous(TimeSinceLastUpdate); + CurrentTimeStamp += TimeSinceLastUpdate; + ServerTimeStamp += TimeSinceLastUpdate; + } + } + + if (class'UTPure'.default.bEnableServerExtrapolation && + bExtrapolatedLastUpdate == false && ExtrapolationDelta > AverageServerDeltaTime + ) { + bExtrapolatedLastUpdate = true; + + SavedLocation = Location; + SavedVelocity = Velocity; + SavedAcceleration = Acceleration; + + SimMoveAutonomous(ExtrapolationDelta); + } + ExtrapolationDelta *= Exp(-2.0 * DeltaTime); + } else { + bWasPaused = true; + } +} + function UndoExtrapolation() { local vector OldLoc; local Decoration Carried; @@ -3778,6 +3819,10 @@ state PlayerSwimming bPressedJump = false; } + event ServerTick(float DeltaTime) { + WarpCompensation(DeltaTime); + global.ServerTick(DeltaTime); + } event UpdateEyeHeight(float DeltaTime) { @@ -4047,45 +4092,7 @@ ignores SeePlayer, HearNoise, Bump; } event ServerTick(float DeltaTime) { - local float TimeSinceLastUpdate; - local float ProcessTime; - - if (Level.Pauser == "" && !bWasPaused) { - TimeSinceLastUpdate = Level.TimeSeconds - ServerTimeStamp; - ProcessTime = TimeSinceLastUpdate - class'UTPure'.default.MaxJitterTime; - - if (class'UTPure'.default.bEnableJitterBounding && - ProcessTime > AverageServerDeltaTime && bJustRespawned == false - ) { - if (class'UTPure'.default.bEnableServerExtrapolation) { - UndoExtrapolation(); - MoveAutonomous(ProcessTime, bRun>0, bDuck>0, false, DODGE_None, Acceleration, rot(0,0,0)); - CurrentTimeStamp += ProcessTime; - ServerTimeStamp += ProcessTime; - ExtrapolationDelta = class'UTPure'.default.MaxJitterTime; - } else { - SimMoveAutonomous(TimeSinceLastUpdate); - CurrentTimeStamp += TimeSinceLastUpdate; - ServerTimeStamp += TimeSinceLastUpdate; - } - } - - if (class'UTPure'.default.bEnableServerExtrapolation && - bExtrapolatedLastUpdate == false && ExtrapolationDelta > AverageServerDeltaTime - ) { - bExtrapolatedLastUpdate = true; - - SavedLocation = Location; - SavedVelocity = Velocity; - SavedAcceleration = Acceleration; - - SimMoveAutonomous(ExtrapolationDelta); - } - ExtrapolationDelta *= Exp(-2.0 * DeltaTime); - } else { - bWasPaused = true; - } - + WarpCompensation(DeltaTime); global.ServerTick(DeltaTime); }