Kael: Along the same lines as removing the block from letting a player promote to Blitz with units who have a base
of 1, the AI is currently only looking at base movement as well
CvUnitAI.cpp - int CvUnitAI::AI_promotionValue(PromotionTypes ePromotion)
Code:
if (GC.getPromotionInfo(ePromotion).isBlitz())
{
if ((AI_getUnitAIType() == UNITAI_RESERVE && baseMoves() > 1) ||
AI_getUnitAIType() == UNITAI_PARADROP)
{
iValue += 10;
}
else
{
//FfH: Modified by Kael 06/28/2008
// iValue += 2;
iValue += 3 * baseMoves();
//FfH: End Modify
}
}
In both cases where basemoves() is used, it should instead reference the unit's current Move score, plus any additional movement from the promotion which is offering Blitz (thus a promotion offering raw Blitz is not valued as much as a promotion offering Blitz AND +1
)
Interesting find:
In CvUnit.cpp - int CvUnit::getExtraSpellMove()
Code:
{
int iCount = 0;
for (int iI = 0; iI < GC.getNumPromotionInfos(); iI++)
{
if (isHasPromotion((PromotionTypes)iI))
{
if (GC.getPromotionInfo((PromotionTypes)iI).getPromotionSummonPerk() != NO_PROMOTION)
{
iCount += GC.getPromotionInfo((PromotionTypes)GC.getPromotionInfo((PromotionTypes)iI).getPromotionSummonPerk()).getMovesChange();
}
}
}
return iCount;
}
This function could easily be used to extend the range of any spell which has a Range value. At present it is only used in AI Logic to select which spell to cast, checking if a Summoned Unit would be capable or reaching a hostile target. But by adding "+ getExtraSpellMove()" to the range value of a spell, you would make it so that anything which grants a Summon Perk with a movement bonus will also provide a range extension of the same value. (in this case, Spell Extension I & II)
In CvUnit.cpp -
CvUnit::doTurn(), under the Abandon actions
Code:
GET_TEAM(getTeam()).changeUnitClassCount(((UnitClassTypes)(m_pUnitInfo->getUnitClassType())), -1);
GET_PLAYER(getOwnerINLINE()).changeUnitClassCount(((UnitClassTypes)(m_pUnitInfo->getUnitClassType())), -1);
GET_PLAYER(getOwnerINLINE()).changeExtraUnitCost(m_pUnitInfo->getExtraCost() * -1);
These 3 lines are already performed by
"kill(this);" 3 lines earlier. So it would actually give the player & Team a Negative count for the number of that unit they have created (since it is subtracting 2 for each Abandonment)
EDIT: Also, a reminder that you need to add some Weight values for the new fields you made in PromotionInfos sometime. The iAIWeight was a fantastic idea for testing and tweaking initially, but since you are doing AI work now it is time to upgrade to SDK weighting so that it can be based on the Unit's AI selection instead of an across-the-board weight value. iAIWeight will continue to be useful for Spell effects though since the Promotion Values are taken into account for spells which cause/remove promotions.
While setting your own values, a lot of work needs done on the Firaxis values. Enhancements to Visibility and Movement bonuses are only available to certain AI types, and though the Vision range is of negligible use to the AI, the Mobility is quite useful and might need to be broadened a little bit. There are doubtless many more cases where their weighting choices don't work for FfH, but those are the 2 I looked at most recently.
I've started setting weight values for a few fields myself. I'll mention all of this again if I ever complete adding values for your fields and they seem balanced, just in case you'd like to start with my values and tweak to your desires from there