Upgrades

wioneo

King
Joined
Jun 11, 2006
Messages
752
I recently aquired a very useful technology which just so happens to allow me to build/upgrade berserkers and to run bueracracy, which I'm sure that I misspelled. Anyways, I seem to be having a problem with getting my swimming maces. I can't upgrade my veterans! That is a time honored tradition in my strategy. I know that units in enemy territory can't be upgraded, but I have a City Raider III axe city behind a newly captured, non revolting city's walls, and he can't upgrade. I definately have enough cash(I upgraded a defending shock axe to be sure), and the action is available in my older cities' defenders, but my City raiders are not elligible. This is extremely annoying, and will cause this war to last a bit longer... What exactly are the criteria necessary to upgrade a unit? I don't think that they can be in a friendly neighbour's territory, either. That is, however, a guess. Also, this seems to be the perfect time to get a vassal for the first time, but I naturally remove feudalim from my prorities now. Vassal States just might bring me back...
 
I've been having similar problems since I installed warlords. I have also had a problem with workers building improvements. Example, plains square in my cutural borders properly irrigated to via civil service, yet I cannot build a farm on the square.

Same problem with upgrades for units, in one of my own cities with the proper techs and enough cash available but I can't upgrade a particular unit. This doesn't seem to persist however, a couple of turns later I have been able to perform the desired task. No idea what gives but I have never experienced these troubles pre Warlords installation.
 
Let's see...to be eligible for upgrade:
  1. The unit must have at least one movement point left.
  2. The unit must be on a plot owned by a member of the unit's team.
  3. The player must have enough gold for the upgrade.
  4. The city that owns the tile in which the unit is located must be able to build the new unit type.
Point 4 requires a bit more explanation. For land and air units, it's simple - the closest city of someone on your team. For sea units, it's the closest COASTAL city of someone on your team.

So...is there any chance that this new, non-revolting city is cut off from copper/iron? If so, it can't build maces, and you can't upgrade to 'em while you're there.

Reference - Warlords SDK:
Spoiler :
Code:
// CvUnit.cpp:5133
bool CvUnit::canUpgrade(UnitTypes eUnit, bool bTestVisible) const
{
	CvCity* pCity;

	if (eUnit == NO_UNIT)
	{
		return false;
	}

	if (!canMove())
	{
		return false;
	}

	if (GC.getCivilizationInfo(GET_PLAYER(getOwnerINLINE()).getCivilizationType()).getCivilizationUnits(GC.getUnitInfo(eUnit).getUnitClassType()) != eUnit)
	{
		return false;
	}

	if (plot()->getTeam() != getTeam())
	{
		return false;
	}

	if (!upgradeAvailable(getUnitType(), ((UnitClassTypes)(GC.getUnitInfo(eUnit).getUnitClassType()))))
	{
		return false;
	}

	if (!bTestVisible)
	{
		if (GET_PLAYER(getOwnerINLINE()).getGold() < upgradePrice(eUnit))
		{
			return false;
		}
	}

	CLLNode<IDInfo>* pUnitNode = plot()->headUnitNode();
	while (pUnitNode != NULL)
	{
		CvUnit* pLoopUnit = ::getUnit(pUnitNode->m_data);
		pUnitNode = plot()->nextUnitNode(pUnitNode);

		if (pLoopUnit->getTransportUnit() == this)
		{
			if (GC.getUnitInfo(eUnit).getSpecialCargo() != NO_SPECIALUNIT)
			{
				if (GC.getUnitInfo(eUnit).getSpecialCargo() != pLoopUnit->getSpecialUnitType())
				{
					return false;
				}
			}

			if (GC.getUnitInfo(eUnit).getDomainCargo() != NO_DOMAIN)
			{
				if (GC.getUnitInfo(eUnit).getDomainCargo() != pLoopUnit->getDomainType())
				{
					return false;
				}
			}
		}
	}

	if (GC.getUnitInfo(eUnit).getCargoSpace() < getCargo())
	{
		return false;
	}

	pCity = GC.getMapINLINE().findCity(getX_INLINE(), getY_INLINE(), NO_PLAYER, getTeam(), true, (getDomainType() == DOMAIN_SEA));

	if (pCity != NULL)
	{
		if (pCity->canTrain(eUnit))
		{
			return true;
		}
	}

	return false;
}

// CvMap.cpp:664
CvCity* CvMap::findCity(int iX, int iY, PlayerTypes eOwner, TeamTypes eTeam, bool bSameArea, bool bCoastalOnly, TeamTypes eTeamAtWarWith, DirectionTypes eDirection, CvCity* pSkipCity)
{
	PROFILE_FUNC();

	CvCity* pLoopCity;
	CvCity* pBestCity;
	int iValue;
	int iBestValue;
	int iLoop;
	int iI;

	// XXX look for barbarian cities???

	iBestValue = MAX_INT;
	pBestCity = NULL;

	for (iI = 0; iI < MAX_PLAYERS; iI++)
	{
		if (GET_PLAYER((PlayerTypes)iI).isAlive())
		{
			if ((eOwner == NO_PLAYER) || (iI == eOwner))
			{
				if ((eTeam == NO_TEAM) || (GET_PLAYER((PlayerTypes)iI).getTeam() == eTeam))
				{
					for (pLoopCity = GET_PLAYER((PlayerTypes)iI).firstCity(&iLoop); pLoopCity != NULL; pLoopCity = GET_PLAYER((PlayerTypes)iI).nextCity(&iLoop))
					{
						if (!bSameArea || (pLoopCity->area() == plotINLINE(iX, iY)->area()) || (bCoastalOnly && (pLoopCity->waterArea() == plotINLINE(iX, iY)->area())))
						{
							if (!bCoastalOnly || pLoopCity->isCoastal(GC.getDefineINT("MIN_WATER_SIZE_FOR_OCEAN")))
							{
								if ((eTeamAtWarWith == NO_TEAM) || atWar(GET_PLAYER((PlayerTypes)iI).getTeam(), eTeamAtWarWith))
								{
									if ((eDirection == NO_DIRECTION) || (estimateDirection(dxWrap(pLoopCity->getX_INLINE() - iX), dyWrap(pLoopCity->getY_INLINE() - iY)) == eDirection))
									{
										if ((pSkipCity == NULL) || (pLoopCity != pSkipCity))
										{
											iValue = plotDistance(iX, iY, pLoopCity->getX_INLINE(), pLoopCity->getY_INLINE());

											if (iValue < iBestValue)
											{
												iBestValue = iValue;
												pBestCity = pLoopCity;
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}

	return pBestCity;
}
 
Zophos said:
Let's see...to be eligible for upgrade:
  1. The unit must have at least one movement point left.
  2. The unit must be on a plot owned by a member of the unit's team.
  3. The player must have enough gold for the upgrade.
  4. The city that owns the tile in which the unit is located must be able to build the new unit type.
Point 4 requires a bit more explanation. For land and air units, it's simple - the closest city of someone on your team. For sea units, it's the closest COASTAL city of someone on your team.

That explains it, there are two rivers that come within one tile of each other and then turn away to either end of the continent. I was just building a road between them. However, I too have noticed the tile improvement thing. I sometimes can't build farms and water mills were I should. Even after civil service and with no mill on the other side of the river. Thank you, though.
 
Can you post a save file? I've never seen the farm/watermill problem, so I'd be curious to investigate.
 
Zophos said:
Can you post a save file? I've never seen the farm/watermill problem, so I'd be curious to investigate.

sorry zophos, I don't have a save file for you. Those little things happen, and I move on. However, if it happens again, I will save the game and drop you a line. I appreciate the interest.

Regarding the upgrade, I am probably guilty of criteria #4 as well but I don't think that was the case. Either way, not important, the thread creator got his answer.
 
I sadly don't have a save either. I usually just ignore it, but those little things are interfering with my builder practice.
 
about farms :
irrigation doesn't spread to tundra.
So a tundra tile next to a river can be farmed. The plain tile next to the farmed tundra tile can be farmed. But the tundra tile without direct access to fresh water can't be farmed even if it's next a irrigated tile.

about watermills, it's a bit more complicated. Only tiles next to straight river can be milled, and only one side of the river can be milled.
SO on a U shaped river you can mill either the central tile of the U, or both external tiles. That's all, the tight part of the U may be milled to, but not the tiles with just a corner access to the river.

That's empiric knowledge. About farms, i'm positive. About watermills, i'm not 100% sure.

About unit upgrades, what zophos said. Obviously, your newly captured city doesn't have access to iron.
 
cabert said:
about farms :
irrigation doesn't spread to tundra.
So a tundra tile next to a river can be farmed. The plain tile next to the farmed tundra tile can be farmed. But the tundra tile without direct access to fresh water can't be farmed even if it's next a irrigated tile.

about watermills, it's a bit more complicated. Only tiles next to straight river can be milled, and only one side of the river can be milled.
SO on a U shaded river you can mill either the central tile of the U, or both external tiles. That's all, the tight part of the U may be milled to, but not the tiles with just a corner access to the river.

That's empiric knowledge. About farms, i'm positive. About watermills, i'm not 100% sure.

About unit upgrades, what zophos said. Obviously, your newly captured city doesn't have access to iron.


I think you are right about the watermills. It ties up with what I have expereinced
 
cabert said:
about watermills, it's a bit more complicated. Only tiles next to straight river can be milled, and only one side of the river can be milled.
SO on a U shaped river you can mill either the central tile of the U, or both external tiles. That's all, the tight part of the U may be milled to, but not the tiles with just a corner access to the river.

The tile which I am talking about wasn't on the bend, there were no designated reasons or it not to be milled at all. The reason that this annoys me so much is that that cottage stood out horribly amongst the water mills. It really didn't make much difference...
 
wioneo said:
The tile which I am talking about wasn't on the bend, there were no designated reasons or it not to be milled at all. The reason that this annoys me so much is that that cottage stood out horribly amongst the water mills. It really didn't make much difference...

maybe you had a watermill on the other side of the river?
could you post a screenshot?
 
Ha ha! it happened again!
Civ4ScreenShot0001.JPG

As you can see, I can build water mills, that tile is empty, there are no mills on either side, and it is on the side of the bend, unlike the piggies on the corner. Did I miss anything?

EDIT: There are two options which are not visible in that screen shot. They were "Build a Trade Network" and "Improve Current City," I believe.
 
Actually there IS a mill on the other side of the river. It's "above" the worker.

Wodan
 
There is a mill on the NORTH side of the bend, but there is no mill on the west side. this river looks to be a bit diagonal, but I still got a malus across it. What about that jungle? I could still build a watermill there...
 
you can't build a mill because there is one to the north!
this is why i used the U shape example!
you're typically on a bend, on a tile you won't be able to watermill. You could try to watermill on the NE, but i bet you can't.
 
cabert said:
you can't build a mill because there is one to the north!
this is why i used the U shape example!
you're typically on a bend, on a tile you won't be able to watermill. You could try to watermill on the NE, but i bet you can't.

What about the jungle and plains adjacent to each other? I can build a mill on both of those. Anyways, aren't the piggies on the bend? I couldn't have built a mill their. I wouldn't have, but I couldn't.
 
Back
Top Bottom