• Firaxis announces Civilization 2K23! Discuss these news with us here.

Preventing barbarian city razing?

tvremote

Chieftain
Joined
Apr 15, 2012
Messages
15
Is there a way to prevent barbarians from razing certain important cities? I know in civ III there was a no raze option but I can't seem to find it in this mod. Even so, the work around in Civ III iirc was to put a wonder in a city so it wouldn't be razed by the ai. However, judging by the amount of times I've seen jersusalem be destroyed that clearly doesn't work anymore.
Of course I wouldn't think it be appropriate to prevent city razing, as there are good reasons to do it, but whenever I enter world builder and see rome, carthage, babylon and jersusalem have all been destroyed I kinda don't feel like playing that game. Maybe its just me, but is there anything short of WB hacks that I can do about this?
 

Leoreth

Blue Period
Moderator
Joined
Aug 23, 2009
Messages
36,444
Location
東京藝術大学
You could disable city razing for everyone completely by editing the scenario files:
Code:
BeginGame 		
	Calendar=CALENDAR_DEFAULT 		
	Option=GAMEOPTION_AGGRESSIVE_AI		
	Option=GAMEOPTION_NO_TECH_BROKERING
	[COLOR="Red"]Option=GAMEOPTION_NO_CITY_RAZING[/COLOR]
	GameTurn=181 		
	StartYear=-3000 		
	Description=TXT_KEY_RHYES_WB_DESC
	ModPath=Mods\RFC Dawn of Civilization
EndGame
... and add the red part at the beginning of both.

Everything more sophisticated would be more difficult.
 

tvremote

Chieftain
Joined
Apr 15, 2012
Messages
15
Hmm thats a little disappointing because sometimes cities just need to be razed (looking at you sparta). How difficult would it be to make it so the ai wouldn't raze a city with a wonder in it? My biggest gripe is when cities like rome or babylon, which i know have a few wonders in them, get razed.

Or i suppose the question I'm asking is how does the ai determine razing? I see them do some really weird things like raze a well built carthage but keep iol ceseare which was built like 3 turns prior.
 

Leoreth

Blue Period
Moderator
Joined
Aug 23, 2009
Messages
36,444
Location
東京藝術大学
The AI is in the DLL so you would need to recompile it.
 

tvremote

Chieftain
Joined
Apr 15, 2012
Messages
15
Yeah that sounds above my pay grade. Oh well guess I'll have to stick to WB.
 

Leoreth

Blue Period
Moderator
Joined
Aug 23, 2009
Messages
36,444
Location
東京藝術大学
But when I have time I'll revisit the AI so it's a little more lenient with wonder cities or historically important sites.
 
Joined
May 26, 2012
Messages
674
Go to the diplomacy files for leaderhead behaviours (gameinfo, civilizationinfos) and change razecityprobability (use ctrl-f) for barbarianleader to 0. You can do it on notepad like me.
 

srpt

Deist
Joined
May 10, 2010
Messages
2,038
Location
Toronto
SoI has a "no ai raze" list in python. it could easily take wonders into account as well.
 

Leoreth

Blue Period
Moderator
Joined
Aug 23, 2009
Messages
36,444
Location
東京藝術大学
Yeah, I was thinking of something like that.

But Pavel Chichikov's LH change is definitely a better temporary solution than my idea.
 

tvremote

Chieftain
Joined
Apr 15, 2012
Messages
15
That sounds like a good fix, but could you specify a bit more where you find the files to change? I hunted around but couldn't seem to find anything named gameinfo or civilzationinfos. Its quite possible I'm being dense but addition directions would be appreciated.
 

Leoreth

Blue Period
Moderator
Joined
Aug 23, 2009
Messages
36,444
Location
東京藝術大学
... found in Assets\XML\Civilizations\.
 
Top Bottom