Bug reports and technical issues

The method numberToAlpha in class CvMercenaryManager is not safe. Or more precisely, there is a potential risk in the way you use it.
Code:
def numberToAlpha(self, iNum):
		#             1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26
		alphaList = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
		strNum = str(iNum)
		strAlpha = ""
		
		# Go though the alphaList and convert the numbers to letters
		for i in range (len(strNum)):
			strAlpha = strAlpha + alphaList[int(strNum[i])]
			
		return strAlpha

For example, you do check whether unit.objUnit is None, before you pass its id to numberToAlpha.
Code:
			if(unit.objUnit != None):
				unitID = unitName + "-" + self.numberToAlpha(unit.objUnit.getID())

Unfortunately this check is not enough.
Under some circumstances, Civ4 program can create a CyUnit object. It is valid from perspective of Python, but it does not represent any CvUnit. Namely, from perspective of C++, this object is not NULL, but its member, m_pUnit, is NULL.

Code:
int CyUnit::getID()
{
	return m_pUnit ? m_pUnit->getID() : -1;
}

In this case, unit.objUnit.getID() yields -1. If you pass -1 to numberToAlpha, numberToAlpha will throw an error like "ValueError: invalid literal for int(): -".
Thus, in my opinion, a safer way is:
Code:
			if(unit.objUnit is not None and not unit.objUnit.isNone()):
				unitID = unitName + "-" + self.numberToAlpha(unit.objUnit.getID())
 
The Empire State Building aint working, oh and some merchant slots would be nice (financial centre much)?
 
The Great Sphynx now grants unlimited specialists of any kind, not just artists. Which is quite nice, don't think I'll update when you fix it, but bug now reported :)

No, wait, not only that, you're actually able to hire great people in your city, when you have it :D Not just the regular specialists, but like settled great people.

Also, the bug when building AP is still present; even when choosing no, you convert to orthodox.
Okay, I'll just make the following changes too appealing so you have to update :p

@zahlen: I didn't write the mercenary code and have never touched it, but I can apply your fixes, of course. Thanks!

While we're at it, I've started to move most of the stability code to the DLL, which meant that for the first time I've looked at the entire stability algorithm. There were even some bugs to fix. For example certain civs were further rewarded instead of penalized for quick early growth (this could've even been a disadvantage because it makes later stagnation more likely), also, there was a mistake in the great depression code that didn't make everyone immune against depressions after one was over.
 
I just started a game as China (3000 BC) and everyone but me and Egypt seems to be in the Modern Era already (It's 650 BC, so no, it's not because I'm lagging behind ;)). They don't have any techs of that era that I can see, but they do have the graphics for workers, cities and improvements.
 
Okay, I'll just make the following changes too appealing so you have to update :p
You gotta come up with something VERY good then :D

Re: The orthodox thing, when building AP, how is it supposed to work? I'm fine with having some(/all?) of your cities converting, when you are playing as fx. Greece, but the event popped for me, and I chose no, and even then my state religion changed to orthodox - I assume that is not meant to be the case?
 
You gotta come up with something VERY good then :D

Re: The orthodox thing, when building AP, how is it supposed to work? I'm fine with having some(/all?) of your cities converting, when you are playing as fx. Greece, but the event popped for me, and I chose no, and even then my state religion changed to orthodox - I assume that is not meant to be the case?
No, if you choose yes you're state religion and all Catholic cities are meant to change to Orthodoxy. If you choose no nothing should happen.

why are you moving stability to the DLL? speed?
Yes. The game currently checks the entire map and every player every three turns, and the calculation for every player is quite long, including several loopings through all of his and even other players' cities. I think it's worth moving something that complex and often repeated to the DLL (I'm going to do some tests on this soon).
 
No, if you choose yes you're state religion and all Catholic cities are meant to change to Orthodoxy. If you choose no nothing should happen

Alright, I was just confused by the reply to it earlier. In that case there is/was something wrong with the event.
For the AI, there is certain percentages for the civs like for the protestant-event?
 
No, the Orthodoxy event is completely deterministic. All civs "east" of the civ that founds it automatically convert.
 
No, the Orthodoxy event is completely deterministic. All civs "east" of the civ that founds it automatically convert.

I see. Well, it could be that the problem originated in the fact that I changed civ, so that the game didn't register that I wasn't an AI player? I don't know. But in any case, choosing "No" didn't make a difference. (Playing as Greece)
 
Which is why I wonder.
Rathaus is Prussian's unique right? (cmiiw)

Btw


I also seen text like "France has made peace with !"
Rathaus is Austrian, Assembly Plant is Prussian
 
600 AD Viking with double Vassalage. :)

Spoiler :


Actually Viking starts with Vassalage as society civic (impossible) and Direct Rule as organization civic.

Also notice -1+10+13+10+1 does not equal 37.
 


I was already wondering why I could ask the AIs to make peace with Brennus.
 
The numbers in the categories are not meant to add up to your total stability (however, doing stability in the DLL gives me the opportunity to completely overhaul its display so it makes more sense).

@strijder20: is there a screenshot? I don't see anything.
 
@strijder20: is there a screenshot? I don't see anything.

Yup, there is one, and I can see it. Weird. Anyway, it just shows a Celtic galley 2N 1 E from the English Whale (in an ocean).
 
Playing as India, I vassalized Khmer for the stone, but soon after that I was forced to declare war on Indonesia because Khmer did so. :confused: I mentioned this a while ago in my China game. Also Khmer was not happy because Indonesia was their friend.
Spoiler :
 
Top Bottom