Unofficial BTS 3.13 patch

Bhruic

Emperor
Joined
Nov 15, 2005
Messages
1,457
Similar to Solver's patch for 3.02, this patch modifies the CvGameCoreDLL.dll file. As with his version, it's best to make a backup of the dll before overwriting it. The source code for the changes is included (multiple files with a .cpp extension). These are only necessary if you will be making your own revisions to the code. Otherwise, you can either delete or ignore them.

I've added a "versioning" system so people can figure out if they have the latest. :)

Changelog:
  • Fixed bug where culture/espionage would not display for building popups
  • Fixed bug where spies would be ejected from a square when declaring war
  • Fixed bug that caused the AI to trade for resources it already had (appears as grossly uneven trades)
  • Refixed trade bug
  • Refixed culture/espionage display bug
  • Fixed bug with Warlords attaching to units when the Great General is part of a selection group
  • Prevented new Colonies from overwriting previously existing Civs
  • No longer displays new Colony message if player hasn't met Master Civ
  • Workers on Transports no longer perform capture of cities (thereby displacing all other units) when city is captured
  • Units considered "unsuitable" for city defense will no longer be prevented from healing in cities
  • No longer able to base an unlimited number of air units in vassal's cities
  • Can found Corporations under Mercantilism
  • Vassal's spies will no longer be "caught" in your territory
  • Amount of time worked taken into consideration by city plot selection (thanks SevenSpirits)
  • The Vassal of a Capitulating Civ is freed before peace treaty
  • Mouse-over for Worker actively working a plot no longer counts Worker twice
  • Automated Workers will no longer idle when railroading is possible
  • Mouse-over for Join City now displays extra bonuses for Great People
  • Vassals freed by Capitulating Master no longer refuse to talk
  • Privateers can only enter team members' or vassals' cities
  • Automated Workers will no longer idle in cities within 2 squares of a hostile border
  • Refixed Vassal/capitulation
  • AIs less likely to build Executives if they can't afford to use them or already have sufficient
  • Buildings that grant both heathiness and unhealthiness will display both instead of neither in building popups
  • Vassals can no longer be their Master's worst enemy
  • Espionage ratio for humans now displayed in score tooltip (thanks morbus)
  • Improved worker threat assessment from units able to move multiple squares
  • Spies no longer interrupt their mission when moving next to an enemy unit
  • Fixed AI turn slowdown caused by change to worker threat assessment
  • Relationship penalty for declaring war on a friend checks if Civs are at war
  • Altered previous worker threat assessment check so it's less useful, but more efficient
  • Fixed bug (introduced) causing endless loop at "waiting for players"
  • Fixed bug (introduced) causing the Great Persons civilopedia entries to be blank
  • Stolen techs can no longer be traded with No Tech Brokering enabled
  • New Colonies mirror their Master's tech status with No Tech Brokering enabled
  • New Colonies mirror their Master's exploration (map) status
  • Healthy/Unhealthy bonuses will display properly under more circumstances (events, etc)
  • Extended spy ejection protection to Great Spies (and any other unit considered "always invisible")
  • AI Civs under Theocracy will no longer accept gifted Missionaries
  • Units withdrawing from combat will be removed from selection group (thanks Moctezuma)
  • When bumping naval units from cities, preference will be given to water tiles
  • Tweaks/bugfixes to improve starting city locations (thanks SevenSpirits)
  • Cities no longer require a Monument to allow Spies to sabotage buildings
  • Rivers added for starting locations will generate flood plains if they pass through desert tiles
  • Spy unit help popup will display the percentage espionage cost decrease from fortification

v1.21
http://forums.civfanatics.com/downloads.php?do=file&id=7288

I'm also including a supplementary fix dealing with XML/Python issues. This patch is not necessary to use the dll patch.

Changelog:
  • Reactivated the Glance diplomatic screen
  • Fixed a bug preventing war declarations via Worldbuilder
  • Civilopedia promotions no longer display a unit class if only a subsection of that class can get the promotion
  • Partisans only appear when Civ is running Emancipation

v1.03
http://forums.civfanatics.com/downloads.php?do=file&id=7301

Bh
 
Yaaaay now I don't have to do anything! :D
 
Would I be wrong in assuming that whatever is causing the out of sync stuff isn't fixable 'unofficially' and is probably hard-coded? It's nice to see you've fixed pretty much all of the annoyance issues though. Good job! :D
 
Updated:
  • Fixed bug that caused the AI to trade for resources it already had (appears as grossly uneven trades)

Bh
 
Cool thanks! One thing tho, could you include the .cpp files in the zip as well?
 
Oops, yes, I meant to do that with this version... I'll make sure to do it for the next one. For now, you can see the changes I've made in posts in the bugs forum.

Bh
 
Woot, Bhruic for president!

How 'bout collecting everything together here (like your fix to restore the Glance tab) and asking a moderator to sticky it?
 
Cool thanks! One thing tho, could you include the .cpp files in the zip as well?

I second that. It would be nice if I didn't have to choose between an unfixed SDK mod and a fixed vanilla game.
 
Wow I'm impressed with how quick this was. I was reading about issues with the patch, went to sleep, woke up, and now they're fixed! :)

So I guess the trade thing is a confirmed bug?

Thanks for your efforts Bhruic! :goodjob:
 
Ha! I started playing a game, noticed the resource bug, excitedly realized what the problem was and was about to go fix it myself, but I decided I'd check here first. You fixed it already! Thank you.
 
File: CvPlayerAI.cpp
Function: CvPlayerAI::AI_bonusTrade
Line: 6857
Replace:
Code:
	if (isHuman())
With:
Code:
	if (isHuman() && GET_PLAYER(ePlayer).isHuman())

Bh

Isn't there a danger that you won't be able to give the AI resources because the game thinks you don't like them enough?

At least you'd want another
Code:
	if (isHuman())
	{
		return NO_DENIAL;
	}
further down, just before bStrategic = false;, right?
 
Ha! I started playing a game, noticed the resource bug, excitedly realized what the problem was and was about to go fix it myself, but I decided I'd check here first. You fixed it already! Thank you.

Same. I'm glad I didn't have to do anything. Bhruic, you've done us all an amazing service by posting this so quickly.
 
Isn't there a danger that you won't be able to give the AI resources because the game thinks you don't like them enough?

You're absolutely right. Although I think it would be best to rearrange the check order a little as well. I don't think that it'll turn up a "worst enemy" for a human player, but it's best to be sure.

Bh
 
Isn't there a danger that you won't be able to give the AI resources because the game thinks you don't like them enough?
I agree that if that is how you did it, it isn't a perfect fix. It would still allow you to get resources you don't need in the special cases where you are at war or they are your vassal. That seems like an unintentional loophole.

I think the correct, if inelegant, way to fix the problem is this:

Replace:

Spoiler :
Code:
	if (isHuman())
	{
		return NO_DENIAL;
	}

	if (GET_TEAM(getTeam()).isVassal(GET_PLAYER(ePlayer).getTeam()))
	{
		return NO_DENIAL;
	}

	if (atWar(getTeam(), GET_PLAYER(ePlayer).getTeam()))
	{
		return NO_DENIAL;
	}

	if (GET_PLAYER(ePlayer).getTeam() == getTeam())
	{
		return NO_DENIAL;
	}

	if (GET_TEAM(getTeam()).AI_getWorstEnemy() == GET_PLAYER(ePlayer).getTeam())
	{
		return DENIAL_WORST_ENEMY;
	}

	if (!isHuman() && (AI_corporationBonusVal(eBonus) > 0))
	{
		return DENIAL_JOKING;
	}

	if (GET_PLAYER(ePlayer).getNumAvailableBonuses(eBonus) > 0 && GET_PLAYER(ePlayer).AI_corporationBonusVal(eBonus) <= 0)
	{
		return (GET_PLAYER(ePlayer).isHuman() ? DENIAL_JOKING : DENIAL_NO_GAIN);
	}

with

Spoiler :
Code:
	if (! (GET_PLAYER(ePlayer).getNumAvailableBonuses(eBonus) > 0 && GET_PLAYER(ePlayer).AI_corporationBonusVal(eBonus) <= 0))
	{
		if (isHuman())
		{
			return NO_DENIAL;
		}

		if (GET_TEAM(getTeam()).isVassal(GET_PLAYER(ePlayer).getTeam()))
		{
			return NO_DENIAL;
		}

		if (atWar(getTeam(), GET_PLAYER(ePlayer).getTeam()))
		{
			return NO_DENIAL;
		}

		if (GET_PLAYER(ePlayer).getTeam() == getTeam())
		{
			return NO_DENIAL;
		}
	}

	if (GET_TEAM(getTeam()).AI_getWorstEnemy() == GET_PLAYER(ePlayer).getTeam())
	{
		return DENIAL_WORST_ENEMY;
	}

	if (!isHuman() && (AI_corporationBonusVal(eBonus) > 0))
	{
		return DENIAL_JOKING;
	}

	if (GET_PLAYER(ePlayer).getNumAvailableBonuses(eBonus) > 0 && GET_PLAYER(ePlayer).AI_corporationBonusVal(eBonus) <= 0)
	{
		return (GET_PLAYER(ePlayer).isHuman() ? DENIAL_JOKING : DENIAL_NO_GAIN);
	}

This completely removes all possibility of returning NO_DENIAL if there is no benefit to the recipient, without changing the order of the different types of denial.

(At least in an unofficial patch, I think it's better to not try to change how the game is "supposed" to work without good reason. If you do not mind giving the "joking/no gain" denial a higher priority than the "worst enemy" one then the easy fix is just to move that test to the top of the list.)
 
They actually changed the order of denials from 3.02 -> 3.13. In 3.02, the DENIAL_JOKING : DENIAL_NO_GAIN actually came first. The reason they moved it is because of the Vassal issue. So I don't think putting it first again is a problem.

Anyway, I've made a change that should encompass all the situations properly.

Bh
 
Top Bottom