- updated world synch debug calls to only log outside of faction pre-calculated pathfinding
This commit is contained in:
parent
6384c4c611
commit
cd952fcda0
|
@ -101,7 +101,7 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
|
||||||
clearUnitPrecache(unit);
|
clearUnitPrecache(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[findPath] unit->getPos() [%s] finalPos [%s]",
|
sprintf(szBuf,"[findPath] unit->getPos() [%s] finalPos [%s]",
|
||||||
unit->getPos().getString().c_str(),finalPos.getString().c_str());
|
unit->getPos().getString().c_str(),finalPos.getString().c_str());
|
||||||
|
@ -174,7 +174,7 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
|
||||||
if( ts == tsBlocked && unit->getInBailOutAttempt() == false &&
|
if( ts == tsBlocked && unit->getInBailOutAttempt() == false &&
|
||||||
path->isStuck() == true) {
|
path->isStuck() == true) {
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[attempting to BAIL OUT] finalPos [%s] ts [%d]",
|
sprintf(szBuf,"[attempting to BAIL OUT] finalPos [%s] ts [%d]",
|
||||||
finalPos.getString().c_str(),ts);
|
finalPos.getString().c_str(),ts);
|
||||||
|
@ -197,7 +197,7 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
|
||||||
const Vec2i newFinalPos = finalPos + Vec2i(bailoutX,bailoutY);
|
const Vec2i newFinalPos = finalPos + Vec2i(bailoutX,bailoutY);
|
||||||
bool canUnitMove = map->canMove(unit, unit->getPos(), newFinalPos);
|
bool canUnitMove = map->canMove(unit, unit->getPos(), newFinalPos);
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[attempting to BAIL OUT] finalPos [%s] newFinalPos [%s] ts [%d] canUnitMove [%d]",
|
sprintf(szBuf,"[attempting to BAIL OUT] finalPos [%s] newFinalPos [%s] ts [%d] canUnitMove [%d]",
|
||||||
finalPos.getString().c_str(),newFinalPos.getString().c_str(),ts,canUnitMove);
|
finalPos.getString().c_str(),newFinalPos.getString().c_str(),ts,canUnitMove);
|
||||||
|
@ -216,7 +216,7 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
|
||||||
const Vec2i newFinalPos = finalPos + Vec2i(bailoutX,bailoutY);
|
const Vec2i newFinalPos = finalPos + Vec2i(bailoutX,bailoutY);
|
||||||
bool canUnitMove = map->canMove(unit, unit->getPos(), newFinalPos);
|
bool canUnitMove = map->canMove(unit, unit->getPos(), newFinalPos);
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[attempting to BAIL OUT] finalPos [%s] newFinalPos [%s] ts [%d] canUnitMove [%d]",
|
sprintf(szBuf,"[attempting to BAIL OUT] finalPos [%s] newFinalPos [%s] ts [%d] canUnitMove [%d]",
|
||||||
finalPos.getString().c_str(),newFinalPos.getString().c_str(),ts,canUnitMove);
|
finalPos.getString().c_str(),newFinalPos.getString().c_str(),ts,canUnitMove);
|
||||||
|
@ -459,7 +459,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled == true && chrono.getMillis() > 4) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled == true && chrono.getMillis() > 4) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[Setting new path for unit] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]",
|
sprintf(szBuf,"[Setting new path for unit] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]",
|
||||||
factions[unit->getFactionIndex()].openNodesList.size(),factions[unit->getFactionIndex()].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
|
factions[unit->getFactionIndex()].openNodesList.size(),factions[unit->getFactionIndex()].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
|
||||||
|
@ -513,7 +513,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled == true && chrono.getMillis() > 4) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled == true && chrono.getMillis() > 4) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[Setting new path for unit] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]",
|
sprintf(szBuf,"[Setting new path for unit] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]",
|
||||||
factions[unit->getFactionIndex()].openNodesList.size(),factions[unit->getFactionIndex()].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
|
factions[unit->getFactionIndex()].openNodesList.size(),factions[unit->getFactionIndex()].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
|
||||||
|
@ -748,7 +748,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout
|
||||||
path->incBlockCount();
|
path->incBlockCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[path for unit BLOCKED] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]",
|
sprintf(szBuf,"[path for unit BLOCKED] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]",
|
||||||
factions[unit->getFactionIndex()].openNodesList.size(),factions[unit->getFactionIndex()].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
|
factions[unit->getFactionIndex()].openNodesList.size(),factions[unit->getFactionIndex()].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
|
||||||
|
@ -803,7 +803,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled == true && chrono.getMillis() > 4) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled == true && chrono.getMillis() > 4) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[Setting new path for unit] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]",
|
sprintf(szBuf,"[Setting new path for unit] openNodesList.size() [%lu] openPosList.size() [%lu] finalPos [%s] targetPos [%s] inBailout [%d] ts [%d]",
|
||||||
factions[unit->getFactionIndex()].openNodesList.size(),factions[unit->getFactionIndex()].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
|
factions[unit->getFactionIndex()].openNodesList.size(),factions[unit->getFactionIndex()].openPosList.size(),finalPos.getString().c_str(),targetPos.getString().c_str(),inBailout,ts);
|
||||||
|
|
|
@ -363,7 +363,7 @@ void UnitUpdater::updateMove(Unit *unit, int frameIndex) {
|
||||||
|
|
||||||
Vec2i pos= command->getUnit()!=NULL? command->getUnit()->getCenteredPos(): command->getPos();
|
Vec2i pos= command->getUnit()!=NULL? command->getUnit()->getCenteredPos(): command->getPos();
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[updateMove] pos [%s] unit [%d - %s] cmd [%s]",pos.getString().c_str(),unit->getId(),unit->getFullName().c_str(),command->toString().c_str());
|
sprintf(szBuf,"[updateMove] pos [%s] unit [%d - %s] cmd [%s]",pos.getString().c_str(),unit->getId(),unit->getFullName().c_str(),command->toString().c_str());
|
||||||
unit->logSynchData(__FILE__,__LINE__,szBuf);
|
unit->logSynchData(__FILE__,__LINE__,szBuf);
|
||||||
|
@ -452,7 +452,7 @@ void UnitUpdater::updateAttack(Unit *unit, int frameIndex) {
|
||||||
pos= command->getPos();
|
pos= command->getPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[updateAttack] pos [%s] unit->getPos() [%s]",
|
sprintf(szBuf,"[updateAttack] pos [%s] unit->getPos() [%s]",
|
||||||
pos.getString().c_str(),unit->getPos().getString().c_str());
|
pos.getString().c_str(),unit->getPos().getString().c_str());
|
||||||
|
@ -625,7 +625,7 @@ void UnitUpdater::updateBuild(Unit *unit, int frameIndex) {
|
||||||
Vec2i buildPos = map->findBestBuildApproach(unit, command->getPos(), ut);
|
Vec2i buildPos = map->findBestBuildApproach(unit, command->getPos(), ut);
|
||||||
//Vec2i buildPos = (command->getPos() + Vec2i(ut->getSize() / 2));
|
//Vec2i buildPos = (command->getPos() + Vec2i(ut->getSize() / 2));
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[updateBuild] unit->getPos() [%s] command->getPos() [%s] buildPos [%s]",
|
sprintf(szBuf,"[updateBuild] unit->getPos() [%s] command->getPos() [%s] buildPos [%s]",
|
||||||
unit->getPos().getString().c_str(),command->getPos().getString().c_str(),buildPos.getString().c_str());
|
unit->getPos().getString().c_str(),command->getPos().getString().c_str(),buildPos.getString().c_str());
|
||||||
|
@ -911,7 +911,7 @@ void UnitUpdater::updateHarvest(Unit *unit, int frameIndex) {
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[updateHarvest] unit->getPos() [%s] command->getPos() [%s]",
|
sprintf(szBuf,"[updateHarvest] unit->getPos() [%s] command->getPos() [%s]",
|
||||||
unit->getPos().getString().c_str(),command->getPos().getString().c_str());
|
unit->getPos().getString().c_str(),command->getPos().getString().c_str());
|
||||||
|
@ -1000,7 +1000,7 @@ void UnitUpdater::updateHarvest(Unit *unit, int frameIndex) {
|
||||||
if(targetPos.x >= 0) {
|
if(targetPos.x >= 0) {
|
||||||
//if not continue walking
|
//if not continue walking
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[updateHarvest #2] unit->getPos() [%s] command->getPos() [%s] targetPos [%s]",
|
sprintf(szBuf,"[updateHarvest #2] unit->getPos() [%s] command->getPos() [%s] targetPos [%s]",
|
||||||
unit->getPos().getString().c_str(),command->getPos().getString().c_str(),targetPos.getString().c_str());
|
unit->getPos().getString().c_str(),command->getPos().getString().c_str(),targetPos.getString().c_str());
|
||||||
|
@ -1061,7 +1061,7 @@ void UnitUpdater::updateHarvest(Unit *unit, int frameIndex) {
|
||||||
//if loaded, return to store
|
//if loaded, return to store
|
||||||
Unit *store= world->nearestStore(unit->getPos(), unit->getFaction()->getIndex(), unit->getLoadType());
|
Unit *store= world->nearestStore(unit->getPos(), unit->getFaction()->getIndex(), unit->getLoadType());
|
||||||
if(store != NULL) {
|
if(store != NULL) {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[updateHarvest #3] unit->getPos() [%s] store->getCenteredPos() [%s]",
|
sprintf(szBuf,"[updateHarvest #3] unit->getPos() [%s] store->getCenteredPos() [%s]",
|
||||||
unit->getPos().getString().c_str(),store->getCenteredPos().getString().c_str());
|
unit->getPos().getString().c_str(),store->getCenteredPos().getString().c_str());
|
||||||
|
@ -1476,7 +1476,7 @@ void UnitUpdater::updateRepair(Unit *unit, int frameIndex) {
|
||||||
else {
|
else {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugUnitCommands).enabled) SystemFlags::OutputDebug(SystemFlags::debugUnitCommands,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugUnitCommands).enabled) SystemFlags::OutputDebug(SystemFlags::debugUnitCommands,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
|
||||||
char szBuf[4096]="";
|
char szBuf[4096]="";
|
||||||
sprintf(szBuf,"[updateRepair] unit->getPos() [%s] command->getPos()() [%s] repairPos [%s]",unit->getPos().getString().c_str(),command->getPos().getString().c_str(),repairPos.getString().c_str());
|
sprintf(szBuf,"[updateRepair] unit->getPos() [%s] command->getPos()() [%s] repairPos [%s]",unit->getPos().getString().c_str(),command->getPos().getString().c_str(),repairPos.getString().c_str());
|
||||||
unit->logSynchData(__FILE__,__LINE__,szBuf);
|
unit->logSynchData(__FILE__,__LINE__,szBuf);
|
||||||
|
|
Loading…
Reference in New Issue