Although I despise playing Quake games our clanmate introduced us to Defrag thingy that is basically a tore-down version of Quake 3 relying on it's Bunny Hopping feature thus creating a "racing game" out of Quake 3.
I started experimenting with an emulation of this feature; on my level of coding knowledge of course and failed miserably.
(In case you are interested in the coding behind Quake's Buny Hopping feature:
I made a prototype tho.
Custom GameType that kills Fall Damage:
Code: Select all
//=============================================================================
// MMUGottaGoFastz.
//=============================================================================
class MMUGottaGoFastz expands DeathMatchGame;
function float PlayerJumpZScaling()
{
if ( bHardCoreMode )
return 1.5;
else
return 1.5;
}
function int ReduceDamage(int Damage, name DamageType, pawn injured, pawn instigatedBy)
{
// Ignore fall damage
if (DamageType == 'Fell')
return 0;
// Check if the injured pawn is in a neutral zone, if so, return 0 damage
if (injured.Region.Zone.bNeutralZone)
return 0;
// If the damage is caused by no one (e.g., environmental damage), return the original damage
if (instigatedBy == None)
return Damage;
// If in hardcore mode, don't modify damage
if (bHardCoreMode)
return Damage;
// Skill level modification
if ((instigatedBy.Skill < 1.5) && instigatedBy.IsA('Bots') && injured.IsA('PlayerPawn'))
Damage = Damage * (0.7 + 0.15 * instigatedBy.skill);
// Apply damage scaling based on instigator
return (Damage * instigatedBy.DamageScaling);
}
Code: Select all
//=============================================================================
// MMUBunnyBoots.
//=============================================================================
class MMUBunnyBoots expands Pickup;
var Vector PreviousLocation; // Declare PreviousLocation at the class level
var Vector AcceleratedVelocity; // Store the accelerated velocity
var bool JustLanded; // Track whether the player has just landed from a jump
state Activated
{
function endstate()
{
if (Owner != None)
{
Pawn(Owner).Airspeed = Pawn(Owner).Default.Airspeed;
Pawn(Owner).Groundspeed = Pawn(Owner).Default.Groundspeed;
Pawn(Owner).Acceleration = Pawn(Owner).Default.Acceleration;
Pawn(Owner).AirControl = Pawn(Owner).Default.AirControl;
}
bActive = false;
}
function AccelerateInAir()
{
// Check if the player is in the air
if (Pawn(Owner).Physics == PHYS_Falling)
{
// Accelerate the player
AcceleratedVelocity = Pawn(Owner).Velocity + Pawn(Owner).Velocity * 0.00000001; // Increase velocity by 10% each tick
}
}
function Tick(float DeltaTime)
{
Super.Tick(DeltaTime);
// Check if the player is moving downhill or in the air
if (Pawn(Owner).Location.Z < PreviousLocation.Z || Pawn(Owner).Physics == PHYS_Falling)
{
// Apply accelerated velocity
if (AcceleratedVelocity != vect(0,0,0))
{
Pawn(Owner).Velocity = AcceleratedVelocity;
}
else
{
// Accelerate the player
Pawn(Owner).Velocity += Pawn(Owner).Velocity * 0.001; // Increase velocity by 10% when moving downhill or in the air
}
}
else if (Pawn(Owner).Location.Z > PreviousLocation.Z)
{
// Decrease velocity when moving uphill
Pawn(Owner).Velocity *= 0.75; // Reduce velocity by half when moving uphill
}
// Check if the player has just landed from a jump
if (Pawn(Owner).Physics == PHYS_Walking && PreviousLocation.Z > Pawn(Owner).Location.Z)
{
JustLanded = true; // Set the flag when the player transitions from falling to walking
}
// Apply bounce effect if the player has just landed from a jump
if (JustLanded)
{
// Apply bounce effect
Pawn(Owner).Velocity *= 1.25; // Increase velocity by 50% upon landing
JustLanded = false; // Reset the flag
}
// Update previous location
PreviousLocation = Pawn(Owner).Location;
}
Begin:
Pawn(Owner).Airspeed = Pawn(Owner).Default.Airspeed * 2.0;
Pawn(Owner).Groundspeed = Pawn(Owner).Default.Groundspeed * 2.0;
Pawn(Owner).Acceleration = Pawn(Owner).Default.Acceleration * 18.0;
Pawn(Owner).AirControl = Pawn(Owner).Default.AirControl * 16.0;
PreviousLocation = Pawn(Owner).Location; // Initialize PreviousLocation
JustLanded = false; // Initialize JustLanded flag
}
state DeActivated
{
Begin:
}
I wonder if anyone has ever tried implementing this in Unreal.
Also, do you know any way for the pickup to make the player retain it's gained speed when hitting the ground?
I also wonder why the player won't keep on accelerating both in the air and on the ground. Something seems to be capping it's speed above the Pickup's GroundSpeed modification.
Any help is appreciated.
Video: