Thunderbrd
C2C War Dog
We have a vision. 'nuff said. The bug squashing is the unfortunate necessity along the way.
We have a vision. 'nuff said. The bug squashing is the unfortunate necessity along the way.
Appearance of bugs is unfortunate necessity due to flaws and limits of man but crushing them is the work of true honor and pride to those who truly love their product.
bool CvSelectionGroup::isHasPathToAreaPlayerCity( PlayerTypes ePlayer, int iFlags )
{
PROFILE_FUNC();
CvCity* pLoopCity = NULL;
int iLoop;
CvReachablePlotSet plotSet(this, iFlags, MAX_INT, false);
for (pLoopCity = GET_PLAYER(ePlayer).firstCity(&iLoop); pLoopCity != NULL; pLoopCity = GET_PLAYER(ePlayer).nextCity(&iLoop))
{
if( pLoopCity->area() == area() && plotSet.find(pLoopCity->plot()) != plotSet.end() )
{
if ( (iFlags & MOVE_IGNORE_DANGER) != 0 || getHeadUnit()->canAttack() )
{
FAssert( generatePath(plot(), pLoopCity->plot(), iFlags, true) );
return true;
}
else if ( generatePath(plot(), pLoopCity->plot(), iFlags, true) )
{
return true;
}
else
{
FAssertMsg(false, "Pathing failed to apparently recahable city");
}
}
}
return false;
}
...
After some analysis, this shows
What's really interesting about this is just how much time this issue eats up so I'm thinking that the pathing check is where the biggest issue with this lies. And again, there's OOS errors, movement rule disagreements and numerous asserts coming from pathing in every game I evaluate. But it's just so very complicated there!
I'm not sure what the best way to go about trying to attack this problem would be to be honest. The calculation on if a unit is stranded will only take place once for every unit that requests this information in a round thanks to caching (and it's STILL costing a LOT) and that was the one thing I could've imagined implementing here. Koshling already beat me to it long ago.
I was thinking much the same. However, I wouldn't have a clue how to best go about programming such a thing. I suppose I could get really creative... lol. However, could something already be partially in place for this and part of the problem be that it could be thinking there should BE a way to get through but just can't find it? There's an assert here that words itself in such a way that suggests this is the case.The pathing engine is good when it finds a path but really slow when it doesn't. The best optimization would be to have a separate plot traversal here that checks if any player city is reachable instead of looping through the cities and asking for a path in each separate instance.
I would think ZoC would make this situation much worse (if that's not a part of this evaluation as it is - I'm not sure if Joe has it on or not.) Doubt city bombardment buildings would have much to do with it because it wouldn't 'deny' the ability to move through the plot.how even worse this issue becomes when using "Zone of Control" gameoption and how much influence city bombardment buildings have on this if any?
Quick question: Did we ever address the bit where the firepits that were generated in all cities by the Controlled Fire wonder were all needing rebuilt as soon as the Controlled Fire wonder obsoleted long before fire pits did?
<GlobalBuildingClassProductionModifiers>
<BuildingClassProductionModifier>
<BuildingClassType>BUILDINGCLASS_FIREPIT</BuildingClassType>
<iProductionModifier>100</iProductionModifier>
</BuildingClassProductionModifier>
</GlobalBuildingClassProductionModifiers>
I would prefer if you could not get the tech to obsolete it until you had built it. Unfortunately that tag is no longer working. It was in v33 or v34.