Unofficial BTS 3.13 patch

Hi.

Yesterday, I installed the SDK and made the following change to CvGameCoreDLL.dll (based on Bhruic's 1.11 code): city governor only builds workers or workboats if the menu option 'workers start automated' is ticked (or there are no other things to build because you don't have researched the proper technologies, and the conditions for building workers or workboats are met). Related forum thread: http://forums.civfanatics.com/showthread.php?t=250781

I have modified CvCityAI::AI_buildGovernorChooseProduction() method with the following changes (in italic), and it seems to work:

//city governor builds a workboat only if 'workers start automated' menu option is ticked
if (GET_PLAYER(getOwnerINLINE()).isOption(PLAYEROPTION_START_AUTOMATED))
{

if (pWaterArea != NULL)
{
if (GET_PLAYER(getOwnerINLINE()).AI_totalWaterAreaUnitAIs(pWaterArea, UNITAI_WORKER_SEA) == 0)
{
if (AI_neededSeaWorkers() > 0)
{
if (AI_chooseUnit(UNITAI_WORKER_SEA))
{
return;
}
}
}
}
}

and:

//city governor builds a worker only if 'workers start automated' menu option is ticked
if (GET_PLAYER(getOwnerINLINE()).isOption(PLAYEROPTION_START_AUTOMATED))
{

int iExistingWorkers = GET_PLAYER(getOwner()).AI_totalAreaUnitAIs(area(), UNITAI_WORKER);
int iNeededWorkers = GET_PLAYER(getOwner()).AI_neededWorkers(area());

if (!bDanger && (iExistingWorkers < ((iNeededWorkers + 1) / 2)))
{
if (AI_chooseUnit(UNITAI_WORKER))
{
return;
}
}
}

I don`t know if this is the right thread to show this or if there's an specific thread to "unofficial patch" code development. If you like the idea, it can be merged into the 'unofficial patch'.
 
Regarding how the A.I. values future improvements, you could modify the expected output of a tiles based on the length of time an improvement would be available. The lumbermill is about halfway up the tech tree, so it would be valued half it's output. Railroads are about 60% up the tech tree so the added production it gives to lumbermills and mines would be one sixth of a production point. Would that work? By the way, could the A.I. adjust those values as it moves up the tech tree? Like valuing a lumbermill closer to it's full value as it gets closer?

That's a nice idea, but I'm not sure it would work properly. There are too many improvements that change value based on other factors. Farming, for example, becomes better with Biology, and becomes more prevalent with Civil Service. Workshops become better with Guilds and Chemistry, as well as Caste System and State Property. Trying to calculate all of the possibilities would quickly become extremely messy.

Bh
 
How I'm approaching it at present:

There are, as I see it, four factors that go into determining the value of a city. Two objective, two subjective.

1) Intrinsic value of an individual plot. By scaling the value of food/hammers/commerce, it's possible to come up with the optimal usage of an individual plot independent of city usage. For example (and I'm making these numbers up), if you value 1 :food: = 2 :hammers: = 4 :commerce:, you can decide if a grassland river tile that generates 2 food and 8 commerce is valued higher than a grassland river tile that generates 3 food and 1 commerce. This independent valuation will be modified by available technologies, civics usage, buildings, etc. Coming up with this valuation is very difficult.

2) Subjective value of a plot to a specific city. Or, put differently, value of a plot within a group of plots. Having multiple plains/hills/iron squares would yield large amounts of hammers, making them quite valuable. But if there's no food to work them, then their situational value decreases. This valuation is moderately difficult.

3) Intrinsic value of a city. Once you've subjectively evaluated the plots, you can come up with a "complete" valuation for a city. This is relatively easy once the previous steps are accomplished.

4) Subjective value of a city. Having an incredibly valuable city location on the other side of the world from your starting location isn't very useful. Having an incredible valuable city location with most of the tiles within another Civ's borders also isn't very useful. So the value of a city needs to be adjusted based on the Civ that is valuing it. This is a moderately difficult task.

With that stated, one of the first steps would seem to be coming up with a proper weighting to food/hammers/commerce. I've been monitoring http://forums.civfanatics.com/showthread.php?t=251230 which has been discussing it, but there hasn't been a lot of participation yet. If anyone would care to comment further, that would help.

Bh
 
speaking of workboats a couple of posts up...

not that i ever harass the AI with privateers for hours on end of course :mischief:, but i hear that if you do that and blockade their seafood sources, even if you don't pillage their fishing boats, they keep making workboats. and keep making them, and keep making them. the fishing boats are still in place, but the civ doesn't get credit for the resource since it's blockaded, i guess that confuses them.

this rumor made me curious so for scientific purposes i staged a re-enactment of this horrible crime i'd never commit on my own, and turned on chipotle. when i held down ctrl over their city to see the "workboats needed" number it clearly says 0, but they're making them anyway. :confused: seems weird to me. if chipotle knows the fishes are netted, why doesn't the governor know?

not the biggest problem in the world of course. if you're blockading them you're trying to cripple them anyway. but that's just a really pathetic level of stupid, and it makes me sad. they're building workboats they wouldn't need to use even if they could get to the fish! :crazyeye:
 
A similar instance with the workboat, which I'm sure many of you have seen, is a resource that is outside the cities Fat cross. Your own build list will continue to list the Wboat even though you will get no direct benefit from sending 1 to that resource tile. The tile is In your area of Influence but if you send the Wboat and it *nets* the fishies you don't get any benefit from it. Why waste the time and effort to send the wboat there? The AI will do it too.

Even if the resource is half a world away but in your area of Influence ALL your cities will list Wboat in the build list. So if I build one in China and set it on Auto it will travel if possible to New York to claim that resource that you will get no benefit from. That seems futile to me.

JosEPh
 
A similar instance with the workboat, which I'm sure many of you have seen, is a resource that is outside the cities Fat cross. Your own build list will continue to list the Wboat even though you will get no direct benefit from sending 1 to that resource tile. The tile is In your area of Influence but if you send the Wboat and it *nets* the fishies you don't get any benefit from it. Why waste the time and effort to send the wboat there? The AI will do it too.

Even if the resource is half a world away but in your area of Influence ALL your cities will list Wboat in the build list. So if I build one in China and set it on Auto it will travel if possible to New York to claim that resource that you will get no benefit from. That seems futile to me.

JosEPh

I have noticed this as well. IIRC, though, the workboat also disappears from the "recommended build" zone once at least one city commences production.
 
Hi

Wouldn't you get the same benefit of having access to any other resource not in a cities fat cross? An extra resource to trade, use for coorporations or just to have a back up in case one of them gets pillaged?

Kaytie
 
I have 2 questions regarding the patch.

1. If we play pitboss game with people that use original 3.13, will there be a problem?

2. The first time I downloaded the patch 1.05 i think, I used only the dll. The last version had an exe file which I used. What does the exe do? And is there anyway to undo what it does?

Thanks and sorry if these have already been answered but there are so many pages in this post it is very difficult to go through them.
 
2. The first time I downloaded the patch 1.05 i think, I used only the dll. The last version had an exe file which I used. What does the exe do? And is there anyway to undo what it does?

Since the patch linked in the first post of this thread comes in the form of a .zip file, I'm assuming that the .exe you used is the automated installer I provided. All it does is copying the files offered by Bhruic to the BTS folders. The goal was to simplify the installation process as far as possible. Since people kept asking what to do with the DLL and the other files, this seemed like a good idea to me.

The installer comes with separate options to install the core patch (dll), the fix for the glance tab and the fixes for the worldbuilder and the civilopedia bug (.py files). By default, all of these will be installed.

Also by default, all files to be replaced are backed up by moving them to folders named "backup_before_bhruic_x_xx" (where the x_xx stands for the version number of Bhruic's patch). To undo the changes made by the installer, simply move the files back out of those backup folders.
 
Perhaps it will be easier for people to help you if you can attach any error message that BtS generate before it kick you back to Desktop after you install 3.13? And do you mean the official 3.13 or the unofficial 3.13? :)

i have installed the unofficial 3.13 and there is no error message
the game simply exits itself
 
Will this fix the problem I am having with 3.13, where it kicks me out to the desktop immediately after starting the game?

Thanks for your help. :)
 
Will this fix the problem I am having with 3.13, where it kicks me out to the desktop immediately after starting the game?

Thanks for your help. :)
While it seems to solve some crashes, there are quite a few reasons for CTDs - if it does not help please post a new thread in the Civ4 Tech Support subforum and we can try to figure out what causes the crash.
 
This is a really newb question, but where to I save the patch to? In the assets folder where the original CVGameCoreDLL is? And should I remove the oringinal DLL file when I do that? (ive got a copy saved on my desktop)
 
This is a really newb question, but where to I save the patch to? In the assets folder where the original CVGameCoreDLL is? And should I remove the oringinal DLL file when I do that? (ive got a copy saved on my desktop)
yes and no need it overwrites it :)
A bit longer:
The zip you can download contains the cvgamecoredll.dll and a couple of .cpp files. Unless you want to change the code yourself you only need the .dll - that goes into the path were the original .dll is and overwrites it, it is prudent to keep a copy of the original around just in case. And: read the readme provided with the patch it does tell you the same I just did :)
 
This may also seem like a newbie question, but it's one that's important for me.

My friends who I play MP with don't want to download the unofficial patch. I have downloaded it and installed it successfully thanks to grumbler's automated .exe file, and have created a backup of the official .dll to another folder. The DLL resides in F:/Program Files/Firaxis Games/Sid Meier's Civilization IV/Beyond the Sword/Assets.

My question is, can I revert to the official patch when I need to by simply moving the DLL's around? I've played a few games with the unofficial patch, but now, every time I replace Bhruic's DLL with the official one, the game doesn't start up at all (Vista says it stopped working). What can I do to simply revert to the original game without having to uninstall/reinstall the whole thing? Does clearing the cache help? If so, how or where do I clear the cache? Do I have to delete some CoreGame files?

Thanks in advance!
 
This may also seem like a newbie question, but it's one that's important for me.

My friends who I play MP with don't want to download the unofficial patch. I have downloaded it and installed it successfully thanks to grumbler's automated .exe file, and have created a backup of the official .dll to another folder. The DLL resides in F:/Program Files/Firaxis Games/Sid Meier's Civilization IV/Beyond the Sword/Assets.

My question is, can I revert to the official patch when I need to by simply moving the DLL's around? I've played a few games with the unofficial patch, but now, every time I replace Bhruic's DLL with the official one, the game doesn't start up at all (Vista says it stopped working). What can I do to simply revert to the original game without having to uninstall/reinstall the whole thing? Does clearing the cache help? If so, how or where do I clear the cache? Do I have to delete some CoreGame files?

Thanks in advance!
You should be able to revert to the official patch by swapping dll files, but the easiest way would be to make Bhruic's patch a mod by creating the following file path (just create the ModName and Assets folders):
F:/Program Files/Firaxis Games/Sid Meier's Civilization IV/Beyond the Sword/Mods/ModName/Assets
then put Bhruic's patch into that Assets folder and when you want to use it just load the mod called ModName (you can obviously call it whatever you like)...
Edit: when it does not start up does it give any errors?
 
You should be able to revert to the official patch by swapping dll files, but the easiest way would be to make Bhruic's patch a mod by creating the following file path (just create the ModName and Assets folders):
F:/Program Files/Firaxis Games/Sid Meier's Civilization IV/Beyond the Sword/Mods/ModName/Assets
then put Bhruic's patch into that Assets folder and when you want to use it just load the mod called ModName (you can obviously call it whatever you like)...
Edit: when it does not start up does it give any errors?
Thanks, I should try that out. Unfortunately, when I tried reinstallation the other day, Windows saw it fit to keep Bhruic's patch installed, so that when I updated to 3.13 again after reinstalling BtS, Bhruic's DLL wasn't replaced and the game remained patched.

When I first downloaded the patch, just swapping the DLLs as the Readme suggests didn't upgrade the game to Bhruic's patch. I had to use grumbler's automated .exe to do the work for me, even though I have no idea why following the Readme's instructions didn't work. I'll probably have to manually delete every trace of BTS or else reinstall all of Civilization IV to be sure.

When I start the game by simply replacing Bhruic's DLL with the backed-up original DLL, the loading screen with different languages pops up, but then after it goes away Windows Vista says that the program stopped working. No Civ IV warnings, no crashing. It just doesn't start up past the loading screen.
 
With that stated, one of the first steps would seem to be coming up with a proper weighting to food/hammers/commerce. I've been monitoring http://forums.civfanatics.com/showthread.php?t=251230 which has been discussing it, but there hasn't been a lot of participation yet. If anyone would care to comment further, that would help.

I don't have an answer, but maybe a suggestion on how to find one...

What if you chose "plausible" weightings AT RANDOM for the valuations the AI puts on various kinds of tiles, and started an AI-only game where each AI uses different random weightings for city placement. Use random personalities to negate UB/trait synergies. See which AI wins the game. Repeat a million times or so, and see if you can find any trends in weightings.

I don't know how easy it is to set up an AI-only game or how long it would take to run to completion, but it's a method you could use to try out various AI strategies and see which one works by the only criterion that really matters: who wins.

Of course, this assumes the AI can support different strategies for city placement for each AI. At any rate, having each AI using different strategies might add another interesting dimension for AI personalities in a game involving humans...
 
Top Bottom