FfH2 Bug Thread

It is necessary to prevent a divide by 0 error if the players discover rand happens to be -100 (I dont think thats possible in FfH since we only boost the number, but who knows what modmodders will try).

Oh I see. I has misread your intention of this comparing code.
I will try more this problem.

And, my sample code CvPlot.cpp may be very buggy.
My japanese FfH2 community reported me that too many new resources is discovered.

Please ignore it, or check behavior by your self.
I'm very sorry to cause confuse. :hammer2:
 
CvGameTextMgr::setImprovementHelp()
Spoiler :
Code:
    int iLast = -1;
    for (int iBonus = 0; iBonus < GC.getNumBonusInfos(); iBonus++)
    {
        int iRand = info.getImprovementBonusDiscoverRand(iBonus);
        if (iRand > 0)
        {
            szFirstBuffer.Format(L"%s%s", NEWLINE, gDLL->getText("TXT_KEY_IMPROVEMENT_CHANCE_DISCOVER"[COLOR=Blue], iRand[/COLOR]).c_str());
            szTempBuffer.Format(L"%c", GC.getBonusInfo((BonusTypes) iBonus).getChar());
            setListHelp(szBuffer, szFirstBuffer, szTempBuffer, L", ", iRand != iLast);
            iLast = iRand;
        }
    }
Blue marked variable is missing. (Mine improvement has displayed funny chance of discovering new resource.)

Awesome! Had always wondered why it displayed such an incorrect value. :goodjob:
 
Worker bug - Crazy Worker AI - Possible Reason?

I had just achieved Machinery and was pleased that my workers would start putting up Windmills. I had just captured some enemy workers, Balseraphs (go figure) and decided to set them on "auto." Then, the game CTD'd.

It didn't crash on the next reload so I continued on, happily stomping the Balseraphs and capturing workers. But, my workers went.. stupid. Up until that point, I hadn't noticed anything unusual. I wasn't focusing on worker's tasks anymore as I was engaged in several wars so, they were all on AUTO mode and, sitting around in cities either doing nothing or one might be ripping the heck out of a Plantation in order to put down something else.. :(

So, I killed off all my workers and then built new ones from scratch. That "seemed" to solve the problem. I guess the Balseraphs were Union Activists.. Anyway, things "seemed" fine until I captured the next Worker unit, this time from Bassium. (I hadn't paid much attention after I verified the "new" worker units were working as intended.)

When I captured that city, I got a CTD as soon as it was time for those units in the city to have their movement turn. I've never used worldbuilder and went into it to see if I could figure it out.

There was one angel left, a worker and a Merchant Caravan in there. I know nothing about Worldbuilder so, after fussing with it, I renamed the worker and chose, what appeared to be, a different script for it. Then, I went back into the game and recaptured the city. Mucking around with the worker, whatever I did, fixed the CTD but, my worker AI was still buggy as heck.

I know the worker issue is already a listed bug but, could it have anything to do with capturing other workers, screwing up their "to do" lists? As it is, using "Auto" is impossible and I hate micromanaging all the workers. Periodically, I'll slaughter them all off and rebuild a new crop. They'll seem to work fine for awhile then but, I usually come back much later only to find them all huddled inside of the cities after raping all my resource plot-builds.. :/

I don't know if I have the CTD saves, I'll have to look through them, if needed. I know next to nothing about Worldbuilder and didn't see any python scripting errors.
 
CvGameUtils.py
Spoiler :
Code:
			#Fishing
							if pCity.isCoastal(5):
								if pLoopPlot.isWater():
									lValues[sTechs.index('TECH_FISHING')]+=10
									[COLOR="Blue"]if pLoopPlot.getFeatureType()==gc.getInfoTypeForString('[COLOR="Red"]FEATURE_KELP[/COLOR]'):
										lValues[sTechs.index('TECH_FISHING')]+=10[/COLOR]
I think color marked lines are unnecessary because unmodded FfH2 doesn't have kelp feature.
Any problems don't be caused by this code. Anyway I reports.



EDIT:
CIV4GameText_FFH2.xml
should be added the following tags.
Spoiler :
Code:
	<TEXT>
		<Tag>TXT_KEY_MISC_ENEMY_TROOPS_SPOTTED</Tag>
		<English>%s2_CivDesc have been spotted near %s1_CityName!</English>
		<French>%s2_CivDesc ennemies ont été repérées près de %s1_CityName !</French>
		<German>Truppen aus dem %[s2_CivDesc] sind in der Nähe der Stadt %s1_CityName gesichtet worden!</German>
		<Italian>%s2_CivDesc avvistate nei pressi di %s1_CityName!</Italian>
		<Spanish>%s2_CivDesc cerca de %s1_CityName.</Spanish>
	</TEXT>
Missing tag from Fall Further. Fall Further tweaks CvPlayer.cpp and this text tag to show spotting enemy's civilization, but patch "l" missed text tag.
(This tweaking shows hidden nationality unit as a barbarian state. If you don't like it, I believe you should roll back CvPlayer.cpp codes about it.)

Spoiler :
Code:
	<TEXT>
		<Tag>TXT_KEY_UNIT_HELP_DELAYED_CASTING</Tag>
		<English>Casting %s1_Spell (%d2_TurnsRemaining [NUM2:Turn:Turns] Remaining)</English>
		<French>Casting %s1_Spell (%d2_TurnsRemaining)</French>
		<German>Zaubert %s1_Spell (%d2_TurnsRemaining)</German>
		<Italian>Casting %s1_Spell (%d2_TurnsRemaining)</Italian>
		<Spanish>Casting %s1_Spell (%d2_TurnsRemaining)</Spanish>
	</TEXT>
Missing too.


CvSpellInfos.xml
Spoiler :
Code:
	<SpellInfo>
		<Type>SPELL_POTION_OF_RESTORATION</Type>
		<Description>TXT_KEY_SPELL_POTION_OF_RESTORATION</Description>
		<Civilopedia>TXT_KEY_SPELL_PLACEHOLDER_PEDIA</Civilopedia>
		<PromotionPrereq1>PROMOTION_POTION_OF_RESTORATION</PromotionPrereq1>
		<bAllowAI>1</bAllowAI>
		<bDisplayWhenDisabled>1</bDisplayWhenDisabled>
		<bIgnoreHasCasted>1</bIgnoreHasCasted>
		<RemovePromotionType1>PROMOTION_POTION_OF_RESTORATION</RemovePromotionType1>
		<bBuffCasterOnly>1</bBuffCasterOnly>
		<bAbility>1</bAbility>
		<bRemoveHasCasted>1</bRemoveHasCasted>
		<Effect>EFFECT_SPELL1</Effect>
		<Sound>AS3D_SPELL_ENCHANTMENT</Sound>
		<Button>Art/Interface/Buttons/Equipment/[COLOR="Blue"]PotionOfInvisibility.dds[/COLOR]</Button>
	</SpellInfo>
Icon mismatching. I believe it should be "PotionOfRestoration.dds".
 
For a number of promotions that include a iExtraCombatStr tag value like bronze weapons, buccaneers, strong, weak, great commander, etc the tooltip for the promotion incorrectly shows things like +1% strength (where I think it should show +1 attack strength).

It is only a display bug, but since so many promotions are affected by it, it does annoy me. I tried fixing it myself, but I can't find a way to do it. Any help would be appreciated.
 
CvGameUtils.py
Spoiler :
Code:
			#Fishing
							if pCity.isCoastal(5):
								if pLoopPlot.isWater():
									lValues[sTechs.index('TECH_FISHING')]+=10
									[COLOR="Blue"]if pLoopPlot.getFeatureType()==gc.getInfoTypeForString('[COLOR="Red"]FEATURE_KELP[/COLOR]'):
										lValues[sTechs.index('TECH_FISHING')]+=10[/COLOR]
I think color marked lines are unnecessary because unmodded FfH2 doesn't have kelp feature.
Any problems don't be caused by this code. Anyway I reports.



EDIT:
CIV4GameText_FFH2.xml
should be added the following tags.
Spoiler :
Code:
	<TEXT>
		<Tag>TXT_KEY_MISC_ENEMY_TROOPS_SPOTTED</Tag>
		<English>%s2_CivDesc have been spotted near %s1_CityName!</English>
		<French>%s2_CivDesc ennemies ont été repérées près de %s1_CityName !</French>
		<German>Truppen aus dem %[s2_CivDesc] sind in der Nähe der Stadt %s1_CityName gesichtet worden!</German>
		<Italian>%s2_CivDesc avvistate nei pressi di %s1_CityName!</Italian>
		<Spanish>%s2_CivDesc cerca de %s1_CityName.</Spanish>
	</TEXT>
Missing tag from Fall Further. Fall Further tweaks CvPlayer.cpp and this text tag to show spotting enemy's civilization, but patch "l" missed text tag.
(This tweaking shows hidden nationality unit as a barbarian state. If you don't like it, I believe you should roll back CvPlayer.cpp codes about it.)

Spoiler :
Code:
	<TEXT>
		<Tag>TXT_KEY_UNIT_HELP_DELAYED_CASTING</Tag>
		<English>Casting %s1_Spell (%d2_TurnsRemaining [NUM2:Turn:Turns] Remaining)</English>
		<French>Casting %s1_Spell (%d2_TurnsRemaining)</French>
		<German>Zaubert %s1_Spell (%d2_TurnsRemaining)</German>
		<Italian>Casting %s1_Spell (%d2_TurnsRemaining)</Italian>
		<Spanish>Casting %s1_Spell (%d2_TurnsRemaining)</Spanish>
	</TEXT>
Missing too.


CvSpellInfos.xml
Spoiler :
Code:
	<SpellInfo>
		<Type>SPELL_POTION_OF_RESTORATION</Type>
		<Description>TXT_KEY_SPELL_POTION_OF_RESTORATION</Description>
		<Civilopedia>TXT_KEY_SPELL_PLACEHOLDER_PEDIA</Civilopedia>
		<PromotionPrereq1>PROMOTION_POTION_OF_RESTORATION</PromotionPrereq1>
		<bAllowAI>1</bAllowAI>
		<bDisplayWhenDisabled>1</bDisplayWhenDisabled>
		<bIgnoreHasCasted>1</bIgnoreHasCasted>
		<RemovePromotionType1>PROMOTION_POTION_OF_RESTORATION</RemovePromotionType1>
		<bBuffCasterOnly>1</bBuffCasterOnly>
		<bAbility>1</bAbility>
		<bRemoveHasCasted>1</bRemoveHasCasted>
		<Effect>EFFECT_SPELL1</Effect>
		<Sound>AS3D_SPELL_ENCHANTMENT</Sound>
		<Button>Art/Interface/Buttons/Equipment/[COLOR="Blue"]PotionOfInvisibility.dds[/COLOR]</Button>
	</SpellInfo>
Icon mismatching. I believe it should be "PotionOfRestoration.dds".

All fixed, thanks denev.

For a number of promotions that include a iExtraCombatStr tag value like bronze weapons, buccaneers, strong, weak, great commander, etc the tooltip for the promotion incorrectly shows things like +1% strength (where I think it should show +1 attack strength).

It is only a display bug, but since so many promotions are affected by it, it does annoy me. I tried fixing it myself, but I can't find a way to do it. Any help would be appreciated.

It will be fixed in the next patch, thanks.
 
Disciple of Acheron's a new unit, so I don't know if this is a bug or intended.

Playing as the Clan, when I cast For the Horde one of the units I gained was a Disciple of Acheron. It was nice, but I don't know if it's intended.
 
Python exception, screenshot attached.
I can confirm that issue.
Spoiler :
Traceback (most recent call last):

File "CvSpellInterface", line 22, in cast

File "<string>", line 0, in ?

File "CvSpellInterface", line 1271, in spellForTheHorde

RuntimeError: unidentifiable C++ exception
ERR: Python function cast failed, module CvSpellInterface
 
That must be the same issue with the Disciples. It should be fixed in the next patch.
 
For a number of promotions that include a iExtraCombatStr tag value like bronze weapons, buccaneers, strong, weak, great commander, etc the tooltip for the promotion incorrectly shows things like +1% strength (where I think it should show +1 attack strength).

It is only a display bug, but since so many promotions are affected by it, it does annoy me. I tried fixing it myself, but I can't find a way to do it. Any help would be appreciated.

This display bug is from my modmod "More Detailed Civilopedia" (via Wild Mana).
I already fixed it on my own modmod, but now it has ton of altered codes.

Kael, MayCan I merge the latest CvGameTextMgr.cpp to fix my display bug?
I don't want to look my own mistake on your great mod.

Please tell me your opinion. Thanks! :)
 
This display bug is from my modmod "More Detailed Civilopedia" (via Wild Mana).
I already fixed it on my own modmod, but now it has ton of altered codes.

Kael, May I merge the latest CvGameTextMgr.cpp to fix my display bug?
I don't want to look my own mistake on your great mod.

Please tell me your opinion. Thanks! :)

Its no stress, its already fixed in the version Im using.
 
Its no stress, its already fixed in the version Im using.

That's cool! :D

Anyway, I will merge the latest CvGameTextMgr.cpp to patch "l" (or later) for my own modmod.
My older CvGameTextMgr.cpp you use includes some issues or some lack of infos still.
I hope you are interested in my coming latest version. Thanks!
 
a few issues here, most of which i would lend absolutely no weight to unless someone else brings it up/confirms(i know the random number generator hates me)

started on patch K, upgraded to L, but none of these issues are addressed in the log

ironicly, my adepts are taking a considerably longer amount of time to level to mages from previous patches. This is with form of titan giving them a 2 point boost. literally 30+ adepts for close to 100 turns never made a single mage, the best i got was 4 experience(including the free 2). not till i upped it to 60+ adepts did i get a slow trickle. was adept experience maybe tied to the new feature growth modification? Was it intentionally changed, slowed?

atleast 4 civs built their capitals in the middle of dense jungle/forests, what is worse, they had to intentionally move there to do it. This left a vast swath of highly valueable flood plains and grasslands for me to take(They handed me the game, i couldn't loose). They completely crippled themselves. while the terrain would have been good once the jungle/forests were cleared, it wasn't immediately exploitable and infact most of the resources were calender. Was the AI's starting location logic messed with?

Barbarians aren't attacking AI civs reliably. Keelyn basically wiped out several civs on her continent, but left the cities undefended. despite several bands of roving skeletons, lizardmen, etc. none of these cities was conquered. i opened up the world builder and watched a skeleton sit on an unadorned hill just staring at an unprotected city. since keelyn is no barbarian, i'm confused.

The AI seems a little confused about boats. I'm noticing that AI ships which can't go into the ocean, instead pace around the very edge of their cultural boarders as if desperately trying to break out. Stationing a couple pirates just outside these boarders causes the ships to abandon defenable coastal positions in a futile effort to engage these ships they can't reach.

shoot, there was more...
 
There are two points about Genesis ritual.
  • Genesis ritual wipes out Forest or Volcano on the Snow tile (You can create them with Snowfall spell).
  • Genesis ritual doesn't remove hell terrain.
This is my sample code to fix them. (and Here is more advanced my approach).

Well, I pray Kael isn't fed up with my repeating reports. :D
 

Attachments

Definitely keep reporting issues. I think the genesis not removing hell terrain is because of this:

Code:
	def genesis(self, iPlayer):
		iSnow = gc.getInfoTypeForString('TERRAIN_SNOW')
		iTundra = gc.getInfoTypeForString('TERRAIN_TUNDRA')
		iPlains = gc.getInfoTypeForString('TERRAIN_PLAINS')
		iDesert = gc.getInfoTypeForString('TERRAIN_DESERT')
		iGrass = gc.getInfoTypeForString('TERRAIN_GRASS')
		iOasis = gc.getInfoTypeForString('FEATURE_OASIS')
		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:
[b]				pPlot.changePlotCounter(0)[/b]
				if(pPlot.getTerrainType() == iSnow):
					pPlot.setTerrainType(iTundra,True,True)
				elif(pPlot.getTerrainType() == iTundra):
					pPlot.setTerrainType(iPlains,True,True)
				elif(pPlot.getTerrainType() == iDesert and pPlot.getFeatureType() != iOasis):
					pPlot.setTerrainType(iPlains,True,True)
				elif(pPlot.getTerrainType() == iPlains):
					pPlot.setTerrainType(iGrass,True,True)
				elif(pPlot.getTerrainType() == iGrass and pPlot.getImprovementType() == -1 and pPlot.getFeatureType() != iForestAncient and pPlot.isPeak() == False and pPlot.isCity() == False):
					pPlot.setFeatureType(iForest, 0)

It should be:

Code:
	def genesis(self, iPlayer):
		iSnow = gc.getInfoTypeForString('TERRAIN_SNOW')
		iTundra = gc.getInfoTypeForString('TERRAIN_TUNDRA')
		iPlains = gc.getInfoTypeForString('TERRAIN_PLAINS')
		iDesert = gc.getInfoTypeForString('TERRAIN_DESERT')
		iGrass = gc.getInfoTypeForString('TERRAIN_GRASS')
		iOasis = gc.getInfoTypeForString('FEATURE_OASIS')
		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:
[b]				pPlot.changePlotCounter(pPlot.getPlotCounter() * -1)[/b]
				if(pPlot.getTerrainType() == iSnow):
					pPlot.setTerrainType(iTundra,True,True)
				elif(pPlot.getTerrainType() == iTundra):
					pPlot.setTerrainType(iPlains,True,True)
				elif(pPlot.getTerrainType() == iDesert and pPlot.getFeatureType() != iOasis):
					pPlot.setTerrainType(iPlains,True,True)
				elif(pPlot.getTerrainType() == iPlains):
					pPlot.setTerrainType(iGrass,True,True)
				elif(pPlot.getTerrainType() == iGrass and pPlot.getImprovementType() == -1 and pPlot.getFeatureType() != iForestAncient and pPlot.isPeak() == False and pPlot.isCity() == False):
					pPlot.setFeatureType(iForest, 0)

As for wiping Volcanoes, I can change the def of Volcano to make all terrains valid so it never gets wiped. Or I could have it change the volcano back into a mountain. Hmm..

Forests on snow are weird because snow should never exist after genesis. So it shouldnt wipe a forest because it doesnt belong on snow. (not that I can think of)
 
As for wiping Volcanoes, I can change the def of Volcano to make all terrains valid so it never gets wiped. Or I could have it change the volcano back into a mountain. Hmm..
Making volcanoes valid on all terrain would be nice anyway. It doesn't seem right that the spread of hell terrain should remove them (but it does). As for Genesis itself, having it return volcanoes to mountains would be nice if volcanoes had some potential negative effect (like occasionally erupting lava, or causing unhappiness in nearby cities) but as it is now it doesn't matter much either way.

Forests on snow are weird because snow should never exist after genesis. So it shouldnt wipe a forest because it doesnt belong on snow. (not that I can think of)
Are you saying that the tile would be converted to Tundra before the check that would potentially remove the Forest takes place, or that Forests should not be present in Snow tiles in general? Snowfall (as Denev mentioned), Wonder, or Temples of the Hand can result in Forests in Snow tiles. (I'm not sure, but I suspect that the "Fantasy Realm" mapscript can also place Forests in Snow tiles during map generation.)

On the topic of unexpected removal of forest-type features, there are two situations in which Ancient Forests are treated differently than Forests. When hell terrain spreads through Tundra there is no obvious change in terrain, but Ancient Forests are removed from Tundra tiles. Forest tiles, however, remain - which seems strange. It seems to me that either all forest-type features should be removed, or they should all remain, or Ancient Forests should be degraded to valid forest-type features (ie Forests). The other situation is the Nature node flare event, which oddly wipes out Ancient Forests in the affected tiles (which makes no sense that I can comprehend). Other forest-type features are not touched by the event. I would think that a Nature flare would not remove Ancient Forests.
 
Definitely keep reporting issues. I think the genesis not removing hell terrain is because of this:
I will do so. ;)

As for wiping Volcanoes, I can change the def of Volcano to make all terrains valid so it never gets wiped. Or I could have it change the volcano back into a mountain. Hmm..
I changed CvPlot::changePlotCounter() to check feature validation only when terrain is changed actually from earthy to hellish, vise varsa.
Snow tile is not affected by plot counter, and doesn't cause checking feature validation.

Forests on snow are weird because snow should never exist after genesis. So it shouldnt wipe a forest because it doesnt belong on snow. (not that I can think of)
CvPlot::changePlotCounter() wipes a Forest or Volcano.
It is called before genesis alters snow tile to tundra.
 
Making volcanoes valid on all terrain would be nice anyway. It doesn't seem right that the spread of hell terrain should remove them (but it does). As for Genesis itself, having it return volcanoes to mountains would be nice if volcanoes had some potential negative effect (like occasionally erupting lava, or causing unhappiness in nearby cities) but as it is now it doesn't matter much either way.

That is exactly what they currently do, though its rare.

Are you saying that the tile would be converted to Tundra before the check that would potentially remove the Forest takes place, or that Forests should not be present in Snow tiles in general? Snowfall (as Denev mentioned), Wonder, or Temples of the Hand can result in Forests in Snow tiles. (I'm not sure, but I suspect that the "Fantasy Realm" mapscript can also place Forests in Snow tiles during map generation.)

Ahh.. you are exactly right. The checks are happening in the wrong order. I will reverse it.

On the topic of unexpected removal of forest-type features, there are two situations in which Ancient Forests are treated differently than Forests. When hell terrain spreads through Tundra there is no obvious change in terrain, but Ancient Forests are removed from Tundra tiles. Forest tiles, however, remain - which seems strange. It seems to me that either all forest-type features should be removed, or they should all remain, or Ancient Forests should be degraded to valid forest-type features (ie Forests). The other situation is the Nature node flare event, which oddly wipes out Ancient Forests in the affected tiles (which makes no sense that I can comprehend). Other forest-type features are not touched by the event. I would think that a Nature flare would not remove Ancient Forests.

This is the same as the volcano problem. Ancient forests dont actually have any valid terrain type since the thing that places them never checks for it. The consequence is that anything that checks to see if they are allowed removes them. I will give ancient forests the same allowed terrains as forests.
 
This is the same as the volcano problem. Ancient forests dont actually have any valid terrain type since the thing that places them never checks for it. The consequence is that anything that checks to see if they are allowed removes them. I will give ancient forests the same allowed terrains as forests.

Would this be the same rationale for Archeron's city tile not changing to Hell terain?
Thanks.
 
Back
Top Bottom