Unofficial Patch for 3.19

Version 1.10 has been posted!

There are a number of tweaks and fixes in this version, including two very important bugs. The first bug permanently blocked access to any trade routes after a city was lost, resulting in lower trade yield for civs that had lost cities in war or set free a colony. The second set of bugs affected the AI's handling of population and gold rushing, and was a significant drain on AIs running Universal Suffrage. Thanks to RedFury, DanF5771, and Pep for their bug hunting!

Also, two prior changes were tweaked by popular demand. With this version, Paratroopers are always able to capture defenseless cities after dropping and a city set to build culture will ask for new orders after cultural borders expand.

Version 1.10 fixes:
Spoiler :

- CvGame::addPlayer - Restored 3.17 UP changes forcing clearing of old player names, civ descriptions, etc when placing a new player in a previously occupied slot.

- CvCity::setCultureLevel - Now behavior where a city building culture would cancel order when reaching next level only applies to human player. It was completely unnecessary for AI and caused a small bug with extra overflow production.

- CvUnit::canMoveInto - Changed to allow paratroopers to capture workers and undefended cities after paradropping. Also allows units with multiple moves to capture multiple tiles of non-combat units like workers.

- CvCity::kill - When a player loses a city, that city now clears all of its trade route claims so that they can be taken by other cities owned by the player. Previously, these trade routes were permanently lost. (Thanks RedFury and DanF5771)

- CvUnitAI::AI_spreadReligionAirlift and CvUnitAI::AI_spreadCorporationAirlift - AI will no longer airlift multiple of the same kind of missionary or executive to the same target spread city on the same turn

- CvAdvisorUtils.py - Advisor will no longer bug for city liberation to player you're at war with.

- CvDomesticAdvisor.py - City liberation to player you're at war with no longer offered.

- CvDLLButtonPopup::launchFreeColonyPopup - Removed cities whose liberation player you are at war with from popup.

- CIV4EventInfos.xml - In EVENT_OVERWHELM_DONE_1, removed references to non-existent Python functions which blocked this option. (thanks Pep)

- CvSelectionGroup::continueMission - Fixed issue causing units with multiple orders to forget their later orders under certain circumstances. (thanks Pep)

- CvCityAI::AI_doHurry - Fixed several bugs where AI would incorrectly think it was getting a great deal on a pop/gold rush when it was actually doing the other kind of rush. (thanks Pep)
 
For those of you keeping score at home ...

There's also a bug with Permanent Alliances and espionage points. If China and Greece merge, they will always keep the greater of their individual espionage point totals towards you, but what you get depends on whether China is merged into Greece or Greece into China.

Thanks to StMikael and phungus420 for the report.
 
Code:
	// XXX marble and stone???

	// Unofficial Patch Start
	// * Fixed bug where AI uses player's ID instead of attitude when evaluating deals. [DanF5571]
	eAttitude = GET_PLAYER(getID()).AI_getAttitude(ePlayer);
	// Unofficial Patch End
In Unofficial 3.17 patch, CvPlayerAI.cpp 6930 line has been changed like above.

But this Unofficial 3.19 patch has changed nothing it (6940 line).
Is this intentional?
 
Code:
	// XXX marble and stone???

	// Unofficial Patch Start
	// * Fixed bug where AI uses player's ID instead of attitude when evaluating deals. [DanF5571]
	eAttitude = GET_PLAYER(getID()).AI_getAttitude(ePlayer);
	// Unofficial Patch End
In Unofficial 3.17 patch, CvPlayerAI.cpp 6930 line has been changed like above.

But this Unofficial 3.19 patch has changed nothing it (6940 line).
Is this intentional?

When I was looking at the 3.17 UP 0.21 and saw this comment, I compared it to the original line which I'm guessing was this:

Code:
eAttitude = AI_getAttitude(ePlayer);

That looks just fine to me. I suspect that when Firaxis was building the 3.19 patch they made the same decision and kept the old (working) code. They took almost every fix from UP 0.21, so I assume they purposely skipped this one.
 
While trying to track down a Stack Attack crash in BULL I came across this bug in 3.19's CvGameCoreUtils.cpp on line 2005:

Code:
void getActivityTypeString(CvWString& szString, ActivityTypes eActivityType)
{
	switch (eActivityType)
	{
	...
	case ACTIVITY_INTERCEPT: szString = L"ACTIVITY_[B][COLOR="DarkOrange"]SENTRY[/COLOR][/B]"; break;
	...
	}
}

That should be L"ACTIVITY_INTERCEPT", but I have no idea what ramifications fixing it has. I do notice that I fixed it in BUFFY's version of BULL, and it hasn't seemed to cause any problems yet.

Note: getActivityTypeString() isn't exposed to Python, nor is it called within the SDK. Perhaps the EXE uses it for something.
 
I have a small request for the next version of the Unofficial Patch.

When putting a negative value for State Religion happiness, it creates a funky looking result in the Civics screen. However, it works just fine in game.

Example:

In CIV4CivicsInfos.xml:
Code:
<iNonStateReligionHappiness>-1</iNonStateReligionHappiness>

Looks like this in the Civics Screen:
http://forums.civfanatics.com/showpost.php?p=8390698&postcount=3222

However, in the game, by doing this you do infact will have +1 Unhappy citizens per Non-State Religion per city.


It's just a cosmetic error, but just thought I'd mention it.
 
It's a mismatch between the "TXT_KEY_CIVIC_NON_STATE_REL_HAPPINESS_NO_STATE" <Text> element and the code. When the civic has a state religion, the code doesn't pass in the # and type of happy/unhappy the civic produces, but the <Text> expects them. The fix is trivial:

Code:
if (GC.getCivicInfo(eCivic).getNonStateReligionHappiness() != 0)
{
	if (GC.getCivicInfo(eCivic).isStateReligion())
	{
		szHelpText.append(NEWLINE);
		szHelpText.append(gDLL->getText("TXT_KEY_CIVIC_NON_STATE_REL_HAPPINESS_NO_STATE"[B][COLOR="DarkOrange"], abs(GC.getCivicInfo(eCivic).getNonStateReligionHappiness()), ((GC.getCivicInfo(eCivic).getNonStateReligionHappiness() > 0) ? gDLL->getSymbolID(HAPPY_CHAR) : gDLL->getSymbolID(UNHAPPY_CHAR))));[/COLOR][/B]
	}
	else
	{
		szHelpText.append(NEWLINE);
		szHelpText.append(gDLL->getText("TXT_KEY_CIVIC_NON_STATE_REL_HAPPINESS_WITH_STATE", abs(GC.getCivicInfo(eCivic).getNonStateReligionHappiness()), ((GC.getCivicInfo(eCivic).getNonStateReligionHappiness() > 0) ? gDLL->getSymbolID(HAPPY_CHAR) : gDLL->getSymbolID(UNHAPPY_CHAR))));
	}
}

Looking at the two <Text> entries, I think they are backwards. It always bothered me that Free Religion says, "per Non-State :religion:," given that all religions will be non-state religions since you cannot have a state religion. Now I see why. The other <Text> doesn't say Non-State, but it makes more sense for that case.

The names of the <Text> entries match what they mean in my eyes, so the code needs to swap which it uses when. The easiest is to just add a not (!) to the isStateReligion() test:

Code:
if ([B][COLOR="DarkOrange"]![/COLOR][/B]GC.getCivicInfo(eCivic).isStateReligion())
 
Having had some time in the last couple of months, I returned to the game and learned to elementary Mod my old trusty 161 Civ4 vanilla version.

Reaching a bit of proficiency after hours of silently trawling this site, I was enthused to buy BtS and I got a complete CiV4 pack version 313 BtS, Warlords and vanilla in one pack.

Following advise from this forum I then Uploaded the Official patch 319. First tried through the game but after 3 unsuccesful uploads, I got a copy from CFC which only worked when I removed all the old games and re-loaded BtS played 1 turn and then OP 319 worked.

Then having read about the bugs and the valiant efforts of the people in this sub-forum to fix patch 319 with the Unofficial 319 Patch, I down loaded your version 1.1 and installed that as well.

I now have some interesting results the whole GUI interface dissapeared, :crazyeye: after I installed the UP 319 v1.1. I now have a workable map with animated units but nothing else!! This happens whether it is a new game or an old saved one under the OP319. The HUD I believe it is called dissapeared.

Can anybody help please?

PS I used your recomendation to change the Firexis original files. I did that by renaming the old ones and I can and have reverted back to them whence the game functions normally.

One point that I noticed is that the OP-319 I downloaded from CFC although it says it is version 319 within the game, works off a 3.1.7 Dll whilst your UP-319 dll is a 3.1.9 version.:confused:

Thank you if you can answer my querry.
 
The 3.1.7 vs 3.1.9 DLL thing is not a problem, Firaxis just forgot to update the field in the resource file which fills in that property.

When the interface disappears that means something has gone wrong in the Python portion of you setup. If you went the renaming route, you have to have renamed the individual Python files, not whole folders. Same is true for the XML parts. Perhaps double check that you have renamed only the four Python files in the UP and placed the four new versions in their place, and similarly for XML.

The most sure approach to getting back to functionality is to reinstall ... annoying, but guaranteed to work if it comes to that.

You can also
 
Thanks for the prompt reply.
I in fact renamed the Python folder to "Original Python", etc. for the rest before I copied your folders in their place.

It was easy to retrieve functionality I renamed your folders to "UP319 Python" etc. and erased the word Original from the old ones. Voila, I was back in business shortly.

But that is not the point. The point is that I think you went to an extraordinary amount of trouble for us to be able to use a good upgrade and I would gratefully like to do so.

Anyway I reinstalled as I wanted to include some art work that was not functioning correctly and Noticed when Uninstalling that the OP 319 sits independent of my CIV4 Complete. Is it possible that this where my problem lies? That I have been working with the CIV4 Complete files and not the patch? If so how do I integrate them? And do I need to? or should I make a simple "Shortcuts Menu" and only use the older material for art and defines copy-overs?

Thank you again for being prompt. Regards.

EDIT:
Thank you for the idea of renaming each file and manually installing it in place instead of the whole folder that I did previously. It worked.
 
I in fact renamed the Python folder to "Original Python", etc. for the rest before I copied your folders in their place.

If you mean that you renamed the folder Beyond the Sword/Assets/Python, this was the problem. This is where the core game interface files reside. The UP only replaces a couple of those files, so swapping the entire folder removes most of the game!
 
Out of curiosity is it possible to create more promotion levels for units? Sometimes when I have a GG attached to a Cataphract with Blitz I run out of levels so can't get the Drill promotions that come after upgrading to Gunship :(.

And if it is possible would it be balanced/worthwhile sticking it in the unofficial patch?

Thanks.
 
Out of curiosity is it possible to create more promotion levels for units? Sometimes when I have a GG attached to a Cataphract with Blitz I run out of levels so can't get the Drill promotions that come after upgrading to Gunship :(.

And if it is possible would it be balanced/worthwhile sticking it in the unofficial patch?

Thanks.

I've played this game so much, I'm surprised I haven't seen this before, and I really like making attacking Warlords as well. Are you sure there is a unit level cap? Do you have a save with a unit hitting this cap? What level is the cap at?
 
I wonder if he realizes that he loses almost all of his XP with the upgrade (the amount for the new level stays the same.

He's talking about GG-lead units which don't lost their XP when they are upgraded (for free even).
 
Top Bottom