Skip to content

AI Cheats

ShadesOT edited this page Oct 13, 2018 · 9 revisions

About this page

This page collects knowledge about the ways the AI "cheats" to pose a challenge to human players and where the associated code and values can be found.

If you contribute to this page, please also leave your nickname at the end of the addition, so developers know who to talk to about a topic.

How the AI cheats

  • The AI players never incur boycotts by their kings in europe. (devolution)
  • If an AI player would incure a boycott, its cities would still be able to ignore the boycott. Currently hardcoded. Lookup CvCity::cache_storageLossTradeValues_usingRawData() . (Shades)
  • The percentage of what is sold to europe from the warehouse overflow, has for the AI a minimum value, that depends on the players handicap level (explorer, pioneer, conquistador, ...) and not on the buildings in the AI cities. Lookup CvCity::cache_storageLossTradeValues_usingRawData() . (Shades)
  • Wood and stone are redistributed among the AIs cities using magic (hardcoded cheat). See CvPlayer::redistributeWood() (Shades)

AI limitations

  • Pioneers can't build monasteries, railroads or terraform (drain marsh, plant forest etc). CvPlayer::canBuild(), moved to CivEffectInfos.xml in CivEffect branch

Preliminary list of handicap dependent cheats:

(based on the difficulty level of the human player, discount scales with difficulty level)

  • Higher limit on money received from excess\overflowing yields getOverflowYieldSellPercent
  • Sells yields that overflow (like the customs house) without having any special buildings
  • AI get more immigrants CvGame::doTurn
  • Increased rebel sentiment from bell production CvCity::doRebelSentiment()
  • Pays less for hurrying a build CvCity::hurryGold ()
  • Gets more gold for selling yield overflow CvCity::getOverflowYieldSellPercent (scales)
  • Pays less for tuition CvCity::getSpecialistTuition
  • More points if using the game option ADVANCED START CvPlayer::initFreeUnits
  • Free defensive unit(s) in ADVANCED_START CvPlayer::initFreeUnits generally all sorts of free stuff in advanced start
  • Production discount for buildings and units CvPlayer::getYieldProductionNeeded
  • Unknown -> CvPlayer::revolutionEuropeUnitThreshold
  • Less crosses needed for immigration CvPlayer::immigrationThreshold
  • Less food neeed for population growth CvPlayer::getGrowthThreshold
  • Pays less when purchasing units in every port CvPlayer::getEuropeUnitBuyPrice, CvPlayer::getAfricaUnitBuyPrice
  • CvPlayer::getPortRoyalUnitBuyPrice (not that you can buy anything there)
  • Needs less equipment for professions CvPlayer::getYieldEquipmentAmountUncached CvPlayer::doPrices
  • Lower maximum tax rate CvPlayer::doPrices
  • More rebel sentiment from bells CvCity::doRebelSentiment