Title: The Complete Guide to Custom Settlement Creation (WIP) Posted by: Ramashan Modding area: Mapping, Modeling, Battle Map Required programs: Notepad (or other text editor), 3D Studio Max (for portion), Photoshop (or graphic editor) Needed & Optional tools:'Settlement Plan Editor' by SigniferOne (3DSMax Plugin) 'Vercingetorix CAS Importer/Exporter' (3DSMax Plugin) Summary: An in-depth, all in one resource, for creating custom settlements from the ground up.
There are so many parts and level of difficulty that one can attempt to learn in completely editing a settlement that I have broke the tutorial down into chapters.
I tried to organize them both logically and in order of difficulty. You can change the entire look of a settlement by following the steps in Chapters 2 & 3. Chapters 4 - 6 get more complicated and focus more on parts that are directly interfaced by the game engine, AI in battle, and the player.
Chapters 2 & 4 you do not need to 3D Studio Max or need to know anything about modeling. Chapter 3 will need the assistance of a modeler in order to create the new buildings and ambients. Chapters 6 to 8 can only be done by an experienced modeler.
- Remember to always use a short cut with show-err.
*most references will be from the Inca Total War: Flower Wars mod - Rama
1. Getting started: Introduction & Glossary of Terms
To begin, you'll need to familiarize yourself with some terms that I will be using throughout this tutorial.
2. Includes & Meeting the Files
A settlement is made up of many parts. In order to make a completely unique settlement plan you will have to edit all these files;
di, dbb, dsp, {settlement}.txt (city, town, large_town, etc), overlay model, underlay model, building model, and pathfinding model.
However, first you will have to know how to create 'includes'. As I said in the glossary, an include is a pointer placed into a master file that tells the game engine where to find additional bits of coding.
<TIP> I use a new include for each culture and/or faction. Makes it easy to code and to find the buildings causing my problems. Also allows for files to be sent in from multiple modders working on different cultures.
Here is a break down of what all those files do and how to edit them.
descr_items.txt
Click to view content:
Example of code:
Code:
include di_mayan_buildings.txt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
type eastern_shrine
lod
max_distance 4000.0
model_rigid eastern_shrine.cas
Green = This is where you place the includes for this file. You do not need to mod path them.
Red = The internal name for this model. This is what the ITEM the game engine creates will be named and what the dbb file will want to reference.
Blue = The distance as which you can see the model. The vanilla game includes three lod distances. I find that using the max of 4000 allows the building to be seen from close up to as far away as you can get. May bog down slow systems though if you have too many.
Purple = name of cas model you wish to turn into an Item. These models need to be mod pathed, and the no matter where you put the model, the texture MUST go into the data/building_models/texture folder.
A mod foldered version of this field would look like this;
Code:
type maya_large_pyramid_temple
lod
max_distance 4000.0
model_rigid ../../itw_fl/data/models_building/maya_buildings/maya_large_pyramid_temple.cas
*******************
In order to begin changing out building models you must start with this file. The game uses what are called .item files for buildings and ambient models. A .item is a compressed version of the .cas model that the RTW game engine can read.
To get this to work in a mod folder, copy and paste the entire ITEMS folder from the vanilla data folder into your mod folder. No pathing is necessary since the game looks into the mod/data/Items once you launch a mod foldered game.
The game engine automatically convert your CAS files into Items on start up and places them into the ITEMS folder in your mod folder. In order for the engine to make this file you have to add a new bit of code to the di file. You will put this code into a new 'include' located in the mod/data/descr_items folder.
Alpaca has extracted and formatted the di files in such way that there are less CTDs and has outlined the steps on adding a new item in this thread.
Click to view content:
1. Extract the file you need (BI or 1.5) to your data directory
2. Backup descr_items.txt
3. Rename the file you extracted to descr_items.txt
4. Add to the beginning any Includes you want made, I recommend using this to add new buildings (you can see a readme on that in the original descr_items.txt)
5. Add your new building entries
6. Delete descr_items.db
7. Start the game
8. You get tons of error message (normally if you use show_err), either click through them or just hit ctrl+alt+del and kill the game process, but descr_items.db is generated anyways
9. Restart the game and enjoy
If you want to use that in a mod folder, you have to extract the RTW item files you want to use there in order for the game to find them.
If you don't want to use a building that is in that file, just delete the entry.
NOTES
• Don't click through the error messages when you restart to build your Items. Hit Control+ALT+Delete.
If you click through, the game wont build the ITEM. This is especially bad for vanilla models since originals do not come with the game.
• Once you go through the restart process and escape the game, go into your Items folder and make sure your new Item is present. If the any Item isn't present it usually means that you misspelled the name in the descr_items.txt code. Double check the spellings and retry. If the game engine finds a problem, it will stop and you will see that no more items will have been created past the problem coded bit.
• A CTD after ITEM recreation is usually caused because of a problem with the model skin. If there is a problem with skins, you can open an Item file with notepad, but you can't make any changes here, and see what the name of the skin is. Easiest thing to do is go into mod/data/models_buildings/textures and rename the texture to match that which the Item is asking for. One of the biggest skin issues I've experienced is with suffix. .jpg, .tga etc being present in the skin name but not present in the text within the Item file. Just delete the suffix in the 'texture' folder.
• The texture an item wants is determined by what the modeler assigned it. Regardless of where the modeler pointed to the location of the texture, the game engine will always look into the texture folder inside the models_building folder.
• (NEED TO TEST) I believe, that once you create the Item, you can delete the original building model. I have not tested this, but eventually these original CAS models will create a large file size. At the end of the mod process you may want to send out your mod folder without the CAS building models.
descr_building_battle.txt
[source]
Example of code:
Code:
All these files come together to create the look, topography, and design of a custom settlement. But, you don't have to work on them all at once in order to achieve your goal. You can change only the buildings out one for one by replacing them in descr_items. You can add new buildings by editing descr_items.txt, desccr_building_battle.txt, and {settlement}.txt or you can only change the texture and topography of the settlement by editing the underlay/overlay and the coding in {settlement}/txt
3. Custom Plan Sets
In the vanilla game, the settlements up grade to different settlement plans according to culture. This doesn't allow for unique cities to grow within a culture group. (There may be a way that I am not aware of). But, we can assign a settlement its own unique settlement plan that will allow it to grow independently of those within the same culture.
We can do this by replacing the 'default_set' with one of our own creation in descr_strat.
Code:
settlement
{
level large_town
region Africa
year_founded 0
population 3500
settlement_tax 50
plan_set default_set
faction_creator egypt
building
{
type core_building governors_villa
}
building
{
type defenses wooden_pallisade
}
}
To do this we need to open data/descr_settlement_plan.txt and scroll all the way down to the bottom until you reach the area that says 'plans'.
Click to view content:
Code:
; Plans
; A plan is an actual layout, for a specific culture (the creating culture for that settlement level)
; and a specific level (town, city etc). It consists of a list of positioned ambient buildings and slots.
; There are NO fail states here; if a plan runs out of (or has no) slots big enough or flagged as suitable for
; a given building type, the building will just not appear in the plan.
; Plans are declared explicitly here, and all required definitions are tested.
plans
{
plan Roman_Fort roman_fort.txt
plan Roman_Village roman_village.txt
plan Roman_Town roman_town.txt
plan Roman_Large_Town roman_large_town.txt
plan Roman_City roman_city.txt
plan Roman_Large_City roman_large_city.txt
plan Roman_Huge_City roman_huge_city.txt
plan Greek_Fort greek_fort.txt
plan Greek_Village roman_village.txt
plan Greek_Town greek_town.txt
plan Greek_Large_Town greek_large_town.txt
plan Greek_City greek_city.txt
plan Greek_Large_City greek_large_city.txt
plan Greek_Huge_City greek_huge_city.txt
plan Egyptian_Fort egyptian_fort.txt
plan Egyptian_Village mayan_village.txt
plan Egyptian_Town mayan_town.txt
plan Egyptian_Large_Town mayan_large_town.txt
plan Egyptian_City mayan_city.txt
plan Egyptian_Large_City mayan_large_city.txt
plan Egyptian_Huge_City mayan_huge_city.txt
plan Eastern_Fort eastern_fort.txt
plan Eastern_Village egyptian_village.txt
plan Eastern_Town eastern_town.txt
plan Eastern_Large_Town eastern_large_town.txt
plan Eastern_City eastern_city.txt
plan Eastern_Large_City eastern_large_city.txt
plan Eastern_Huge_City eastern_huge_city.txt
plan Carthaginian_Fort eastern_fort.txt
plan Carthaginian_Village egyptian_village.txt
plan Carthaginian_Town carthaginian_town.txt
plan Carthaginian_Large_Town carthaginian_large_town.txt
plan Carthaginian_City carthaginian_city.txt
plan Carthaginian_Large_City carthaginian_large_city.txt
plan Carthaginian_Huge_City carthaginian_huge_city.txt
plan Barbarian_Fort barbarian_fort.txt
plan Barbarian_Village barbarian_village.txt
plan Barbarian_Town barbarian_town.txt
plan Barbarian_Large_Town barbarian_large_town.txt
plan Barbarian_City barbarian_city.txt
plan Barbarian_Large_City barbarian_city.txt
plan Barbarian_Huge_City barbarian_city.txt
plan Tenoch_Fort eastern_fort.txt
plan Tenoch_Village egyptian_village.txt
plan Tenoch_Town east_town.txt
plan Tenoch_Large_Town eastern_large_town.txt
plan Tenoch_City eastern_city.txt
plan Tenoch_Large_City eastern_large_city.txt
plan Tenoch_Huge_City eastern_huge_city.txt
}
; PLANS BY LEVEL
;
; These define a full list of plans for all the settlement levels.
; Format:
; plan_levels <plan id>
; {
; <level type> <level id>
; }
; A complete level list must be supplied. Order is unimportant, and repeats override.
plans_by_level
{
plan_levels Roman_plan_levels
{
village Roman_Village
town Roman_Town
large_town Roman_Large_Town
city Roman_City
large_city Roman_Large_City
huge_city Roman_Huge_City
}
plan_levels Egyptian_plan_levels
{
village Egyptian_Village
town Egyptian_Town
large_town Egyptian_Large_Town
city Egyptian_City
large_city Egyptian_Large_City
huge_city Egyptian_Huge_City
}
plan_levels Eastern_plan_levels
{
village Egyptian_Village
town Eastern_Town
large_town Eastern_Large_Town
city Eastern_City
large_city Eastern_Large_City
huge_city Eastern_Huge_City
}
plan_levels Greek_plan_levels
{
village Roman_Village
town Greek_Town
large_town Greek_Large_Town
city Greek_City
large_city Greek_Large_City
huge_city Greek_Huge_City
}
plan_levels Barbarian_plan_levels
{
village Barbarian_Village
town Barbarian_Town
large_town Barbarian_Large_Town
city Barbarian_City
large_city Barbarian_Large_City
huge_city Barbarian_Huge_City
}
plan_levels Carthaginian_plan_levels
{
village Egyptian_Village
town Carthaginian_Town
large_town Carthaginian_Large_Town
city Carthaginian_City
large_city Carthaginian_Large_City
huge_city Carthaginian_Huge_City
}
;************* only using this settlement ***************
;
; plan_levels test_levels
; {
;
; ; as long as settlement is village in descr_battle.txt then only the following line is used.
;
; village Roman_Large_Town
;
; town Egyptian_Village
; large_town Egyptian_Village
; city Egyptian_Village
; large_city Egyptian_Village
; huge_city Egyptian_Village
; }
}
; PLAN SETS
; associate plan_levels and cultures; a settlement gets a full plan set, and can then keep that whatever happens.
; There may be selection criteria at some point, eg for terrain etc. Initially we'll have a limited set,
; but we'll expand these. It means we can have different plans for different cultures if we want, without
; it ever being a problem. Port plan sets are treated as separate - when a settlement gets a plan set,
; it'll know whether it's coastal or not. How plans are chosen is unresolved; currently, a plan can be requested
; at random (knowing inland or port) or by plan name (for settlements in template files). Later, if we get varying
; height plans in, there may be extra criteria such as local terrain used when a player creates a settlement.
plan_sets
{
;inland default_set
plan_set default_set
{
locale any
;default test_levels
roman Roman_plan_levels
greek Greek_plan_levels
carthaginian Carthaginian_plan_levels
egyptian Egyptian_plan_levels
eastern Eastern_plan_levels
barbarian Barbarian_plan_levels
}
This area is broken down into three parts; plans, plan_levels, and plan_sets. This is sort of listed in the reverse of the order in which you will need to create them.
plans point to the level text documents located in data/settlement_plans that determine the look of each settlement level; village, town, large_town, city, etc.
plan_levels point to the list of settlement plans to be used by a culture group or unique group of your naming. The levels tend to be culture groups but can be anything you wish them to be.
plan_sets is the over all heading a set of levels and plans that will determine what settlements look like according to culture. There is only one set in the vanilla game.
First lets look at the plan_set.
Code:
plan_set default_set
{
locale any
;default test_levels
roman Roman_plan_levels
greek Greek_plan_levels
carthaginian Carthaginian_plan_levels
egyptian Egyptian_plan_levels
eastern Eastern_plan_levels
barbarian Barbarian_plan_levels
}
You'll see that there is a call out for each of the culture groups as well as a marked out default. Because of this, we can use the default to place our own unique set.
The plan_set tells the game what group of levels to look for for your city.
For the purposes of this tutorial we'll call our new plan_set: custom_set.
We will also need to tell the set what level set to look for, we'll call this custom_levels.
This is how it should look.
Code:
plan_set default_set
{
locale any
;default test_levels
roman Roman_plan_levels
greek Greek_plan_levels
carthaginian Carthaginian_plan_levels
egyptian Egyptian_plan_levels
eastern Eastern_plan_levels
barbarian Barbarian_plan_levels
}
plan_set custom_set
{
locale any
default custom_plan_levels
}
Now, moving up the page we go to the section named, 'plan by levels'
At the bottom of list we'll add our custom levels, like so.
Code:
plan_levels Carthaginian_plan_levels
{
village Egyptian_Village
town Carthaginian_Town
large_town Carthaginian_Large_Town
city Carthaginian_City
large_city Carthaginian_Large_City
huge_city Carthaginian_Huge_City
}
plan_levels custom_plan_levels
{
village custom_Village
town custom_Town
large_town custom_Large_Town
city custom_City
large_city custom_Large_City
huge_city custom_Huge_City
}
As you can see, each settlement level is represented and points to a separate city plan. But now we have to tell the game which text files to refer to for each of the city levels. We do this in the plans section.
Add your new ones on the bottom of the list.
Code:
plan Barbarian_Fort barbarian_fort.txt
plan Barbarian_Village barbarian_village.txt
plan Barbarian_Town barbarian_town.txt
plan Barbarian_Large_Town barbarian_large_town.txt
plan Barbarian_City barbarian_city.txt
plan Barbarian_Large_City barbarian_city.txt
plan Barbarian_Huge_City barbarian_city.txt
plan custom_Fort eastern_fort.txt
plan custom_Village egyptian_village.txt
plan custom_Town east_town.txt
plan custom_Large_Town eastern_large_town.txt
plan custom_City eastern_city.txt
plan custom_Large_City eastern_large_city.txt
plan custom_Huge_City eastern_huge_city.txt
For now you can point each plan to vanilla text files until you create your own. You don't need to direct the game to text files that exist in a mod folder so long as you place them in the proper place the game will look in the mod folder before looking in the vanilla data folder.
The last thing you need to do is assign your new plan_set to a city in descr_strat.
Code:
settlement
{
level large_town
region Africa
year_founded 0
population 3500
settlement_tax 50
plan_set custom_set
faction_creator egypt
building
{
type core_building governors_villa
}
building
{
type defenses wooden_pallisade
}
}
Now you can edit your own custom settlement plans, overlays, underlays, etc and have unique cities grow within a culture group. This is perfect for representing a historically accurate city or having your capital city look different than all other cities.
You could also create a custom plan set and leave the cultures listed. Then go on to create new plan_sets with new plan_levels if you want to have the capital in each culture group be unique and different. This is an easier way to make 6 new settlement plans, one for each culture. So, there are a variety of ways you can mix and match this.
You need to make sure all your spelling is accurate because you can't code this a bit at a time and the game will CTD without an error if done wrong. I've managed to get it working as shown, but I have also had to use the wording, 'default_custom_set' on the plan_set level.
4. Adding the Building and Ambient Models
5. Building Groups & Variants
6. BPI
7. Topography
8. Pathfinding
*All content was only possibly by the hard work of fellow modders such as SigniferOne, Alpaca, RedFox, Thor the Bassist, Aradan, Makayane, Seth Krn3ll, and many others whose names I have lost to memory after using their tutorials and suggestions. So, much thanks and praise must go to them.
Last edited by Ramashan; April 01, 2011 at 04:55 PM.
This is obviously a work in progress. I have only the first three chapters fleshed out. Any feed back or input would be greatly appreciated. Also, anything you think I'm missing or a part anyone would like to participate in would be helpful. I'll continue to work on this and adjust as I can.
Another complete guide has been written or at least started good job!
Under the patronage of Roman_Man#3, Patron of Ishan Click for my tools and tutorials
"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein
Let me paste here some comments about creation of custom cities that I posted for development of our mod. Some of them might be useful here.
If you want to try to modify the cities, the .cas models are placed in the folder: RTW\Data\settlement_plans\
They are imported/exported the same than the units. I have never created new ones, but I know how to modify them, and I'll try to list all the related files, using Minas Tirith as example:
RTW\Data\settlement_plans\overlay\k_minas_tirith_overlay.CAS RTW\Data\settlement_plans\underlay\k_minas_tirith_underlay.CAS
Those files are thought to define the landscape where the city is placed, but Seth Krnell use them to create the whole city model: including ground, terrain and buildings, so you only need one 3dsmax model per city.
The .cas placed in \overlay\ defines the visual aspect of the city: the 3d model and the textures. Each object is a "editable mesh" with an asigned "material". Every object must be linked to the "scene root".
The .cas placed in \underlay\ defines the terrain relief under the city. It includes 2 objects named "underlay" and "outline":
- the "underlay" is a copy of the "overlay", attached into one single object with one single texture. It must fit the "overlay" perfectly, else the texures are not shown properly.
Remember the units can walk over the underlay, unless it is defined as non-passable terrain in the collision file.
- I don't know the purpose of the "outline", it seems a simple plane to define the limits of the city.
RTW\\Data\models_building\INFO\k_minas_tirith_INFO.cas
The .cas in the folder \INFO\ defines the collsions. There are several allowed objects:
- collision_3d: you know, collisions for the camera and projectiles. It is again a copy of the underlay.
- collision: non-passable terrain for units (2d collisions). It is possible to use several objects named "collision_xx" (xx is a number).
In fact, it seems the collsions do not work if the object consist of more than one "element". I needed to detach each "element" into different objects to fix the collisions.
All objects must be linked to the "scene_root"
When the game first load a city, it uses this info .cas to generate a .bpi file with the collision information. Then the .cas is not longer needed.
RTW\Data\settlement_plans\street_plans\k_minas_tirith_pathfinding.cas
This is the pathfinding of the city. There are 2 type of objects:
- Node_xx: squares for the nodes of the path
- Link_xx: rectangles for the links followed by the soldiers.
Again, all objects must be linked to the "scene_root"
I have made some paths from scratch and I think I have learnt how to design and implement them.
The most important is that the links do not overlap any non-passable terrain (2d collision).
It seems the AI continually check if there is a straight line without collisions to his objective, and if true the AI ignores the paths.
Else, the AI tries to go straight towards the closer node, and then to follow the path towards the node that is is closer to his objective.
Finally, you call all those files from the settlement plan .txt file placed at: \alexander\lotrtw\data\settlement_plans\
-target rectangle = it is the area you need to capture to conquer the city.
-floor = underlay and overlay
-ground_types = ground texture. Not needed if the floor (underlay + overaly) covers the ground completely.
-street_plan = pathfinding
-borders = wall positions. You can use the walleditor tool to create them.
-ambient buildings: the buildings in the walls of each Minas Tirith level are ambient buildings, and they can be destroyed in battle.
-slot positions for constructed buildings: the citadel at the top is a standard building, as well as the forge and barracks.
They can be upgraded or destroyed in campaign.
-at the end you can see the collision file. It seems it must be defined in the descr_building_battle.txt as any other building.
Those plans are called from the file: \alexander\lotrtw\data\descr_settlement_plan.txt
where you can define any number of custom plans you want. Though only default plans can be used in custom and historical battles.
Thank you Bardo. I'll try to organize all that information into the main post above. Great addition. As you can see, the whole settlement creation thing is quite in depth.