3.15 Railroads

Ahriman

Tyrant
Joined
Jun 8, 2008
Messages
13,266
Location
Washington, DC
The railroad production bonus doesn't seem to be working. It works in the capital but not in any other cities.
 
Here:

I tried exiting and reloading and it didn't seem to make a difference. I'm not 100% sure if the issue is just that the bonus isn't being displayed, but certainly there is no mention of railroads in the mouseover text in the city screen, except in the capital.
 

Attachments

  • argh.Civ5Save
    1.3 MB · Views: 49
It is quite possible I am reading the code incorrectly but, it appears to be this "Railroad Connection" modifier is MEANT to only be an internal modifier that signifies the connection is now available.

Looking through both our code and the vanilla C++ seems to show this as a rate applied to the city IF it is connected to the capital by railroad, not to the capital IF connected to other cities.

Here is the code from the vanilla file CvCity.cpp

Spoiler :
Code:
int CvCity::getGeneralProductionModifiers(CvString* toolTipSink) const
{
	int iMultiplier = 0;

	// Railroad to capital?
	if (IsIndustrialRouteToCapital())
	{
		const int iTempMod = GC.getINDUSTRIAL_ROUTE_PRODUCTION_MOD();
		iMultiplier += iTempMod;
		if (toolTipSink && iTempMod)
		{
			GC.getGame().BuildProdModHelpText(toolTipSink, "TXT_KEY_PRODMOD_RAILROAD_CONNECTION", iTempMod);
		}
	}

	return iMultiplier;
}

Here it refers to 2 outside values.
INDUSTRIAL_ROUTE_PRODUCTION_MOD() in vanilla and in CEP it is 25 which is stored in the Defines table.
TXT_KEY_PRODMOD_RAILROAD_CONNECTION is the text that accompanies this value and is in CEP:
{1_Num} from Railroad Connection
and the vanilla is:
Modifier for Railroad Connection: {1_Num}%
(as a side question, I would like to know why we need to define it differently when both say essentially the same thing? In fact the vanilla is more clear.)

Edit: Perhaps this represents the fact the understanding of how this modifier works was also not clear when the YieldLibrary was first written.

The {1_num} is a variable that pulls the INDUSTRIAL_ROUTE_PRODUCTION_MOD value from the Defines table.

So that it reads "25 from Railroad Connection"

These two screengrabs show what happens when a city becomes connected by a railroad.

Note the tooltip: X% from City

If anything this could be re-worded to be more clear as to what it represents. Perhaps having separate lines for the different % gains from each source.

So, what all this means is:
The railroad connection works as it is meant to but the description of it is unclear.

EDIT:
On closer examination the tooltip used to show the X% from City is the same as used for a great number of things, including Culture, Faith, etc.
I don't think it would be difficult to re-word it to show another TXT_KEY that is more descriptive of what is happening.
X% Production from Railroad to Capital or something like it.
 

Attachments

  • Nanjing after a Railroad to the capital.jpg
    Nanjing after a Railroad to the capital.jpg
    75.1 KB · Views: 100
  • Nanjing before a Railroad to the capital.png
    Nanjing before a Railroad to the capital.png
    495.4 KB · Views: 79
20% from buildings, 10% from policies, 25% from railroad = 55% total

Sorry that our tooltips are a mess right now. I've been reactivating features but there's a lot of code that I don't entirely understand.
 
It could be that it's just a tooltip error, it's hard to tell because in the build I'm running smithies, factories, etc. don't have the appropriate tooltips either.

But I think it's important for this to be in there separately - as it is in vanilla.
 
Yeah it is most definitely an error in the tooltip.
Just as an exercise I started a new game, granted myself ALL techs and then looked at the tooltip in the capital.

The capital gets 2 tooltips both indicating the same thing.
25% from City
and
25 from Railroad Connection

The production value also increases by the 25%.

All of this is on turn 0 with no buildings or worker improved tiles.

I imagine this is NOT what is supposed to happen. Isn't the railroad bonus ONLY to come when cities are CONNECTED by railroad? Is the capital supposed to get this bonus if it is the only city? Perhaps mimicking the internal railroad system inside the city tile?

If not, we need to modify the code that shows this tooltip to not show up when there are no other cities. In addition to the need to remove the superfluous 2nd tooltip.
 
Is the capital supposed to get this bonus if it is the only city
Yes, the intended effect in the mod is for the capital to get the effect even if it is the only city, so that OCC and the like still benefit from railroads, and so we don't get a weird effect where the capital is the only city not benefiting from railroads.

But it should only get the benefit once.
 
I get railroad bonuses on every connected city in my saves.

The main issue for me is the weird happiness/food surplus/golden age bug. It's one of those stealth problems that I noticed only after a lot of testing due to the lack of tooltips, but has a wide ranging effect.
 
I get railroad bonuses on every connected city in my saves.
And you get the tooltip message "bonus from railroads" in the city screen of non-capital cities?

One thing, I still haven't updated since the first 3.15 posted a few days ago, could it be that whatever fixed the smithy/factory/etc. tooltip issues also fixed this, and that you have included these changes?
 
Possibly. I've applied stackpointer's production tooltip hotfix, the Hagia Sophia fix, and the specialist yield fixes so production, gold and science building modifiers show up for me.
 
...could it be that whatever fixed the smithy/factory/etc. tooltip issues also fixed this, and that you have included these changes?

Not likely.

stackpointer has been focusing on the code that handles the actual values and I have been looking at the code that shows the tooltip description.
Though related they are separate. His extensive work of bringing the YieldLibrary back into play shouldn't be underestimated, it is a great task considering the code needs to be first deciphered before making additions.

The tooltip descriptions are another area that need attention, as my most recent postings will show. We simply are not giving a better experience, IMO.
 
I messed up the tooltip percentages when I was testing functions from the YieldLibrary. I'll try to restore it to the former functionality.

However, the total yields you see in the city view is definitely correct (in terms of what's being granted) so you can work backwards from there to determine what base yield or percentage modifier is missing or incorrect.
 
I did notice that the city connection icon below the city's name in the main view doesn't change to a glowing orange color like it used to, and like it does in vanilla when you make a RR connection. It'd probably help if that was fixed, from a UI standpoint.
 
Whatever it was, it worked in previous versions of the mod, so is presumably fixable somehow.
 
Top Bottom