Bug reports and technical issues

They do are behind. If you subtract SM give them corporation or steel. Else just give mexico city a prebuilt catholic monastery, it is the easiest solution. Historically speaking, there should be a lot of monasteries to Mexico back then.
 
There seems to be problems when switching civs in turns where two appear at the same time. I was playing as Phoenicia, in turn 122 popups offering to switch to Ethiopia and Tamils appear, the one for Ethiopia on top. No matter which one I select Yes to, it will always be Ethiopia the civ I end up switching to.
I'm attaching the save of the turn before in case you have any ideas.
I know these switches must be quite complicated... there seems to be an issue with them, in that any gameplay options from the options menu will behave as if not active after the switch. I use wait till end of turn, quick moves, and quick combat, but after the switch I have to go to options, untick them, close, open options again and retick them.
I recall BBAI has a key shortcut for changing the player's civ (Ctrl-Shift-X perhaps?) which worked quite well (as in, it didn't have that issue), maybe it could be worth looking into.


Another technical issue. When a city collapses to independents or is traded, there's some code to remove conflicting buildings, but it doesn't do a very good job of it. Palaces will remain, some wonders in RFC which were national wonders in vanilla will be destroyed. If the city later flips to a new civ, the surplus palace can mess up their capital's location. The code is in CvRFCEventHandler.py, onCityAcquired:
Code:
if bTrade:
	for i in range(con.iScotlandYard - con.iHeroicEpic + 1):
		iNationalWonder = i + con.iHeroicEpic
		if city.hasBuilding(iNationalWonder):
			city.setHasRealBuilding(iNationalWonder, False)
back when I did some work on RFC RAND, I changed that to:
Code:
if (bTrade):
	for i in range (con.iNumBuildings):
		iNationalWonder = i
		if (city.hasBuilding(iNationalWonder)):
			if (isNationalWonderClass(gc.getBuildingInfo(iNationalWonder).getBuildingClassType())):
				city.setHasRealBuilding((iNationalWonder), False)
 

Attachments

  • Hannibal Bronze Age Turn 121.CivBeyondSwordSave
    230.1 KB · Views: 24
They do are behind. If you subtract SM give them corporation or steel. Else just give mexico city a prebuilt catholic monastery, it is the easiest solution. Historically speaking, there should be a lot of monasteries to Mexico back then.
I don't even know how that works right now ... when a normal civ that has some monasteries discovers SM, can it still use these monasteries to train missionaries?

There seems to be problems when switching civs in turns where two appear at the same time. I was playing as Phoenicia, in turn 122 popups offering to switch to Ethiopia and Tamils appear, the one for Ethiopia on top. No matter which one I select Yes to, it will always be Ethiopia the civ I end up switching to.
I'm attaching the save of the turn before in case you have any ideas.
I know these switches must be quite complicated... there seems to be an issue with them, in that any gameplay options from the options menu will behave as if not active after the switch. I use wait till end of turn, quick moves, and quick combat, but after the switch I have to go to options, untick them, close, open options again and retick them.
I recall BBAI has a key shortcut for changing the player's civ (Ctrl-Shift-X perhaps?) which worked quite well (as in, it didn't have that issue), maybe it could be worth looking into.
The code is probably a bit too simplistic there, yes.

Another technical issue. When a city collapses to independents or is traded, there's some code to remove conflicting buildings, but it doesn't do a very good job of it. Palaces will remain, some wonders in RFC which were national wonders in vanilla will be destroyed. If the city later flips to a new civ, the surplus palace can mess up their capital's location. The code is in CvRFCEventHandler.py, onCityAcquired:
Spoiler :

if bTrade:
for i in range(con.iScotlandYard - con.iHeroicEpic + 1):
iNationalWonder = i + con.iHeroicEpic
if city.hasBuilding(iNationalWonder):
city.setHasRealBuilding(iNationalWonder, False)

back when I did some work on RFC RAND, I changed that to:
Spoiler :

if (bTrade):
for i in range (con.iNumBuildings):
iNationalWonder = i
if (city.hasBuilding(iNationalWonder)):
if (isNationalWonderClass(gc.getBuildingInfo(iNationalWonder).getBuildingClassType())):
city.setHasRealBuilding((iNationalWonder), False)
Thanks, that's helpful.
 
I don't even know how that works right now ... when a normal civ that has some monasteries discovers SM, can it still use these monasteries to train missionaries?

Yes... quite convenient as a colonial civilization to spread Catholicism into newly founded cities such that the temple is a first building good for production, culture, and happiness.
 
When Mughals accept peacefully to give away their cities, you recieve only two cities instead of three. Moreover, these cities don't recieve cultural assimilation, so they flip back to Mughals in almost no time.

Moreover, when I declared war to Tibetan Calcuta and Gron gker me Tong, Tibet collapsed and both cities were gifted to Mughals! It isn't fair :(
 
Fair enough, I have to think of a better way to handle this.
 
A minor technical issue, since it only affects a few units' looks: Just for the record, units have three ArtDefineTags and the game decides which to display in CvInfos.cpp at const CvArtInfoUnit* CvUnitInfo::getArtInfo:
Code:
if ((eEra > GC.getNumEraInfos() / 2) && !CvString(getLateArtDefineTag(i, eStyle)).empty())
{
	return ARTFILEMGR.getUnitArtInfo(getLateArtDefineTag(i, eStyle));
}
else if ((eEra > GC.getNumEraInfos() / 4) && !CvString(getMiddleArtDefineTag(i, eStyle)).empty())
{
	return ARTFILEMGR.getUnitArtInfo(getMiddleArtDefineTag(i, eStyle));
}
else
{
	return ARTFILEMGR.getUnitArtInfo(getEarlyArtDefineTag(i, eStyle));
}
Because it uses GC.getNumEraInfos(), this assumes a vanilla setting with the default 7 eras, from Ancient to Future age, numbered in game 0 to 6. But DoC adds three more eras for soundtrack purposes (I have no idea how these actually work BTW, are they referenced somewhere in the dll so all civs use the same 7 eras, but the middle east and asian ones draw music from these other 3 perhaps?) so GC.getNumEraInfos() = 10. The result is that you only get to see the late artdeftag in the future age (10/2 = 5, so you only see it at age nº 6 > 5, future age), and the middle artdeftag doesn't appear until the renaissance age (10/4 = 2.5, you see it at age nº 3 > 2.5, renaissance). Great Generals will look like mesopotamian warlords until then, and be suited in chainmail and sword through the industrial and modern age, workers will be shirtless throughout, etc.
Admittedly it isn't much of an issue, but fixing it is as simple as changing references to GC.getNumEraInfos() with the actual era number you want them to come into play. So, late artdeftag: if ((eEra > 3) &&..., and middle artdeftag: if ((eEra > 1) &&...

This might also affect some other stuff that assumes a default value of GC.getNumEraInfos(), but I only know this one.
 
Oh, great that you caught this. I should just go and hardcode that.

You don't have to be "in" a specific era to draw from its soundtrack, the standard implementation just worked that way. I have added an intermediary method that maps a civ to its "soundtrack era" which can also be one of the special eras that you can never actually be in.
 
I see this error when razing city (3000 BC / Romans)

Code:
Traceback (most recent call last):
  File "BugEventManager", line 400, in _handleDefaultEvent
  File "CvRFCEventHandler", line 303, in onCityRazed
  File "Stability", line 75, in onCityRazed
AttributeError: 'module' object has no attribute 'iMongols'

(Not sure if this is something i should report :) )
 
Definitely. This is both a very urgent and a very obvious bug so I really should take some time to fix it (tomorrow).
 
From my previous post:
BTW, Colombia failed their third UHV goal as soon as I switched to them, not sure what's going on there
Well I have no idea where would that be handled (python?), but it got me thinking, Colombia is set as a Maya respawn, whose third UHV goal was to be the first to discover Astronomy, could it be that the code mixes up the two somehow when Colombia spawns and you switch to them?
I did get the other two UHV goals (well, worldbuilder got them for me that is): ensure no European presence in Caribbean, Peru, Colombia and Guayanas in 1870 and control South America in 1920, but I got no triumphal arch for them either, but I did get them when playing as Maya from before switching to them, again could it be due to such an error?
Control South America in 1920... I thought 'control' meant just having more cities than anyone else in the area? For that one it seems no other presence than Colombia at all can be allowed, quite a challenge for expansion stability. Or maybe it isn't so hard if I actually played the game...

A very small suggestion: in Civ4gameText_Victory2 you can see TXT_KEY_MIN_LATITUDE is jacked by the original RFC to display the triumphal arch's idiosyncrasies, but nowadays if I understand correctly you can make that kind of extra bullet text appear with python or something, for the wonders' special powers for example. Using that, the triumphal arch doesn't need that 91º min latitude value to display that text.

Also, the building's tooltip text that tells what civic makes them build at double speed appears in red regardless of having the mentioned civic, though production speed does get the bonus correctly. this happens for all of them except apparently drydocks and harbors with naval dominance, which get the expected green text with it.
In that regard, could the civics that give double production speed for some buildings have them listed in a single line, so it's like 'Double production speed for Hospital, University' rather than
'Double production speed for Hospital', line break, 'Double production speed for University'...
 
Didn't even know that Rhye had abused the latitude tag for the triumphal arc, haha.

For the separate mentions of buildings with different production speeds, I agree, but it requires some additional effort. Civics can accelerate buildings at different rates, and while that isn't the case currently, it makes it quite complicated to aggregate all buildings that receive the same modifier in a way that covers all situations.

See this is what happens when I don't just stupidly hard code stuff for once ;)
 
Another minor bug on victory screen. This happened when i was playing Japan and got 2 UHV goals done. There is also some error (maybe the same maybe different, not sure, don't have it logged or saved) when you won religious victory.

Code:
Traceback (most recent call last):

  File "CvScreensInterface", line 390, in showVictoryScreen

  File "CvVictoryScreen", line 208, in interfaceScreen

  File "CvVictoryScreen", line 1356, in showVictoryConditionScreen

TypeError: getCivilizationShortDescription() takes exactly 1 argument (2 given)
ERR: Python function showVictoryScreen failed, module CvScreensInterface
 
I wanted to play for a Turks, however something really awkward happened. After few turns i couldn't build any building, only units.
 

Attachments

  • Mehmed II AD-1330 Turn 254wtf.CivBeyondSwordSave.zip
    590.7 KB · Views: 36
So, Gauss' name was corrected in the latest commit... now it's 'Carl Friedrich Gauá' :cry:
I see the names of the GP were placed directly in their names list instead of using a text file, and I guess the name you were going for was 'Gauß' , so it should be 'Carl Friedrich Gau# & 223;' without spaces (automatic parser...)
EDIT: while I'm at it, may I suggest changes to Spanish GP names to conform to our orthography and my OCD? (I don't really have OCD, I'm just a PITA)
Prophets: Juan de Sep#& 250;lveda, Francisco Su# & 225;rez, Bartolom# & 233; de las Casas, Jun# & 237;pero Serra
Artists: Velazquez is better known as Diego Vel# & 225;zquez
Scientists: Gherard de Cremona --> Gerardo de Cremona
Merchants: Fernando Magallanes --> Fernando de Magallanes, though his Portuguese name is Fern# & 227;o de Magalh# & 227;es. Also, Cristoforo Colombo is his real name since he was most likely Genovesi, though at school all kids learn about Crist# & 243;bal Col# & 243;n
Engineers: Alberto Palacio --> Alberto de Palacio y Elissague
Generals: Hernando Cortes --> Hern# & 225;n Cort# & 233;s, Alvaro de Bazan --> # & 193;lvaro de Baz# & 225;n BUT WAIT THERE'S MORE Ambrosio Sp& # 237;nola Doria, though you could keep the Genovesi name Ambrogio Spinola Doria

More with names... after the Prussian spawn, I noticed that Germany is being referred to as 'Austria' in all instances where it should read as 'Austrian', as if the name was used instead of the adjective. In that line, Vikings keep being named such even though their capital is Stockholm in my latest game. I see there's some names in their dynamic names text file for being referred as 'Scandinavians', this seems well inclusive enough of all their area, perhaps it could be the default adjective after the Viking era for them?

And to end this post, the immigration code seems wrong. It seems to prioritize targeting cities that will not have enough food to support the new population, instead of the ones they do. As America, all my immigrants are flocking to the same tundra city and dying off constantly. I think the problem is in UniquePowers.py, selectRandomCityTargetCiv:
Code:
        def selectRandomCityTargetCiv(self, iCiv):
                if (gc.getPlayer(iCiv).isAlive()):
                        cityList = []
                        for pyCity in PyPlayer(iCiv).getCityList():
                                if (pyCity.GetCy()):
                                        [b]if ( pyCity.GetCy().isDisorder() or pyCity.GetCy().foodDifference(False) < 0):
                                                return pyCity.GetCy()[/b]
                                cityList.append(pyCity.GetCy())
                        if (len(cityList)):
                                iCity = gc.getGame().getSorenRandNum(len(cityList), 'random city')
                                return cityList[iCity]
                return False
Doesn't the part in bold mean that if a city in disorder or with a food deficit is found, the function returns it directly and stops making a list with the others?
In RFC RAND I changed to:
Code:
        def selectRandomCityTargetCiv(self, iCiv):
                if (gc.getPlayer(iCiv).isAlive()):
                        cityList = []
                        for pyCity in PyPlayer(iCiv).getCityList():
                                if (pyCity.GetCy()):
                                        [b] if ((not pyCity.GetCy().isDisorder()) and pyCity.GetCy().foodDifference(False) > 0):
                                                cityList.append(pyCity.GetCy())[/b]
                        if (len(cityList)):
                                iCity = gc.getGame().getSorenRandNum(len(cityList), 'random city')
                                return cityList[iCity]
                return False
and it seemed to work fine.
 
Thanks for the spelling corrections, OCD here is very welcome.

I didn't write the target city code (it would look less messy), but I agree with your correction.
 
Another minor bug on victory screen. This happened when i was playing Japan and got 2 UHV goals done. There is also some error (maybe the same maybe different, not sure, don't have it logged or saved) when you won religious victory.

Code:
Traceback (most recent call last):

  File "CvScreensInterface", line 390, in showVictoryScreen

  File "CvVictoryScreen", line 208, in interfaceScreen

  File "CvVictoryScreen", line 1356, in showVictoryConditionScreen

TypeError: getCivilizationShortDescription() takes exactly 1 argument (2 given)
ERR: Python function showVictoryScreen failed, module CvScreensInterface

So, Gauss' name was corrected in the latest commit... now it's 'Carl Friedrich Gauá' :cry:
I see the names of the GP were placed directly in their names list instead of using a text file, and I guess the name you were going for was 'Gauß' , so it should be 'Carl Friedrich Gau# & 223;' without spaces (automatic parser...)
EDIT: while I'm at it, may I suggest changes to Spanish GP names to conform to our orthography and my OCD? (I don't really have OCD, I'm just a PITA)
Prophets: Juan de Sep#& 250;lveda, Francisco Su# & 225;rez, Bartolom# & 233; de las Casas, Jun# & 237;pero Serra
Artists: Velazquez is better known as Diego Vel# & 225;zquez
Scientists: Gherard de Cremona --> Gerardo de Cremona
Merchants: Fernando Magallanes --> Fernando de Magallanes, though his Portuguese name is Fern# & 227;o de Magalh# & 227;es. Also, Cristoforo Colombo is his real name since he was most likely Genovesi, though at school all kids learn about Crist# & 243;bal Col# & 243;n
Engineers: Alberto Palacio --> Alberto de Palacio y Elissague
Generals: Hernando Cortes --> Hern# & 225;n Cort# & 233;s, Alvaro de Bazan --> # & 193;lvaro de Baz# & 225;n BUT WAIT THERE'S MORE Ambrosio Sp& # 237;nola Doria, though you could keep the Genovesi name Ambrogio Spinola Doria

More with names... after the Prussian spawn, I noticed that Germany is being referred to as 'Austria' in all instances where it should read as 'Austrian', as if the name was used instead of the adjective. In that line, Vikings keep being named such even though their capital is Stockholm in my latest game. I see there's some names in their dynamic names text file for being referred as 'Scandinavians', this seems well inclusive enough of all their area, perhaps it could be the default adjective after the Viking era for them?

And to end this post, the immigration code seems wrong. It seems to prioritize targeting cities that will not have enough food to support the new population, instead of the ones they do. As America, all my immigrants are flocking to the same tundra city and dying off constantly. I think the problem is in UniquePowers.py, selectRandomCityTargetCiv:
Code:
        def selectRandomCityTargetCiv(self, iCiv):
                if (gc.getPlayer(iCiv).isAlive()):
                        cityList = []
                        for pyCity in PyPlayer(iCiv).getCityList():
                                if (pyCity.GetCy()):
                                        [b]if ( pyCity.GetCy().isDisorder() or pyCity.GetCy().foodDifference(False) < 0):
                                                return pyCity.GetCy()[/b]
                                cityList.append(pyCity.GetCy())
                        if (len(cityList)):
                                iCity = gc.getGame().getSorenRandNum(len(cityList), 'random city')
                                return cityList[iCity]
                return False
Doesn't the part in bold mean that if a city in disorder or with a food deficit is found, the function returns it directly and stops making a list with the others?
In RFC RAND I changed to:
Code:
        def selectRandomCityTargetCiv(self, iCiv):
                if (gc.getPlayer(iCiv).isAlive()):
                        cityList = []
                        for pyCity in PyPlayer(iCiv).getCityList():
                                if (pyCity.GetCy()):
                                        [b] if ((not pyCity.GetCy().isDisorder()) and pyCity.GetCy().foodDifference(False) > 0):
                                                cityList.append(pyCity.GetCy())[/b]
                        if (len(cityList)):
                                iCity = gc.getGame().getSorenRandNum(len(cityList), 'random city')
                                return cityList[iCity]
                return False
and it seemed to work fine.
Dealt with all of these.
 
Arabia is too strong in the game. I tried crusades, but even without Jerusalem and Mecca Arabians are still strong and tech leaders! They control Egyptian and Mesopotamian flood plains, so losing the two most commercious cities of the world does nothing against them. Moreover, their core area includes Egypt and Mesopotamia making them immortal. Is that intentional?
 
Top Bottom