[BtS] JCultureControl: Beyond City Borders

Jeckel

Great Reverend
Joined
Nov 16, 2005
Messages
1,637
Location
Peoria, IL
!! RELEASED !! - July 20, 2008
!! NEW VERSION RELEASED !! - August 21, 2008

Requires: Civilization 4: Beyond the Sword v3.17

This mod gives Tile Improvements the ablitity to emit Culture Borders, similar to Cities. The range that Culture Borders expand from the Improvement is set in a new CIV4ImprovementInfos.xml tag. There is no code limit to this range, but exceptionally high values may cause lag when Improvements are built. However, no normal value should cause any lag at all.

If an Improvement Spreads Culture Control then the name of its owning Civilization will be displayed before the Improvement's Description on the Main Interface's Flying Help Text when you hover the Cursor over the Improvement's Plot.

Improvements also have a Strength Value to their Culture Control. When an Improvement is placed, its Strength is added to each Tile in Range for the placing Player. When the game decides which Player's Border to place on the Tile, the Player with the highest Culture Control Strength will be choosen. If two or more Players tie for the highest Culture Control Strength, then no Player's Border will be placed on the Tile. The Percent of Culture Control for each Player with some Culture Control Strength will be displayed in the Flying Help Text when you hover the Cursor over a Tile.

If you have Cheat Level enabled, then in Single Player games, you can hold the SHIFT key and various information about a Plot's Culture Control States will be displayed.

The Rules

There are a few simple rules to how Improvement's Culture Control applies its Culture Borders.

Rule 1: Cities Rule the Land
A City's Culture Borders will always override any Improvement's Culture Border.

Rule 1.5: There Are Always Exceptions
The one exception to Rule 1. The Tile an Improvement is on will always keep its Culture Border until it is Pillaged by a Unit.
Note: This can be disable with an option in the GlobalDefinesAlt.xml file.

Rule 2: The More the Merrier
The more Improvements with a Tile within their Range, the more Culture Control you will have on that Tile. The Player with the Highest Culture Control of a Tile will get their Culure Border around it.

Rule 2.5: Everyone Loses a Tie
If two or more Players tie for the Highest Culture Control of a Tile then no Border at all will be applied to that Tile. If you don't control it more then everyone else, then you don't really control it, do you.

Rule 3: Borders Not Required
If you don't like Improvements emiting Cutlture Borders, but you still would like Improvements to belong to the Civilization that builds them, you can set the CIV4ImprovementInfos.xml tag bSpreadCultureBorder to 1 and iCultureBorderRange to -1. This will cause Improvements to be displayed as “Aztec Town”, “Sumarian Fort”, “American Workshop”, etc, but will not add any Culture Border on or around them.

Rule 4: Fat Crosses for Everyone
If an Improvement has an iCultureBorderRange of 2 or more, then its Culture Border will not be square. Instead it will be a Fat Cross similar to the larger levels of a City's Culture Border. Basicly, the 4 corner Tiles will not get Culture Border.
Note: This can be disable with an option in the GlobalDefinesAlt.xml file.

Rule 4.5: Exceptions Make the Rule
An Improvement with an iCultureBorderRange of 1 will be square and include the 8 Tiles around the Improvement's Tile. This also is similar to City Culture Border expansion.

Requires: Beyond the Sword v3.17
Changes: XML, Python, SDK
Version: 2.000 - Released August 21, 2008
Download: JCultureControl Mod
Sources: http://forums.civfanatics.com/downloads.php?do=file&id=10076
 
Screen Shots are attached to this post for those that are visually oriented.

The first three shots are of Improvements with iCultureBorderRange 0, 1, and 2.

The next three are Pedia Pages of Fort, Castle, and Citedal, the example Improvements in the mod.

The last screen shot is of several different Improvements conflicting over some Tiles. Not that the Percents of Culture Control being displayed in the Flying Help Text on the left of the Screen Shot.
 

Attachments

  • JCultureControl_CultureBorderRange0.JPG
    JCultureControl_CultureBorderRange0.JPG
    85.3 KB · Views: 1,037
  • JCultureControl_CultureBorderRange1.JPG
    JCultureControl_CultureBorderRange1.JPG
    99.7 KB · Views: 1,058
  • JCultureControl_CultureBorderRange2.JPG
    JCultureControl_CultureBorderRange2.JPG
    106.6 KB · Views: 1,075
  • JCultureControl_Pedia_Fort.JPG
    JCultureControl_Pedia_Fort.JPG
    78.8 KB · Views: 836
  • JCultureControl_Pedia_Castle.JPG
    JCultureControl_Pedia_Castle.JPG
    80.1 KB · Views: 776
  • JCultureControl_Pedia_Citadel.JPG
    JCultureControl_Pedia_Citadel.JPG
    78.8 KB · Views: 734
  • JCultureControl_Example.JPG
    JCultureControl_Example.JPG
    135.2 KB · Views: 1,003
Known Glitches:

None




Known Quirks:

Improvements NOT built by a Unit, placed in the Worled Builder, or placed durning Advanced Start will not be owned by any Player.




Planned Future Changes:

DONE - v1.110 - Update WorldBuilder to use Culture Control features.

DONE - v2.000 - Update Advanced Start to use Culture Control features.

Teach the AI to build Culture Border emitting Improvements "correctly". First will have to determine what "correctly" means.
 
I just got up for the day.I think I might have found a glitch that is keeping the AI from using my changes. I have to go pick my girlfriend up from work in a bit, but when I get home I am going to verify that there is a glitch and fix it if there is.

But after that, one way or another, I will be uploading it. So I would say some time within the next 6 to 8 hours. :D
 
Ok, after much fighting with my dial up internet connection, I finnally got the mod uploaded. I had to upload the Mod's SDK Sources seperatly as my connection just couldn't handle the extra 0.7 MBs of compressed data. :crazyeye:

The glitch I thought I found was there, but wasn't anything really important. It seems that the data I set on Plots in the SDK is erased, and not set to begin with, when the AIAutoPlay feature is used.. :confused: O'well, doesn't effect 99.9999% of mods, so I'm not to worried about it.

Anyway, the mod and the sources are uploaded and both are linked in the first post. :king:
 
Hey,beautiful Mod!!!
But I am not sure if I did everything right...After 3 rounds the culture disappeard :-(
I changed nothing!? Whats wrong?
 
humm....
say jeckel,

is the culture code is basicley only on the sdk?

the python is only for the alerts and ai right?


*******
well, i thinks theres an error with the sdk files,
i got an error on the cvunit.cpp, something with idamage on lines 12244 12252,

im no sdk coder, but it seems theres no cvunit.h .....

could you plz take a look at this ?
 
Hmm, yes, I am now also noticing several problems. I think I have a lead on the problem. Sorry for the inconvience. I will post a little later with more details.
 
humm....
say jeckel,

is the culture code is basicley only on the sdk?

the python is only for the alerts and ai right?
Yes, the dll and the modified Terrain Schemea XML file are the only things required by the mod. All the Python is just for AIAutoPlay.


well, i thinks theres an error with the sdk files,
i got an error on the cvunit.cpp, something with idamage on lines 12244 12252,

im no sdk coder, but it seems theres no cvunit.h .....

could you plz take a look at this ?
I don't know about that one. I checked those lines and I hadn't modded anything near them or to do with them that I saw. Perhaps it is related to the reason Improvements are losing their Borders.



As an update.

I have narrowed down the problem a bit. It seems Culture Control and Improvement Owner data is lost when an auto save is performed. I am continuing to narrow this down. Its just a matter of time, but dang, nothin can ever be easy, can it... :crazyeye:

EDIT: A further update. I am 99 percent sure I have found and fixed the problem. Incidentally, AIAutoPlay also now works correctly and with no quirks. :band:
 
ok jeckel,
i will try to compile a file only using your code,

the error wont let the compiling finish acctually,


i hope there wont be a problem with only your files

in my merging i have only pulled out the culture code, without the ai, its not suppose to be a problem, right?
 
ok jeckel,
i will try to compile a file only using your code,

the error wont let the compiling finish acctually,


i hope there wont be a problem with only your files

in my merging i have only pulled out the culture code, without the ai, its not suppose to be a problem, right?

Correct, if you just copy the JCultureControl stuff and ignore the AIAutoPlay stuff in the SDK, there won't be any problem. The AIAutoPlay changes don't effect the JCultureControl stuff at all.
 
Alright, I guess I was tired when I finished this mod up last night, because the primary problem was a miss copy/paste by me. But, beyond that, I identified and fix several problem areas.

The problems with the Culture Borders disappearing and the quirks with the AIAutoPlay clearing Culture Control and Improvement Ownership have been fixed.

I have tested several games for 100 plus turns and havn't noticed any problems.

I have uploaded a fixed version and Sources, now v1.100. Delete any previous installation of JCultureControl, download the new one, and unzip.

Sorry for the problems, but you get what you pay for some times. :p
 
Very cool, a definite addition to my mod. Forts will be so much more important now. And the good thing about that is that the AI actually builds forts on bonus ressources that's outside it's city borders! Now we just need to teach the AI to build forts at chokepoints! ;)
 
Top Bottom