1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Bug Reports and Discussion

Discussion in 'More Naval AI Modmod' started by Tholal, Jan 3, 2013.

  1. Azhral

    Azhral Let's get Tactical!

    Joined:
    Jul 9, 2008
    Messages:
    622
    Location:
    Dunedin, New Zealand
    Hey Guys

    Found a weird and interesting bug last night. Not too sure exactly what was going on, but a Clan city with no culture but a large garrison was being beseiged by the Amurites who had a Hill Giant (event one based on the empty pasture I saw) and Loki was 1 tile away from said city. Had the dreaded infinite 'Waiting on Civilizations' on the interturn, until I went back and killed off Loki with the Worldbuilder, then everything was fine. Wasn't the Clans last city, but it did appear that the Amurites would capture it on the next turn. Unsure of the diplomatic status of either side with the Balseraphs however.

    Can go back and find an Autosave with the issue (maybe) if you care enough to investigate further.

    On another note, does anybody know where I can find the code that doubles the Khazad cultural defense bonus? Can't seem to find it myself. Would it be in the DLL or somewhere in the Python?

    Edit: Ignore the "I can provide a save" bit. Changed a bunch of stuff and now I can't load that game or any saves associated with it. Immediate CTD, and the error logs are as unhelpful as always. Pity, was an awesome game and I spent a good hour regenerating till everything looked good. Thought all I changed was just XML, but then I was pretty drunk...
     
  2. Tholal

    Tholal Emperor

    Joined:
    May 19, 2009
    Messages:
    1,676
    Yes, I would appreciate savegames for any infinite hangs or crashing issues. Thought I had taken care of all of them.

    Never heard of it.

    XML changes are the easiest way to break savegames. All it takes is adding or removing one entry.
     
  3. fe79

    fe79 Chieftain

    Joined:
    Sep 19, 2013
    Messages:
    33
    Revision 1780 broke the Heal spell. Very easy to fix though.
     

    Attached Files:

  4. Qgqqqqq

    Qgqqqqq Emperor

    Joined:
    Aug 13, 2012
    Messages:
    1,073
    As Tholal said, this isn't a thing. What you're likely thinking of is the +20% to all cities the Khazad get through their palace (which will likely be in the building entry).
     
  5. Azhral

    Azhral Let's get Tactical!

    Joined:
    Jul 9, 2008
    Messages:
    622
    Location:
    Dunedin, New Zealand
    Ahh, yeah that's probably it. Cheers.
     
  6. Terkhen

    Terkhen King

    Joined:
    Aug 1, 2011
    Messages:
    909
    Gender:
    Male
    Location:
    United Kingdom
  7. Tholal

    Tholal Emperor

    Joined:
    May 19, 2009
    Messages:
    1,676
    Fixed and fixed. Thanks to you both!
     
  8. Terkhen

    Terkhen King

    Joined:
    Aug 1, 2011
    Messages:
    909
    Gender:
    Male
    Location:
    United Kingdom
    Hello again:

    I have been analyzing More Naval AI code with some static analysis tools in order to detect any possible issues. I have used cppcheck to analyze the CvGameCoreDll code. A list of the most serious issues can be found below, but besides those the tool has found a lot of variables (more than 200) that are assigned but never used. I'm hesitant to tackle those because some have notes in the style of "do something with this in the future", while others seem to have been used in the past but BTS_BETTER_AI or MNAI improvements commented their usage out. The compiler is likely to remove most of those variables anyways.

    • The method CvCity::getRevIndexHappinessVal apparently does a lot of things, but in the end it just returns zero.
    • In line 1260 of CvCityAI, iFreeSeaExperience is never used, but the other two are. Seems like something is missing.
    • In CvCityAI::AI_updateBestBuild, some calculations are done with iWorkedFood and iWorkableFood, but the calculated values are never used.
    • In CvCityAI::AI_getYieldMultipliers, some calculations are done with iWorkableFood and iWorkableFoodPlotCount, but the calculated values are never used.
    • In CvCityAI::AI_getImprovementValue, a value is calculated for bHasBonusImprovement but it is never used.
    • In line 6787 of CvGameTextMgr, BuildTypes eBestBuild is calculated but never used.
    • There is a duplicated condition in CvGameTextMgr::parseFreeSpecialistHelp: (!szYield.isEmpty() || !szYield.isEmpty())
    • In line 17742 of CvPlayerAI, there is a bitwise operator (bFirstPass | bWantSwitch) that definitely looks like as if it should be an or operator.
    • A break is missing in line 4106 of CvPlayerAI.
    • In CvPlayerAI, all lines from 6055 to 6087 can be removed as they only set values to variables that are never used.
    • In CvPlayerAI::AI_magicCombatValue, iSpellBonus is calculated but never used.
    • On line 3867 of CvSelectionGroup, bSentryAlert is initialized but never used.
    • On line 1528 of CvUnitAI there is a bitwise operator (!bHero & !isAlive()) that probably should be an and operator.
    • On line 11017 of CvUnitAI, the following condition is duplicated: "(eUnitAI == UNITAI_ATTACK_SEA) ||". "(eUnitAI == UNITAI_RESERVE_SEA) ||" is duplicated too.
     
  9. Sarmatian

    Sarmatian Chieftain

    Joined:
    Sep 30, 2008
    Messages:
    56
    I've tried playing MNAI, downloaded 2.61 (6mb or so), installed it and launched when prompted after installation finished.

    It all started normally, I've set up a custom game and hit play - after some loading, the game crashed to desktop. There was no actual crash, there was just a black screen for a moment and then I've landed to desktop.

    Any idea what might be the reason?
     
  10. Korak

    Korak Chieftain

    Joined:
    Feb 15, 2015
    Messages:
    6
    Location:
    On the keyboard
    Not sure this is a bug, but I'm getting tech that I didn't research. At times during a game, I receive notice of gaining a tech that I wasn't chasing. When I trade tech, I notice that I have gained bulbs on techs my opponents have, but I haven't researched. Something in the game is researching these techs for me.
     
  11. fe79

    fe79 Chieftain

    Joined:
    Sep 19, 2013
    Messages:
    33
    Let's check the simple stuff first:

    Did you install FFH2, and the media pack, and the patch before installing MNAI?

    Have you installed Blue Marble? That can cause problems together with some video card drivers, especially if you have the map grid-lines option enabled in-game.
     
  12. Terkhen

    Terkhen King

    Joined:
    Aug 1, 2011
    Messages:
    909
    Gender:
    Male
    Location:
    United Kingdom
    Tech diffusion (enabled by the game option advanced tactics) does that.
     
  13. Sarmatian

    Sarmatian Chieftain

    Joined:
    Sep 30, 2008
    Messages:
    56
    Yep.

    1) FFH2
    2) patch (latest from ffh2 thread)
    3) media pack

    and blue marble...

    Could blue marble be the problem?
     
  14. Tholal

    Tholal Emperor

    Joined:
    May 19, 2009
    Messages:
    1,676
    Yes. That's the issue.

    Something about Blue Marble causes a crash. I believe you can install Blue Marble last and it will work.
     
  15. Sarmatian

    Sarmatian Chieftain

    Joined:
    Sep 30, 2008
    Messages:
    56
    Thanks!

    Is there a way to just uninstall blue marble, or do I have to uninstall everything (vanilla CIV/BtS included) and do everything all over again?
     
  16. fe79

    fe79 Chieftain

    Joined:
    Sep 19, 2013
    Messages:
    33
    The Blue Marble installer has an "Uninstall all" option that you can try.
     
  17. Korak

    Korak Chieftain

    Joined:
    Feb 15, 2015
    Messages:
    6
    Location:
    On the keyboard
    Thanks Terkhen.
     
  18. Sarmatian

    Sarmatian Chieftain

    Joined:
    Sep 30, 2008
    Messages:
    56
    Thanks!
     
  19. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,109
    Location:
    Kael's head
    I just found this bug around line 358 of PyHelpers.py

    NameError: global name 'i' is not defined
    Code:
    	def getPlotList(self):
    		' plotList - player plots '
    		lPlots = []
    		for[COLOR="Red"] iIndex [/COLOR]in self.getPlotIDList():
    			lPlots.append( CyMap().plotByIndex([COLOR="Red"]i[/COLOR]) )
    		return lPlots
    Obviously either iIndex or i should be changed to match the other. Since iIndex is used nowhere else in that file and i is used often, I assume it would be better to change iIndex to i.
     
  20. omegaflames

    omegaflames Warlord

    Joined:
    Sep 21, 2012
    Messages:
    134
    in CustomFunctions.py what do the last 2 lines of the genesis code actually do? Because it looks to me like all it does is set a feature that is already there.
    Spoiler :
    Code:
    	def genesis(self, iPlayer):
    		iBrokenLands = gc.getInfoTypeForString('TERRAIN_BROKEN_LANDS')
    		iBurningSands = gc.getInfoTypeForString('TERRAIN_BURNING_SANDS')
    		iDesert = gc.getInfoTypeForString('TERRAIN_DESERT')
    		iFields = gc.getInfoTypeForString('TERRAIN_FIELDS_OF_PERDITION')
    		iGrass = gc.getInfoTypeForString('TERRAIN_GRASS')
    		iSnow = gc.getInfoTypeForString('TERRAIN_SNOW')
    		iTundra = gc.getInfoTypeForString('TERRAIN_TUNDRA')
    		iPlains = gc.getInfoTypeForString('TERRAIN_PLAINS')
    		iForestAncient = gc.getInfoTypeForString('FEATURE_FOREST_ANCIENT')
    		iForest = gc.getInfoTypeForString('FEATURE_FOREST')
    		for i in range (CyMap().numPlots()):
    			pPlot = CyMap().plotByIndex(i)
    			if pPlot.getOwner() == iPlayer:
    				iTerrain = pPlot.getTerrainType()
    				if iTerrain == iSnow:
    					pPlot.setTerrainType(iTundra,True,True)
    				if iTerrain == iTundra:
    					pPlot.setTerrainType(iPlains,True,True)
    				if (iTerrain == iDesert or iTerrain == iBurningSands):
    					pPlot.setTerrainType(iPlains,True,True)
    				if (iTerrain == iPlains or iTerrain == iFields or iTerrain == iBrokenLands):
    					pPlot.setTerrainType(iGrass,True,True)
    				if (iTerrain == iGrass and pPlot.getImprovementType() == -1 and pPlot.getFeatureType() != iForestAncient and pPlot.isPeak() == False and pPlot.isCity() == False):
    					pPlot.setFeatureType(iForest, 0)
    				iTemp = pPlot.getFeatureType()
    				pPlot.changePlotCounter(-100)
    				if iTemp!=-1:
    					pPlot.setFeatureType(iTemp, 0)
     

Share This Page