1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

0.19.1: Unofficial Update to the Unofficial Patch

Discussion in 'Civ4 - Unofficial Patches' started by Dresden, Aug 18, 2008.

  1. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    Ok, you're asking for personal opinions, so here's mine:

    Fix these please.

    I'm also very much in favour of fixing this. To quote myself from the already quoted thread:

    In my opinion this AI-upgrade could be integrated in the unofficial patch. But some may not like AI-upgrades in an unofficial patch.

    Yep, fix these please.

    I've personally encountered this bug. While it may not happen very often, when it happens it just ruins the additional diplomacy options that the AP offers. When this bug occurs, a significant part of the diplomacy functionality is removed from the game seriously diminishing the diplomacy fun and strategic factor of that game.

    My version of the bug was slightly different. Someone commented on my description of the bug that it was related to the winner of the AP-election getting an additional city or something. I can't remember it exactly and can't find it anymore. However, it resulted in no more AP-Palace resident elections.

    Yes, please fix these.

    Note that normal hammer bonuses from a forge, factory and such also apply to the 'build wealth' option (and build science and build culture), so it's not entirely logical to base the gold output on the base hammers value.

    An example: You're building something with a 50% production bonus from a forge and factory and another 100% production bonus from a resource. You have a base production output of 40 and you still need to produce 30 hammers to finish that construction that turn. 12 of those 40 base hammers would give you the needed 30 hammers (12 * (1 + 0.5 + 1) = 30.
    The remaining 28 hammers would presently give you 28 * 2.5 = 70 gold. When the gold would be based on base hammers, you'd get 28 gold. When you'd get gold based on the normal hammer bonus, you'd get 28 * 1.5 = 42 gold.

    When you'd 'build wealth' for a single turn instead of finishing the construction, you'd get 40 * 1.5 = 60 gold, so the present 70 gold version is certainly weird.
     
  2. Lexad

    Lexad royalcrownchinpokomaster

    Joined:
    Mar 26, 2006
    Messages:
    2,337
    Location:
    Russia
    Vale presents in this thread (http://forums.civfanatics.com/showthread.php?t=218272) the power of gold overflow - esp. post 6 where you get Artillery for free each turn. I think removing production modifiers fixes the balance - you still get something from overflow if you missed the beat with MM (unlike vanilla, where you just lose excess overflow), but it becomes inefficient for you to exploit.
     
  3. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    9,049
    Location:
    an Aussie in Boston
    I did perform a fair bit of self testing (most unlike my usual activity :D) and asked that the person submitting the issue also test (which I was lead to believe that they did). I've uploaded the latest version here in case anyone else wants to look at it too.
     
  4. GooglyBoogly

    GooglyBoogly Freakamongus

    Joined:
    Apr 20, 2008
    Messages:
    725
    Location:
    New Zealand
    There appears to be a potential bug involving the game not checking for fort-connected resources at an appropriate time. See this thread
     
  5. Dresden

    Dresden Emperor

    Joined:
    Jul 10, 2008
    Messages:
    1,081
    @Googly: Thanks. I saw that but hadn't looked into the code yet.
     
  6. Dresden

    Dresden Emperor

    Joined:
    Jul 10, 2008
    Messages:
    1,081
    After looking at it, the fort thing will definitely be fixed on the next release. Speaking of which, when that happens I'll be going back to the Solver numbering conventions and will call it 0.21.

    I'll also probably go with the less-radical overflow gold change (only undoing those "non-generic" modifiers which wouldn't affect wealth) assuming it tests okay. Both are reflected in the updated to-do list back on post #57.
     
  7. DanF5771

    DanF5771 Emperor

    Joined:
    Feb 21, 2008
    Messages:
    1,194
    Hmmm, after some tests with a modified CvVictoryScreen.py to show me the timer values for votes and Resident elections, I can't say I'm really much wiser.
    There is just one odd thing:
    When the VoteTimer reaches 0 it triggers a vote and the timer is then reset to iVoteInterval (9 turns for normal game speed). But if there are no valid resolutions the VoteTimer is set to 0 again immediately, hence the game tries for a new vote on the very next turn. The ResidentTimer starts with 4 (GlobalDefines DIPLO_VOTE_SECRETARY_GENERAL_INTERVAL) and decrements every time the VoteTimer reaches 0. If the ResidentTimer reaches 0 itself the next vote will be the election of a new Resident (this vote is always possible). But in case there are no valid resolutions the timers develop like this:
    Code:
    [SIZE="3"]  VoteTimer  |  ResidentTimer
    	9   |   4
    	8   |   4
    	7   |   4
    	6   |   4
    	5   |   4
    	4   |   4
    	3   |   4
    	2   |   4
    	1   |   4
    	0   |   4   (no vote possible)
    	0   |   3   (no vote possible)
    	0   |   2   (no vote possible)
    	0   |   1   (no vote possible)
    	0   |   0   (Vote for new Resident)[/SIZE]
    If there is no valid Resident (former Resident was not the builder of AP and changed Religion or switched to FR) the game skips the normal vote triggering procedure when the VoteTimer reaches 0. The VoteTimer is therefore reset to 9, the ResidentTimer decrements and the game goes on. Thus it takes much longer until a new Resident gets elected and until valid votes can be triggered again (up to almost 50 turns scaled for game speed). Maybe that was the reason why some thought the AP was in a state of hibernation. But it *will* come back to life eventually, so it's not really a bug that breaks the AP completely.

    I would suggest to alter CvGame::clearSecretaryGeneral (the method that's called when the Resident loses his position due to FR or another Religion):
    Code:
    [SIZE="3"]void CvGame::clearSecretaryGeneral(VoteSourceTypes eVoteSource)
    {
    	for (int j = 0; j < GC.getNumVoteInfos(); ++j)
    	{
    		CvVoteInfo& kVote = GC.getVoteInfo((VoteTypes)j);
    
    		if (kVote.isVoteSourceType(eVoteSource))
    		{
    			if (kVote.isSecretaryGeneral())
    			{
    				VoteTriggeredData kData;
    				kData.eVoteSource = eVoteSource;
    				kData.kVoteOption.eVote = (VoteTypes)j;
    				kData.kVoteOption.iCityId = -1;
    				kData.kVoteOption.szText.empty();
    				kData.kVoteOption.ePlayer = NO_PLAYER;
    				setVoteOutcome(kData, NO_PLAYER_VOTE);
    
    				[COLOR="RoyalBlue"][B]setSecretaryGeneralTimer(eVoteSource, 0);[/B][/COLOR]
    			}
    		}
    	}
    }[/SIZE]
    The blue code sets the ResidentTimer to 0 so that a new Resident can be elected at the earliest possible voting date (VoteTimer = 0).
    I don't have much time right now unfortunately to test this thoroughly (just tried with LegionSteve's save and it worked fine). I also hadn't encountered that problem personally so I don't have any other saves or testbeds to try it out...
     
  8. Dresden

    Dresden Emperor

    Joined:
    Jul 10, 2008
    Messages:
    1,081
    Wonderful Dan. This was the last thing on the agenda for the next version. I also don't have any saves that had the problem but with a better understanding of the problem perhaps we can come up with some test methods.
     
  9. Dresden

    Dresden Emperor

    Joined:
    Jul 10, 2008
    Messages:
    1,081
    Just a note that the next version (0.21) is in final testing and should hopefully be released in a week or so. We did what we could with the AP voting but some of the reported oddities just weren't reproducible so they'll have to wait for later.
     
  10. Lexad

    Lexad royalcrownchinpokomaster

    Joined:
    Mar 26, 2006
    Messages:
    2,337
    Location:
    Russia
    Dan - great, as always! Thank you guys for your efforts!
     
  11. Joshua368

    Joshua368 Warmongering builder

    Joined:
    Jun 12, 2008
    Messages:
    3,072
    I downloaded the installer and set it for a custom assets installation with 50 civ support and collateral damage for tanks. While the 50 civ thing seems to work fine, the civilopedia doesn't show barrage access for tanks or cho-no-kus.

    Also when I try to load up my save it causes the game to freeze, completely broken. Is this an incompatibility with the BUG mod or the minor changes I made to the CustomAssets folder? Is there any way to uninstall the patch if I can't get it to work?
     
  12. Dresden

    Dresden Emperor

    Joined:
    Jul 10, 2008
    Messages:
    1,081
    Just to be clear since this is the older topic, did you install 0.19.1 or 0.21?

    For the loading problem: was it an older 50-civ save or an 18-civ save? If you're playing with a 50-civ DLL, you can't load an 18-civ game or vice-versa.

    As far as I know, the installer only allows 2 options: a mod install or an Assets install. Did you do the latter and then move the files to CustomAssets? In an Assets install, CustomAssets will still take precedence so if you have any CustomAssets XML files, they'll still override those installed by the Unofficial Patch. What's the exact size & modification time on both the Assets/XML/Units/CIV4PromotionInfos.xml and (if you have one) the same file under CustomAssets?

    I'm not sure about an automated uninstall but all files which are replaced during installation are backed up to a folder with a name like "backup_before_dresden_0.21" so you can restore them all if you need to uninstall.
     
  13. Joshua368

    Joshua368 Warmongering builder

    Joined:
    Jun 12, 2008
    Messages:
    3,072
    Ah yes, got the threads mixed up, it was the 0.21 version.

    Also the 50-civ/18-civ makes sense, okay, no big deal I'll just stick to 18 then. That was probably the problem. But what about the collateral promo not appearing in the civilopedia? Is that just a quirk of the pedia and it'll still exist ingame?

    The main reason I don't want an Assets edit is because I'm pretty sure that screws me over in multiplayer. It's late now so I'm going to bed but tomorrow. Which files should I delete/transfer? CvGameCoreDLL and GlobalDefines? (the only two which I can see back-ups for)
     
  14. Dresden

    Dresden Emperor

    Joined:
    Jul 10, 2008
    Messages:
    1,081
    The promos might be a quirk of the pedia. WB yourself a tank with some XP and see if the promo is available; if not, check for a CIV4PromotionInfos.xml in your CustomAssets. The DLL has to stay in Assets to have any effect (DLLs don't work in CustomAssets) so you'll want to swap it out with the original to play MP but you can certainly move the GlobalDefines to CustomAssets and restore the original one.
     
  15. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,789
    Location:
    Where animals hop not run
    Have a happy XMAS Dresdon! Thanks for your work on keeping this great game up to scratch. Your general knowledge on all things BTS has been invaluable.
    Cheers.
     

Share This Page