Bug Reporting

Just upgraded to BUG 2.20, now started getting a python error occasionally:

Code:
Traceback (most recent call last):

  File "CvEventInterface", line 30, in onEvent

  File "CvCustomEventManager", line 124, in handleEvent

  File "CvCustomEventManager", line 135, in _handleDefaultEvent

  File "Civ4lerts", line 185, in onCityLost

  File "Civ4lerts", line 217, in _discardCity

  File "Civ4lerts", line 401, in discardCity

AttributeError: 'dict' object has no attribute 'discard'
ERR: Python function onEvent failed, module CvEventInterface

Save attached - just press enter and wait for error to pop up (or if you've disabled python error popups, read the log when the turn has been generated).
 

Attachments

I've noticed 35 people have downloaded the 2.20 package. Is anyone else having these problems? Anyway, I think EF is having video card issues, so won't be able to look at this until he gets that resolved.
 
@alerum:

No, didn't occur to me yet. Yet one thing I noticed - which was the reason for upgrading - that my BUG mod 2.11 was completely weird from one day to the other. I couldn't change anything at all and all the values were different. I think playing savegames from SGs where a different version is used might screw up the install (though I cant't figure out why and how)... Also the 2.20 version identifies itself as 2.11 on the info screen.

Imhotep
 
Imhotep, are you by chance keeping your Bug Mod.ini from install to install, and merging them together? Also, have you tried loading it with a new game to see if you get the same results?

I'm pretty sure I updated the version number in the file to 2.20... let me check now.... oops, I guess I didn't update it.:( Got so carried away with updating the documents that it got mixed up in the shuffle. I'm working on a new help file and so the version number is giong to have to remain until I put out 2.21 with the new help file.... Anyway, I downloaded your save now, and will be doing the testing tonight, and see if I can reproduce it.
 
Just upgraded to BUG 2.20, now started getting a python error occasionally:

Code:
Traceback (most recent call last):

  File "CvEventInterface", line 30, in onEvent

  File "CvCustomEventManager", line 124, in handleEvent

  File "CvCustomEventManager", line 135, in _handleDefaultEvent

  File "Civ4lerts", line 185, in onCityLost

  File "Civ4lerts", line 217, in _discardCity

  File "Civ4lerts", line 401, in discardCity

AttributeError: 'dict' object has no attribute 'discard'
ERR: Python function onEvent failed, module CvEventInterface

Save attached - just press enter and wait for error to pop up (or if you've disabled python error popups, read the log when the turn has been generated).

I got the same python exception. I modified the code in Civ4lert.py line 401 from:

Code:
self.populations.discard(city.getID())

to:

Code:
                cityID = city.getID()
		if ( cityID in self.populations):
			del self.populations[cityID]

This kept the error message from reappearing.
P.S. I had to check first if the cityID is present in dictionary as otherwise I get an exception if it is not found.
 
Bug Report: Espionage screen shown when you turn OFF the BUG version is wrong. It hasn't been updated for 3.13. See here for details.
 
FWIW this is not a bug of BUG, the issue will persist without BUG installed.

I have this issue of trade route numbers showing up as 1247.... as well. I did NOT have the issue prior to BUG so I am sure it is BUG related. Not game breaking but I hope it can be fixed.

I'm thinking of removing the total modifier (the value in []s) from the screen as it's a) misleading and b) meaningless. A +4 means nothing and cannot be compared to any other AIs number. In fact, it doesn't even compare to the number from the same AI later in the game.

In its place, I could add some new icons:

  • Will stop trading
  • Will DoW
  • Will sign peace
  • Would sign peace if other AI would ("Talk to them")
Are there any other checks to perform between pairs of civs?

Could you add a "Worst enemy" indicator? Right now the only way to find out if a civ is a civ's worst enemy is to open up the diplomatic screen and hope that the "We encourage you to beware of our worst enemy, <name> !!" comes up. Sometimes I end up clicking their name 10 times just to see this and it gets old really fast. It would be great to have an icon in the glance screen for worst enemy. One cannot tell it directly from the glance screen since the values aren't the "real" values, i.e. one civ might have -4 to one AI and -6 to the other but the 1st one is their worst enemy.

P.S. I already put this in as a request in the sourceforge feature requests page a few weeks ago
 
I have this issue of trade route numbers showing up as 1247.... as well. I did NOT have the issue prior to BUG so I am sure it is BUG related.

Sorry, but it is not BUG-related. It happens in the normal game as well. Firaxis broke this in the DLL with BtS 3.13.

If I figure out a way to determine a Civ's worst enemy, I will definitely consider adding it to the Glance tab. Thanks for putting it into SF.net.
 
If I figure out a way to determine a Civ's worst enemy, I will definitely consider adding it to the Glance tab. Thanks for putting it into SF.net.

Not sure if this helps but here's an example to how the AI_getWorstEnemy() function is used to call up the worst enemy in the diplomacy screen:

Spoiler :
Code:
DiploCommentTypes CvPlayerAI::AI_getGreeting(PlayerTypes ePlayer)
{
	TeamTypes eWorstEnemy;

	if (GET_PLAYER(ePlayer).getTeam() != getTeam())
	{
		eWorstEnemy = GET_TEAM(getTeam()).AI_getWorstEnemy();

		if ((eWorstEnemy != NO_TEAM) && (eWorstEnemy != GET_PLAYER(ePlayer).getTeam()) && GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isHasMet(eWorstEnemy) && (GC.getASyncRand().get(4) == 0))
		{
			if (GET_PLAYER(ePlayer).AI_hasTradedWithTeam(eWorstEnemy) && !atWar(GET_PLAYER(ePlayer).getTeam(), eWorstEnemy))
			{
				return (DiploCommentTypes)GC.getInfoTypeForString("AI_DIPLOCOMMENT_WORST_ENEMY_TRADING");
			}
			else
			{
				return (DiploCommentTypes)GC.getInfoTypeForString("AI_DIPLOCOMMENT_WORST_ENEMY");
			}
		}
		else if ((getNumNukeUnits() > 0) && (GC.getASyncRand().get(4) == 0))
		{
			return (DiploCommentTypes)GC.getInfoTypeForString("AI_DIPLOCOMMENT_NUKES");
		}
		else if ((GET_PLAYER(ePlayer).getPower() < getPower()) && AI_getAttitude(ePlayer) < ATTITUDE_PLEASED && (GC.getASyncRand().get(4) == 0))
		{
			return (DiploCommentTypes)GC.getInfoTypeForString("AI_DIPLOCOMMENT_UNIT_BRAG");
		}
	}

	return (DiploCommentTypes)GC.getInfoTypeForString("AI_DIPLOCOMMENT_GREETINGS");
}

Here's another partial example: (from the DenialTypes CvPlayerAI::AI_bonusTrade function)

Spoiler :
Code:
	if (GET_TEAM(getTeam()).AI_getWorstEnemy() == GET_PLAYER(ePlayer).getTeam())
	{
		return DENIAL_WORST_ENEMY;
 
AFAIK AI_getWorstEnemy() is not exported to Python. It is available only from within the C++ DLL. It wouldn't be hard to export it, but that would put this feature on the list of DLL-only features.
 
It works simply because it checks that the city exists in the population before deleting it. The actual question is rather why is it being removed if it's never been there - this fixes the symptom but not the cause.
 
I checked the code that adds cities IDs to the dictionary and I didn't see anything wrong with it. AFAIK cities IDs are removed when a city is razed. The function is called from onCityRazed. Now onCityRazed is called for any city that belongs to any player. populations dictionary includes cities that belong only to the human player. It is actually normal that for other cities the IDs are not there. Another way to do it would be to check if the city in question belongs to the human player before attempting to remove it. However the check I made is simpler and adequate as long as any city that belongs to the player get actually added to populations.
 
Thanks for the explanation Kalimakhus. Sounds like it's reasonable to assume that this is the proper place to check whether city is listed before removing.
 
Btw, do you guys know anything about the missing culture points display?
Is it a BTS thing or to do with BUG?

Cheers, PW
 
Bug Report: Espionage screen shown when you turn OFF the BUG version is wrong. It hasn't been updated for 3.13. See here for details.
Fixed in update 556.
 
I saw another bug in BUG last night. There is an alert that says 'the XXX being built in YYY can be hurried with the loss of Z people and the overflow of H hammers' (or similar). Naturally, I rushed to that city and whipped the settler. The message said I would get an overflow of 8 hammers, but next turn, I got an overflow of about 15 to 20 hammers. I'm fairly sure that this is because excess food is turned into hammers then added to the settler / worker. These hammers (food) also flow into the excess.

I'll see if I can post a game illustrating this.
 
Back
Top Bottom