View Full Version : CulturalDecay Mod
Bhruic Nov 23, 2005, 10:39 PM CulturalDecay makes two significant changes to culture. First, any time a city is lost (conquered, destroyed, etc), it sends a "Culture Shock" through the region, resulting in the loss of 50-75% of the culture generated by the city. Note, this culture is NOT the culture visible in the city screen, it is the culture that determines the city boundaries, and which Empire will be able to work a square. The Culture Shock makes it much easier for an Empire to exert control over squares surrounding a city when it is conquered.
The second thing it does (which gives it its name) is cause squares outside of an Empire's borders to slowly lose culture over time. This loss (5% of the square's culture every turn, resulting in a half-life of roughly 14 turns) makes it harder for an Empire to regain lands that they lost in the past.
Installation:
CulturalDecay should NOT be installed in your main Civ IV location, as it will overwrite necessary files. Instead, it should be installed at: "My Documents\My Games\Civilization 4".
CulturalDecay makes use of the DataStorage mod to track culture generation on a square. Because it needs to store the information every turn, using this mod on games in progress will not result in optimal behaviour (although there should be no problems doing so).
History:
v0.2
- removed the cultural smoothing effect
- added the Culture Shock effect
- switched to using DataStorage to store cultural data
- borrowed some code from Mylon to determine Cultural boundaries
v0.1
- first release
Bh
Tad Nov 24, 2005, 03:40 PM i like this idea, but i'm not sure what you mean by:
Currently, once an Empire's culture has developed on a square, it is there permanently (until the Empire is destroyed).
i've had culture borders shift quite a bit in my games. i've even taken over cities from rival civs because my culture borders engulfed their cities, as in civ3. can you clarify this a bit more?
Tad
Bhruic Nov 24, 2005, 05:03 PM That's because your culture is increasing. The civ that 'owns' a square is the one that has the highest culture rating. The square also needs to be within the cultural boundaries of a city.
However, let's say you destroy an enemy city. 200 years later, they rebuild a city in the same location. They immediately have the full cultural 'effect' that they had previously.
The easiest way to see what I'm refering to is to turn cheat mode on, and hold the shift key while mousing over a square. It will display the culture ratings for any civ that has 'affected' that square.
Bh
Dom Pedro II Nov 25, 2005, 12:03 AM Huh... I didn't know that. Well, this is a very good idea, I think. You've done great work so far, Bhruic. :thumbsup:
Gargoyle Nov 25, 2005, 11:26 AM Nice work but I may have a problem with your premise.
Poland, Estonia, Lativa, Lithuania, Armenian, Ukrania, Macedonia, Serbia, Croatia, Bosnia, Czechslovia, PALESTINE, NORTHERN EIRELAND, Scotland, etc...
They may have be enveloped by other Civilizations, in some case have been returned to Sovenignty, but never did their culture seem to slip.
Bhruic Nov 25, 2005, 11:32 AM Sorry, but I don't give a flying fig about realism. I made this mod because I didn't find the current cultural model to be the best for gameplay. If there are other people who agree, they can use it. If you're looking for realism, probably best to look elsewhere.
Bh
Gargoyle Nov 25, 2005, 12:30 PM Sorry, but I don't give a flying fig about realism. I made this mod because I didn't find the current cultural model to be the best for gameplay. If there are other people who agree, they can use it. If you're looking for realism, probably best to look elsewhere.
Bh
Sorry, didn't mean to offend you. I was just engaging in constructive analysis. I thought you might return with your arguement as to the flaw in my evaluation.
Never the less, again good work.
Bhruic Nov 25, 2005, 01:27 PM Hmm, hope I didn't come off too offended - I really wasn't. I guess it was a bit on the blunt side.
I know some people like realism in their games (and in Civ in particular), but I'm not one of them. I'm for logical consistency, and good gameplay. In this case, I don't find it "makes sense" for a square to continue to have the cultural level associated with a civilization that no longer affects the square. For example, in one of my games, I was at war with the Egyptians. I razed/captured all of their cities on the mainland, and they were left with a single island on the other side of the world. And yet their cultural level remained in the territory I conquered. If they had sailed back and planted a new settlement, they would have overwhelmed my cities, and possibly taken them over culturally.
Now that could actually 'make sense' if they did it immediately, but 20 turns later? 50? 100? That's pushing it, imo.
Ideally what I'd like to do is come up with a better cultural 'war' system. I'm looking into things like having units spread/destroy culture, etc. Hopefully I can come up with something good.
Bh
Herandar IV Nov 26, 2005, 09:28 PM This a great idea. I've always thought a problem with the series in general is that no civilization decays, they are only overwhelmed by another more powerful Civ. History shows numerous times that civilizations do fall apart at times, and not just because of a threat on the horizon. Rome is the obvious example.
I would like it if there was some sort of need to actively maintain your nation's culture, or risk wholesale rebellions and the creation of new splinter Civs, (e.g. The Byzantine Empire inheriting the Eastern half of the Roman Empire, or the Diadochi Empires after the death of Alexander) especially by military expansionists. Throwing off the shackles of the overlords, so to speak.
Bit of a grand concept, I suppose, but I look forward to steps in this direction, Bhruic.
BaneBlade Nov 26, 2005, 10:49 PM This is truly a great idea, i'll give it a try and wan't to thank you now, especially since i noticed your "THE" MoO3-Bhruic i want to
THANK YOU
for what you have already done for me!
You nearly made the game live up to what i should have been from the start, and i can't imagine how much work it took to turn this piece of **** into the good game i experienced with your MOD!
BaneBlade
syneris Nov 26, 2005, 11:22 PM However, let's say you destroy an enemy city. 200 years later, they rebuild a city in the same location. They immediately have the full cultural 'effect' that they had previously.
Did you pillage the city ruins?
Xerxes_Pi Nov 27, 2005, 07:16 AM Is it compatible with v1.09? This looks nice.
Bhruic Nov 27, 2005, 11:18 AM Yup, it works just fine in v1.09.
Bh
Tad Nov 27, 2005, 02:21 PM "My Documents\My Games\Civilization 4".
am i correct in assuming that i need to put the file in my games/civilization 4/MODS? when i put the filein the civ 4 folder under no sub-directory, i cant seem to locate the mod in any of the game menus, but when i put the folder in MODS the mod appears under the name 'custom assets' and not 'cultural decay mod', is this correct? i just wanted to double check before i get too far into a game.
Tad
Bhruic Nov 27, 2005, 03:08 PM No, you aren't supposed to put it in "My Games/Civilization 4/MODS". Just unzip it in the main "My Games/Civilization 4" folder and it'll put the files into their proper location in CustomAssets.
It's designed as an "always on" mod, not one you have to select.
Bh
Tad Nov 27, 2005, 03:09 PM ah ha! that was the answer i was hoping for, an always on mod. thank you sir, i appreciate your hard work.
Tad
The Great Apple Dec 24, 2005, 10:43 AM Hi, sorry about the rather large bump...
Unless I'm mistaken, there's a slight bug in the code for this mod - I don't think the bottom, or the far right line of squares will be effected. This is because the python range() function is not inclusive (I believe). I'm not certain, and haven't tested it, but I've just been having problems with a similar line of code.
Bhruic Dec 24, 2005, 12:00 PM range(x) goes from 0 to (x - 1). So if you do range(3), like I do, you'll loop through 0, 1, 2 (for a total of 3 numbers).
Or, in other words, that's not a bug. :)
Bh
The Great Apple Dec 24, 2005, 07:04 PM Okies, just me being stupid then!
Sorry!
Fachy Dec 30, 2005, 09:33 PM Bhuric I'm not sure I got your first post well. In my game (at least v.1.52) the borders seem to come and go according to culture, it's not like you stick with a square once you owned it once (till your city dies)
Am I wrong?
Bhruic Dec 30, 2005, 10:17 PM I don't think you understood my first post. Each square has a "culture" rating for every empire in the game. If a player has a city that is exerting its cultural influence on a square, that square will be gaining culture. If you remove the city, the square will stop gaining culture, but it won't lose any of the culture that it had gained to that point. If a city is rebuilt so that the square is once more within the cultural boundaries, then the culture will continue to grow where it left off.
Bh
Bhruic Dec 31, 2005, 01:37 AM Made some changes to the way it works - most significantly, it now includes a "Culture Shock" effect that occurs when you (or anyone else) loses a city. 50-75% of the culture generated by that city is lost, making it easier to exert your own cultural influence on the surrounding territory.
Bh
Fachy Dec 31, 2005, 03:22 AM ooh ok now I understand! Is it compatible with 1.52? Coz none of the python mods seem to be working with it
Bhruic Dec 31, 2005, 03:59 AM Yeah, the new version is fully compatible with v1.52
Bh
Fachy Dec 31, 2005, 04:55 AM Do you know why there were problems with python mods? Did 1.52 change how the python works?
Also what did you mean by "borrowed some code from Mylon to determine Cultural boundaries" in the read me?
Bhruic Dec 31, 2005, 05:48 AM They changed a few of the functions from 1.09 -> 1.52. So if a mod used the old function calls, the mod wouldn't work properly.
By "borrowed some code" I mean that he had a decent way to determine if a plot point was within the cultural boundary of a city. I did a slightly more efficient version, of course (;)), but the base code was his - hence the credit.
Bh
Zibby Jan 01, 2006, 10:58 AM Did you pillage the city ruins?
I noticed in the game that these ruins can be pillaged, but what efect does this have? There was no mention of it anywhere!
Zibby Jan 01, 2006, 11:04 AM Sorry, double post!
Grave Jan 08, 2006, 08:53 PM CulturalDecay makes use of the DataStorage mod to track culture generation on a square. Because it needs to store the information every turn, using this mod on games in progress will not result in optimal behaviour (although there should be no problems doing so).
The DataStorage reference in the CulturalDecay.py file is causing my CvEventInterface file not to load properly.
What I do is...
I add the following to my CvCustomEventManager from your CvCustomEventManager:
import CulturalDecay
culturalDecay = CulturalDecay.CulturalDecay()
def onCityBuilt(self, argsList):
self.parent.onCityBuilt(self, argsList)
culturalDecay.onCityBuilt(argsList)
def onCityLost(self, argsList):
self.parent.onCityLost(self, argsList)
culturalDecay.onCityLost(argsList)
def onCityDoTurn(self, argsList):
self.parent.onCityDoTurn(self, argsList)
culturalDecay.onCityDoTurn(argsList)
def onEndGameTurn(self, argsList):
self.parent.onEndGameTurn(self, argsList)
culturalDecay.onEndGameTurn(argsList)
Everything else that's in your CvCustomEventManger is the EXACT same as mine.
I updated my CulturalDecay.py file with the v0.2 version, and I copied over the updated DataStorage file.
When I go to load my mod... it keeps saying the CvEventInterface won't load! :mad:
But...
When I go back into the CulturalDecay.py file and delete these tabs the game will load right up:
import DataStorage
data = DataStorage.DataStorage()
Any idea what might be the problem?
AWolfe Jan 08, 2006, 09:07 PM I recently had the same problem, which Kristine (KGrevstad) was able to solve for me. Quoting from her PM: "The problem you're having is that Proper Score Graph is not 100% compatible with the new version of DataStorage, which originally was written as a module of functions, and the new one is written as a class, hence it hasn't any of the public functions that it used to have. I've included the diffs to make it work. Note that I've commented out the several lines of code that imported functions from DataStorage, created a single object of class DataStorage and used that to call SetVal and GetVal. I also commented out the HasKey and Initkey stuff since DataStorage now does that automatically."
Index: ResearchProgress.py
================================================== =================
RCS file: /var/www/html/kristine/repository/Civ4_1.52/Mods/Realism/Assets/Python/ResearchProgress.py,v
retrieving revision 1.2
retrieving revision 1.1
diff -r1.2 -r1.1
13,17c13,16
< data = DataStorage.DataStorage()
< #initKey = DataStorage.initKey
< #hasKey = DataStorage.hasKey
< #setVal = DataStorage.setVal
< #getVal = DataStorage.getVal
---
> initKey = DataStorage.initKey
> hasKey = DataStorage.hasKey
> setVal = DataStorage.setVal
> getVal = DataStorage.getVal
32c31
< iRet = data.getVal('ResearchProgress', str(iTurn), 'ResearchPoints', gc.getPlayer(iPlayer))
---
> iRet = getVal('ResearchProgress', str(iTurn), 'ResearchPoints', gc.getPlayer(iPlayer))
45,46c44,45
< # if (not hasKey('ResearchProgress', str(iGameTurn), gc.getPlayer(iPlayer))):
< # initKey('ResearchProgress', str(iGameTurn), vTable, gc.getPlayer(iPlayer))
---
> if (not hasKey('ResearchProgress', str(iGameTurn), gc.getPlayer(iPlayer))):
> initKey('ResearchProgress', str(iGameTurn), vTable, gc.getPlayer(iPlayer))
48c47
< data.setVal('ResearchProgress', str(iGameTurn), 'ResearchPoints', iResearchPoints, gc.getPlayer(iPlayer))
---
> setVal('ResearchProgress', str(iGameTurn), 'ResearchPoints', iResearchPoints, gc.getPlayer(iPlayer))
RogerBacon Jan 15, 2006, 02:12 PM Hi Bhruic,
I have a problem with Culture Decay. I've added some levels of culture to my game because I wanted cultural borders to have a bigger effect. However when .... is greater than 10 I get "IndexError: list index out of range" in doCultureAdd:
for iRangeX in range(iRange):
***************for iRangeY in range(iRange):
********************iX = iRangeX - iRadius + iCityX
********************iY = iRangeY - iRadius + iCityY
********************iDistanceX = abs(iRangeX - iRadius)
********************iDistanceY = abs(iRangeY - iRadius)
********************if (gc.getMap().isPlot(iX, iY)):
*************************if (iRadius >= self.Distance[iDistanceX][iDistanceY]):
******************************iCultureChange = ((iRadius - self.Distance[iDistanceX][iDistanceY]) * 20 + iCulture + 1)
******************************iCurrentCulture = data.getSingleVal('CulturalDecay', pCity.getID(), gc.getMap().plot(iX, iY))
I thought maybe the .Distance function was doing a X^2 + Y^2 thing and maybe it only stores one byte so when the value goes over 255 it is out of range but if that's the case then 11 should be ok but 11 causes the error.
Roger Bacon
[Edit]
those *** were tabs before the forum changed them. Ignore them.
[Edit2]
Well, I'm pretty sure why I get the error. Duh! I just looked at your formula for distance:
self.Distance = [[0] * 11 for i in range(11)]
for iX in range(11):
for iY in range(11):
It's only defined for 0-10. I'll change it when I get home and see if that is the reason (but I'm 99% sure it is).
Roger Bacon
roidesfoux Feb 19, 2006, 12:40 AM I was looking through CultureDecay.py trying to figure it out. I think I got most of it, but I can't figure out what exactly doCultureAdd is doing. Could you enlighten me?
-RdF
Bhruic Mar 07, 2006, 11:07 AM In order for doCultureShock to work properly, each square has to be tracked based on the culture generated by the specific city - which is what doCultureAdd does.
Bh
casey1966 Apr 04, 2006, 10:35 PM Bhruic, I'll have to say this culture decay mod is excellent. It just seems like a natural part of the game that should be implemented into the original. What's the point of capturing a city & not being able to use any tiles.
Case in Point:
I captured a city that was 8 or 9 tiles from the capital,threw a GA at it & the only tiles it gave me were the coastal,lol & this was'nt even late in the game.Besides this works great for me considering I only play war mongering games.
I'm surprised you have'nt recieved much praise for this work,thanks much!:goodjob:
Anyways I added this with a mod & the only problem I have is that for some reason it adds extra attacking against city defenses from arty & naval ships,don't know why.....
Caesium Apr 17, 2006, 12:10 AM I've got a little question:
Will there be an update to 1.61?
Caesium Apr 22, 2006, 07:28 PM I've got a little question:
Will there be an update to 1.61?
:undecide:
CellKu Apr 23, 2006, 02:17 PM I've got a little question:
Will there be an update to 1.61?
I hope! Thus, I support the request for an updated version! I am still a bit reluctant to update to 1.61, because I would like to continue playing this mod.
CellKu
Caesium May 09, 2006, 06:23 PM Is here someone, who can help me with a problem I got while using this mod?
As long as the captured city has no culture adding buldings, the cultural borders won't grow. What I want to say is that the radius is zero, only the city and nothing around.
TheLopez May 09, 2006, 06:49 PM Bhruic are you going to update this mod to be compatible with the v1.61 patch? Are you still around?
Impaler[WrG] May 16, 2006, 01:05 AM I will put an SDK version of this on my to do list, control will be through a new XML value that defines the % of decay.
TheLopez May 16, 2006, 06:19 AM Impaler I already have one out that does this through INI files - the Cultural Influences Mod.
RogerBacon May 16, 2006, 09:35 AM Are you guys saying that this doesn't work with 1.61? I've had this in my customAssets files since the beginning and I haven't noticed if it has stopped working.
Roger Bacon
TheLopez May 16, 2006, 09:48 AM Roger, I didn't see any problems with it either runing on v1.61 but...
I did see some slowness when running the mod with other mods.
When I checked the actual cultural decay mod code I noticed that a lot of things in there were being done very inefficiently. In my update of this mod in the Cultural Influences mod I have updated the cultural decay mod code to work a lot faster.
Caesium May 16, 2006, 02:21 PM TheLopez, though you rewrote the cultural decay mod, would you drop a "stand alone" version to this thread?
TheLopez May 16, 2006, 02:30 PM Sure, but it will take about a day to do it.
|
|