src/tron/gCycle.cpp File Reference

#include "eEventNotification.h"
#include "gCycle.h"
#include "nConfig.h"
#include "rModel.h"
#include "eGrid.h"
#include "rTexture.h"
#include "eTimer.h"
#include "tInitExit.h"
#include "tRecorder.h"
#include "rScreen.h"
#include "rFont.h"
#include "gSensor.h"
#include "gJoystick.h"
#include "ePlayer.h"
#include "eSoundMixer.h"
#include "eFloor.h"
#include "gSparks.h"
#include "gExplosion.h"
#include "gWall.h"
#include "nKrawall.h"
#include "gAIBase.h"
#include "eDebugLine.h"
#include "eLagCompensation.h"
#include "gArena.h"
#include "gStatistics.h"
#include "cCockpit.h"
#include "tMath.h"
#include <stdlib.h>
#include <fstream>
#include <memory>
#include "rRender.h"
#include "tDirectories.h"

Include dependency graph for gCycle.cpp:

Go to the source code of this file.

Namespaces

namespace  gLaggometer

Classes

class  gTextureCycle
class  gCycleChatBot
class  gCycleChatBot::Sensor
class  gCycleChatBot::WallHug
class  gFloatCompressor
struct  gCycleVisuals
class  gCycleWallRenderer
struct  gPredictPositionData
 intermediate data for position prediction More...
class  gJustChecking
class  gFakeDirDriveSetter
class  gLaggometer::Colour
class  gLaggometer::DirectionTransformer
class  gLaggometer::LagOMeterRenderer
class  gLaggometer::AxesIndicator

Defines

#define DONTDOIT
#define GNUPLOT_DEBUG

Typedefs

typedef nSettingItem< REALgChatBotSetting
typedef nSettingItem< bool > gChatBotSwitch

Functions

static REAL sg_GetSyncIntervalSelf (gCycle *cycle)
void sg_RubberValues (ePlayerNetID const *player, REAL speed, REAL &max, REAL &effectiveness)
static void sg_ArchiveCoord (eCoord &coord, int level)
static void sg_ArchiveReal (REAL &real, int level)
static void new_destination_handler (nMessage &m)
static void BroadCastNewDestination (gCycleMovement *c, gDestination *dest)
static REAL sg_CycleWallLengthFromDist (REAL distance)
static void rotate (eCoord &r, REAL angle)
static void DecaySmooth (REAL &smooth, REAL relSpeed, REAL minSpeed, REAL clamp)
static REAL ClampDisplacement (gCycle *cycle, eCoord &displacement, const eCoord &lookout, const eCoord &pos)
REAL sg_GetSparksDistance ()
static void sg_KillFutureWall (gCycle *cycle, gNetPlayerWall *wall)
static void sg_KillFutureWalls (gCycle *cycle)
static void sg_HoleScore (gCycle &cycle)
static void dir_eWall_select ()
void se_SanifyDisplacement (eGameObject *base, eCoord &displacement)
void ClampForward (eCoord &newPos, const eCoord &startPos, const eCoord &dir)

Variables

bool sg_gnuplotDebug = false
static tSettingItem< bool > sg_ ("DEBUG_GNUPLOT", sg_gnuplotDebug)
static REAL sg_minDropInterval = 0.05
static tSettingItem< REALsg_minDropIntervalConf ("CYCLE_MIN_WALLDROP_INTERVAL", sg_minDropInterval)
static bool sg_predictWalls = true
static tSettingItem< bool > sg_predictWallsConf ("PREDICT_WALLS", sg_predictWalls)
static nNOInitialisator< gCyclecycle_init (320,"cycle")
bool headlights = 0
bool cycleprograminited = 0
static float sg_cycleSyncSmoothTime = .1f
static tSettingItem< float > conf_smoothTime ("CYCLE_SMOOTH_TIME", sg_cycleSyncSmoothTime)
static float sg_cycleSyncSmoothMinSpeed = .2f
static tSettingItem< float > conf_smoothMinSpeed ("CYCLE_SMOOTH_MIN_SPEED", sg_cycleSyncSmoothMinSpeed)
static float sg_cycleSyncSmoothThreshold = .2f
static tSettingItem< float > conf_smoothThreshold ("CYCLE_SMOOTH_THRESHOLD", sg_cycleSyncSmoothThreshold)
static REAL sg_enemyChatbotTimePenalty = 30.0f
 penalty for victim in chatbot mode
static tSettingItem< REALsg_enemyChatbotTimePenaltyConf ("ENEMY_CHATBOT_PENALTY", sg_enemyChatbotTimePenalty)
REAL sg_suicideTimeout
 influences older than this don't count as kill cause
static nSettingItem< REAL > * c_pwsud = NULL
static nSettingItem< REAL > * c_pwl = NULL
static nSettingItem< REAL > * c_per = NULL
static REAL sg_speedCycleSound = 15
static nSettingItem< REALc_ss ("CYCLE_SOUND_SPEED", sg_speedCycleSound)
static REAL sg_cycleWallTime = 0.0
static nSettingItemWatched< REALsg_cycleWallTimeConf ("CYCLE_WALL_TIME", sg_cycleWallTime, nConfItemVersionWatcher::Group_Bumpy, 14)
static REAL sg_cycleInvulnerableTime = 0.0
static nSettingItemWatched< REALsg_cycleInvulnerableTimeConf ("CYCLE_INVULNERABLE_TIME", sg_cycleInvulnerableTime, nConfItemVersionWatcher::Group_Bumpy, 12)
static bool sg_cycleFirstSpawnProtection = false
static nSettingItemWatched< bool > sg_cycleFirstSpawnProtectionConf ("CYCLE_FIRST_SPAWN_PROTECTION", sg_cycleFirstSpawnProtection, nConfItemVersionWatcher::Group_Bumpy, 12)
static REAL sg_syncIntervalEnemy = 1
static tSettingItem< REALc_sie ("CYCLE_SYNC_INTERVAL_ENEMY", sg_syncIntervalEnemy)
static REAL sg_syncIntervalSelf = .1
static tSettingItem< REALc_sis ("CYCLE_SYNC_INTERVAL_SELF", sg_syncIntervalSelf)
static bool sg_avoidBadOldClientSync = true
static tSettingItem< bool > c_sbs ("CYCLE_AVOID_OLDCLIENT_BAD_SYNC", sg_avoidBadOldClientSync)
static REAL sg_syncFF = 10
static tSettingItem< REALc_sff ("CYCLE_SYNC_FF", sg_syncFF)
static int sg_syncFFSteps = 1
static tSettingItem< int > c_sffs ("CYCLE_SYNC_FF_STEPS", sg_syncFFSteps)
static nVersionFeature sg_NoLocalTunnelOnSync (4)
static int score_hole = 0
static tSettingItem< int > s_h ("SCORE_HOLE", score_hole)
static int score_survive = 0
static tSettingItem< int > s_sur ("SCORE_SURVIVE", score_survive)
static int score_die = -2
static tSettingItem< int > s_d ("SCORE_DIE", score_die)
static int score_kill = 3
static tSettingItem< int > s_k ("SCORE_KILL", score_kill)
static int score_suicide = -4
static tSettingItem< int > s_s ("SCORE_SUICIDE", score_suicide)
static uActionPlayer s_brakeToggle ("CYCLE_BRAKE_TOGGLE",-5)
REAL sg_brakeCycle
REAL sg_cycleBrakeDeplete
static bool sg_chatBotAlwaysActive = false
static gChatBotSwitch sg_chatBotAlwaysActiveConf ("CHATBOT_ALWAYS_ACTIVE", sg_chatBotAlwaysActive)
static REAL sg_chatBotNewWallBlindness = .3
static gChatBotSetting sg_chatBotNewWallBlindnessConf ("CHATBOT_NEW_WALL_BLINDNESS", sg_chatBotNewWallBlindness)
static REAL sg_chatBotMinTimestep = .3
static gChatBotSetting sg_chatBotMinTimestepConf ("CHATBOT_MIN_TIMESTEP", sg_chatBotMinTimestep)
static REAL sg_chatBotDelay = .5
static gChatBotSetting sg_chatBotDelayConf ("CHATBOT_DELAY", sg_chatBotDelay)
static REAL sg_chatBotRange = 1
static gChatBotSetting sg_chatBotRangeConf ("CHATBOT_RANGE", sg_chatBotRange)
static REAL sg_chatBotDecay = .02
static gChatBotSetting sg_chatBotDecayConf ("CHATBOT_DECAY", sg_chatBotDecay)
static gFloatCompressor compressZeroOne (0, 1)
static nDescriptor destination_descriptor (321,&new_destination_handler,"destinaton")
static REAL sg_cycleRubberWallShrink = 0
static nSettingItemWatched< REALsg_cycleRubberWallShrinkConf ("CYCLE_RUBBER_WALL_SHRINK", sg_cycleRubberWallShrink, nConfItemVersionWatcher::Group_Bumpy, 12)
static REAL sg_cycleDistWallShrink = 0
static nSettingItemWatched< REALsg_cycleDistWallShrinkConf ("CYCLE_DIST_WALL_SHRINK", sg_cycleDistWallShrink, nConfItemVersionWatcher::Group_Bumpy, 12)
static REAL sg_cycleDistWallShrinkOffset = 0
static nSettingItemWatched< REALsg_cycleDistWallShrinkOffsetConf ("CYCLE_DIST_WALL_SHRINK_OFFSET", sg_cycleDistWallShrinkOffset, nConfItemVersionWatcher::Group_Bumpy, 12)
bool crash_sparks = true
REAL planned_rate_control [MAXCLIENTS+2]
static nVersionFeature sg_SyncsAreUsed (5)
static eCoord const * sg_fakeDirDrive = NULL
static rFileTexture cycle_shad (rTextureGroups::TEX_FLOOR,"textures/shadow.png", 0, 0, true)
REAL sg_laggometerScale = 1
static tSettingItem< REALsg_laggometerScaleConf ("LAG_O_METER_SCALE", sg_laggometerScale)
REAL sg_laggometerThreshold = .5
static tSettingItem< REALsg_laggometerThresholdConf ("LAG_O_METER_THRESHOLD", sg_laggometerThreshold)
REAL sg_laggometerBlend = .5
static tSettingItem< REALsg_laggometerBlendConf ("LAG_O_METER_BLEND", sg_laggometerBlend)
bool sg_axesIndicator = false
int sg_blinkFrequency = 10
static tSettingItem< int > sg_blinkFrequencyConf ("CYCLE_BLINK_FREQUENCY", sg_blinkFrequency)
static REAL mp_eWall_stretch = 4
static tSettingItem< REALmpws ("MOVIEPACK_WALL_STRETCH", mp_eWall_stretch)
static rFileTexture dir_eWall (rTextureGroups::TEX_WALL,"textures/dir_wall.png", 1, 0, 1)
static rFileTexture dir_eWall_moviepack (rTextureGroups::TEX_WALL,"moviepack/dir_wall.png", 1, 0, 1)
static REAL fadeOutNameAfter = 5.0f
static bool showOwnName = 0
static tSettingItem< bool > sg_showOwnName ("SHOW_OWN_NAME", showOwnName)
static tSettingItem< REALsg_fadeOutNameAfter ("FADEOUT_NAME_DELAY", fadeOutNameAfter)
static bool sg_displayColoredNameOverCycles = true
static tSettingItem< bool > sg_displayColoredNameOverCyclesCfg ("DISPLAY_COLORED_NAMES_OVER_CYCLES", sg_displayColoredNameOverCycles)
static nVersionFeature sg_verletIntegration (7)
static int sg_useExtrapolatorSync = 1
static tSettingItem< int > sg_useExtrapolatorSyncConf ("EXTRAPOLATOR_SYNC", sg_useExtrapolatorSync)
REAL sg_cycleBrakeRefill


Define Documentation

#define DONTDOIT

Definition at line 66 of file gCycle.cpp.

#define GNUPLOT_DEBUG

Definition at line 76 of file gCycle.cpp.


Typedef Documentation

typedef nSettingItem<REAL> gChatBotSetting

Definition at line 298 of file gCycle.cpp.

typedef nSettingItem<bool> gChatBotSwitch

Definition at line 299 of file gCycle.cpp.


Function Documentation

static void BroadCastNewDestination ( gCycleMovement c,
gDestination dest 
) [static]

Definition at line 1413 of file gCycle.cpp.

References nMessage::BroadCast(), destination_descriptor, nNetObject::ID(), and gDestination::WriteCreate().

Referenced by gCycle::OnNotifyNewDestination().

01413                                                                           {
01414     nMessage *m=new nMessage(destination_descriptor);
01415     dest->WriteCreate(*m, c->ID() );
01416     m->BroadCast();
01417 }

Here is the call graph for this function:

Here is the caller graph for this function:

static REAL ClampDisplacement ( gCycle cycle,
eCoord &  displacement,
const eCoord &  lookout,
const eCoord &  pos 
) [static]

Definition at line 2718 of file gCycle.cpp.

References eSensor::detect(), and eSensor::hit.

Referenced by gCycle::TimestepCore().

02720 {
02721     gSensor sensor( cycle, pos, lookout );
02722     sensor.detect(1);
02723     if ( sensor.ehit && sensor.hit >= 0 && sensor.hit < 1 )
02724     {
02725 #ifdef DEBUG_X
02726         // repeat sensor
02727         gSensor sensor( cycle, pos, lookout );
02728         sensor.detect(1);
02729 #endif
02730         displacement = displacement * sensor.hit;
02731     }
02732     return sensor.hit;

Here is the call graph for this function:

Here is the caller graph for this function:

void ClampForward ( eCoord &  newPos,
const eCoord &  startPos,
const eCoord &  dir 
)

Definition at line 5244 of file gCycle.cpp.

References REAL.

Referenced by gCycle::ReadSync().

05246 {
05247     REAL forward = eCoord::F( newPos - startPos, dir )/dir.NormSquared();
05248     if ( forward < 0 )
05249         newPos = newPos - dir * forward;

Here is the caller graph for this function:

static void DecaySmooth ( REAL smooth,
REAL  relSpeed,
REAL  minSpeed,
REAL  clamp 
) [static]

Definition at line 2685 of file gCycle.cpp.

References REAL, and x.

Referenced by gCycle::TimestepCore().

02687 {
02688     if ( fabs(smooth) > .01 )
02689     {
02690         int x;
02691         x = 1;
02692     }
02693 
02694     // increase correction speed if the value is out of bounds
02695     if ( clamp > 0 )
02696         relSpeed *= ( 1 + smooth * smooth / ( clamp * clamp ) );
02697 
02698     // nothing to do
02699     if ( smooth == 0 )
02700     {
02701         return;
02702     }
02703 
02704     // calculate speed from relative speed
02705     REAL speed = smooth * relSpeed;
02706 
02707     // apply minimal correction
02708     if ( fabs( speed ) < minSpeed )
02709         speed = copysign ( minSpeed , smooth );
02710 
02711     // don't overshoot
02712     if ( fabs( speed ) > fabs( smooth ) )
02713         smooth = 0;
02714     else
02715         smooth -= speed;

Here is the caller graph for this function:

static void dir_eWall_select (  )  [static]

Definition at line 3946 of file gCycle.cpp.

References dir_eWall, dir_eWall_moviepack, IdentityMatrix(), ScaleMatrix(), rITexture::Select(), sg_MoviePack(), and TexMatrix().

Referenced by gCycleWallsDisplayListManager::RenderAll().

03948 {
03949     if (sg_MoviePack()){
03950         TexMatrix();
03951         IdentityMatrix();
03952         ScaleMatrix(1/mp_eWall_stretch,1,1);
03953         dir_eWall_moviepack.Select();
03954     }
03955     else
03956     {
03957         dir_eWall.Select();
03958     }

Here is the call graph for this function:

Here is the caller graph for this function:

static void new_destination_handler ( nMessage m  )  [static]

Definition at line 1374 of file gCycle.cpp.

References ePlayerNetID::Activity(), gCycleMovement::AddDestination(), c, gDestination::Chatting(), Cheater(), nNetObject::CreatorDescriptor(), cycle_init, gDestination::gDestination(), gDestination::GetGameTime(), eNetGameObject::Lag(), nSERVER, nNetObject::ObjectDangerous(), nNetObject::Owner(), eNetGameObject::Player(), se_GameTime(), nMessage::SenderID(), gDestination::SetGameTime(), sn_GetNetState(), and sn_myNetID.

01375 {
01376     // read the destination
01377     unsigned short cycle_id;
01378     gDestination *dest=new gDestination(m, cycle_id );
01379 
01380     // and the ID of the cycle the destination is added to
01381     nNetObject *o=nNetObject::ObjectDangerous(cycle_id);
01382     if (o && &o->CreatorDescriptor() == &cycle_init){
01383         if ((sn_GetNetState() == nSERVER) && (m.SenderID() != o->Owner()))
01384         {
01385             Cheater(m.SenderID());
01386         }
01387         else
01388             if(o->Owner() != ::sn_myNetID)
01389             {
01390                 gCycle* c = dynamic_cast<gCycle *>(o);
01391                 if (c)
01392                 {
01393                     if ( c->Player() && !dest->Chatting() )
01394                         c->Player()->Activity();
01395 
01396                     // fill default gametime
01397                     if ( dest->GetGameTime() < -100 )
01398                         dest->SetGameTime( se_GameTime()+c->Lag()*3 );
01399 
01400                     c->AddDestination(dest);
01401                     dest = 0;
01402                 }
01403             }
01404     }
01405 
01406     // delete the destination if it has not been used
01407     // TODO: exception safety!
01408     delete dest;
01409 }

Here is the call graph for this function:

static void rotate ( eCoord &  r,
REAL  angle 
) [inline, static]

Definition at line 2405 of file gCycle.cpp.

References REAL, sqrt(), and x.

Referenced by gGame::Analysis(), cWidget::Map::DrawMap(), gGame::StateUpdate(), and gCycle::TimestepCore().

02406                                                {
02407     REAL x=r.x;
02408     r.x+=r.y*angle;
02409     r.y-=x*angle;
02410     r=r*(1/sqrt(r.NormSquared()));

Here is the call graph for this function:

Here is the caller graph for this function:

void se_SanifyDisplacement ( eGameObject base,
eCoord &  displacement 
)

Definition at line 5109 of file gCycle.cpp.

References con, eSensor::detect(), eCoord, eSensor::hit, eGameObject::Position(), REAL, and se_EstimatedRangeOfMult().

05111 {
05112     eCoord base_pos = base->Position();
05113     eCoord reachable_pos = base->Position() + displacement;
05114 
05115     int timeout = 5;
05116     while( timeout > 0 )
05117     {
05118         --timeout;
05119 
05120         // cast ray fron sync_pos to reachable_pos
05121         gSensor test( base, base_pos, displacement );
05122         test.detect(1);
05123 
05124         if ( timeout == 0 )
05125         {
05126             // emergency exit; take something closely before the wall
05127             displacement = ( displacement ) * ( test.hit * .99 );
05128             break;
05129         }
05130 
05131         if ( !test.ehit )
05132         {
05133             // path is clear
05134             break;
05135         }
05136         else
05137         {
05138 #ifdef DEBUG
05139             // see if the wall that was hit is nearly parallel to the desired move. maybe we should add
05140             // special code for that. However, the projection idea seems to be universally robust.
05141             float p = test.ehit->Vec() * displacement;
05142             float m = se_EstimatedRangeOfMult( test.ehit->Vec(), displacement );
05143             if ( fabs(p) < m * .001 )
05144             {
05145                 con << "Almost missed wall during gCycle::ReadSync positon update";
05146             }
05147 #endif
05148 
05149             // project reachable_pos to the line that was hit
05150             REAL alpha = test.ehit->Ratio( base_pos + displacement );
05151             displacement = *test.ehit->Point() + test.ehit->Vec() * alpha - base_pos;
05152 
05153             // move it a bit closer to the known good position
05154             displacement = displacement * .99;
05155         }
05156     }

Here is the call graph for this function:

static void sg_ArchiveCoord ( eCoord &  coord,
int  level 
) [static]

Definition at line 1059 of file gCycle.cpp.

References tRecorderSync< DATA >::Archive(), and section.

Referenced by gCycle::DoTurn(), gCycle::gCycle(), gCycle::Timestep(), gCycleMovement::TimestepCore(), and gCycle::TimestepCore().

01060 {
01061     static char const * section = "_COORD";
01062     tRecorderSync< eCoord >::Archive( section, level, coord );
01063 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void sg_ArchiveReal ( REAL real,
int  level 
) [static]

Definition at line 1065 of file gCycle.cpp.

References tRecorderSync< DATA >::Archive(), and section.

Referenced by gCycleMovement::ApplyAcceleration(), gCycleMovement::CalculateAcceleration(), gCycle::gCycle(), gCycleMovement::GetMaxSpaceAhead(), gCycleMovement::Timestep(), gCycle::Timestep(), gCycleMovement::TimestepCore(), and gCycle::TimestepCore().

01066 {
01067     static char const * section = "_REAL";
01068     tRecorderSync< REAL >::Archive( section, level, real );
01069 }

Here is the call graph for this function:

Here is the caller graph for this function:

static REAL sg_CycleWallLengthFromDist ( REAL  distance  )  [static]

Definition at line 1636 of file gCycle.cpp.

References d, REAL, sg_cycleDistWallShrink, sg_cycleDistWallShrinkOffset, and gCycle::WallsLength().

Referenced by gCycle::MaxWallsLength(), and gCycle::ThisWallsLength().

01637 {
01638     REAL len = gCycle::WallsLength();
01639 
01640     // make base length longer or shorter, depending on the sign of sg_cycleDistWallShrink
01641     REAL d = sg_cycleDistWallShrinkOffset - distance;
01642     if ( d > 0 )
01643         len -= sg_cycleDistWallShrink * d;
01644 
01645     return len;
01646 }

Here is the call graph for this function:

Here is the caller graph for this function:

REAL sg_GetSparksDistance (  ) 

Definition at line 122 of file gCycleMovement.cpp.

References sg_cycleWidth, and sg_cycleWidthSide.

Referenced by gCycle::TimestepCore().

00124 {
00125     if ( sg_cycleWidth < 2 * sg_cycleWidthSide )
00126         return sg_cycleWidth;
00127     else if ( sg_cycleWidthSide > 0 )
00128         return sg_cycleWidthSide * 2;
00129     else
00130         return .25; // return 0.2.8.2 default

Here is the caller graph for this function:

static REAL sg_GetSyncIntervalSelf ( gCycle cycle  )  [static]

Definition at line 188 of file gCycle.cpp.

References nNetObject::Owner(), sg_NoLocalTunnelOnSync, sg_syncIntervalEnemy, sg_syncIntervalSelf, and nVersionFeature::Supported().

Referenced by gCycle::RequestSyncOwner(), gCycle::RightBeforeDeath(), and gCycle::TimestepCore().

00189 {
00190     if ( sg_NoLocalTunnelOnSync.Supported( cycle->Owner() ) )
00191         return sg_syncIntervalSelf;
00192     else
00193         return sg_syncIntervalEnemy * 10;
00194 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void sg_HoleScore ( gCycle cycle  )  [static]

Definition at line 3333 of file gCycle.cpp.

References ePlayerNetID::AddScore(), eNetGameObject::Player(), and score_hole.

Referenced by gCycle::PassEdge().

03335 {
03336     cycle.Player()->AddScore( score_hole, tOutput("$player_win_hole"), tOutput("$player_lose_hole") );

Here is the call graph for this function:

Here is the caller graph for this function:

static void sg_KillFutureWall ( gCycle cycle,
gNetPlayerWall wall 
) [static]

Definition at line 3306 of file gCycle.cpp.

References gNetPlayerWall::BlowHole(), gNetPlayerWall::Cycle(), gCycleMovement::GetDistance(), and gNetPlayerWall::Pos().

Referenced by sg_KillFutureWalls().

03308 {
03309     if ( cycle && wall && wall->Cycle() == cycle && wall->Pos(1) > cycle->GetDistance() )
03310     {
03311         wall->BlowHole( cycle->GetDistance(), wall->Pos(1) + 100, 0 );
03312     }

Here is the call graph for this function:

Here is the caller graph for this function:

static void sg_KillFutureWalls ( gCycle cycle  )  [static]

Definition at line 3315 of file gCycle.cpp.

References con, nCLIENT, sg_KillFutureWall(), sg_netPlayerWalls, sg_netPlayerWallsGridded, and sn_GetNetState().

Referenced by gCycle::PassEdge().

03317 {
03318 #ifdef DEBUG_X
03319     con << "Removing future walls of the cylce that just got killed mercilessly.\n";
03320 #endif
03321 
03322     // handle future walls that won't be drawn after all. Just make them a big hole.
03323     if ( sn_GetNetState() != nCLIENT )
03324     {
03325         int i;
03326         for ( i = sg_netPlayerWalls.Len()-1; i >= 0; --i )
03327             sg_KillFutureWall( cycle, sg_netPlayerWalls(i) );
03328 
03329         for ( i = sg_netPlayerWallsGridded.Len()-1; i >= 0; --i )
03330             sg_KillFutureWall( cycle, sg_netPlayerWallsGridded(i) );
03331     }

Here is the call graph for this function:

Here is the caller graph for this function:

void sg_RubberValues ( ePlayerNetID const *  player,
REAL  speed,
REAL max,
REAL effectiveness 
)

Definition at line 2758 of file gCycleMovement.cpp.

References ePlayerNetID::ping, REAL, sg_rubberCycle, sg_rubberCyclePing, sg_rubberCycleTimeBased, sg_speedCycle, and gCycleMovement::SpeedMultiplier().

Referenced by gCycleChatBot::Activate(), gCycleMovement::GetMaxSpaceAhead(), gCycle::OnNotifyNewDestination(), gCycle::PassEdge(), gCycleMovement::Timestep(), gCycleMovement::TimestepCore(), and gCycle::WallEndSpeed().

02760 {
02761     // base values
02762     max=sg_rubberCycle;
02763     effectiveness=1;
02764 
02765     // make rubber more effective for high ping players
02766     if ( player )
02767     {
02768         if ( max > 0 )
02769             // either by increasing the effectiveness...
02770             effectiveness *= ( max + player->ping * sg_rubberCyclePing )/max;
02771         else
02772             // or the reservoir.
02773             max += player->ping * sg_rubberCyclePing;
02774     }
02775 
02776     {
02777         // modify rubber effectiveness by a speed dependant power law
02778         REAL speedFactor = speed/(sg_speedCycle*gCycleMovement::SpeedMultiplier());
02779 
02780         effectiveness *= pow( speedFactor, sg_rubberCycleTimeBased );
02781     }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

nSettingItem<REAL> * c_per = NULL [static]

Definition at line 120 of file gCycle.cpp.

Referenced by gCycle::PrivateSettings(), and gCycle::SetExplosionRadius().

nSettingItem<REAL> * c_pwl = NULL [static]

Definition at line 120 of file gCycle.cpp.

Referenced by gCycle::PrivateSettings(), and gCycle::SetWallsLength().

nSettingItem<REAL>* c_pwsud = NULL [static]

Definition at line 120 of file gCycle.cpp.

tSettingItem<bool> c_sbs("CYCLE_AVOID_OLDCLIENT_BAD_SYNC", sg_avoidBadOldClientSync) [static]

tSettingItem<REAL> c_sff("CYCLE_SYNC_FF", sg_syncFF) [static]

tSettingItem<int> c_sffs("CYCLE_SYNC_FF_STEPS", sg_syncFFSteps) [static]

tSettingItem<REAL> c_sie("CYCLE_SYNC_INTERVAL_ENEMY", sg_syncIntervalEnemy) [static]

tSettingItem<REAL> c_sis("CYCLE_SYNC_INTERVAL_SELF", sg_syncIntervalSelf) [static]

nSettingItem<REAL> c_ss("CYCLE_SOUND_SPEED", sg_speedCycleSound) [static]

gFloatCompressor compressZeroOne(0, 1) [static]

Referenced by gCycle::ReadSync(), and gCycle::WriteSync().

tSettingItem<float> conf_smoothMinSpeed("CYCLE_SMOOTH_MIN_SPEED", sg_cycleSyncSmoothMinSpeed) [static]

tSettingItem<float> conf_smoothThreshold("CYCLE_SMOOTH_THRESHOLD", sg_cycleSyncSmoothThreshold) [static]

tSettingItem<float> conf_smoothTime("CYCLE_SMOOTH_TIME", sg_cycleSyncSmoothTime) [static]

bool crash_sparks = true

Definition at line 2416 of file gCycle.cpp.

Referenced by gCycle::TimestepCore().

nNOInitialisator<gCycle> cycle_init(320,"cycle") [static]

Referenced by gCycle::CreatorDescriptor(), gCycleExtrapolator::CreatorDescriptor(), and new_destination_handler().

rFileTexture cycle_shad(rTextureGroups::TEX_FLOOR,"textures/shadow.png", 0, 0, true) [static]

Referenced by gCycle::Render().

bool cycleprograminited = 0

Definition at line 100 of file gCycle.cpp.

Referenced by gCycle::Render().

nDescriptor destination_descriptor(321,&new_destination_handler,"destinaton") [static]

Referenced by BroadCastNewDestination().

rFileTexture dir_eWall(rTextureGroups::TEX_WALL,"textures/dir_wall.png", 1, 0, 1) [static]

Referenced by dir_eWall_select().

rFileTexture dir_eWall_moviepack(rTextureGroups::TEX_WALL,"moviepack/dir_wall.png", 1, 0, 1) [static]

Referenced by dir_eWall_select().

REAL fadeOutNameAfter = 5.0f [static]

Definition at line 4628 of file gCycle.cpp.

bool headlights = 0

Definition at line 99 of file gCycle.cpp.

Referenced by gCycle::Render().

REAL mp_eWall_stretch = 4 [static]

Definition at line 3939 of file gCycle.cpp.

tSettingItem<REAL> mpws("MOVIEPACK_WALL_STRETCH", mp_eWall_stretch) [static]

REAL planned_rate_control[MAXCLIENTS+2]

uActionPlayer s_brakeToggle("CYCLE_BRAKE_TOGGLE",-5) [static]

Referenced by gCycle::Act().

tSettingItem<int> s_d("SCORE_DIE", score_die) [static]

tSettingItem<int> s_h("SCORE_HOLE", score_hole) [static]

tSettingItem<int> s_k("SCORE_KILL", score_kill) [static]

tSettingItem<int> s_s("SCORE_SUICIDE", score_suicide) [static]

tSettingItem<int> s_sur("SCORE_SURVIVE", score_survive) [static]

int score_die = -2 [static]

Definition at line 206 of file gCycle.cpp.

Referenced by gCycle::KillAt().

int score_hole = 0 [static]

Definition at line 200 of file gCycle.cpp.

Referenced by gCycle::PassEdge(), and sg_HoleScore().

int score_kill = 3 [static]

Definition at line 209 of file gCycle.cpp.

Referenced by gCycle::KillAt().

int score_suicide = -4 [static]

Definition at line 212 of file gCycle.cpp.

Referenced by gCycle::KillAt().

int score_survive = 0 [static]

Definition at line 203 of file gCycle.cpp.

Referenced by gCycle::OnRoundEnd().

tSettingItem<bool> sg_("DEBUG_GNUPLOT", sg_gnuplotDebug) [static]

bool sg_avoidBadOldClientSync = true [static]

Definition at line 172 of file gCycle.cpp.

Referenced by gCycle::RightBeforeDeath(), and gCycle::TimestepCore().

bool sg_axesIndicator = false

Definition at line 3795 of file gCycle.cpp.

Referenced by gCycle::Render().

int sg_blinkFrequency = 10

Definition at line 3797 of file gCycle.cpp.

Referenced by gCycle::Render().

tSettingItem< int > sg_blinkFrequencyConf("CYCLE_BLINK_FREQUENCY", sg_blinkFrequency) [static]

REAL sg_brakeCycle

Definition at line 98 of file gCycleMovement.cpp.

Referenced by gCycleChatBot::Activate(), gCycleMovement::CalculateAcceleration(), and gCycleMovement::MaximalSpeed().

bool sg_chatBotAlwaysActive = false [static]

Definition at line 302 of file gCycle.cpp.

Referenced by gCycle::Timestep().

gChatBotSwitch sg_chatBotAlwaysActiveConf("CHATBOT_ALWAYS_ACTIVE", sg_chatBotAlwaysActive) [static]

REAL sg_chatBotDecay = .02 [static]

Definition at line 321 of file gCycle.cpp.

Referenced by gCycleChatBot::Activate().

gChatBotSetting sg_chatBotDecayConf("CHATBOT_DECAY", sg_chatBotDecay) [static]

REAL sg_chatBotDelay = .5 [static]

Definition at line 313 of file gCycle.cpp.

Referenced by gCycleChatBot::Activate().

gChatBotSetting sg_chatBotDelayConf("CHATBOT_DELAY", sg_chatBotDelay) [static]

REAL sg_chatBotMinTimestep = .3 [static]

Definition at line 309 of file gCycle.cpp.

Referenced by gCycleChatBot::Activate().

gChatBotSetting sg_chatBotMinTimestepConf("CHATBOT_MIN_TIMESTEP", sg_chatBotMinTimestep) [static]

REAL sg_chatBotNewWallBlindness = .3 [static]

Definition at line 305 of file gCycle.cpp.

Referenced by gCycleChatBot::Sensor::DoExtraDetectionStuff().

gChatBotSetting sg_chatBotNewWallBlindnessConf("CHATBOT_NEW_WALL_BLINDNESS", sg_chatBotNewWallBlindness) [static]

REAL sg_chatBotRange = 1 [static]

Definition at line 317 of file gCycle.cpp.

Referenced by gCycleChatBot::Activate().

gChatBotSetting sg_chatBotRangeConf("CHATBOT_RANGE", sg_chatBotRange) [static]

REAL sg_cycleBrakeDeplete

Definition at line 5252 of file gCycle.cpp.

Referenced by gCycleChatBot::Activate(), gCycleMovement::CalculateAcceleration(), and gCycleMovement::MaximalSpeed().

REAL sg_cycleBrakeRefill

Definition at line 102 of file gCycleMovement.cpp.

Referenced by gCycleMovement::CalculateAcceleration(), and gCycleMovement::MaximalSpeed().

REAL sg_cycleDistWallShrink = 0 [static]

Definition at line 1621 of file gCycle.cpp.

Referenced by gCycle::MaxWallsLength(), sg_CycleWallLengthFromDist(), and gCycle::WallEndSpeed().

nSettingItemWatched<REAL> sg_cycleDistWallShrinkConf("CYCLE_DIST_WALL_SHRINK", sg_cycleDistWallShrink, nConfItemVersionWatcher::Group_Bumpy, 12) [static]

REAL sg_cycleDistWallShrinkOffset = 0 [static]

Definition at line 1628 of file gCycle.cpp.

Referenced by sg_CycleWallLengthFromDist(), and gCycle::WallEndSpeed().

nSettingItemWatched<REAL> sg_cycleDistWallShrinkOffsetConf("CYCLE_DIST_WALL_SHRINK_OFFSET", sg_cycleDistWallShrinkOffset, nConfItemVersionWatcher::Group_Bumpy, 12) [static]

bool sg_cycleFirstSpawnProtection = false [static]

Definition at line 155 of file gCycle.cpp.

Referenced by gCycle::MyInitAfterCreation(), and gCycle::ReadSync().

nSettingItemWatched<bool> sg_cycleFirstSpawnProtectionConf("CYCLE_FIRST_SPAWN_PROTECTION", sg_cycleFirstSpawnProtection, nConfItemVersionWatcher::Group_Bumpy, 12) [static]

REAL sg_cycleInvulnerableTime = 0.0 [static]

Definition at line 147 of file gCycle.cpp.

Referenced by gCycle::Vulnerable().

nSettingItemWatched<REAL> sg_cycleInvulnerableTimeConf("CYCLE_INVULNERABLE_TIME", sg_cycleInvulnerableTime, nConfItemVersionWatcher::Group_Bumpy, 12) [static]

REAL sg_cycleRubberWallShrink = 0 [static]

Definition at line 1613 of file gCycle.cpp.

Referenced by gCycle::MaxWallsLength(), gCycle::ThisWallsLength(), and gCycle::WallEndSpeed().

nSettingItemWatched<REAL> sg_cycleRubberWallShrinkConf("CYCLE_RUBBER_WALL_SHRINK", sg_cycleRubberWallShrink, nConfItemVersionWatcher::Group_Bumpy, 12) [static]

float sg_cycleSyncSmoothMinSpeed = .2f [static]

Definition at line 105 of file gCycle.cpp.

Referenced by gCycle::TimestepCore().

float sg_cycleSyncSmoothThreshold = .2f [static]

Definition at line 108 of file gCycle.cpp.

Referenced by gCycle::TimestepCore().

float sg_cycleSyncSmoothTime = .1f [static]

Definition at line 102 of file gCycle.cpp.

Referenced by gCycle::TimestepCore().

REAL sg_cycleWallTime = 0.0 [static]

Definition at line 139 of file gCycle.cpp.

Referenced by gCycle::DropWall(), gCycle::SyncEnemy(), gCycle::SyncFromExtrapolator(), and gCycle::TimestepCore().

nSettingItemWatched<REAL> sg_cycleWallTimeConf("CYCLE_WALL_TIME", sg_cycleWallTime, nConfItemVersionWatcher::Group_Bumpy, 14) [static]

bool sg_displayColoredNameOverCycles = true [static]

Definition at line 4636 of file gCycle.cpp.

tSettingItem< bool > sg_displayColoredNameOverCyclesCfg("DISPLAY_COLORED_NAMES_OVER_CYCLES", sg_displayColoredNameOverCycles) [static]

REAL sg_enemyChatbotTimePenalty = 30.0f [static]

penalty for victim in chatbot mode

Definition at line 111 of file gCycle.cpp.

Referenced by gCycleChatBot::Activate().

tSettingItem<REAL> sg_enemyChatbotTimePenaltyConf("ENEMY_CHATBOT_PENALTY", sg_enemyChatbotTimePenalty) [static]

tSettingItem< REAL > sg_fadeOutNameAfter("FADEOUT_NAME_DELAY", fadeOutNameAfter) [static]

eCoord const* sg_fakeDirDrive = NULL [static]

Definition at line 3603 of file gCycle.cpp.

Referenced by gCycle::DropWall(), gFakeDirDriveSetter::gFakeDirDriveSetter(), and gFakeDirDriveSetter::~gFakeDirDriveSetter().

bool sg_gnuplotDebug = false

Definition at line 74 of file gCycle.cpp.

Referenced by gCycle::DoTurn(), gCycle::MyInitAfterCreation(), gCycle::OnNotifyNewDestination(), sg_TopologyPoliceCheck(), and gCycle::Timestep().

REAL sg_laggometerBlend = .5

Definition at line 3789 of file gCycle.cpp.

Referenced by gLaggometer::LagOMeterRenderer::LagOMeterRenderer().

tSettingItem< REAL > sg_laggometerBlendConf("LAG_O_METER_BLEND", sg_laggometerBlend) [static]

REAL sg_laggometerScale = 1

Definition at line 3785 of file gCycle.cpp.

Referenced by gCycle::Render().

tSettingItem< REAL > sg_laggometerScaleConf("LAG_O_METER_SCALE", sg_laggometerScale) [static]

REAL sg_laggometerThreshold = .5

Definition at line 3787 of file gCycle.cpp.

Referenced by gCycle::Render().

tSettingItem< REAL > sg_laggometerThresholdConf("LAG_O_METER_THRESHOLD", sg_laggometerThreshold) [static]

REAL sg_minDropInterval = 0.05 [static]

Definition at line 83 of file gCycle.cpp.

Referenced by gCycle::OnDropTempWall(), and gCycle::Timestep().

tSettingItem< REAL > sg_minDropIntervalConf("CYCLE_MIN_WALLDROP_INTERVAL", sg_minDropInterval) [static]

nVersionFeature sg_NoLocalTunnelOnSync(4) [static]

Referenced by gCycle::RightBeforeDeath(), sg_GetSyncIntervalSelf(), and gCycle::TimestepCore().

bool sg_predictWalls = true [static]

Definition at line 86 of file gCycle.cpp.

Referenced by gCycle::CalculatePredictPosition(), and gCycle::PreparePredictPosition().

tSettingItem< bool > sg_predictWallsConf("PREDICT_WALLS", sg_predictWalls) [static]

tSettingItem< bool > sg_showOwnName("SHOW_OWN_NAME", showOwnName) [static]

REAL sg_speedCycleSound = 15 [static]

Definition at line 134 of file gCycle.cpp.

REAL sg_suicideTimeout

influences older than this don't count as kill cause

Definition at line 502 of file gCycleMovement.cpp.

Referenced by gEnemyInfluence::gEnemyInfluence(), and gCycle::KillAt().

REAL sg_syncFF = 10 [static]

Definition at line 177 of file gCycle.cpp.

Referenced by gCycle::Timestep().

int sg_syncFFSteps = 1 [static]

Definition at line 181 of file gCycle.cpp.

Referenced by gCycle::Timestep().

REAL sg_syncIntervalEnemy = 1 [static]

Definition at line 163 of file gCycle.cpp.

Referenced by gCycle::RequestSyncAll(), gCycle::RightBeforeDeath(), sg_GetSyncIntervalSelf(), and gCycle::TimestepCore().

REAL sg_syncIntervalSelf = .1 [static]

Definition at line 167 of file gCycle.cpp.

Referenced by sg_GetSyncIntervalSelf().

nVersionFeature sg_SyncsAreUsed(5) [static]

int sg_useExtrapolatorSync = 1 [static]

Definition at line 5240 of file gCycle.cpp.

tSettingItem<int> sg_useExtrapolatorSyncConf("EXTRAPOLATOR_SYNC", sg_useExtrapolatorSync) [static]

nVersionFeature sg_verletIntegration(7) [static]

Referenced by gCycleMovement::ApplyAcceleration(), gCycleMovement::TimestepCore(), and gCycle::WriteSync().

bool showOwnName = 0 [static]

Definition at line 4630 of file gCycle.cpp.


Generated on Sat Mar 15 23:15:06 2008 for Armagetron Advanced by  doxygen 1.5.4