Announcement

Collapse
No announcement yet.

[Mod] ChangePlotCulture()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Mod] ChangePlotCulture()

    Mod released! ChangePlotCulture() v0.90

    This mod adds a new function: ChangePlotCulture()

    This function operates similarly to how plot culture is assigned already. A check is included to differentiate between negative and positive culture. Note that this function is only meant to be called once per turn, as the formula is not entirely proportional to the culture rate.

    As is, this mod will put all cities at a cultural standstill. This is more of a programming tool than an actual mod.

    The mod uses a hard-coded formula for determine the cultural borders and the XML values have been edited to account for this. If I can find out how to calculate what the borders should be, I'll update this mod as appropriate to version 1.0

    Get the mod here: http://apolyton.net/upload/view.php?...lotCulture.zip

    For now, expect the cultural model I promised in my main mod!
    Last edited by Mylon; November 26, 2005, 12:29.
    Mylon Mod - Adressing game pace and making big cities bigger.
    Inquisition Mod - Exterminating heretic religions since 1200 AD

  • #2
    Sounds okay. I'll give it a try.

    edit: In what file can I find this plot culture stuff?
    Last edited by Junuxx; November 23, 2005, 18:19.

    Check out my Atlas Map Generator

    Generate, preview and play Civ IV maps of any size with the alternative Map Generator

    Comment


    • #3
      You can't. It is, like most of the functions of Civilization (like food, production, gold, research, and culture calculations of cities), hidden.

      Instead, you'll need something to the effect of PyCity.getX(), PyCity.getY(), PyCity.plot().ChangeCulture(TargetNation, PlotCulture), and PyCity.getCultureLevel() and PyCity.getCommerceRate(gc.getInfoTypeForString('CO MMERCE_CULTURE')) together to make the function.
      Mylon Mod - Adressing game pace and making big cities bigger.
      Inquisition Mod - Exterminating heretic religions since 1200 AD

      Comment


      • #4
        Okay, I've made some progress on this myself. On further examination it seems that if ChangeCulture also affects PlotCulture on these conditions: The culture change is positive. The player and the city's owner are the same. Therefore, to counter the existing way that culture occurs I must:

        Assign negative culture equal to culture rate.
        Assign negative plot culture equal to culture rate.
        Assign culture equal to new culture rate.
        Assign plot culture equal to culture rate. (For foreign Civs only).

        I also got a function that emulates the assignment of plot culture. It seems to work at the moment, but I'm having difficulty determining the radius to use. The statement
        Code:
        if CurrentCulture >= gc.getCultureLevelInfo(i).getXmlVal():
        Doesn't seem to be true, where CurrentCulture is the city's current culture and this statement is checked for every value of i within the range of culture levels. The API page doesn't list any other way that suggests it returns how much culture is needed to achieve a particular level. The only other option seems to be using a hard-coded table, which I would like to avoid if at all possible.
        Mylon Mod - Adressing game pace and making big cities bigger.
        Inquisition Mod - Exterminating heretic religions since 1200 AD

        Comment


        • #5
          Only function that seems like it may apply is:
          CvCity.getCultureThreshold()

          edit:
          Hmm, seems like there's an undocumented call for CvCultureLevelInfo.
          CvCultureLevelInfo.getSpeedThreshold(?)

          Not sure if it takes any variables, although it would look like it has to take the gamespeedtype if it's going to return the proper value.

          Bh

          Comment


          • #6
            I doubt threshhold will do what I want it to, though. What if the city owner has 4000 culture (for a threshold of 5000), but I'm assigning culture for that city's neighbor nation, which only has 400 culture?

            One method I've considered is changing the culture levels to follow a formula (50*5^(culturelevel)) which means I could use the formula in the code, but this is still a form of hard-coding.

            On another note, the way plot culture is assigned will make things really difficult if a city ever has more foreign culture than domestic culture. A difference of one culture level means +20 more culture on the city tile, which either must be overcome by the city's owner or the entire formula changed.

            Here's the situation: You just captured an enemy city. The city's nationality is 90% theirs, 10% yours, and the enemy has 2 culture levels on you. It's generating a base of 20 culture, which means if split across nationality, the city plot is getting +59 for them, and +5 for you. This means it'll only further become the enemy's city, without any foreign influence. Not including this +20 bonus per culture level, the city would gravitate towards 50/50.
            Mylon Mod - Adressing game pace and making big cities bigger.
            Inquisition Mod - Exterminating heretic religions since 1200 AD

            Comment


            • #7
              Interestingly enough, it seems that even assigning negative city culture results in a positive increase in plot culture. There's an exception to this when city culture is at 0, so all cities will start with 1 point of culture.

              Overall I've managed to get it to work rather well, even testing it for a radius of up to 7, but the function that determines the radius is hard-coded. I guess that'll do for now. If there's any interest, I'll release this as a standalone mod.
              Mylon Mod - Adressing game pace and making big cities bigger.
              Inquisition Mod - Exterminating heretic religions since 1200 AD

              Comment

              Working...
              X