Bug Reports and Discussion

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...
 
Can go back and find an Autosave with the issue (maybe) if you care enough to investigate further.

Yes, I would appreciate savegames for any infinite hangs or crashing issues. Thought I had taken care of all of them.

On another note, does anybody know where I can find the code that doubles the Khazad cultural defense bonus?

Never heard of it.

Thought all I changed was just XML, but then I was pretty drunk...

XML changes are the easiest way to break savegames. All it takes is adding or removing one entry.
 
Revision 1780 broke the Heal spell. Very easy to fix though.
 

Attachments

  • heal_patch.txt
    758 bytes · Views: 83
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?

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).
 
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).

Ahh, yeah that's probably it. Cheers.
 
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.
 
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?
 
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.
 
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?

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.
 
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.
Tech diffusion (enabled by the game option advanced tactics) does that.
 
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.

Yep.

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

and blue marble...

Could blue marble be the problem?
 
Yes. That's the issue.

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

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?
 
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?

The Blue Marble installer has an "Uninstall all" option that you can try.
 
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.
 
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)
 
Top Bottom