Bug Thread

This is very minor, but I've noticed that the Heroic Epic is listed as a national wonder. I often can't build/see opportunity to build it later in the game, is it only possible to view it if you are centered on a city with a training compound or is the HE actually a world wonder?
 
The national wonders that require a specific building do only show up if that specific building exists. As I recall, they only show up if you have the planet with the required building on it selected as the current build planet. Those that also require some minimum number of other buildings will show up but be grayed-out if your build planet has the specific prereq building but you don't have enough of the other "requires X of them anywhere in your empire" buildings (and if you dont' have enough the mouse-over pop-up help will tell you which building that is and how many you have vs. how many you need).

Heroic Epic => Training Compound
National Epic => University
Institute for Advanced Research => Research Lab (+4 Universities)
Interstellar Exchange => Space Port (+4 Banks)
Industrial Complex => Manufacturing Planet (+4 Factories)
War College => none (just a unit of level 5)
Office of the Ombudsman => Intelligence Center (+4 Interstellar Beacons)

(I think the "4 buildings" also scales with map size. I think it is 4 for Standard and 6 for a Large map.)
 
Hi, I got the following message when a pirate razed a city:

"Error in cityRazed event handler <bound method FinalFrontierEvents.onCityRazed of <FinalFrontierEvents.FinalFrontierEvents instance at 0x257995D0>

There were no problems with gameplay, it went on w/o problems.

Also, as a note: Scouts/Recon ships could maybe get some promotions more suited for scouts (as they can't really use combat promotions, esp. the weak scouts). Such as visibility (already there, but not in first selection), more movement, hiding esp.

Also, there are two seemingly identical promotions of +1 visibility (as I remember they have the same name, text and icon). Do they add up? They should have a different name (like Visibility 1 and Visibility 2).
 
Hi Guys, I have located a couple of bugs as follows.

Defender Withdrawal doesn't seem to be working correctly. As I understand it if the defender withdraws the unit should retreat (move one space) to a free tile. I've seen Defender Withdrawal messages at least 4 times whilst play testing but the unit stays in the same tile.

If a city has 3 planets in it's first ring able to support 2 population each (for example) If the city grows to size seven the city window doesn't show that there is an 'idle' or 'unassigned' population point it still shows the 6 population that is working. If the city radius expands the invisible 'unassigned' population point automatically appears on any available planet in the new city radius. This screen shot shows the Sol system with a population of 30, 28 are assigned to planets but the last 2 population points are not showing. I only remembered to do a screen shot of this late on.View attachment 300844

World Builder seems to still have the same problem as before when adding in resources.

View attachment 300847

The last problem is linked to the double click on an un-inhabited system. You get a pop up exception, once for each planet in the system. These clear off but it happens every time. I know this was fixed in the non-BUG version and before you tell me it was something I must have done when merging B5 with FF+BUG all I have done is merge the xml files.
 
Defender Withdrawal doesn't seem to be working correctly. As I understand it if the defender withdraws the unit should retreat (move one space) to a free tile. I've seen Defender Withdrawal messages at least 4 times whilst play testing but the unit stays in the same tile.

There are 2 different types of defensive withdrawal implemented in various Civ mods. One has the unit move away. This is evidently not that one. In FFP, from having had it happen to me (mostly as the attacker) I can tell you when the defensive withdrawal happens the defender stays put and it picks a new defender (they withdraw behind the new defender, not out of the plot entirely). If there is no other unit on the plot, then the original unit is stuck being the defender again and so it is most likely going to die. What I don't know is if the second combat is a full combat with first strikes again and everything or if it just dives right in without first strikes being checked for.

I have lost some pretty good ships this way. I seem to recall losing a delta battleship to a stack with two battleships a cruiser and some other stuff. My delta BB attacks and the first defending BB withdraws (the AI loves those 3 stealth promotions for +15% withdraw and +1 first strike chance each). The second defending BB then also withdraws. Unfortunately for me, between the two of them they did enough damage that the third defender, a cruiser, is strong enough to destroy my delta battleship. When using equal generation ships it is even worse - the odds of a battleship being able to defeat two battleships without healing between is somewhat slim even if it has an extra promotion or two. I'm thinking that perhaps the attacker should have a chance of not pressing the attack if the new defender would be stronger then they are now (I don't see why a damaged ship would always blindly pursue a fleeing ship into the sights of some other ship), something like a 50% chance of calling off the pursuit if the odds of defeating the new defender are 50% or less (or maybe set to 100% - odds, so if they would have a 60% chance of winning there would be a 40% chance to not continue the fight or a 90% chance to not continue if their odds are only 10%). But I digress.

If a city has 3 planets in it's first ring able to support 2 population each (for example) If the city grows to size seven the city window doesn't show that there is an 'idle' or 'unassigned' population point it still shows the 6 population that is working. If the city radius expands the invisible 'unassigned' population point automatically appears on any available planet in the new city radius. This screen shot shows the Sol system with a population of 30, 28 are assigned to planets but the last 2 population points are not showing. I only remembered to do a screen shot of this late on.View attachment 300844

Note that the unassigned population says "0/28". The number after the slash is the total supportable population. There is no unassigned population because there is nothing to assign them to. It might be possible to squeeze in another note somewhere when there is excess population. The only relevant place that really has enough room is up in the title bar. Perhaps if there are unassignable population points it could say something like "Sol: 30 (2 excess)" (or perhaps use a symbol, or say "2 over limit" or something else along those lines).

Note that should specialists ever manage to make it back in, this would no longer be an issue.

World Builder seems to still have the same problem as before when adding in resources.

View attachment 300847

I cant' say I've ever really tried to use the Worldbuilder for making a map. I've only used to to examine what's going on and move or remove a black hole when they had the "too close to the edge" problem. TC01 will probably have to help you out with this one. Unless, maybe, you have a bad CvWorldBuilderScreen.py file. The code right before the line specified should currently read:
Code:
#			FinalFrontier = CvEventInterface.getEventManager() #FFPBUG
			pSystem = getSystemAt(self.m_pCurrentPlot.getX(), self.m_pCurrentPlot.getY()) #FFPBUG
Note that the first of thsoe two lines is commended out and the second does not have a "FinalFrontier." prefix for the getSystemAt function.

The last problem is linked to the double click on an un-inhabited system. You get a pop up exception, once for each planet in the system. These clear off but it happens every time. I know this was fixed in the non-BUG version and before you tell me it was something I must have done when merging B5 with FF+BUG all I have done is merge the xml files.

Well, I'll say it anyway: it's something you did. Well, I can't be 100% certain, but plain old un-B5-merged FFP version 7.12 does not have this problem for me.

What is the error message? It should be recorded in PythonErr.log (until the next time you run the game, anyway).
 
In fixing an error in my post above, I looked at the CvWorldBuilderScreen.py file again and noticed a bug.

It looks like the code to check to see if there is a star system on the plot where the resource is being placed is missing, so it always tries to add the resource to a planet. It should only do that if the plot has a star system. Currently it should only work correctly if you are adding a resource to a star system.

Current lines 884-892:
Code:
#Added in Final Frontier Worldbuilder: TC01
#			FinalFrontier = CvEventInterface.getEventManager() #FFPBUG
			pSystem = getSystemAt(self.m_pCurrentPlot.getX(), self.m_pCurrentPlot.getY()) #FFPBUG
			for iPlanet in range(pSystem.getNumPlanets()):
				pPlanet = pSystem.getPlanetByIndex(iPlanet)
				pPlanet.setBonusType(-1)
			pBuildingPlanet = pSystem.getPlanet(pSystem.getBuildingPlanetRing())
			pBuildingPlanet.setBonusType(iBonusType)
#End of Final Frontier Worldbuilder

How to fix:
Code:
#Added in Final Frontier Worldbuilder: TC01
			if self.m_pCurrentPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_SOLAR_SYSTEM'):
				pSystem = getSystemAt(self.m_pCurrentPlot.getX(), self.m_pCurrentPlot.getY()) #FFPBUG
				for iPlanet in range(pSystem.getNumPlanets()):
					pPlanet = pSystem.getPlanetByIndex(iPlanet)
					pPlanet.setBonusType(-1)
				pBuildingPlanet = pSystem.getPlanet(pSystem.getBuildingPlanetRing())
				pBuildingPlanet.setBonusType(iBonusType)
#End of Final Frontier Worldbuilder

I removed the commented out definition of FinalFrontier and put the whole thing in an "if" so it will only do this part if you are adding the resource to a star system. It is already added to the plot in the code right before this.

(Untested, but the "if" statement was copied from another line in the file that should be working, and is used in multiple places already, and the rest is just bumping up the indentation level, so it should work.)
 
Is there any way we can change the defender withdrawal to the one where the unit retreats a tile?

Thank you for clarifying the population problem for me, I misread what I was looking at. :blush:

Thanks for finding the WorldBuilder problem!

I'll check the merge again but I'm positive the only stuff I merged was xml files.
 
Is there any way we can change the defender withdrawal to the one where the unit retreats a tile?

Initially, that is what I had expected to see happen. Now I'm not sure that that version actually makes any sense. Why would a ship not just run away over behind the battleship that is nearby and instead run away for a light year (or whatever a plot represents)? Normally, until pretty late in the game, it takes a ship somewhere between half a month and a month to go that far (depending on if it is speed 2 or speed 1), but now that it has had some big holes put in its hull and vital components it's suddenly faster (it gets shot at and runs away but then moves back, or elsewhere, getting double the movement rate, if it was a speed 1 ship, in the same month that it takes probably over 80% damage). I don't think getting all shot up is going to make your ship any faster - probably the opposite. Also, if you can move to the adjacent plot, why can't I follow you? Surely you nearly destroyed ship isn't any faster than my probably not quite as damaged ship. In this version the answer is that you can't follow because another ship gets in the way and starts shooting at you. If there is no other ship then you do follow and shoot at it some more.

[QUOTEThank you for clarifying the population problem for me, I misread what I was looking at. :blush:[/QUOTE]

I'm not sure that you did. The number after the slash is the total population it can assign. Normally this is the total population, but it just won't go over the maximum amount that can be working on the planets in the current influence range.
 
I can't remember if this was discussed before or not, but neither the Nanotech Hospital nor the Extended Habitation System are increasing in cost like the other buildings.
 
I can't remember if this was discussed before or not, but neither the Nanotech Hospital nor the Extended Habitation System are increasing in cost like the other buildings.

Good catch. Both are missing the "<iCostModIncrease>2</iCostModIncrease>" line (I'm assuming it will be set to 2 for both) in their entries in CIV4BuildingInfos.xml. No wonder the AI spams out so many N. Hospitals once it can build them.

I think it may have been mentioned for the Nanotech Hospital (maybe both) at some point quite a while ago, but if so we apparently never fixed it or checked for others.
 
The 'Info' tab in the foreign adviser screen is very screwed up for me. Information for a single one of my rivals fills the entire pane (or myself and a rival if I enable detailed info from the BUG options), and it becomes impossible to switch to any of the other foreign adviser tabs. Unless there is some hotkey that I don't know about to do so.
 
The Info screen issue is a bug caused by the new multiple favorite civics having a bug or two in the Python related to it - on that Info screen when showing the first player it hits the code to show the favorite civic at the end of the line and crashes the screen code so nothing else on it, like the exit button, gets put on it.

I suspect that a 1.73 patch release is not too far away. There have a few bug fixes (including fixing that one, and a bug when razing a city), the multiple production feature has been finished (it is not working in 1.72), and the Python AI code has been tweaked some. That's probably about enough for a 1.73 release.
 
Ah, you said that before and I completely forgot about it. That would be the problem with my on again, off again playtesting. :crazyeye:
 
Sorry, new computer, new to Windows 7, have only ever played vanilla Final Frontier before this.

I'm sure this must be something really obvious, but I can't figure it out, nor have I found similar error messages reported in a cursory survey of this forum.

Spoiler :
Traceback (most recent call last):
File "BugGameUtils", line 342, in callHandler
File "CvGameUtils", line 359, in calculateScore
AttributeError: BugEventManager instance has no attribute 'iMaxPopulation'
Traceback (most recent call last):
File "BugConfig", line 110, in unknown_endtag
File "BugConfig", line 334, in endChild
File "BugConfig", line 337, in end
File "BugConfig", line 318, in process
File "BugConfig", line 547, in handle
File "BugUtil", line 651, in callFunction
File "autologEventManager", line 82, in __init__
File "autolog", line 30, in __init__
File "autolog", line 47, in setLogFilePath
File "BugPath", line 305, in findOrMakeDir
File "BugPath", line 295, in makeDir
File "e:/main/civilization4/warlords/assets/python/system\os.py", line 159, in makedirs
OSError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Firaxis Games\\Sid Meier's Civilization 4\\Beyond the Sword\\Mods\\Final Frontier Plus\\Autolog"
Traceback (most recent call last):
File "BugConfig", line 110, in unknown_endtag
File "BugConfig", line 334, in endChild
File "BugConfig", line 337, in end
File "BugConfig", line 318, in process
File "BugConfig", line 547, in handle
File "BugUtil", line 651, in callFunction
File "ReminderEventManager", line 60, in __init__
File "autolog", line 30, in __init__
File "autolog", line 47, in setLogFilePath
File "BugPath", line 305, in findOrMakeDir
File "BugPath", line 295, in makeDir
File "e:/main/civilization4/warlords/assets/python/system\os.py", line 159, in makedirs
OSError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Firaxis Games\\Sid Meier's Civilization 4\\Beyond the Sword\\Mods\\Final Frontier Plus\\Autolog"
Traceback (most recent call last):
File "BugOptions", line 314, in write
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Firaxis Games\\Sid Meier's Civilization 4\\Beyond the Sword\\Mods\\Final Frontier Plus\\UserSettings\\FFP.ini"


Is this something to do with file locations in Windows 7? Or permissions? Whatever the cause, how would I fix it?

*cringes and waits for the flames*
 
Well, FF+ doesn't have any sort of nuclear meltdown from a building so it isn't an issue for it as far as that goes.

I am guessing that you are using the standard iNukeExplosionRand setting in the CIV4BuildingInfos.xml, just like the nuclear powr plant in BtS, which does some meltdown specific stuff and then runs the code in the DLL that is the same as dropping a nuke on the city.

Looking at it, I'm pretty sure that nuking a city, whether for meltdown or weapon, is not actually working correctly in FF+. Some work had been put into this, but it appears that it didn't fix most of the problem (just the specific issue of nuking a capitol building). I had thought this was fixed for the nuclear weapons in FF+, but apparently not.

The issue:

The DLL goes through and removes buildings based on a random chance (and it knows nothing of planets, so it is just randomly wiping them out city-wide) - if a building of a type exists in the city it checks the random chance for it and if it is in the probability it removes one of that type. It also wipes out every building of the type that had the meltdown. The Python onNukeExplosion event handler is then called. That does it's own thing - wiping out the planet and such. Between the two of them, there is an almost certain mismatch in buildings in the city that will result unless it has never had any built anywhere but on the one "best planet" (or there is an incredibly amount of luck).

Solutions parts:

1) There is a relatively easy immediate fix: go through the CIV4BuildingInfos.xml and set every building type to be immune to nukes via "<bNukeImmune>1</bNukeImmune>". That will prevent the DLL from removing any buildings. The Python onNukeExplosion event handler will still wipe out the best planet in the system and remove all of it's buildings (it ignores the nuke immune setting). Note that there is no way to know which specific planet the building was on - the meltdown may be happening on some completely different planet than the one that is wiped out. So this would actually fix the problem for nuclear weapons, but only improve the situation for meltdowns such that it wouldn't cause a building list mismatch between the DLL and Python but would tend to wipe out the wrong planet. The one thing this won't fix is the wiping out of all buildings of the type that did the meltdown. To deal with that you could add a check in the building type loop to see if the type is meltdown enabled and if so check the city's count of them and if it is 0 then loop over all planets and set them all to 0 too - or you can do this part via solution 2.

2) A possible complete fix for the meltdown would be to enable the doMeltdown callback in FinalFrontierGameUtils.py and handle the entire thing in there. If that callback returns True then the DLL's meltdown code is not run. Note that this would get run for every city the player owns every turn, for each player. In it you'd have to manually check for buildings that have a meltdown chance and then check to see if they do so, but you could do it per planet so you'd know where the meltdown really happened. If one does happen you'd apply the effect by essentially duplicating the onNukeExplosion function's activities but pointed at the correct planet instead of using the "best planet", and then report it to the player. You'd also still need to do the unit damage and radiation cloud creation chances in there too, to get the full effect. This would also allow for removing only the one specific building that did had the meltdown, instead of every building of that type.

A complete fix for both the weapons and the meltdowns would be to do both options 1 and 2.

At this point I see no really good option for fixing it in the DLL, but it could be done. The building mis-match could be dealth with by removing all building destruction code from the CvPlot::nukeExplosion code (or commenting out, anyway - should planets ever get moved into the DLL you;d want to do this stuff here again) and relying on the Python onNukeExplosion for that part, which is OK for the nuclear weapon side but still not so good for a meltdown since that should target a specific planet with a meltdown enabled building rather than the calculated best planet. The closest I can think of would be to pass an additional optional parameter around that specifies a building type, set in the CvCity::doMeltdown code when calling CvPlot::nukeExplosion. The onNukeExplosion event handler could check for that argument and pick a planet with a that type of building on it if it is set to something other than -1 instead of going for the best planet in that case.

By the way, as it currently stands, building more than one building of the same type that has a meltdown chance on different planets does not change the chance of a meltdown since it is checked once per building type with no consideration of how many of the building there are. So once you build that first one, you may as well build one on every planet you can (if it is not a one per system type building, of course).

I will see about implementing a full solution for this later today, combining both parts 1 and 2 above. You'll still need to set all buildings to "nuke immune" in the XML - rather annoying but necessary to prevent the DLL for doing any building removals that the Python building lists don't duplicate.

Sometime soon we'll be doing a 1.73 patch (I'll be assembling the set of changed files for it sometime soon), which should include this but I'll also post it separately when it is done. Final Frontier Plus will have the doMeltdown callback code present but with the callback disabled (for speed purposes) since it currently has no buildings that can have a meltdown.
 
OK, I tried to post this last night but sadly the nightly downtime had started and the site was still unavailable half an hour later so I went to bed. Anyhow, it worked out for the best, because I improved the fix...

First, the fix for the meltdown. There are 3 steps.

This is code to replace the existing doMeltdown function in the game utils Python. That would be FinalFrontierGameUtils.py in FFP version 1.7 or later (the post BUGification versions) or CvGameUtils.py in earlier versions (which would include the Star Trek mods). The new function completely replaces what the DLL does for a meltdown so the DLL's code is not run (including running the CvPlut::nukeExplosion - that doesn't happen anymore). It is, in essence, a copy of everything the DLL did, including checking the random chance for each building type that can have a meltdown, but focused on the specific planet that has the building that is having the meltdown. It does deal with the issue of a meltdown on the planet where the Capitol building is located. The code should be explained well enough that modifications should be easy to make, if any are desired.

At some point, I'm not sure exactly when, FFP added a flag to control whether or not the doMeltdown callback was active. Before that it was always active.

So, the instructions to fix the meltdown:

1) Check PythonCallbackDefines.xml for USE_DO_MELTDOWN_CALLBACK. If it exists then set it to 1 to enable it. If it does not exist then it is always enabled so you don't have to do anything in this file.

2) Replace the doMeltdown function with this code:

EDIT: bad code removed

3) Sadly, you now need to go through every building in CIV4BuildingInfos.xml and decide if the building should survive the meltdown. No building that is actually on the planet should do so. In particular, the Capitol should be set to not be immune (in FFP it was set to be immune) so that the "what do we do with the Capitol" code gets run. The only buildings that should definitely survive in regular FFP are: capital shipyard, squadron factory, squadron defense network (already set), and star fortress (and UB star citadel version). You could also set things that would be in orbit to be nuke immune, like the stardock and spaceport. The moonbase could also be set to be immune, but currently doing so would currently have no effect since the planet's disabled setting is being checked first in the planet population limit check and it directly sets it to 0, so the CvSolarSystem.py's CvPlanet.getPopulationLimit function would need to be modified to get that to work, which I didn't do. Of course, the easiest solution for this is to just set them all to 0, so nothing is immune, but it doesn't make much sense, logically speaking, for those "buildings" that are not actually on the planet.

That should fix it. I tested it by setting the nutrition facility to have a 50% chance of melting down each turn, so in the first few turns of a game every civ got its starting planet wiped out. This correctly destroyed all the buildings on the planet and moved the Capitol to a different planet in the system, disabled the planet (changing it to the star graphic and setting its max population to 0), and spread a few plots of radiation cloud around the system's plot. It was wonderfully, gruesomely, horrible.

-----

Second, the other related issue: nuclear weapons that have the same effect, but always targeted at the best planet.

There are three steps to fixing this.

1) Add an entry in GlobalDefinesAlt.xml with a DefineName of NUKE_BUILDING_DESTRUCTION_PROB and an iDefineIntVal of 0, like so:
Code:
	<Define>
		<DefineName>NUKE_BUILDING_DESTRUCTION_PROB</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>

2) Change one line of code in FinalFrontierEvents.py (current version) or CvFinalFrontierEvents.py (previous versions).

In the onNukeExplosion function, about 14 lines in, the line that looked like this:

EDIT: code removed, the entire function has a replacement given a few posts after this.

3) Go through CIV4BuildingInfos.xml and adjust building's bNukeImmune setting as per step 3 of the meltdown fix. If you already did this for the meltdown fix, you don't need to do this step since it is identical.

And there you have it. With any luck, this will fix the thing completely so it won't have to be revisited later. That said, in the DLL the the CvPlot::nukeEffect code could have it's building removal check commented out (to be reinstated only if planets make it into the DLL at some point, at which time it can be fixed to work correctly).
 
Unfortunately there is a small bug in that code in that last post...
It won't crash, as far as I know, but it won't fix the "cant build buildings anymore" problem under some circumstances.

It is in the part that deals with moving a capitol when there are no other star systems owned by this player. It is a bit of a logic issue that would result in the Capitol being removed from the planet being nuked but not added to any other planet if the current build planet is not the planet where it is located. This part of the code was a duplicate (aside from a variable name or two) of the already existing code used by the onNukeExplosion code, so the bug exists there too (and has ever since that fix for the even worse bug was done). I obviously left of an "else" condition from what I did then. I have fixed it in a different way now.

There is also a slight logic issue in the entire Capitol thing about what happens if there is no other place to move the Capitol.

All of these issues have (hopefully, again) been fixed in these versions of the code.

There is also an issue that I forgot about for the last fix relating to a difference between how the post-BUG version finds the FFP event manager module's functions and how the earlier versions do it. This involves changing one line of code in the doMeltdown function. So the previously posted version would not have worked all the way through in earlier versions of the thing (or mods based on them, like Star Trek).

So this is a new version of the doMeltdown code fix.
Important Note: To make the Star Trek update easier, this is the "old" (pre-BUG) version that should be compatible with it. (They found it, so I made it compatible for them.) The info on the one line difference is after the code.

EDIT: bad code removed

The current FFP version would have one line different. Instead of "FinalFrontier = CvEventInterface.getEventManager()" it would use "FinalFrontier = CvEventInterface.getEventManager().FinalFrontier". That allows it to retrieve the correct data from the BUG event manager (which was obviously not being used in the pre-BUG version).

And here is a fixed version of the onNukeExplosion function from the event manager (CvFinalFrontierEvents.py for the old, FinalFrontierEvents.py for the new - no code differences):

EDIT: a new version of this function has been posted below.

I'd have posted the files as attachments if it wasn't for the different version issue - the post-BUG versions of these files are not suitable for use with the earlier version that the Star Trek suite of mods use.

Note: these files are being committed to the Final Frontier Plus project over at Sourceforge (in the current version variety, of course).
 
Thank you, Kiwitt. It took me a while to find the time to follow your instructions, but the game seems to be working perfectly now.
 
Back
Top Bottom