1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Bug Thread

Discussion in 'Civ4 - Final Frontier Plus' started by TC01, May 26, 2010.

  1. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    It looks like the theme files have to be there; I tried moving the Resource folder into Art\ and I changed the path to point to Art\Resource\Civ4.thm, but I got GFC errors. Is this the case?

    I really hate to have to hard-code the mod name like this... but there doesn't appear to be any other solution.
     
  2. ctrlkhan

    ctrlkhan Chieftain

    Joined:
    Feb 8, 2009
    Messages:
    6
    I have the same problem.
    http://forums.civfanatics.com/showpost.php?p=9503474&postcount=380

    My OS is Win2003, Civ 4 is from retail.

    I made those changes mentioned above, Final Frontier Plus now starts. :goodjob:

    Only now the selection screens for Map, Universe Size&Climate, Civilization,
    difficulty is screwed up. I attached screenshots of that.
    Also it very hard to see the in-/decrease button for research, it that by design ;) ?


    FYI, Icon from Desktop Shortcut is set to F:\Civilization 4 Mods\Final Frontier Modding\Final Frontier Plus\Final Frontier.ico
     

    Attached Files:

  3. Moshe Dayan

    Moshe Dayan Da General

    Joined:
    Apr 9, 2010
    Messages:
    310
    Location:
    Occupying the Sinai
    Changing it to "Final Frontier Plus" didnt do anything, nor did copying the thm file. Also I'm getting the same error in "ExtremeMod2", but all of my other mods work fine :confused:
     
  4. deanej

    deanej Deity

    Joined:
    Apr 8, 2006
    Messages:
    4,859
    Location:
    New York State
    Are you sure the mods are in the right place? Themes are NOT loaded from the My Games folder. If Afterworld, Gods of Old, etc. are not in the same folder as Final Frontier Plus, you put it in the wrong place.
     
  5. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    He said on page 3 that he had a Steam install and the mod was installed to the mods folder under the Steam installation path.

    By "changing it to Final Frontier Plus", you mean that XML entry now looks like this:

    Code:
    		<MiscArtInfo>
    			<Type>DEFAULT_THEME_NAME</Type>
    			<Path>Mods/Final Frontier Plus/Resource/Civ4.thm</Path>
    			<fScale>0.0</fScale>
    			<NIF>None</NIF>
    			<KFM>None</KFM>
    		</MiscArtInfo>
    Hmm... in that case, try removing the "Mods/Final Frontier Plus" bit from the front and see if it works. It should run using the default Civ 4 theme, rather than the custom FF one. (That's what it did when I was trying to get it to be pathname independent).
     
  6. Moshe Dayan

    Moshe Dayan Da General

    Joined:
    Apr 9, 2010
    Messages:
    310
    Location:
    Occupying the Sinai
    Sooo I changed the code to:

    Code:
    <MiscArtInfo>
    			<Type>DEFAULT_THEME_NAME</Type>
    			<Path>Resource/Civ4.thm</Path>
    			<fScale>0.0</fScale>
    			<NIF>None</NIF>
    			<KFM>None</KFM>
    		</MiscArtInfo>
    and it worked! Thanks dude! :goodjob:
     
  7. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Uh -oh.

    Another problem or two. The Civ4.thm file in the Final Frontier Plus/Resource folder looks like this:
    Code:
    // *** Control Bitmap Theme file
    
    // Set the resource 
    resource_path	"Mods/Final Frontier/Resource";
    
    // Setup common properties
    include			"Mods/Final Frontier/Resource/Themes/Civ4/Civ4Theme.thm";
    Fortunately the files that are loaded from that (all of the .thm files in Mods/Final Frontier/Resource/Themes/Civ4) do not include any path information - presumably they use the defined resource_path or just use the same folder the parent file is in. Therefore, changing these two instances of "Final Frontier" to "Final Frontier Plus" (in addition to the path to this file in the MiscArtInfo) should hopefully help.
     
  8. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    I didn't realize the *.thm file was raw text...

    I tested the fix by renaming the Final Frontier folder before running Final Frontier Plus, and things worked. So with that fixed, I'll now put out patch 1.64. Thanks God-Emperor!
     
  9. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Another bug...

    The "start with 10x the starting money" that the Paradise trait has is not working. They start with the same money as everyone: 10 credits. They do have the new iStartingGoldMultiplier set to 10 in the TraitInfo.
     
  10. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    You had to find that just as I was posting a patch. :lol:

    I found it, though. It's still being set manually via Python to 10 in onGameStart. That means it's just getting overridden (starting gold is calculated way before onGameStart is called). Should be as simple as commenting out the red line:

    Code:
    				# Set up Player stuff: Star Systems & Gold		
    				self.doBeginTurnAI(iPlayerLoop, false)
    				
    				[COLOR="Red"]pPlayer.setGold(10)[/COLOR]
    					
    				#Final Frontier AI: TC01, thanks to deanej and T-Hawk
    				if not pPlayer.isHuman():
    					AI.doCityAIUpdate(pPlayer.getCapitalCity())
     
  11. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Yeah - I didn't realize you had just posted the patch a couple of minutes before I posted until afterwards.

    That almost fixes it, except that they are actually starting with 11 times instead of 10 (110 credits instead of 100). After a quick glance at the SDK I have no idea why this is happening. It is better than it was...
     
  12. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    I ran into this too.

    I swear it was reported recently, but I can't find the post. However, I remember fixing it- in fact, I have the fix in the source for the DLL. But... for some reason, I never compiled the project since. Which means that the fix was never released. I forgot about it until I fixed the issue in Python.

    I pressed Compile and it worked... so maybe I'll just update 1.64 with these things fixed.

    (The bug is that I'm using changeGold(getGold() * multiplier) instead of setGold(getGold() * multiplier). Because getGold() = 10, changeGold(getGold() * multiplier) will add change
     
  13. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    Ah. Of course. The difference between changeX and setX.
    I saw something about this not too long ago - I'm not sure if it was in regards to this in FFP or in reference to something else entirely.
     
  14. ctrlkhan

    ctrlkhan Chieftain

    Joined:
    Feb 8, 2009
    Messages:
    6
    Patch 1.64 solved all these issues. :goodjob: Thanks a lot.
     
  15. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    I think there is a bug in the barbarian spawn code.

    Code:
    //Added in Final Frontier SDK: TC01
    //	Change way max number of barbarian units is generated
    //	[B]Target = (Number of Owned Tiles * (Current Era + 1)) - Num Barbs[/B]
    //	To get actual value, subtract rand number less than half the Target
    /*	Old Code:
    				iNeededBarbs = ((pLoopArea->getNumUnownedTiles() / iDivisor) - pLoopArea->getUnitsPerPlayer(BARBARIAN_PLAYER)); XXX eventually need to measure how many barbs of eBarbUnitAI we have in this area...
    New Code:*/
    				int iNumBarbs = pLoopArea->getUnitsPerPlayer(BARBARIAN_PLAYER);
    				[B]int iTarget = ((pLoopArea->getNumUnownedTiles() / iDivisor) - iNumBarbs ) * ((int)GC.getGame().getCurrentEra() + 1);[/B]
    				int iFinalFrontierRand = GC.getGame().getSorenRandNum(iTarget / 2, "Barbarian spawns");
    				iNeededBarbs = iTarget - iFinalFrontierRand;
    //End of Final Frontier SDK
    Note that the "int iTarget =" line does not match the comment a few lines before.

    I think the comment's version is correct (except that it is unowned tiles, not owned tiles). You should multiply the base number by the era based modifier before subtracting the current number of barbs.

    It seems to me that fixing this will actually increase the number of pirates, which may already be a little high. In fact, I'm thinking that the current version doesn't actually increase the maximum number of pirates that can appear as the era increases, just make it more likely to be at, or near, the limit that doesn't change with era. If I'm right about that then the iUnownedTilesPerBarbarianUnit for each difficulty level may need to be adjusted, perhaps doubling them to reduce the actual number by something like half (otherwise the target number will actually become double what it currently is when the second era is entered).
     
  16. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    After looking through the building yield override code for something like the 3rd time, I think I figured out why it doesn't work correctly...

    The current code (starting on line 994 of CvCity.cpp):
    Code:
    		//Building yields
    		for (int iBuilding = 0; iBuilding < GC.getNumBuildingInfos(); iBuilding++)
    		{
    			BuildingTypes eBuilding = (BuildingTypes)iBuilding;
    			if (getNumRealBuilding(eBuilding) > 0)
    			{
    				iBuildingYield = GC.getBuildingInfo(eBuilding).getYieldChange(iYieldLoop) * getNumRealBuilding(eBuilding);
    			}
    			iYield += iBuildingYield;
    		}
    
    
    Notice that inside the for loop the value of iBuildingYield is never zeroed.

    If you have a building in the city that has a non-zero yield for the current yield type, then it sets iBuildingYield to that value (times the number of buildings of that type) and adds it to the iYield value on the iteration of the loop for that building. But the next time through the loop the value of iBuildingYield is still what it was on the previous time through the loop, so it gets added in to iYield again. And again. And again. Until it hits a building type that actually exists in the city, at which point the iBuildingYield value changes to what this new building type has for its yield value (times the number of them that there are in the city). Since most buildings have a 0 for this, it usually zeros out the iBuildingYield value and stops adding it in at that point.

    This is why the Capitol building in FF+ does not have this problem: in each system there is also the planet in the system that gets the system's free Nutrition Facility, which just happens to be the 2nd building in CIV4BuildingInfos.xml which is right after the Palace (which is, of course, the first building in the file) and which therefore zeros out iBuildingYield since it has the default YieldChange of 0 commerce.

    This explains the amount of commerce that the Office of the Auditor General usually provides as well. It is building number 49 and there are another 21 buildings in the file after that one so it adds it's 4 commerce for itself, then adds it for each of the 21 buildings after itself in the list for another 84 which gives a total of 88. This value decreases if any of the 21 buildings after it in the list is built (which are the various UBs, some World Wonders, and the 6 resource related buildings) since none of them produce 4 commerce per turn. Likewise for the various resource related buildings - they are the last ones in the file and only 2 of them provide any yield (ranch gives +1 production, harbor gives +1 commerce) - if you count the number of buildings after them in the file, this is the extra yield they are giving.

    The reason various other mods switching to this is worse is presumably that they still have the Capitol building first in the file and it probably still provides something like 8 commerce per turn. But they are evidently not giving one of the very next building in the file to the system for free. If there are no free buildings at all then it should be giving an amount of commerce equal to the commerce yield given by the Capitol times the number of buildings in the file. If there are free buildings, then it would be less (assuming that the free building doesn't give the same amount of commerce) and the amount less would depend on where in the list the free building is located.

    The simplest fix would be to get rid of the iBuildingYield variable and just add directly to iYield instead. The other good option is to zero iBuildingYield inside the loop before the "if" statement. There are other more complicated (and slower) ways to do it, but I would just use one of these (probably the first).
     
  17. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    20,253
    Yay! This should fix my problem, right?
     
  18. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    So, it was the same problem as before, just a different variable...

    Thanks God-Emperor! I'm going to compile a new DLL with this and the barbarian spawning error you posted above, and then release a new patch.

    I got rid of iBuildingYield; and iTraitYield too, which could be causing similar issues.

    EDIT: God-Emperor, what do you think the trait values should be changed to? Do you think any other changes are needed to balance things?
     
  19. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    A heads-up to avoid the update timing issues that happened the last time...

    I'll be posting an update to CvAI.py over in the development thread soon, so you might want to hold off on the update until then. It should be just a couple of hours.
     
  20. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    I sure do hope so.
     

Share This Page