Unofficial BTS 3.13 patch

There are checks on how many executives and missionaries the AI thinks needed but the way the code works now bypasses them. So it should be easy to add them.

How about adding something like
Code:
if (kPlayer.AI_neededExecutives(area(), eCorporation) > kPlayer.countCorporationSpreadUnits(area(),eCorporation))
to somewhere in CvCityAI::AI_bestSpreadUnit?

Of course, if a civ is on a Pangaea, with lots of foreign cities and doesn't have open borders with its neighbours, it would still build too many.

EDIT: No, that won't work all that well. You'd need to change AI_neededExecutives too so that it will spread foreign corporations. But that's not hard.

The way the missionary and executive AI code works now, it makes builds the right unit but doesn't know how many it will need or take into account the possibility of overseas spread. Missionaries worked better in the Better AI mod.
 
Isn't there a mod that dynamically changes the missionary/executive limit with map sizes? Wonder why they still haven't done such a thing officially.
 
My sense from seeing the executive problem in action is that the AI sees that there are cities without the corporation, so builds an exec to remedy that. However, some other circumstances, such as geography and war, prevent the exec from traveling to the cities in question. They stay where they were built but the cycle starts again, without the AI realizing that it already has more executives than it can use.

I don't know how simple this fix would be, but a crude approach to the problem would be to prevent any city from building a corporate exec if there's already one sitting there. Not perfect, but reduces the problem to one exec per city and ensures that the AI isn't starved for execs as can be the case with the old cap reinstated.
 
Thanks a lot for your excellent work, Bhruic. 3.13 is playable again (and it's a bit harder than 3.02, too). You da man! :rockon:
 
@Quagga: Hm, if *that* is the underlying problem, then the best solution would probably be to subtract the current number of executives from the number of potential target cities. Also, it might be a good idea to make the AI a bit suspicious of its own executive stacks. If it has executives idling around, then it should grow suspicious of its own desire to build even more, and stop doing so.
 
I don't know how simple this fix would be, but a crude approach to the problem would be to prevent any city from building a corporate exec if there's already one sitting there. Not perfect, but reduces the problem to one exec per city and ensures that the AI isn't starved for execs as can be the case with the old cap reinstated.

Seems simple and functional, might switch it to blocking at two executives of the particular type in the city ... that way if they've just built 1, they can then start building another. Otherwise the unit has to move first, so the AI wouldn't be able to continuously pump them out even if it had places to send them (unless the AI moves its units before issues build orders ...).

Certainly a real AI solution would be best, but simple might be much easier to test.
 
The Real fix for corporate spam is obviously for the AI to consider how many Executives it actually wants to use (it needs to also consider the gold cost of using them then) then the AI would use that as its individual "Cap"

But a large cap (like 6) seems reasonable enough as an unofficial fix.
 
the corporate exec thing sounds like a bad bug to me! i don't know how to fix it of course, all i can do is .xml stuff. on the off-chance that it might help you experts track it down and fix it, i went and looked up the other changes to execs from the change list for the official patch:

Automated corporation spreading no longer tries to spread corporation where it cannot be spread

Fixed AI seaborne corporation spreading bug



You only have to change the XML? I thought there was more to it than that. It says 3 units max in the game and everything?

spoilered for space since it's a sidetrack, and because i'm not entirely sure that i understood your question:
Spoiler :
that's all you need to do for the limit itself to go away, yup. i know nothing of programming but the stuff you can do from .xml is spiffy. that information in the civilopedia and when you hover over the unit (3 max, etc) is drawn from the .xml files as you play, not set in stone somewhere. that's why the pedia entries for things like "time to grow a cottage" and "temples needed for a cath" are better to check during a game - if you check from the main menu, it defaults to standard size, normal speed. during a game it'll use the game settings.

if you start a game, exit it and change the .xml so that the kremlin requires The Wheel as its only pre-req, then restart civ, the pedia entry for the kremlin will list the pre-req as the wheel, stuff like that.

you can change the effects and obsoleting of events (not add new events mid-game tho), change limits, change pre-reqs and obsoleting techs for units, wonders, techs, just about everything except that i never figured out how to make monasteries last past SciM *giggle*.

sorry for the ramble if that wasn't what you were asking. i think it's ultra-spiffy that the system is this easy/flexible. i guess i felt the need to advertise it ;). you can write a leader picker, so if even i can do this, i'm sure you can!
 
Spoiler for KMad :
Yeah, KMad, I know the power of XML. I'm a code guy by trade, but tend to avoid it outside of work. I'm afraid if I dive into this game's code, I'll wind up changing a lot of things, and spend more time there than in the game.:blush:

ANYWAY, thanks for the clarification. I wasn't aware that the unit limits were in the XML. I just never checked, and couldn't while I'm away from the game today.:( For some reason I had in my head that they would be somewhere else.


Well this appears to be a short-term solution that I'm going to implement. Short of someone coding the AI to use execs in a more intelligent way, this should accomplish roughly the same thing.
 
I'm afraid if I dive into this game's code, I'll wind up changing a lot of things, and spend more time there than in the game.:blush:

legitimate fear! hubby prefers to mod civ4 rather than play it :crazyeye: quite welcome, and i'm glad you didn't read my ramble as condescending.

oh i posted while you were editing. i had no idea you could add words to the Spoiler line, thanks!
 
Does anyone have a game where the AI has a lot of Executives on hand, and is still constructing more in their cities? None of my games have made it as far as Corporations yet (I play Marathon, and usually end up starting a new game before it gets that far), so I haven't experienced it yet.

Bh
 
Bhruic.

May I ask a stoopid question? (repeat one actually)

If I am hosting a PitBoss game and I am using your patch fix...will there be real problems with those who aren't using your patch-fix?

We're getting the file mis-match warning but so far no problems.

ta!
 
I can't say for certain, I've never played a PitBoss game, and don't really know how they function. But as long as only one player is playing at a time, you won't run into "problems", per se, but you'll end up operating the game by different rules depending on who's currently playing.

Bh
 
Hey Bhruic... looks like some people are having problems installing the Patch, Why don't you make it into a Mod?

So all the people have to do it extract the files and folders into (C:\Users\Administrator\My Documents\My Games\Beyond the Sword\MODS)
and they can just load the mod and if they don't like loading the mod manually every single time they load Civ4, they can just change the ini. file to this

; Specify a Mod folder (Mods\Mesopotamia), '0' for none
Mod = Mods\Bhruic's Patch


That is how I install the patch lol.
 
It depends. On a duel sized map 3 executives per corp is more than enough for a quick spreading of corporations. On a huge map with a 40 city multi continent empire and many foreign cities, it can be pretty slow especially since it takes several turns to build an executive and you can only have 3 in the build queue + active.

Very good point!

There probably should be a limitation, but as you said, it should be linked to map size... which makes sense.

Would this work well with missionaries too?
 
I need some help because I am now afraid to touch my computer. I renamed my original dll files, then downloaded the unofficial patch. I then put the new dll files inside the C: program files,etc. At this point I tried to open beyond the sword multiple times, but it wouldn't(always at the same point). At this point the original DLL was a folder inside the main BTS folder, but outside the assets. I tried putting the new one in the same general BTS folder, then both inside the assets folder. None of this worked so I just deleted the new DLL and was going to try it again after asking what I was doing wrong. Now the game won't work with the original DLL inside or outside of the assets folder. I even went to go and see if I could uninstall BTS, then reinstall to try and fix everything, but couldn't find the program in the list of the things to uninstall.

So sorry for the very long post, but it is frustrating because I just bought it a little while ago and it was working before I "fixed" it. It was working with version 3.13 to, in case that's important.
 
Gutentag

Well you can do What I did. Make the Patch into a Mod so you can just load the mod whenever you want to use it.

This is what you do...

Extract the file I've Uploaded HERE to the following location (My Documents\My Games\Beyond the Sword\MODS)



The pic above is an example of where to extract the files (NOTE this is the 1.07 version of the unofficial patch I've uploaded)

And that's all you have to do... just load the game normally, go to Advance => Load a Mod and you should be able to Load Bhruic's Patch.

If you get tired of loading Bhruic's Patch manually, just go to the ini file (My Documents\My Games\Beyond the Sword) and make the game automatically load the game for you with Bhruic's patch every time you play




The two pics above are examples of where the ini file is (It's highlighted in the 1st pic) and what and how to change (It's also highlighted)

Hope it's not too complicated for you, any questions just ask.

Note: I've also include the supplementary fixes.

Whenever a new version of the Unofficial Patch is released just replace the old DLL at the following location

My Documents\My Games\Beyond the Sword\MODS\Bhruic's Patch\Assets
 
Back
Top Bottom