Final Frontier Plus

How did the yield bug from trade routes get fixed?

In CvCity::doTurn, at the end, right before some debug-DLL-specific code and the report event command, I added a block looking like this:

Spoiler :
Code:
//Added in Final Frontier: TC01
//	Looks at building yield changes, trait yield changes, trait yield changes with trade routes to set city base yield, and trade route yields
//	Then, planet-specific yield stuff is done automatically in Python with changeYieldRate, in the callback right after this
//	There are potential problems... if a city can't have negative base yield rate (Forge gets -1 in all cities). This has been (hopefully) fixed by "Python override"
//	Would PROBABLY be easier to edit this into the functions elsewhere that do building yield changes... not sure how though
	CvPlayer& pPlayer = GET_PLAYER(getOwner());
	int iYield = 0;
	int iBuildingYield = 0;
	int iTraitYield = 0;
	setFoodOverride(0);
	setProductionOverride(0);
	setGoldOverride(0);
	for (int iYieldLoop = 0; iYieldLoop < NUM_YIELD_TYPES; iYieldLoop++)
	{
		//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;
		}

		//Trait yields, and traits with trade routes yields
		for (int iTrait = 0; iTrait < GC.getNumTraitInfos(); iTrait++)
		{
			TraitTypes eTrait = (TraitTypes)iTrait;
			if (pPlayer.hasTrait(eTrait))
			{
				iTraitYield = GC.getTraitInfo(eTrait).getYieldChanges(iYieldLoop);
				for (int iTradeCity = 0; iTradeCity < getTradeRoutes(); iTradeCity++)
				{
					CvCity* pTradeCity = getTradeCity(iTradeCity);
					if (pTradeCity != NULL)
					{
						iTraitYield += GC.getTraitInfo(eTrait).getTradeRouteYieldChanges(iYieldLoop);
					}
				}
				iYield += iTraitYield;
			}
		}

		//Trade routes (currently, only Gold is used... bad?)
		if (iYieldLoop == 2)
		{
			iYield += getTradeYield((YieldTypes)2);
		}

		//Finally, store the value so Python can access it (because I'm too lazy to move all this back to Python)
		YieldTypes eYield = (YieldTypes)iYieldLoop;
		switch (eYield)
		{
			case YIELD_FOOD:
			{
				setFoodOverride(iYield);
				break;
			}
			case YIELD_PRODUCTION:
			{
				setProductionOverride(iYield);
				break;
			}
			case YIELD_COMMERCE:
			{
				setGoldOverride(iYield);
				break;
			}
			default:
			{
				break;
			}
		}
	}
//End of Final Frontier

You want to add an iYield = 0 statement to the start of the primary for loop, so the start of this block looks like this:

Code:
	CvPlayer& pPlayer = GET_PLAYER(getOwner());
	int iYield = 0;
	int iBuildingYield = 0;
	int iTraitYield = 0;
	setFoodOverride(0);
	setProductionOverride(0);
	setGoldOverride(0);
	for (int iYieldLoop = 0; iYieldLoop < NUM_YIELD_TYPES; iYieldLoop++)
	{
		[COLOR="Red"]//Reset iYield to 0 on each pass
		iYield = 0;[/COLOR]

The problem was that the yield change was not being reset each time, so the production yield change was actually food + production yield change, and the commerce yield change was actually food + production + commerce yield change.
 
you guys are not interested in the all terrain transport then?

No- at least, I'm not.

Because it's not really related to the problem. There are no transports in Final Frontier, only carriers.

Unless I'm mistaken and it does work for carriers, that is. In which case, I might be more interested.
 
ok, just wanted to help,

although - im not so sure about the functionality of carriers with that code, i guess - if you define that unit as an all terrain with special cargo like missiles - there's a good chance the ai will transport those missiles.

interesting to check.

if you still wish it, pm me.

p.s.
in final frontier - theres no transports, ok so if you wanna attack a very distant player - you need to move stacks a long way?
 
keldath:

so are you saying it's possible to create a "water" unit that is truly amphibious/"all-terrain"?
 
Hi,

The mod shows no text for me.. even when I manage it to "blindclick" me into game there is no text.
I tried both installways (copy the old folder and just install additional files + patch) and the full 1.62 installer package.



What could I have done wrong?

Some additional infos:
- Bts 3.19 without dll-mods
- Windows 7 Pro x64
- os(and game) language: german
 
The mod (at present) does not support foreign languages. You'll need to change the language to English for the text to show up.

Someone was working on translating it into Spanish, and that action involved fixing things so text does show up for the other languages as well (even though all new text will probably be in English, not German). So until that is released, you'll have to run the mod in English.
 
Thank you :)

edit:

another question, is it intended that a buildprocess is completly lost, when switching to another planet? I was building a worldwonder and noticed I need to build a health-building on another planet to prevent unhealtiness... when I switched back to my planet to complete the wonder all of its progress has been lost.. (like 20 rounds, marathon gamespeed)
 
Having read the most recent posts i think i may now know what the problem was that i was experiencing (see posts on page 16) through out the B5 mod i am still using the standard FF stuff as below
Code:
			<ExtraYieldThresholds>
				<iYield>-1</iYield><!-- Food -->
				<iYield>0</iYield><!-- Hammers -->
				<iYield>0</iYield><!-- Credits -->
			</ExtraYieldThresholds>	
			<TradeYieldModifiers>
				<iYield>0</iYield><!-- Food -->
				<iYield>0</iYield><!-- Hammers -->
				<iYield>0</iYield><!-- Credits -->
			</TradeYieldModifiers>
			<CommerceChanges>
				<iCommerce>0</iCommerce><!-- Credits -->
				<iCommerce>1</iCommerce><!-- Research -->
				<iCommerce>0</iCommerce><!-- Influence -->
				<iCommerce>0</iCommerce><!-- Espionage -->
			</CommerceChanges>
			<CommerceModifiers>
				<iCommerce>0</iCommerce><!-- Credits -->
				<iCommerce>5</iCommerce><!-- Research -->
				<iCommerce>0</iCommerce><!-- Influence -->
			</CommerceModifiers>
But from what i've read here i should be using iYield only and not iCommerce. Or have i totally got the wrong end of the stick?
 
another question, is it intended that a buildprocess is completly lost, when switching to another planet? I was building a worldwonder and noticed I need to build a health-building on another planet to prevent unhealtiness... when I switched back to my planet to complete the wonder all of its progress has been lost.. (like 20 rounds, marathon gamespeed)

Well, it is supposed to work that way. But I don't really like the way it works. I don't know how to "fix" it, though, so for the time being it's stuck that way.

Having read the most recent posts i think i may now know what the problem was that i was experiencing (see posts on page 16) through out the B5 mod i am still using the standard FF stuff as below
Code:
			<ExtraYieldThresholds>
				<iYield>-1</iYield><!-- Food -->
				<iYield>0</iYield><!-- Hammers -->
				<iYield>0</iYield><!-- Credits -->
			</ExtraYieldThresholds>	
			<TradeYieldModifiers>
				<iYield>0</iYield><!-- Food -->
				<iYield>0</iYield><!-- Hammers -->
				<iYield>0</iYield><!-- Credits -->
			</TradeYieldModifiers>
			<CommerceChanges>
				<iCommerce>0</iCommerce><!-- Credits -->
				<iCommerce>1</iCommerce><!-- Research -->
				<iCommerce>0</iCommerce><!-- Influence -->
				<iCommerce>0</iCommerce><!-- Espionage -->
			</CommerceChanges>
			<CommerceModifiers>
				<iCommerce>0</iCommerce><!-- Credits -->
				<iCommerce>5</iCommerce><!-- Research -->
				<iCommerce>0</iCommerce><!-- Influence -->
			</CommerceModifiers>
But from what i've read here i should be using iYield only and not iCommerce. Or have i totally got the wrong end of the stick?

No. There is only one array, TradeRouteYieldChanges, in CIV4TraitInfos.xml, where I used <iCommerce> when I should have used <iYield>, in one case (for the Red Syndicate, the only civ using the feature).
 
I've released patch 1.63. This fixes the bug in the DLL causing yield overrides to be calculated incorrectly, and also fixes a Worldbuilder issue (adding resources to planets). Full changelog:

-Fixed bug with yields from buildings, traits, and trade routes
-Fixed bug in Worldbuilder when adding resources to solar systems
-Changed hardcoded BUILDING_PALACE to use global define
-Added iCostModIncrease tags for all UBs

I'll post a Mod Platform patch reasonably soon with the two bugfixes.
 
I played around with this a little bit and one of the custom game options seems to be broken. With "no aliens" ticked, the inhabited planets on solar systems with goodies still pop up.
 
This mod is pretty awesome :D However, I'm having some display issues on both computers in our household. I have installed the 1.63 patch on top of a new install of BTS.

On my computer, unexplored areas are partially shown - I can see every star system on the map just by scrolling around. Space debris, other players, wormholes, and supernovas still need to be found the traditional way through exploration.

On my husband's computer, units are not visible. They can still be used to explore, attack, etc.

Does anyone else have these issues, and is there something I can do to fix the problems?
 
If the resource is on a planet that is outside your current influence range, then it is temporarily removed from the plot which produces the side effect that the resource icon pointer thing doesn't show up on the map anymore (the resource will still be mentioned in the help text that pops up when you hover over the planet on the "city screen"). Once your influence extends to where you can assign people to the planet with the resource (you don't actually have to do so, just be able to), the resource is put back and should show up on the map again, and you should have the resource in that system and any system of yours that has a route to it. Resources that are on one of the innermost planets, so that you can work them without a border pop, should not disappear.
 
This mod is pretty awesome :D However, I'm having some display issues on both computers in our household. I have installed the 1.63 patch on top of a new install of BTS.

On my computer, unexplored areas are partially shown - I can see every star system on the map just by scrolling around. Space debris, other players, wormholes, and supernovas still need to be found the traditional way through exploration.

On my husband's computer, units are not visible. They can still be used to explore, attack, etc.

Does anyone else have these issues, and is there something I can do to fix the problems?

I'm not sure about the first one- as deanej says, it might be a flying camera issue.

As for the second one, there's an option on the map control panel (where you can enable things like Enemy Troops and Resources pointers, and cultural view when zoomed out) to toggle whether or not units are visible.

If you set this for one mod, the game seems to remember the setting and when you load another mod and start a new game, it will be this way too. Make sure this isn't toggled on.
 
Top Bottom