Creating a "Dungeon" System

paramecium13

Chieftain
Joined
Oct 11, 2012
Messages
1
I created this system for my mod for Civ V, which I am still working on, and decided to share it here. It is used to create so called "dungeons", which can be captured by civilizations, providing various benefits (determined by modder).

A dungeon is at its base a city state with certain buildings and settings. It is unable to grow in population or territory and is hostile to all players. Additionally, it cannot purchase or produce new units or buildings.

The first component is the "NOGROWTH" building, which prevents gold, food, culture, production, etc.

Code:
<GameData>
	<Buildings>
		<Row>
			<Type>BUILDING_NOGROWTH</Type>
			<BuildingClass>BUILDINGCLASS_WORKSHOP</BuildingClass>
			<FreeStartEra>ERA_INDUSTRIAL</FreeStartEra>
			<Cost>-1</Cost>
			<GoldMaintenance>200</GoldMaintenance>
			<PrereqTech>TECH_METAL_CASTING</PrereqTech>
			<Help>TXT_KEY_BUILDING_WORKSHOP_STRATEGY</Help>
			<Description>TXT_KEY_BUILDING_WORKSHOP</Description>
			<Civilopedia>TXT_KEY_CIV5_BUILDINGS_WORKSHOP_TEXT</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_WORKSHOP_STRATEGY</Strategy>
			<ArtDefineTag>ART_DEF_BUILDING_FORGE</ArtDefineTag>
			<NukeImmune>true</NukeImmune>
			<MinAreaSize>-1</MinAreaSize>
			<CapturePlunderModifier>900</CapturePlunderModifier>
			<ConquestProb>0</ConquestProb>
			<Happiness>-100</Happiness>
			<HurryCostModifier>25</HurryCostModifier>
			<IconAtlas>BW_ATLAS_1</IconAtlas>
			<PortraitIndex>28</PortraitIndex>
		</Row>
	</Buildings>
	<Building_YieldChanges>
		<Row>
			<BuildingType>BUILDING_NOGROWTH</BuildingType>
			<YieldType>YIELD_FOOD</YieldType>
			<Yield>-1000</Yield>
		</Row>
		<Row>
			<BuildingType>BUILDING_NOGROWTH</BuildingType>
			<YieldType>YIELD_PRODUCTION</YieldType>
			<Yield>-1000</Yield>
		</Row>
		<Row>
			<BuildingType>BUILDING_NOGROWTH</BuildingType>
			<YieldType>YIELD_GOLD</YieldType>
			<Yield>-1000</Yield>
		</Row>
		<Row>
			<BuildingType>BUILDING_NOGROWTH</BuildingType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>-1000</Yield>
		</Row>
		<Row>
			<BuildingType>BUILDING_NOGROWTH</BuildingType>
			<YieldType>YIELD_FAITH</YieldType>
			<Yield>-1000</Yield>
		</Row>
		<Row>
			<BuildingType>BUILDING_NOGROWTH</BuildingType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>-1000</Yield>
		</Row>
	</Building_YieldChanges>
</GameData>
This building has the same icon and information as the workshop because I used the workshop building date as a template to make this building and because there is no point changing it since the player will never see it (it is destroyed when the city is captured). It also increases the gold a player gets when capturing the dungeon.

The next step is to create a new city state and give it the name and Civilopedia info you want your dungeon to have. You can also create the benefits you want the dungeon to give to the player who captures it. These benefits can be new wonders, unique buildings, or whatever else you are able to add. The benefits can also be things that already exist in the game.

After this, go to WorldBuilder and open or create the map you wish to use. In the scenario window, add the city state that is your dungeon and set it to be at permanent war with all other players. Then simply add it to your map (as a city belonging to the city state you made to be your dungeon) with the "NOGROWTH" building and the benefit buildings and/or wonders you want it to have. I also recommend you give it some defensive buildings and possibly units to make it harder to capture.

So far I do not know how to make the random map generator create dungeons on a map. Since my mod is going to be a scenario with a map I made, this is not a problem for me. Feel free to try to make the random map generator make dungeons. If you succeed, please post how you did so in this thread.

Please feel free to use this in your mods. Just be sure to let me know and give me credit.

Note: Because my mod is very early in development, I have not tested this yet. It is possible that this does not work and it may be carcinogenic. Feel free to test this and please share your results with me.
 
I'm pretty sure that Paramecium13 already gave us the purpose:

"These benefits can be new wonders, unique buildings, or whatever else you are able to add. The benefits can also be things that already exist in the game."

So these dungeons would be weak (or strong, depending on the bonuses for capturing them) city-states that you actually want to capture, not only because they may have nice terrain but because the person who captures them gets interesting stuff no one else can get. That brings up another question, though - even if this City-state is always at war with everyone, would you still get the Civ Elimination diplomatic penalty for eliminating the city-state? I guess that you could just make all dungeons owned by a single city-state with another city completely surrounded by ice way off in the frozen north so that it would never be eliminated, but that seems like an inelegant solution.

This is an interesting concept. I'm guessing that your scenario is going to be fantasy-based; when do you think that you'll be done with the scenario? Can you tell us anything else about it?
Once I figure out how to work this thing I'll test out your building and tell you how it went. Thanks again.
 
Back
Top Bottom