Tweak Mod for Xtended + Master of Mana Updates

SpyFanatic

Warlord
Joined
May 1, 2013
Messages
159
Scope of this mod: merge of Tweak Mod for Xtended and Master of mana updates, plus focus on fixing OOS and Bugs that prevent playing.

v0.5 released: https://sourceforge.net/projects/masterofmanatweaks/files/Master of Mana 0.5.zip/download
v0.4 released: https://sourceforge.net/projects/masterofmanatweaks/files/Master of Mana 0.4.zip/download
v0.3 released: https://sourceforge.net/projects/masterofmanatweaks/files/Master of Mana 0.3.zip/download
v0.2 released: https://sourceforge.net/projects/masterofmanatweaks/files/Master of Mana 0.2.zip/download
v0.1 released: https://sourceforge.net/projects/masterofmanatweaks/files/Master of Mana 0.1.zip/download

ChangeLog v0.5:
Spoiler :

  • Added super forts from https://forums.civfanatics.com/threads/super-forts.444512/ and added ability to garrison units in forts and to have boats pass through them. Culture for forts is not enabled for Barbarian. Additionally, if super forts option is not enabled, boat cannot anymore pass through Austrin Fortified Outpost. NB: unit garrison in forts will be immune to fear.
  • Added from lfgr mnai-u 2.9-beta3u to cycle through unit in stack with ctrl-space and ctrl-shift-space
  • Added display of plot wilderness values and wilderness required for resource spawning (can be turned setting SHOW_WILDERNESS_INFO to 0 in GlobalDefinesAlt)
  • Displaying number of currently available free promotion available, if any, to a unit (in the popup description, just below level).
  • Civilopedia Leader showing also Hated Civic (which leader cannot adopt)
  • In City view, arrange better the size of the columns to adapt correctly in case of smaller screen (scrollbar where not selectable due to wrong width)
  • MoM_Hub: Reverted back usage of map own findStartingPlot (only in case 'def isPlaneMapscript' return false. At the moment, restored for MoM_Hub to allow all civs to start in its own hub
  • MoM_Maze: fixed python error due to unimplemented methods
  • MoM_MountainCoast corrected typo that lead to python exception
  • MoM_Oasis removed unimplemented method
  • MoM_Wheel removed wrong method
  • MoM_Highland tuned AI_foundValue to reduce the value of a plot if not nearby seas to avoid infinite loop as all plot are value 0 for lanun
  • perfectworld2 added try/catch for error on bonusList as assignStartingPlots is called from dll before addBonuses in CvMapGenerator and thus self.bonusList is not yet populated
  • CvPlayer setCurrentMagicRitual manage specific case of Miracle casted while having an ongoing Mana Ritual to avoid the latter being removed
  • CvMagicScreen removed 'CHANGES ENHANCED INTERFACE MOD' section (probably a merge error?) which was causing python exception when right click in magic screen... and it does not seems to be used at all
  • Fixed event of Immigrants to dont show option to get settler in case of one city challange
  • Spawning of new Civ now process correctly transferred bonuses (for example: +2 to units) - Fix issue with Mercurian/Infernal/Frozen spawning
  • Tuned to not wakeup while healing if danger is only a wildmana guardian
  • Fixed Visionary spell to only be available when Improvement takes more than 1 turn to upgrade, and added check that its available for your civilization (e.g. enclave when not Kurio)
  • Show dispel percentage percentage for disjunction rituals
  • Added information on Waning ritual
  • Grigori: selection of initial guild is postponed until found of new city
  • Tuned choices in doGovernorAssassination for Governor has been assassinated event, to be more incisive based on Civics
  • Corrected Fear effects for Aura (Demonic Reflexes, Glyph of Power and Ward of Terror) to be applied to defending unit (and not attacking one) and increase percentage for those effects
  • Tuned AI_getPlotDanger to ignore Wildmana guardian (worker stopping to build improvement next to them, even if no real danger is there)
  • Added golshan_fire.nif needed by ATTACHABLE_GOLSHAN_FIRE causing Dovoveo units to be a big red circle on screen
  • Tuned EVENT_CLAIRONE_1 to pick up only AI as other player and implemented the +1 unhappiness which was not given by the event. Additionally, -3 relation
  • Corrected text for event TXT_KEY_EVENT_STORMY_SEAS
  • Event Flare Fire Mana Node changes to dont create smoke on the fire mana node plot, as it seems it cannot be extinguished by quench flame (doFlareFireNode)
  • Arcane Lacuna: now global enchantment/summon/miracle/terraforming are blocked as well (this time for real)
  • Caravan Center / Caravansary to have a chance to spawn Herbs as well (Kuriotates / Malakim latest improvement level)
  • Allowed build of Altar of Luonnotar (final) even if victory is not enabled (otherwise why all the bonuses???)
  • Corrected getReducedManaCostInGoldenAge management (balseparh discount in golden age is always applied)
  • Correct showing which equipment will be removed when buying a new one in CvGameTextMgr::parseEquipmentHelp.
  • Alms House not anymore giving +1H for Faith as there is no way to increase it
  • Wizard Tower not anymore allowing Mana increase, as it is not implemented as possibility
  • Shipyard and Heron Throne now requiring (as intended) at least 10 plot costal lake/sea
  • Corrected cleanup of Hostile GE once civ is destroyed (e.g. Abomnable Growth)
  • Guilds of Figher/Archer/Naval/Knight now require correspondent building in the city (so stable for knightly, shipyard for naval)
  • Elhoim World spell not pushing out of border barbarian stationed in lairs (but they still cannot move out of lair)
  • Demons Altar: clarified that unit must be at least level 2 and be in the city
  • Fixed Water bonus in capital increasing spawn percentage in all empire, due to CvCity::processBonus managing the iDiscoverRandModifier (probably done for Earth Mana)
  • Set Undercouncil as Barbarian Leader HatedCivic else it can contribute to voting and election
  • Elegy of the Sheaim corrected Python ElegySheaim to increase of 10 (not 15) and double the cost to 600 Mana. Increased Hallowing of the Elhoim to cost 1500 Faith
  • Corrected percentage bonus done from Resources on Commerce (Culture, Faith, Research and Gold) when city is on the resource (as it is for Yield)
  • Zarcaz placement at start of game is now limited to be at least 4 plot from any unit
  • Global Define CLIMATE_MAP_ALLOW_FOUND_NO_FOOD (Default to 1) if set to 1 disable the requirement of at least 1 food for climate maps
  • AI promotion selection now include to evaluate also generic defense bonus and not only city bonus (thus fixing unit in garrison with offensive discipline)
  • AI while choosing eqipment now can evaluate a replacement if the new one has at least 'double value' of the current one.
  • Created Global Define AI_DISCOUNT_GLOBAL_YIELD to put in xml the default (500) discount on global yield done on AI. Set it to 0 to see impact for equipment acquisition for the AI
  • Mana Shrine, Witch Hut, Lost Temple and Ancient Tower can now be removed (settle city, create other improvement) by a Human player. AI still cannot.
  • Tuned AI selection on GE, Terraforming and summon by adding an AI weight on some of them:
    • Terraforming: Added AiWight and reduced its value to block AI from casting (continuously): Mystical Forest, Enchanted Forest, Mother Earth
    • Summon: allow summon only if are Tier 3 or 4 or are greater Tier then other available unit
    • Global Enchantement: Create xxx now get evaluated based on which of the global yield is less, else AI always cast create Stone. Stop to cast them once 1k are present
  • AI always removing Hidden Nationality from Unit, as it seems to not be using them (and by the way, would you really dont know who is ravaging you???)
  • Turn on Ephasize production in city automation (CvCityAI::AI_doEmphasize) when AI as only 1 city and prioritize creation of unit to escort settler until AI has at least 3 cities, to help AI struggling with low production due to research prioritization in the early phase.
  • Improvement on AIGroup Settle:
    • Removed limit of max 1 existing settler and changed CvCityAI.AI_chooseSettlerUnit to avoid create a settler if: 1) a settler has been already produced in the same turn (and so its not yet part of an AIGroup) or 2) there is already an AIGroup AISETTLE with not enough unit and thus a defensive unit is checked instead, and if not possible then settler is not build anyway. The original limit of max(2,1 + citycount/5) still apply.
    • Lowered gold requirement in CvPlayerAI.isLackMoneyForExpansion for first 3 cities, to allow AI to build a minimum of 3 cities asap and then wait for economy to stabilize a bit for the fourth. But at te same time in CvUnitAI.AI_getSettlerPatrolUnitsNeeded increase the number of the settler escort to 7 (instead of 3) if there are less then 4 cities (i.e. more wilderness, lairs, better to go more protected) and in CvAIGroup::isUnitAllowed allows 'filler' units. Additionally, if attack odds are ok, it can attack a nearby lair during his journey to found a new ciy, if it happens to stop nearby. In this way AI should found fast the first 3 cities without beeing too much threatened by lairs.
    • Precedence on filling up settler groups over invasion / destroy lair group until 3 cities founded (unless at war)
    • Reserve unit fill up Settler group choosing the one who need less unit first (2 settlers cause ai to fill the stack spreading unit evenly thus requiring more time)
    • AIGroup settler will now check for a nearby cityspot first. In MoM_Hub sometime a spot in the nearby hub, but cant get there
    • Group will now check for a suitable spot using the same algo using for movement (generatePath with safe flag) to avoid picking a good spot but then not move the stack as it pass across not visible terrain
  • Improvement on AIGroup for City Invasion:
    • With Aggressive AI option now AI will select a nearby weak player (city distance using plot distance) as a target for war, regardless of diplomacy and start to consider this civ as target for war. AI should be opportunistic and conquer its neighbour first to grow up
    • AI Group for Invasion will now get Target City using step distance, not line of air distance. MoM_Hub is a good example when air distance can fail in choosing the right target.
    • AI Invasion Group will pick the nearest higher defense plot, not only considering defensive bonus to avoid to circumnavigate the city (and be destroyed) just to have slightly higher terrain defense
    • AI Invasion Group tuned promotion selection by adding AIunittype and stack type so to select different categories (CIV4AIPromotionSpecializationInfos.xml)
    • AIGroup dedicated to city invasion of a player - but not yet strong enough - can now target barb city which are easier to conquer (note: not lairs)
  • Improvement on AIGroup for Destroy Lair:
    • AIGroup destroy Lair reserve group can be filled progressively, not only if there are enough units with enough power for the lair. As unit initially are created one at the time this means that AI is not capable of having a stack strong enough for lair, as unit are allocated then to other task.
  • Tuned Priviledge Class civic selection, organizing in 3 levels (initial - first two civic, mid game - when Code of Laws is reserched and late game - when one of the latest 3 are available). On initial, military state in case AI is at war and has issue with troops else stays in City Governor. Mid game means always Aristocracy to remove the research malus. Late game choose if Craftmen, Merchant or Magocracy are suitable, else stays in Aristocracy. Magocracy is selected if leader has trait Arcane, Channeler, Summoner or Loremaster. Craftman and Merchant are still tbd
  • In AI_techValueScience the check that prioritize Code of Laws to have Aristocracy is modified to consider if its the civ hated civic (so few leader will not pick up)

ChangeLog v0.4:
Spoiler :

  • Reduced BonusPane length in City screen so that Yeoman can be adjusted
  • Show level of a unit (when you place mouse over the icon, not on the unit on the map)
  • Show Tier of a unit in civilopedia (inside description and as a popup)
  • Capturing Barbarian City acquired gold now caps to 1000
  • Fixed some assert in the new AI_bonus code added in 0.3
  • Fixed AI_doEnemyUnitData to avoid random memory address to be overwritten
  • Gibbon Goetia spellBodySnatch fixed adding a newUnit.setHasCasted(True) to avoid AI going in infinite loop
  • setGoodHealthHelp fix as it can sometimes shows a fake Healthy Yeaaah
  • Fixed Assert iCount >= getAtWarCount(bIgnoreMinors) who is significant only if getAnyWarPlanCount is for NO_TEAM
  • Commented out a Assert in CvPlayer doGold in favour of a logging in order to report when an AI player is going on strike due to negative gold reserve
  • CvCity updateCommerceFromUnits added a check for getCityCommerceChanges to not result in negative values (research and commerce for Balseraph Loki puppet unit)
  • update_Settle improved to have Settler retreat to city only if stack can move, else AI_retreatToCity will still anyhow not move them
  • isModifierPerBonus (i.e. Mana Resources) corrected to only apply for spell research and mutate change (and not to happy/health as was partially done)
  • On disband unit commented out changeUnitClassCount as it is already done in kill, so should not be done again
  • On CvPlayer:applyEvent corrected m_iTurn in case of additional event triggering (was not successfully moodified due to EventTriggeredData kTriggered = *pTriggeredData;)
  • Art file compressed to XtendedTweaks.fpk
  • CvGame addPlayerAdvanced added in addition to have Barbarian Teams declare war, also set AI_setWarPlan((TeamTypes)iNewTeam, WARPLAN_LIMITED) to keep aligned war plan and war count
  • Added ATTACHABLE_GOLSHAN_FIRE in CIV4AttachableInfos.xml (needed as attachable element in golshan.nif)
  • Block improvement to spawn on water tiles if there is a unique improvement (i.e. maelstrom)
  • Fixed missing 'regenerate map' due to AIAutoPlay setting some CvGame ScriptData
  • Double the trade value of gold per turn (in AI_goldTradeValuePercent) and adapted the logic to trade the correct amount of gold per each resource (in AI_doDiplo) to avoid the behavior of the AI cancelling the deal after few turns
  • Fix CTD in case of slave revolt when the slave is in empty city (canTriggerSlaveRevoltUnit)
  • Adjusted civilopedia traits for Jotnar (Giantkin) to show +2 food instead of just '2' (TXT_KEY_TRAIT_FOOD_PER_POPULATION_HELP changed %d to %D)
  • Adjusted Jotnar description that cities can work 3rd plot and no city size restriction
  • In CvPlayerAI updateAIGroups do not create AIGroups of type CounterUnit if you see barbarian roaming your land, it is better to create a stack to destroy the lair rather then filling up your military capacity with recon units
  • City Production AI_chooseCityLairUnit added check that unit is not isOnlyDefensive (grigori creating Yeoman to attack a lair)
  • AI_ValueUnitBaseCombat now consider +2 from tech and not only base strength, some AI are building religious units due to that instead of more powerful units
  • doImmortalRebirth fix remove auras from immortal units once they die, otherwise they remains there
  • CombatAura kill will check also for unit of a player which is notalive to manage killUnits (e.g. when all unit of a player got killed as last city got conquered)
  • Civilopedia Index corrected management of civic categories which were appearing as mistake under </font
  • CvPlayer RemoveGlobalEnchantment remove MEMORY_MAGIC_CHARM when Global Enchantment like Aura of Majesty are removed
  • Corrected Barbarian demands which disappeared due to wrong fix to avoid CTD when lairs are conquered in the same turn a demand is triggered (all lars except for dungeon, graveyard and burrow where removed from turn 0)
  • Fixed spawn of Orthus which was disabled due to AIAutoplay and fixed popup alert for the event which was not shown
  • Added dedicated gameoption to increase animal spawning to not include it in raging barbarian option
  • Added gameoption to increase the resource spawn between MoM Legacy and current one, it will:
    • Test for each possible resource and after choose a random one from them (instead of stopping search at first resource discovered)
    • Arid Climate,Humid Climate and Evergrow grants
    • Nearby similar resources grant +100% chance instead of +50%
    • Trade Post and Cottage percentage will stack, else only the higher one will be taken into consideration
  • iAdjacentFindResourceModify reduced for tradepost and cottage (value of 1 means +20% or + 33% based on original chance for bonus) in Assets/Modules/NormalModules/Xtended/XGuilds/XGUILDS_CIV4ImprovementInfos.xml and Assets/XML/Terrain/CIV4ImprovementInfos.xml
    • IMPROVEMENT_COTTAGE, IMPROVEMENT_FROZEN_COTTAGE, IMPROVEMENT_INFERNAL_COTTAGE 1
    • IMPROVEMENT_HAMLET 2
    • IMPROVEMENT_VILLAGE 3
    • IMPROVEMENT_TOWN 4
    • IMPROVEMENT_ENCLAVE 5
    • IMPROVEMENT_TRADE1 1
    • IMPROVEMENT_TRADE2 2
    • IMPROVEMENT_TRADE3 3
    • IMPROVEMENT_CARAVAN_CENTER, IMPROVEMENT_CARAVANSARY 4
  • Added PlatyBuilder with the addition of beein able to toogle victory conditions
  • Climate maps: corrected check canFound on civic traits ignore food for civs which does not have a civic trait
  • CvCity setPlotRadius account for changeCityRadiusCount and changePlayerCityRadiusCount on Kuriotates
  • removed reference to IMPROVEMENT_AIFON_ISLE in spellSanctifyUF
  • AI_retreatToCity removing bReuse in path finding algorithm in case unit can move (some case in which this caching was giving some bad result)
  • Fixed doImmortalRebirth in case unit is killed while razing capital city it is now placed in the future capital (if there will be)
  • Added Python binding for CyCity.getReligionCount
  • Disabled assert on changeNumOutsideUnits as mechanic for calculateUnitSupply has been disabled
  • Corrected text for Elohim, Bannor, Amurites Epic destiny
  • Fixed random effects from Vyrkul and Grimoire as they were reference some old effects not anymore existing
  • Miracle that win the game are not enabled if the victory is disabled (additional check in canDoGlobalEnchantment)
  • Fixed Random promotion for Scions Emperor's Dagger
  • Fixed assert error when mercurian spawn in a city with a building that change global health (1. mercurian spawn in city, 2. building destroyed thus global counter reduced to -1, 3. new city is created but counter is already at -1 so mercurian does not get +1 health but 0)
  • Fixed "Additional production" for building with negative
  • Documented spawning resources in civilopedia, and what happen if option is selected.
  • On Unit description added usage of ctrl, shift and alt to display combat auras and blessing/curse else the list is so long that not everything can be displayed
  • canDoSummon now limit summon unit if there is not anymore free unit support
  • Adventure Step complete will trigger a golden age only if Epic Destiny victory is enabled
  • Changed for Climate maps Balseraphs terrain from pasture to plains as their favs improvement is cottage
  • Changed for Climate maps Khazad terrain from pasture to Sordid Field as their favs Mushroom garden
  • Elohim Epic Destiny Purity Counter replaced with 4 Abbey
  • Fix python error that sometime arise when launching spell
  • The water increase spawn chance for a nearby bonus is added only if the nearby plot has an improvement (and Gameoptions for Resource Spawning is enabled) resources will not spawn at all in water(
  • Corrected typo in calculateCityBonusCommerceRateModifier to allow bonus for getFreeBonus2 and getFreeBonus3
  • Added a PyCanDo tag for ProjectInfo to have a python evaluate check if Global Enchantment / Miracle can be casted
  • Added Python requirements for 3 Illians Miracle (The White Hand, The Deepening, Stir from Slumber) to avoid to pay faith but the Miracle is not triggered
  • Fixed bug in Ascension Final Illians Ritual
  • Changed RuneKeeper Bounty of Kilmore to spawn mineral resources in caster plot, rather then a random one
  • update_City_Invasion_doesEnemyOutNumberUs should count defensive unit and bonus as well. The fact that we want to train the Hero doesn't mean we should declare war and reach the city with 0% attack chance...

ChangeLog v0.3:
Spoiler :

  • AIAutoPlay now can select which player to give control to AI (default ALL): in this way it is possible to have a real multiplayer game to catch OOS while the 2nd human player is controlled by AI.
  • OOSLogger write log correctly to UTF-8 and once each turn in case of OOS (previously it was limited at once per game, you had to restart civ to enable it back).
  • Advanced Start additional plot visibility (from Master of Mana updates) has been corrected as it resulted in OOS.
  • Added Epic Destiny Civilopedia entries.
  • Civics in Civilopedia are now sorted per category.
  • Displaying Tier, Religion and Civilization in Unit categories entry in Civilopedia.
  • Shrine of the Champion and Statue of Glory, which grants new unit a free promotion, requires unit of level 4: adjusted civilopedia entry to clearly state this requirement.
  • Enabled Bug PLE (not sure if it was disabled by mistake or on purpose but a warning was displayed... I did not noticed anything changed...)
  • Fixed Random By Alignment leader selection - was still resulting in empty AI player slot, maybe can be due to a wrong merge by my side.
  • Corrected Kuriotates Civilopedia District entry removing the free wonder in capital which will not be granted.
  • Modified religion weight for all leader to allow Human leader to pick any religion (-100 means human leader cannot convert to that religion) - in case religion weight -100 will be set later on for a leader the civilopedia page will displayed that the religion can not be adopted and it will be removed from the religion chooser popup.
  • Fixed TASK_CITY_DUNGEON_EVENT and CvDLLButtonPopup::launchDungeonEventPopup: added check that Dungeon is still existing at this time, to avoid CTD if someone else destroy it while player choose an event (I guess event is checked at early turn begin but then an AI can still be executing its turn before player does, so popup is displayed but dungeon has been destroyed in the meantime).
  • Fixed CvDungeon doTurn to clean up dungeon not anymore existing (for example in case Barbarian city has been conquered) to avoid barbarian civ to trigger requests even if the city is now under another civ control (and resulting in CTD).
  • Added caching of GC.getDefineINT("DEFAULT_SPECIALIST") in an attempt to optimize performance (don't think it lead to any significant change).
  • Replaced www.masterofmana.com with www.civfanatics.com in the loading tips.
  • Changed gold acquired by conquering a barbarian city from fixed 1000 to (current turn - turn city was founded) * 20
  • Arcane Lacuna: now global enchantment/summon/miracle/terraforming are blocked as well.
  • Kazhad Mother Load now accounts also for deep mine on top of regular mines.
  • Correctly CAP gold to 50% and Culture at 30% (previously possible to trick and reach 50% culture) and correctly aligned in MainInterface gold percentage increase (empty row for spellresearch)
  • Gold/silver/copper/gems/amber now available only with Artisan Guild (as per ranger guild & deer/camp) - but still visible on map without it (as per Master of Mana updates) and still allowing the bonus of being near the city.
  • Now Imported/Exported Resources contribute to allow construction of building that consume them (nation epic, heroic epic). So if you own 1 marble and you trade with someone for a second marble, you can construct 2 heroic epic.
  • Fixed OOS due to m_iCultivationRate not initialized to 0 which result in different values among pc.
  • CvUnit updatePower modified algorithm (instead of power = Pow(power,1.4)/40 ; power = power*power/10000 using only int values). I am running civ in linux on top of old wine version 3.19 and this resulted in small different results than on windows, which were causing OOS. From a ideal point of view this should be corrected with a wine patch (tbc if not resolved in more recent releases) but as I do not have such skill, in this way issue was corrected without impacting on the updatePower logic.
  • In the tech value logic for the AI to choose what to research, added an increment if tech unlock a civic which does not give a malus in research (and currently all available civics options gives a malus in research). This helps in prioritizing for example Code of Laws which grant Aristocracy as the first civic without a research malus and could help AI to remove as soon as possible research malus.
  • AI_getGoldTreasury modified to get AI spare gold only for tech that can be traded and gold cost is adjusted by game speed research percent. Currently it was aiming for all tech which were not owned (even if they cannot be traded) and cost was always for normal speed.
  • Adapted city specialization for merchant as now there are bigger cities thus more need for gold.
  • Prioritizing in the build queues buildings that gives hammer and that gives gold (if no merchant district present yet). This could prioritize a construction yard at te beginning so that more hammer will be produced once city grows.
  • Fixed some issue and made some improvement on the Improvement system, so to optimize worker job and force AI Cities to grow more (more population = more tech research)
    • Corrected bug (= instead of ==) that as result prioritize AI to build improvement that gives production (CvImprovementSystem update_AI_valueYield)
    • Changed CvPlot canHaveImprovement to calculateNatureYield to not count features if will be removed (else you have each time to chop a jungle to understand if Farm can be built or not and AI does not see the +1 food)
    • Aligned ActualImprovementYield (which check the foreseen yield for a future improvement) with calculateImprovementYieldChange (which actually compute the changes). The usage of isIrrigated in the first method instead of isIrrigationAvailable causes irrigation for farm not to be computed and the AI to chose a lot of groundwater well over farms.
    • Fixed bug that consider improvement upgrades while evaluating yield gains and values, even if are not allowed by the civ (e.g. workshop & artisan workshop only for dural)
    • Added method to force construction of buildings which provide happiness/health to allow the city to grow
    • Modified code in ActualImprovementChanges for having actual changes considering the plot only (i.e. to not reduce yield for the other plot which will not be worked anymore as this evaluation is for when the city will have enough pop to use it). So now AI and also Actual Changes popup will not consider the fact that you are removing a citizen from another plot to work the tile.
    • Also value reported in UI are display in this way (when you mouse on the build mine for example)
  • BETA: Changed AI Civic values, to have to AI stay away as much as possible from military states/city governors and profits which give a strong malus in research or gold/production. This should (and I hope will) be tuned in future release as there could be situation in which can be used.
  • BETA: Temporary limit the number of existing/under construction settlers to 1. There could be situation in which more than 1 can be useful but for the time being AI is always trying to have 2 settlers to spare, which is too much
  • BETA: Changed how AI trade bonus with human players/other AI, by allowing to give or to receive gold per turn for a resource (100 values = +1 gold per turn, and gold is offered only if no other bonus is available to trade) and by modifying how perceive bonus resources values in trading:
    • Removed the max(300,value) and the += Random(1-10000) as this lead to AI trading random resources regardless of their perceived value
    • Value is now evaluated considering (check AI_Bonus.cpp):
      • Happiness
      • Health
      • Yield & Commerce
      • If it allows to build a building faster: 250 value for a national wonder, 500 for a world wonder
      • If it allows to build a building which is limited by the number of resources: 100 for a new building that can be build (given all other prereq are met)
      • If it gives an affinity bonus to units: 100 for each +5 among all units (minimum 100)
      • If it allows some equipment to be crafted: 50 for each equipment that is allowed and can be equipped to at least one unit (given all other prereq are met)
      • If it allows to build a building: for each allowed building, 50 for each city in which the new building can be built (given all other prereq are met)
      • If it allows to train units: for each allowed unit that can be trained (given all other prereq are met) 100 for each Tier (minimum 100)

ChangeLog v0.2:
Spoiler :

  • Fixed Gaping Wound to be correctly removed once healed
  • Fixed Summoning Circle as summons were still spawning in capital
  • Fixed Nexus teleport ability which was resulting in CTD
  • Added a Randomization when choosing among the first 4 forced early tech (military strategy,education, barter, exploration) to vary a little bit
  • Reduced bonus +20% spawn rate by Merchant District which was bugged: instead of 1.2 * merch district, now is correctly changed in 1 + (0,2 + merch district)). The 20% spawn increase was exponentially increasing the percentage from 2nd district on. Additionally, modifiers are now added after all multiplications, which should also slighly reduce the spawning rate.
  • Corrected behavior on first settler found city logic, previously was always founding on starting plot. If plot does not allow create city (e.g. lost temple) the AI simply stays there with the stack.
  • Added check in Map generator to not place Ancient Tower on Improvement (on Erebus, MoM_Erebus, MoM_Erebus_Climate)
  • Improved selection of tech to unlock tier3/tier4 units vs researching a +2 strength tech. A small randomness (1 - 10) is added to the selection. Additionally a +2 tech is considered (at this stage of tech selection) only if the bonus is appliable to at least half of the existing combat units. This should help Luchuirp and Aristrakh which does not use a lot of troops which are benefiting from +2.
  • Fixed Turn display for healing when in selection group there is a hurt unit that cannot heal as MAX_INT is displayed. If a unit cannot heal (for example poisoned and no healers in stack) it is not counted for the count of remaining turns which are, in fact, infinite.
  • Displaying Tier (from 1 to 4) of a Unit in Civilopedia.
  • Improved guild selection at tech: prioritize first guilds that gives additional units to the civilization (e.g: Luchuirp should always get Artisan Guild and Mage Circle first). Previously was a little bit random and result in some cases, for example, in Luchuirp never taking Artisan Guild. the value of a guild is computed as: (attack strength of all units unlocked * 100) + 1d100.
  • Improved Global Culture spending for acquiring guilds, by prioritizing the ones that cost less in term of culture and that unlock a new unit. If the cost is greater than the cost of the creative trait then prioritize creative. This means now AI will spare culture to acquire the needed tech instead of buying as soon as it has enough culture.
  • Set Tech prereq for UNIT_DWARVEN_SHADOW and UNIT_SHADOW to only TECH_PRECISION (and not TECH_PRECISION and TECH_ESUS_GUILD, which requires TECH_PRECISION anyhow....) this help in the algorithm for Guild selection
  • In CvUnit updatePower changed rounding of long double to int from m_iPower = (int)iPower; to m_iPower = (int)std::floor(iPower): I got some OOS in lan due to some units having different power value discrepancy of +/- 1 with no other clues of what can be the cause. And this is not reproducible by me locally only in lan. Maybe there is a different rounding implementation among linux/wine (as I run Civ4) and windows (other lan computers). Mainly was visible with Foxfire with the +1 fire affinity enchantment equipment. Not sure if it can fix an OOS but for sure it does no harm.
  • Added Wanderer dds icon (ugly but better then the pink square) - If someone is willing to modify it I will be happy to merge in the next release.
  • Prevent event triggering if city count < 1 to avoid event which require at least a city (once I paid money for a great prophet which I never get as it was supposed to spawn in capital).
  • In the existing logic that prioritize Settler production, added an additional check (on top of the max 2 existing Settler at once) to not create more then the foreseen visible plot to found a city. Currently we detect that the AI has always 2 settler in capital, even if there is no space at all to found (we play on tiny map crowded with civs).
  • Changed an assert on destination plot selection when in danger [FAssert(!atPlot(pBestPlot) || canDefend());] to take into consideration that the unit stays in the current plot as it can defend
  • Bugfix to block AI to take both way of the wise and way of the wicked (or righteousness/malevolent design/commune with nature) as it was not implemented in AI logic and it was, in fact, always buying both.
  • In CvGuildScreen fixed bug that allows Human playrs to buy righteousness even if malevolent design has been taken (if neutral alignment)
  • Fixed multiplayer bug in which all team member get to choose a guild (different guild can be choosen). Now only first team member get to choose.
  • Tuned AI_doCitySpecialization, to try to force the first 3 cities into building research/culture/military. Not sure if the perfect algorithm but we noticed an increase in research and culture as with existing algorithm the AI privilege Merchant.
    • Capital: research unless there is a +60% production. If true, and there is a 50% culture, go for culture else go for military.
    • 2nd: if capital is in research go for military, else go for research.
    • 3rd: if no military city yet, and there is a +40% production go for military. If culture is needed and the city can either grow (+40% food) or has a culture bonus resource. If +60% gold go for merchant, else go for reaseach.
    • Others: First try to check bonuses and apply the specialization for it (30% research go for sage, 50% culture go for bard, etc...) if 50% faith go for temple but max once, as I am not sure if the AI used at all faith (maybe in researching religious tech). Else try to keep the number of specialization even among the number of cities, but still giving priority to research/culture.
  • Tuned AI_chooseProductionDistrict based on city specialization to account also for 2 level district. It tries to push build district earlier to increase research/culture. Also it reduce a little the number of merchant district which were almost the majority in earlier version. For 2nd level merchant district only Trade is considered (luxury/resource are probably not needed by AI). Also herbalist is not considered. It is based on the city specialization given in AI_doCitySpecialization.
  • Reduced number of allowed guild back to 4.
  • Removed all debug/compile header to reduce download size

ChangeLog v0.1:
Spoiler :

  • Merged Sephi Tweak Mod for Xtended 1.09 from https://forums.civfanatics.com/threads/tweak-mod-for-xtended.658776/
  • Merged Kozar Master of Mana updates 1.4 from https://forums.civfanatics.com/threads/master-of-mana-updates.671192/
    • Fixed CTD when casting spell from a selection group but not enough mana available for all spells.
    • Fixed a systematic OOS when launching a spell
  • Scaled down initial Trait Acquisition cost
  • Scaled Yield cost based on gamespeed form MANA/FAITH/GOLD related equipment
  • [GUILD] Added option to look at the big picture at guild selection (but disabled possibility to acquire new guild/traits with culture)
  • [AI] Allowed Illians AI to create Frozen
  • [GAMEOPTION] Added gameoption to disable World Wonder and World Units
  • [AI] forced AI to build Raise of a Legend
  • [AI] trying to improve tech research (expecially on tech that gives +2 warrior strenght) by:
    • reduce minimum amount of money that is forced to keep (from original 500 to 50 if 1 city, 100 if 2 city, 150 if more). Otherwise this caused AI to always research 50%
    • forced to build sage district in capital so to maximize research
    • forced to build district in city when turn for production is reasonable based on city specialization (gold = merchant, research = sage, production = noble)
    • forced to research a tech that either gives +2 to unit or unblock a new unit tier if cost is less than 30 + number of civ with greater power + number of barbarian villages AI is trying to destroy
  • [XML] Removed reference to CIVIC_SHAMANISM, no present in XML
  • DoPacifistDemonstration5 corrected from PROMOTION_VAMPIRISM to PROMOTION_VAMPIRE
  • Removed reference of IMPROVEMENT_ODIOS_PRISON in PrivateMaps
  • Civilopedia added empty text for missing labels
  • Corrected CvModName to be 'Master of Mana' needed by AIAutoPlay
  • Added a small stacktrace to FAssertDlg for who does not have a debugger like me...
  • [Possible OOS?] Disabled caching m_aiAttitudeCache in AI_getAttitudeVal as it seems that each turn it could get calculated in an async context (BUG ui). Not sure if it can lead to OOS as values seems to different for small numbers.
  • [OOS] Changed behavior for update_Reserve_PickupEquipment in AI_group.cpp to avoid OOS
  • ENABLE_OOSLOG to enable/disable logging (default is currently enabled)
  • Tuned a lot of logging to be with a kind of csv format for better parsing and analysis
  • NJAGCL Enabled option to switch between turn and golden age length
  • [Civilopedia] Added link in TXT_KEY_SPELL_TAUNT_HELP to PROMOTION_ENRAGED and TXT_KEY_UNIT_ENSLAVEMENT_CHANCE link to UNIT_SLAVE
  • [XML] corrected text for some epic victory: TXT_KEY_ADVENTURESTEP_VAMPIRE_LEVEL_20 level required is 10, not 20, TXT_KEY_ADVENTURESTEP_VAMPIRE_LORD_LEVEL_30 level is 15 not 30, TXT_KEY_ADVENTURESTEP_LOSHA_LEVEL_30 15 not 30
  • TXT_KEY_ADVENTURESTEP_CREATE_TRACKER is Wisp, not Tracker, TXT_KEY_ADVENTURESTEP_NEVER_ADOPT_THEOCRACY is Religion Civic not Theocracy
  • [XML] Corrected ADVENTURESTEP_NEVER_ADOPT_THEOCRACY from <bCivicDuration>1</bCivicDuration> to bNeverAdoptCivic>1</bNeverAdoptCivic>
  • [OOS] EVENT_YOUNGER_COUNCIL_1 added <iHappyTurns>0</iHappyTurns>
  • [PYTHON] Added more logging to OOSLogger
  • [PYTHON] corrected BUILDING_VACANT_MAUSOLEUM
  • [OOS] reqStunned and reqSilencedArcaneLacuna now implemented through sendModNetMessage
  • [PYTHON] reqRebuildBarnaxus added check for pCityPlayer not None
  • [PYTHON] doCondantis22 added check that civ isAlive
  • [PYTHON] doPerfectStorm3 corrected argument parsing
  • [PYTHON] reqStealGold added check for gc.getPlayer(pCity.getOwner()) not None
  • [PYTHON] reqLightOfLugus added check for pOtherPlayer not None
  • [PYTHON] WildmanaGuardianDefeated removed changeResearchProgress due to Assimilate Promotion. Does not seems to be implemented anywhere else and there are some cases which cause c++ exception (current research sometime -1)
  • [PYTHON] reqEmperorshand added missing return statement
  • [PYTHON] Embedded AIAutoPlay
[\SPOILER]
 
Last edited:
Thank you for your merging. Two big branches of the mod have been unified again.(and more!)

Here's some thoughts...

I feel enhancement of resource discovery chance is too much. MoM's basic discovery chance was 0.03% but many improvements shows 1% or higher now. So almost all improvements of the whole world have gotten bonus resources before the middle phase of the game and some global enchantments accelerate this process. Great Merchant's buisiness-opening ability or FoL's Call to Nature spell became actually meaningless. And some promotions can be too powerful such as Duskwood Archer.
I wish you reduce some factors to calm down this endless resource popping though I understand this feature is from MoM Updates files. :) (capping at 0.1~0.15% would be enough, I think)

[AI] trying to improve tech research (expecially on tech that gives +2 warrior strenght)
This works well. AI civs have stronger units than before. But Luchiurp is somewhat behind in armament race probably because their golems are not strengthened by tech progress and scattered around in tech tree and guild tree... How about giving golems affinity for some resources? i.e. marble affinity for marble golems and stone for gargoyles. Also for this purpose, resource discovery should not overflourish...
 
Thanks for the valuable feedback!
On your points:
  1. Also I have noticed that the spawning rate of resource is just too much... Usually we ends up with capital overflown by resources.... Will try to adjust the spawn rate to be higher than original MoM but slightly less. Only sea resources I would prefer to keep as it is, as normally without this a city placed on coast is not really worth it. At least with an increased percentage of sea resource spawn it allows to be worth to place a city by the sea... Any opinion on that? I will try to check to find a suitable rate for land resources.
  2. On Lurchiurp I am not sure. If I play them I am able to focus on correct tech and guilds. The civ favour quantity over quality by definition and usually when played by human they can be a considerable challange. Thus I wonder if the issue is more on AI choices than Civ balance by itself. Did you get same impression also by playing them?
  3. Do you have any feedback on the Gaping wound topic I posted on https://forums.civfanatics.com/threads/tweak-mod-for-xtended.658776/page-7 ? I am still in doubt if I miss something or it is a bug....
 
On topic 1 :

Only sea resources I would prefer to keep as it is, as normally without this a city placed on coast is not really worth it
I agree.

I will try to check to find a suitable rate for land resources.
Please cap at 0.1 or 0.15%. These figures are 3~5 times greater than the base chance and enough to spawn quite many new resources till the game ends. I think if resources are too common, they are of little value and fun. It would be more interesting if resources are found only occasionally. :)

On topic 2 ;
I am sorry. I should have mentioned that 'AI' Luchiurp's military is weak.(Human players should face any circumstances. )
They mainly count on marble golems when other AIs have much stronger units strengthened by some techs and promotions. Their cities are easily captured. So some golems may need city fortification bonus. And Luchiurp AI may have to put more priority on Artisan's guild or Magi guild for strong golems as well as Siege workshop tech.

On topic 3 :
I used to think that there may be a spell/aura that can remove the gaping wound just like 'Diseased' effect and forgot about it.
It makes no sense to say that it will be cured someday though damaging occurs eternally. How about changing possibility of damage to 40% per turn or so? Then the wounded unit will slowly but eventually get recovered especially with a medic at the same plot and the Gaping wound can disappear.
 
1) OK, will check I forgot where those values are placed and I would like to crosscheck current values. If I remember correctly in our games I was able to see 0.169% of spawning. Value can increase if resource are nearby but basically I would like to review a little bit the spawn system to check how it works (maybe it does change based on game speed?)
2) To be honest, I would prefer to crosscheck how to improve AI. One thing I am curious about is how to prioritize guild selection. I will try to add some logs and check what is doing. Maybe it run towards the '+2' tech as the Artificers are using this bonus....
3) Either I miss how it is supposed to remove it (thus Civilopedia is wrong) or due to how the 'removed after healed' flag works it never enter the conditions. Thus what I will probably do is to fix in order to actually remove it once healed.

Thanks anyhow for your feedback! Currently I will try to collect requests and feedback. Probably will start again to work actively on the mod in a couple of months...
 
I am sorry to keep posting again but would you mind if I ask you to look into two other bugs?
Please see this posting and this posting. Thank you. :)

And...I was a little bit surprised...
I was able to see 0.169% of spawning.
Is that the maximum value you have seen? In my games, 2% is not very rare...
 

Attachments

  • Civ4ScreenShot0009.JPG
    Civ4ScreenShot0009.JPG
    642.9 KB · Views: 194
I agree with the previous posters, the resource discovery rate is too high at the moment. It ca´n be a little higher than in the base- MoM-mod, but not so much higher. From the midgame on resource tiles are not thast special any more.

Gaping Wound is a pita. I have to remove it in the world builder. I hate it so much i have restarted several games when having the Lanun as neighbors, because their base infantry causes it with their build-in axes. Didnt want to have to deal with this in a war. If it cant be fixed, just drop it, or make it a slow-healing debuff like Poisoned by goblins. Or like, only cureable in a city, even perhaps with a healing building (Herbalist, Healing Hut, etc...) or Medic-promotion unit necessary in this city. Atm it is just broken and annoying.
 
Last edited:
Crosschecking with iDiscoverRand in XML for Improvement and Bonus, what has been done is to modify it from 3 to 5, or 0 to 5 etc... So I do not really understand how this relates with the percentages display. During our matches on MoM Erebus with quick speed I am able to see an initial percentage on a Farm of 0,044% which later on around turn 200 change in 0.169% or something. The value doubles if there is a resource in an adjacent plot.
Thus I would really like to tune a little bit but first I will have to understand the algorithm behind those values....

As a side note:
- Fixed Gaping Wound, but I will have to playtest a bit.
- Fixed Summoning Circle
- Fixed Nexus Teleport

Additional AI improvement: I have noticed that AI tend to build a lot of Settler. Even on a small map with 15 AI, when after the 3rd city we focus on conquest as space is over, we noticed AI has always 2 or 3 settlers in capital city. Will try to have a look on it to understand if this can be somehow tuned.
 
I think I catch why the spawning resource can go to crazy values... It could be tied to how Merchant District increase the global spawning rate of the empire of 20%.
Basically:
Code:
iBase *= (1.20 * kPlayer.getBuildingClassCount((BuildingClassTypes)GC.getBUILDINGCLASS_MERCHANT_DISTRICT()));
Should be instead this:
Code:
iBase *= 1 + (0.20 * kPlayer.getBuildingClassCount((BuildingClassTypes)GC.getBUILDINGCLASS_MERCHANT_DISTRICT()));
Otherwise the second Merchant District would double the base spawning rate + adding 40%

Maybe this is the reason why we never saw these kind of huge values... we rarely build more than one merchant district (except with Austrin).

I have also moved all the addition to the spawning rate from improvement (e.g. Underground well) after all multiplication which should also reduce it a little bit.

I do not know Felis catus if you are able to confirm if in games displaying this great spawn percentage, if a lot of merchant district are build.

Additional partial changelog:
  1. Randomized the first 4 early tech (Barter, Education, Exploration, Warrior Caste) to have some different AI behavior during games
  2. Improved AI guild selection to focus on guild that unlock additional unique units for the civilizaton (prioritized by cost). Previously, Luchiurp was not always selecting Artisan Guild
 
I'm very happy to hear that you have found the cause. :thanx:
I think I usually build one Merchant District in every fourth or fifth city though I did not know that Merchant District increases the spawning rate.
In my opinion, we had better get rid of that feature because it is too much. Merchant District already gives bonus related to resources. It can provides a free resource with Luxury District and the number of resources in the city can be doubled and It can double the city yields with Warehouse District...

I am looking forward to these changes. :thumbsup:
Additional partial changelog:
  1. Randomized the first 4 early tech (Barter, Education, Exploration, Warrior Caste) to have some different AI behavior during games
  2. Improved AI guild selection to focus on guild that unlock additional unique units for the civilizaton (prioritized by cost). Previously, Luchiurp was not always selecting Artisan Guild
 
Thanks!
I am preparing the changelog and I will have to playtest a bit the additional modifications in guild selection, culture spending for guild and city specialization/district building that I have added: afterwards, I will upload v0.2.
Another last modification that I am planning to add is to restore the original guild selection to max 4 guilds and on the original tech (barter/trade/etc...). Currently it is possible to get all of them and it is reducing the fun to have to choose carefully which one to take (afterwards I may have to tune better guild selection).
 
Good afternoon. I noticed that the saves in this modification are somehow encoded and do not open with notepad. Please tell me how they can be opened.
Is Notepad++ not suitable for creating a script?
 
Hi
If you mean in-game save file, those are in binary format (also in civ4 vanilla and other mod) and cannot be opened or modified with a text editor. There is no way of doing that.
If you mean worldbuilder save or scenario file this is something I do not know as I never worked on that.
 
Hi thanks!
This is a standalone mod, just download and unzip in the beyond the sword mod folder, and make sure it's called 'Master of Mana'
 
Hey! Is it alright if I create a fork from this project? Been poking my head into the MoM codebase and been trying to fix some of the annoying bits I have found there + add back some of the unused content sitting in the files. ( Austrin's 'Exotic' mechanic where they can build a wonder to spawn any civ being one, it's just sitting there in the code unused! )

Figured basing the fork off of this version makes more sense then doing it off of the 2016 version!
 
Found a bug involving the Game Option that lets barbs spawn in unclaimed territory even within line of sight/vision (Savage World/Wild World I think it's called?).
A rather nasty bug too, it's a CTD if triggered, auto-save on the turn of the CTD is attached and it is easily replicable as detailed below.

Here's the gist of it; Estias (northwest Aristrakh city on this map) was conquered from the barbarians. Despite being conquered AND IN MY TERRITORY it will still fire off the Barbarian Uprising event. If you do anything other than than pay tribute to these glitched-out chucklefudgs then the game will crash (presumably due to attempting to spawn barbarians on the garrisoned city, if un-garrisoned then the barbs just steal the city right away, and the event will still fire off later on if you reconquer the city).

By the way, when are you going to replace the default worldbuilder with something like PlatyBuilder? This glitch would be much more manageable if I had something other than that primitive piece of junk default worldbuilder.
 

Attachments

  • AutoSave_AD-0312.CivBeyondSwordSave
    902.2 KB · Views: 29
Found a bug involving the Game Option that lets barbs spawn in unclaimed territory even within line of sight/vision (Savage World/Wild World I think it's called?).
A rather nasty bug too, it's a CTD if triggered, auto-save on the turn of the CTD is attached and it is easily replicable as detailed below.

Here's the gist of it; Estias (northwest Aristrakh city on this map) was conquered from the barbarians. Despite being conquered AND IN MY TERRITORY it will still fire off the Barbarian Uprising event. If you do anything other than than pay tribute to these glitched-out chucklefudgs then the game will crash (presumably due to attempting to spawn barbarians on the garrisoned city, if un-garrisoned then the barbs just steal the city right away, and the event will still fire off later on if you reconquer the city).

By the way, when are you going to replace the default worldbuilder with something like PlatyBuilder? This glitch would be much more manageable if I had something other than that primitive piece of junk default worldbuilder.


I think this bug is mostly down to the fact that, if a dungeon improvement is removed due to unusual circumstances, it still isn't actually 'removed' from the codebase like it would be if you were to go there yourself and explore the dungeon.

I try to fix this in my own fork by doing this change in cvDungeon, mostly as a catch all if something happens to the improvement - i.e. it gets removed through world builder or deleted by a spell or something.

void CvDungeon::doTurn() { ImprovementTypes iGraveYard = (ImprovementTypes)GC.getInfoTypeForString("IMPROVEMENT_GRAVEYARD"); ImprovementTypes iDungeon = (ImprovementTypes)GC.getInfoTypeForString("IMPROVEMENT_DUNGEON"); ImprovementTypes iBarrow = (ImprovementTypes)GC.getInfoTypeForString("IMPROVEMENT_BARROW"); CvPlot* pPlot = plot(); if (pPlot == NULL || (pPlot->getImprovementType() != iGraveYard && pPlot->getImprovementType() != iDungeon && pPlot->getImprovementType() != iBarrow)) { kill(); // Destroy the object if the plot is null or the improvement is not a graveyard, dungeon, or barrow return; }//Rest of code normal after this
 
Last edited:
Thank ShimonSays for the detalied bug report.
I have noticed in the past a similar issue caused by the Dungeon (I think it was a Goblin Fort) beeing destroyed by an AI on the same turn a demand to the player (Barbarian Uprising Event).
The fix was preventing the CTD but still I was never able to hide the popup with the request.
Also, the fix Zusk reported above is not preventing the CTD by itself.
Thus, I manage to fix the case you reported (testing the quicksave) by:

Modify the fix provided by Zusk to consider also the Barbarian City
//SpyFanatic: patch taken from Zusk, to remove Dungeon destroyed but not removed ImprovementTypes iGraveYard = (ImprovementTypes)GC.getInfoTypeForString("IMPROVEMENT_GRAVEYARD"); ImprovementTypes iDungeon = (ImprovementTypes)GC.getInfoTypeForString("IMPROVEMENT_DUNGEON"); ImprovementTypes iBarrow = (ImprovementTypes)GC.getInfoTypeForString("IMPROVEMENT_BARROW"); CvPlot* pPlot = plot(); if (pPlot == NULL || (pPlot->getImprovementType() != iGraveYard && pPlot->getImprovementType() != iDungeon && pPlot->getImprovementType() != iBarrow)) { kill(); // Destroy the object if the plot is null or the improvement is not a graveyard, dungeon, or barrow return; } if (pPlot != NULL && (pPlot->getPlotCity() != NULL && pPlot->getPlotCity()->getOwnerINLINE() < BARBARIAN_PLAYER)) { kill(); // Destroy the object if the plot is null or the improvement is not a graveyard, dungeon, or barrow return; } //Rest of code normal after this

In CvCity::DoTask on top of the not NULL check, added a similar check (this is actually preventing the CTD in the autosave provided)
case TASK_CITY_DUNGEON_EVENT: { //GC.getMapINLINE().getDungeon(iData1)->ResolveDeal(getOwnerINLINE(), (DungeonEventTypes)iData2); //SpyFanatic: CTD in case in the meantime AI civ destroyed that Dungeon, so as safe measure, crosscheck that Dungeon is still existing before proceeding, so adding a NULL check CvDungeon* pTargetDungeon = GC.getMapINLINE().getDungeon(iData1); if(pTargetDungeon != NULL) { //Do not execute if the dungeon is a barbaric city not anymore belonging to barbs player if(pTargetDungeon->plot() == NULL || pTargetDungeon->plot()->getPlotCity() == NULL || pTargetDungeon->plot()->getPlotCity()->getOwnerINLINE() >= BARBARIAN_PLAYER) { pTargetDungeon->ResolveDeal(getOwnerINLINE(), (DungeonEventTypes)iData2); } } } break;

The result is that in the autosave the Barbarian Uprising Event appears, but regardless of the choice made nothing is really happening. I assume that Zusk fix should fix it in the normal way (each turn cleanup old Dungeon), but it is simply not testable from the autosave. Maybe if you have the autosave of turn before you can check that the Barbarian Uprising Event is not triggered at all... I am not sure about this.
 
Top Bottom