- made staggered faction updates toggle flag
This commit is contained in:
parent
61a2340e14
commit
1daecc4145
|
@ -48,6 +48,7 @@ World::World(){
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
Config &config= Config::getInstance();
|
Config &config= Config::getInstance();
|
||||||
|
|
||||||
|
staggeredFactionUpdates = false;
|
||||||
ExploredCellsLookupItemCache.clear();
|
ExploredCellsLookupItemCache.clear();
|
||||||
ExploredCellsLookupItemCacheTimer.clear();
|
ExploredCellsLookupItemCacheTimer.clear();
|
||||||
ExploredCellsLookupItemCacheTimerCount = 0;
|
ExploredCellsLookupItemCacheTimerCount = 0;
|
||||||
|
@ -307,10 +308,13 @@ void World::update(){
|
||||||
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
|
||||||
//tick
|
//tick
|
||||||
if(frameCount % GameConstants::updateFps == 0) {
|
bool needToTick = (frameCount % GameConstants::updateFps == 0);
|
||||||
|
if(staggeredFactionUpdates == true) {
|
||||||
|
needToTick = (frameCount % (GameConstants::updateFps / GameConstants::maxPlayers) == 0);
|
||||||
|
}
|
||||||
|
if(needToTick == true) {
|
||||||
//if(frameCount % (GameConstants::updateFps / GameConstants::maxPlayers) == 0) {
|
//if(frameCount % (GameConstants::updateFps / GameConstants::maxPlayers) == 0) {
|
||||||
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
|
||||||
tick();
|
tick();
|
||||||
}
|
}
|
||||||
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
@ -345,11 +349,12 @@ int World::tickFactionIndex() {
|
||||||
|
|
||||||
void World::tick() {
|
void World::tick() {
|
||||||
int factionIdxToTick = -1;
|
int factionIdxToTick = -1;
|
||||||
//int factionIdxToTick = tickFactionIndex();
|
if(staggeredFactionUpdates == true) {
|
||||||
//if(factionIdxToTick < 0) {
|
int factionIdxToTick = tickFactionIndex();
|
||||||
// return;
|
if(factionIdxToTick < 0) {
|
||||||
//}
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
computeFow(factionIdxToTick);
|
computeFow(factionIdxToTick);
|
||||||
|
|
||||||
if(factionIdxToTick == -1 || factionIdxToTick == 0) {
|
if(factionIdxToTick == -1 || factionIdxToTick == 0) {
|
||||||
|
|
|
@ -120,6 +120,8 @@ private:
|
||||||
Chrono chronoPerfTimer;
|
Chrono chronoPerfTimer;
|
||||||
bool perfTimerEnabled;
|
bool perfTimerEnabled;
|
||||||
|
|
||||||
|
bool staggeredFactionUpdates;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
World();
|
World();
|
||||||
~World();
|
~World();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user