~aavoodoo/+junk/0.2.8-armagetronad-opengles

« back to all changes in this revision

Viewing changes to src/engine/eLagCompensation.cpp

  • Committer: voodoo
  • Date: 2009-02-11 18:09:31 UTC
  • Revision ID: voodoo-20090211180931-8gvwixzss1mdy4ds
merge from mainline r976..1015

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
static REAL se_lagSlowWeight=.2f;       // extra weight lag reports from the server influence the slow lag compensation with
45
45
static REAL se_lagFastWeight=1.0f;      // extra weight lag reports from the server influence the fast lag compensation with
46
46
 
 
47
static REAL se_lagCreditSingle = .1f;   // maximal seconds of lag credit given or accepted in a single event
 
48
 
47
49
static tSettingItem< REAL > se_maxLagSpeedupConf( "LAG_MAX_SPEEDUP_TIMER", se_maxLagSpeedup );
48
50
static tSettingItem< REAL > se_lagSlowDecayTimeConf( "LAG_SLOW_TIME", se_lagSlowDecayTime );
49
51
static tSettingItem< REAL > se_lagFastDecayTimeConf( "LAG_FAST_TIME", se_lagFastDecayTime );
63
65
        con << "Received message of " << lag << " seconds of lag, weight " << weight << "\n";
64
66
#endif
65
67
 
 
68
        // clamp
 
69
        lag = lag > se_lagCreditSingle ? se_lagCreditSingle : lag;
 
70
 
66
71
        // memorize the time of serious reports
67
72
        if ( weight > 1 )
68
73
            lagLast_ = tSysTimeFloat();
89
94
        if ( lagFast_ < lagSlow_ )
90
95
            lagFast_ = lagSlow_;
91
96
 
92
 
        // clam smooth lag with fast lag
 
97
        // clamp smooth lag with fast lag
93
98
        if (  smoothLag_ > lagFast_ )
94
99
            smoothLag_ = lagFast_;
95
100
 
130
135
// maximal seconds of lag credit
131
136
static REAL se_lagCredit = .5f;
132
137
 
133
 
// maximal seconds of lag credit given in a single event
134
 
static REAL se_lagCreditSingle = .1f;
135
 
 
136
138
// sweet spot, the fill ratio of lag credit the server tries to keep the client at
137
139
static REAL se_lagCreditSweetSpot = .5f;
138
140