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

[BtS] JCultureControl: Beyond City Borders

Discussion in 'Civ4 - Mod Components' started by Jeckel, Jul 19, 2008.

  1. Jeckel

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

    Jeckel Great Reverend

    Joined:
    Nov 16, 2005
    Messages:
    1,637
    Location:
    Peoria, IL
    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.
     

    Attached Files:

  3. Jeckel

    Jeckel Great Reverend

    Joined:
    Nov 16, 2005
    Messages:
    1,637
    Location:
    Peoria, IL
    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.
     
  4. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,519
    Location:
    israel
    awesome,

    cant wait.
     
  5. Jeckel

    Jeckel Great Reverend

    Joined:
    Nov 16, 2005
    Messages:
    1,637
    Location:
    Peoria, IL
    Attached 6 ScreenShots, the Readme PDF, and the API PDF to the second post.
     
  6. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,519
    Location:
    israel
    wow...great looking photos,

    can you say when youll release?
     
  7. Jeckel

    Jeckel Great Reverend

    Joined:
    Nov 16, 2005
    Messages:
    1,637
    Location:
    Peoria, IL
    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
     
  8. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,519
    Location:
    israel
    great man,

    its a really cool addition to civ,
    \
    building forts now can really matter, now it will allow to build kida like border lines to your empire with forts!

    awesome!
     
  9. Jeckel

    Jeckel Great Reverend

    Joined:
    Nov 16, 2005
    Messages:
    1,637
    Location:
    Peoria, IL
    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:
     
  10. Vic_Tizailion

    Vic_Tizailion Chieftain

    Joined:
    Aug 3, 2007
    Messages:
    9
    Thanks so much for this. It is exactly what I have wanted to try for a long time. Does the DLL contain the unofficial patch changes? Unfortunately I don't have the skills to merge the two myself. I'd love to make this part of my standard game. Thanks again for your efforts!
     
  11. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,519
    Location:
    israel
    let rock n rolll!!!

    thansk alot buddy! great work!
     
  12. Tripod

    Tripod Chieftain

    Joined:
    Dec 9, 2007
    Messages:
    32
    Location:
    Germany
    Hey,beautiful Mod!!!
    But I am not sure if I did everything right...After 3 rounds the culture disappeard :-(
    I changed nothing!? Whats wrong?
     
  13. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,519
    Location:
    israel
    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 ?
     
  14. Jeckel

    Jeckel Great Reverend

    Joined:
    Nov 16, 2005
    Messages:
    1,637
    Location:
    Peoria, IL
    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.
     
  15. Jeckel

    Jeckel Great Reverend

    Joined:
    Nov 16, 2005
    Messages:
    1,637
    Location:
    Peoria, IL
    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.


    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:
     
  16. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,519
    Location:
    israel
    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?
     
  17. Jeckel

    Jeckel Great Reverend

    Joined:
    Nov 16, 2005
    Messages:
    1,637
    Location:
    Peoria, IL
    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.
     
  18. Jeckel

    Jeckel Great Reverend

    Joined:
    Nov 16, 2005
    Messages:
    1,637
    Location:
    Peoria, IL
    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
     
  19. Ninja2

    Ninja2 Great Engineer

    Joined:
    Nov 17, 2005
    Messages:
    1,142
    Location:
    Denmarkia
    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! ;)
     
  20. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,519
    Location:
    israel
    thanks jeckel,

    ill be sure to try and merge the new version when i get home :)

    keep up with your awseome additions.
     

Share This Page