Announcement

Collapse
No announcement yet.

[MOD] SD Culture Conquest

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

  • [MOD] SD Culture Conquest

    (Also posted on CivFanatics)

    I thought it was unrealistic for a city's culture to drop to zero upon capture. So, to fix that, I implemented this.

    Upon capture, the city's culture is reset to one half of the original, PLUS a random number whose maximum is half of the original. Prior to this calculation, the original number is adjusted to account for the lost population.


    NewCulture = ( OriginalCulture / 2 ) + ( Random(OriginalCulture / 4) ) + ( Random(OriginalCulture / 4) )


    If the conqueror is also the original founder, this calculation becomes :


    NewCulture = OldCulture x ((Current_year - Loss_year) / (Max_years * 0.25))

    If the conqueror is NOT the original founder AND the losing civilization is also NOT the original founder AND the city's culture is at least double what it was when the founder lost it, the loser becomes the founder.

    If you build a city on the same plot as that of an older city that got itself razed, the new city will gain some of the older city's culture to a maximum of 80%, depending on how long ago the razing took place.


    NewCulture = (Culture_old x ((Current_year - Loss_year) / (Max_years * 0.15))) * 0.8


    Additionally, if you check the logs, each city now has a capture count.

    Now, instead of a city being completely written off after capture due to zero culture, you can fight over it!


    History
    =-=-=-=

    v1.00 :
    Initial Release.

    v1.10 :
    Uses SdToolKit.
    Better motive to regain lost cities. 80% of ORIGINAL culture is restored to the founder, minus a small chunk for population depletion and building loss. If the original culture is less than the current culture, then the current culture is used.
    If a city is captured from a previous conqueror by someone other than the original founder AND the current culture value is equal to or over 200% of the original culture, then the loser becomes the 'founder' and gains the aforementioned motive.
    Adjusted loss calculation from (0.25 + rand(0.25) + rand(0.25)) to (0.5 + rand(0.25) + rand(0.25))

    v1.20 :
    Requires sdToolKit 1.10+
    Implemented safeguards to allow continuation of current savegames with no disruption.
    Eliminated a potential exploit. A city's data is no longer dependant on the city's name.
    Removed population loss adjustment. T'was a silly idea.
    New variable, fDateLost. Stores the date the city was taken from the founder.
    Founder recapture culture redone : Culture_new = Culture_old x ((Current_year - Loss_year) / (Max_years * 0.25)). NOT turn based... year based.
    If founder's restored culture is less than the non-founder culture, the non-founder culture is used.
    Included two mods by Bhruic for the user's convenience. Please see the "Included Mods" section.

    v1.30 :
    Requires sdToolKit 1.20+
    Implemented version control. Will no longer perform a fix-loop every game turn, causing a slowdown.
    Some minor cleanups and optimizations.
    Founding a city where an older city once stood will give some (max 80%) of that older city's culture to the new city.
    Rebuilt culture is : Culture_new = (Culture_old x ((Current_year - Loss_year) / (Max_years * 0.15))) * 0.8


    Included Mods
    =-=-=-=-=-=-=
    In order to avoid a deluge of queries and requests, I have decided to include a number of 3rd party mods... however, they have been disabled. To enable them, open "sdEventManager.py" in your favourite TEXT (ASCII) editor. Notepad should suffice. Search the content for the mod's opening and closing tags (for example, # ) and uncomment everything WITHIN those tags. There may be multiple occurances, depending on the mod. The included mods are :

    Code:
    MOD Title       Author          Tag
    -----------------------------------------------
    Cultural Decay  Bhruic          
    TechConquest    Bhruic          

    Note that there are a number of other commented mod tags. The components for these you will have to download separately, the tags are there to serve as a guide and example.
    Attached Files
    Last edited by Stone-D; December 11, 2005, 13:49.

  • #2
    I might have to look at this mod--I was extremely put out in a recent game in which I was going for a cultural win to find out that a *single* capture of a city zeroes out the culture. All that time spent building my cities' culture up, and at that point the game was pretty much over for me.

    (Oh, well. That will teach me to try to win culture without having military muscle to back me up. Especially since when the AI is out of room to expand, you're high on the target list if you're the low score on the totem pole, even if you've been buttering them up.)

    Comment


    • #3
      That is nice, especially if the city is anywhere near another one that been there awhile, the culture is very high to bring up, plus other civs will try to steal it from you via a flip due to such low culutre.

      One thing that bothers me, why does not the culture plot number value for an enemy city I destroyed, still hang around forever? I would think the Culuture Plot number would decay if it is not within a decent boundary line of somekind, or being added to.

      The Culture Plot numbers need a hole in the bucket to leak out the culture back to zero over time if not being feed points (say 100 turns). Can this be done? Would it work well?

      Comment


      • #4
        Huh? Since when does culture get zero-ed upon capture? If you loose a city and re-capture it, it "remembers" what culture it had. Unfortunately buildings are often lost in the process, but that's another matter.
        Mylon Mod - Adressing game pace and making big cities bigger.
        Inquisition Mod - Exterminating heretic religions since 1200 AD

        Comment


        • #5
          Xerxes: I think you're looking for the Cultural Decay mod.

          Mylon: True. What this does is give each conqueror a chunk of the previous culture. Its a mad attempt at simulating a city's degradation as it changes hands during wars.

          Comment


          • #6
            That CultureDecay Mod will not work for me . I still have very old razed cities well inside my borders that persist forever in culture points.

            I tried out your CultureConquest Mod and it is nice to have starting culture captured instead of a plain zero, gives a reason to keep them instead of razing them to zero. Good job!

            if you check the logs, each city now has a capture count.
            I did not get any message or log report, the city I took had exactly 1/4 of its original owners culture at size 1.

            The Q is what is this function: += , a typo since (+ and =) is on the same key? I do not know much about Python except to modify others code to my own projects.

            Does it just auto update CaptureCount value by +1 everytime it is executed? or is it meant to set the variable initially to 1?? I am trying to learn, thanks for any help.



            ***Excerpt file sdCultureConquest.py***

            if (city.CaptureState > 0):
            SdEcho('%s (%s) was captured by the %s.'
            %(city.getName(), gc.getPlayer(city.loser).getCivilizationAdjective( 0), gc.getPlayer(city.getOwner()).getCivilizationDescr iption(0)))
            if (city.oCulture < 4):
            city.oCulture = 4
            cdice = CyRandom()
            cdice.init(city.oCulture)
            cPop = city.getPopulation()
            oPop = cPop + 1
            pCulture = (city.oCulture/oPop)*cPop
            city.nCulture = (pCulture/4) + cdice.get((pCulture/4), "Culture Conquest") + cdice.get((pCulture/4), "Culture Conquest")
            city.setCulture(city.nCulture, True)
            SdEcho('Conquest : %s Culture is %d (WAS %d, %d at capture)'
            %(city.getName(), city.getCulture(), city.oCulture, pCulture))
            city.CaptureCount += 1
            city.CaptureState = 0
            city.loser = 0
            city.oCulture = 0
            szScriptData = [city.CaptureCount, city.CaptureState, city.loser, city.oCulture]
            city.setScriptData(pickle.dumps(szScriptData))
            SdEcho('Conquest : %s has been captured %d times.'
            %(city.getName(), city.CaptureCount))
            return 0
            Last edited by Xerxes712; December 2, 2005, 06:52.

            Comment


            • #7
              Yep, it basically increments the value. The same as Variable++; in C.

              If you open (as I see you have, already) the python script again, at the top you'll see the definition for SdEcho. There are two variables - one says true, the other false. Set both to True and you'll see the debug messages in-game.

              Comment


              • #8
                OK thanks! quicker way to write it. I learn programming from trial and error.

                I ran another test, I took a city with population 5 at 573 culture produced.

                I was left with a vassal city with population 4 with 193 culture points left. So my new city expanded to use the left over culture after the revolt was put down in 3 turns.

                So it does work fine! No more culture = zero after a city capture. I think this is an important mod for people to use especially over a hard fought border city between two empires.

                The message does display after I set it the debug log to TRUE.

                Comment


                • #9
                  I think that it would be better balanced if the option to have cities flip back to the opposing civ was made mandatory with this mod.
                  "Compromises are not always good things. If one guy wants to drill a five-inch hole in the bottom of your life boat, and the other person doesn't, a compromise of a two-inch hole is still stupid." - chegitz guevara
                  "Bill3000: The United Demesos? Boy, I was young and stupid back then.
                  Jasonian22: Bill, you are STILL young and stupid."

                  "is it normal to imaginne dartrh vader and myself in a tjhreee way with some hot chick? i'ts always been my fantasy" - Dis

                  Comment


                  • #10
                    Xerxes: Best way to learn programming, really.

                    Bill: Why? Let them fight for it!

                    I'm not entirely happy with the way the new culture is calculated. I'd prefer to base some of it on which buildings were lost... I'm working on that during the weekend.

                    Also, the next version will keep a record of the original culture... that way, when the original civ recaptures it, they get all their culture back, minus whatever was lost due to building loss, plus a chunk of whatever culture the conqueror gained in the intervening time.

                    Or something like that, haven't actually coded any of it yet, slightly drunk.

                    Comment


                    • #11
                      Dammit, just discovered that the saved data is lost when a city is captured. Doesn't affect the current version, but I'll have to find a workaround for my other ideas. :P

                      Comment


                      • #12
                        I noticed your having the City keep 1/4 of its culture plus a bell curve (essentialy 2 dice rolls) that averages to 1/4 their culture. So average loss is half the culture

                        I think this is a bit harsh, culture is very hard to get rid of, perhaps keeping 1/2 as base plus the same random rolls for an average loss of 1/4 the total culture and a slim chance of lossing none.

                        I was hoping to combine your mod with the cultural decay mod and possibly combine them with Mylons culture changes as well. I think with both of these effects in play at their default values it would be too powerfull in removing oposing culture.

                        With this new math in place I dont think it will be nessary to return lost culture to the former owner, simply remove some of the old owners culture by the same rules and your good. Cultural decay will do the rest.
                        Companions the creator seeks, not corpses, not herds and believers. Fellow creators, the creator seeks - those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest. - Thus spoke Zarathustra, Fredrick Nietzsche

                        Comment


                        • #13
                          Yeah, been fiddling with that calc. I've set it as you suggested in 1.1, lets see how that pans out.

                          BTW, feel free to combine away - I use the cultural decay mod and others myself.

                          Comment


                          • #14
                            It looks as if the CultureDecay mod 'is/was/could be' included in your SdEventsManager.py . It is defined there.

                            So can these two be combined together rather easily?

                            Maybe you already have done this? ( It appears to be straight forward to combine them, more or less with some basic changes and cut 'n paste and renaming).

                            Comment


                            • #15
                              Yep, you're right. Here's a copy of my 'master' SdEventManager - it uses SdReligion, SdCultureConquest, Inquisition and CultureDecay.

                              Everything except for SdCultureConquest and CultureDecay is commented out / disabled.
                              Attached Files

                              Comment

                              Working...
                              X