1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Unofficial BTS 3.13 patch

Discussion in 'Civ4 - General Discussions' started by Bhruic, Oct 5, 2007.

  1. Bhruic

    Bhruic Chieftain

    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
     
  2. LiDDiS

    LiDDiS Chieftain

    Joined:
    Sep 3, 2007
    Messages:
    125
    Location:
    Canada
    Nice, good thing you're here to patch the patch D:
     
  3. Solver

    Solver Civ4/5 beta tester

    Joined:
    Mar 22, 2002
    Messages:
    1,260
    Location:
    Latvia, Riga
    Yaaaay now I don't have to do anything! :D
     
  4. LiDDiS

    LiDDiS Chieftain

    Joined:
    Sep 3, 2007
    Messages:
    125
    Location:
    Canada
    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
     
  5. Bhruic

    Bhruic Chieftain

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    Updated:
    • Fixed bug that caused the AI to trade for resources it already had (appears as grossly uneven trades)

    Bh
     
  6. lulu135

    lulu135 Chieftain

    Joined:
    Aug 4, 2007
    Messages:
    135
    Cool thanks! One thing tho, could you include the .cpp files in the zip as well?
     
  7. Bhruic

    Bhruic Chieftain

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    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
     
  8. jray

    jray Chieftain

    Joined:
    Jan 31, 2006
    Messages:
    923
    Location:
    North Carolina (USA)
    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?
     
  9. Teg_Navanis

    Teg_Navanis Chieftain

    Joined:
    Jan 21, 2006
    Messages:
    737
    I second that. It would be nice if I didn't have to choose between an unfixed SDK mod and a fixed vanilla game.
     
  10. ChickenSalad

    ChickenSalad Chieftain

    Joined:
    Oct 3, 2006
    Messages:
    35
    Nice job. Guess I can apply the patch now. Thanks! :)
     
  11. ChinaBlue

    ChinaBlue Xenite

    Joined:
    Dec 17, 2006
    Messages:
    191
    Terrific-thanks a lot bhruic
     
  12. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    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:
     
  13. SevenSpirits

    SevenSpirits Immortal?

    Joined:
    Jul 7, 2007
    Messages:
    512
    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.
     
  14. .Shane.

    .Shane. Take it like a voter Retired Moderator

    Joined:
    May 9, 2005
    Messages:
    9,232
    Location:
    NorCal
    You rock! Thanks for the patches! :)
     
  15. Nor Me

    Nor Me Chieftain

    Joined:
    Feb 22, 2003
    Messages:
    50
    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?
     
  16. Underdawg

    Underdawg Chieftain

    Joined:
    Oct 10, 2005
    Messages:
    672
    Location:
    Wet Coast... er... West Coast, CAN
  17. Powerslave

    Powerslave Chieftain

    Joined:
    Jun 3, 2004
    Messages:
    388
    Location:
    USA
    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.
     
  18. Bhruic

    Bhruic Chieftain

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    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
     
  19. SevenSpirits

    SevenSpirits Immortal?

    Joined:
    Jul 7, 2007
    Messages:
    512
    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.)
     
  20. Bhruic

    Bhruic Chieftain

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    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
     

Share This Page