PDA

View Full Version : Further Exploration in Settlement Layout in RTW



waitcu
02-16-2006, 18:54
Further Exploration in Settlement Layout in <<Rome:TW>>
By: Han Ben (Chen Zhen)
Translated by: Po-Lung Chia (sephodwyrm), mychinesetranslation.com (shameless self-advertisement)


What is settlement plan ?
The settlement plan is a distribution of buildings, streets, trees, rivers over a contour map in a visual. One point to note is that the modified settlement plan would only be exhibited in siege warfare over the control of the modified settlement or pass. Field battles require a different set of knowledge of modification. In the game, settlement plans include the following:


ONE: UNDERLAYS


- the contours and topography of the settlement is determined by 2 elements: one being the position of the settlement on the map, the other being the underlay model of the city


- The position of the city and the surrounding topography can be modified through this file: \Data\world\maps\base\map_heights.tga. The position of the city can be obtained by calculating backwards via this document. This document provides the real position of the settlement on the grand map – the black dots in the color plaques would be the position of the city. The white dots would represent the ports. We can, via PHOTOSHOP, obtain the (X,Y) co-ordinates of these, and with this formula:
X1 = X*2+1;Y1=Y*2+1
We obtain the (X1,Y1) co-ordinates of the settlement. This co-ordinate would be the real position of the city on map_heights.tga. The gray number ( C ) would be the altitude of the city. The consensus number is 7511.272. We can set this as the ( mH ). The real altitude in meters could be calculated via this formula:
Altitude (in meters) = C/255 * mH

Now we will learn how to control the city’s altitude and the surrounding topography. This is done by editing map_heights.tga. But this is only part of it. We still have to change the topography within the city. This would allow us to form hills or valleys within the city itself. This would require the modification of the underlays model.


The underlays models are placed in the folder: \Data\settlement_plans\underlays
These models can be opened in 3DSmax like how we open unit models. If we want to change the topography of a Roman settlement, we would open underlay_roman_town.cas. After opening this document, we would see that there 2 main parts to the model: the outline and the Underlay. The Underlay model is responsible for the topography and contour of the settlement plan. The outline would be the link between the Underlay and the topography provided by the grand map itself.
The Underlay model can be edited via MAX freely to create your own topographic distribution. But these rules msut be followed:
1. The Outline model is planar, all Z co-ordinates should be set at 0
2. From the viewpoint of the Z axis, the Underlay and Outline should be a perfect overlap with no size change
3. The borders of the Underlay and Outline must also be a perfect match. If they don’t you would see gaps in the ground in the game, and the poor men would fall straight to Tartarus
4. The lowest point of the Underlay cannot be too deep. This is important when the city is already at lower altitudes. This might cause crashes to occur.
5. The Outline should have as few facings possible. A maximum of 6000 is suggested.

We can thus modify a working Underlays model following these guidelines. After modification, we can link the Underlays and Outline to the Scene Root points and provide a few textures. This can then be exported.


TWO: OVERLAYS

The Overlays are textures for the topography, and are designed to fit the Underlays. So we can say that the Underlays are responsible for the contours and topograhy UNDERneath, while the Overlays are responsible for the land OVER the curves. The 2 models should fit with each other without seams. First we would open this document:
\Data\settlement_plans\overlays\ overlay_roman_town.cas
And then we would delete all the original models to provide a clean face to skin the Overlays. We then import our newly modified underlay_roman_town.cas and delete the OUTLINE model.

Now we can skin the overlays model. The methods are the same with that of skinning unit models. But we should consider that the models are larger and hence the skins are not very sharp. We can divide the Overlays model into several individual models and use multiple skinning techniques to skin each model. (NOTE: The Pillar team has our own multiple CAS exporter. This can increase the skin sharpness of buildings, ground surface, siege equipments, trees and other models)


Note, even if you have separated these models, you should not change their co-ordinates. Otherwise if you enter the game, the 2 models would be separated.

We would then link all these to the points of Scene Root, and then export them to overlay_roman_town.cas

THREE: STREET PLANS

The street plan is also displayed as a CAS model, and is stored at \Data\settlement_plans\street_plans folder. If we open pathfinding_roman_town.cas, we would see that this model controls the street plans of the roman town. There are many <<node>> and <<link>> models. They only need to be intercrossed according to the rules. The co-ordinates need not be strictly applied.

The street plan is actually not used to show the streets of the city, nor is it used for setting the contours of the roads. These are both controlled by the Underlay model instead. The street plan has 2 uses:
1. Pathfinding for the troops in the game
2. Providing troop positions for the defending side in an assault.


FOUR: BORDERS



Settlement planning is a big topic with a broad spectrum of associated contents. We can simply say that the walls are divided into segments, which are then joined with a standard linking program into a continuous border. How this connection works is not within our discussion since we have already published a border layout program:
http://www.twcenter.net/forums/showthread.php?t=40060
This tool would help you create your own walls.


After hundreds of repeated experiments, I see that there is another function to the borders. It is used to control the consensus troop deployment points of the attacking side in an assault. For example, if the army is assaulting the city from the north face, then the consensus troop deployment position would be approximately 50 m north. Also, the borders cannot too small because that might lead to a lack of deployment position for the defending side, leading to crashes.


FIVE: COLLISION


Walk areas determines the areas that the troops can walk on and areas that are not. For example, in our Pass model, the troops are only allowed to walk on the winding path on the mountain side, and this was done via modifying the Collision.

The collision fields belong to the “building pathfinding” techniques. These files are also CAS models, and these are usually kept in the folder of Data\models_building\INFO. One usually has to decompress the PAK files to get into the INFO content. CA, wishing to keep these techniques secret, did not publicize any building pathfinding model. This includes our before-mentioned Walk Areas model. These can also be called collision tests from the viewpoint of a 3D game engine. In RTW, we would call it Collision.


For BI, the folder of Data\models_building\INFO contained newly publicized basic building COLLISION model from CA. This allowed us to have better idea on how the collision model works. We can open the building models under BI\Data\models_building\INFO via MAX. We can see that there are 2 models: one begins with COLLISION, the other with COLLISION3D.

Models beginning with COLLISION control the 2D areas of the walking zones. It is a polygon with a Z axis value of 0 throughout. Strictly speaking, it controls for the area that units can walk on. So, if we have a rock in the middle of the map, and require that the soldiers not walk on the rock, we can make a circular shape in the COLLISION model.


The COLLISION3D models are classic 3D collision test models. These automatically raise view points to prevent it from getting into the models itself. We know that when we move our view points onto the buildings, it is automatically lifted with the building.

We can control walking zones for the troops via COLLISION. COLLISION3D is usually left untouched.


SIX: FIXING THINGS TOGETHER

Now we have to copy these files to the various folders of the game and fix the associated TXT files.

1. Copy the completed UNDERLAYS model to: the folder Rome - Total War\Data\settlement_plans\underlays
2. Copy the completed OVERLAYS model to: Rome - Total War\Data\settlement_plans\overlays
3. Copy the completed STREET PLANS model to: Rome - Total War\Data\settlement_plans\street_plans
4. Copy the completed COLLISION model to: Rome - Total War\Data\models_building\INFO
5. Open the TXT file: Data\descr_building_battle\dbb_kevins_buildings.txt



We then add additional information, such as:

roman_town_collision ;can be freely editted
{
stat_cat indestructable ;unknown
localised_name none ;unknown
level
{
min_health 0 ;building life
battle_stats ;unknown
item dummy ;the associated item MODEL
physical_info roman_city_collision_info.CAS ;the associated COLLISION model
}
}



6. Open \settlement_plans\roman_town.txt
7. We can then edit the 4 models via this text model. I will make some commentaries on this file.

plan ;opening…not to be editted
{
target rectangle x -24 z 24 rot 0 width 32 height 32 ;this reflects the central plaza to be seized in the assault
floor roman_town_underlay.cas roman_town_overlay.CAS ;this is the underlay and overlay document names
ground_types roman_town_ground.tga -288 -288 288 288 ;unknown…maybe lacks function
street_plan pathfinding_roman_town.cas ; street plans model
borders ;border{}the middle is the castle wall or border plans. It can be edited with the layouts program
{
gateway, 224, 0, 90, 0.50
tower_external_corner_link, -224, 224, -90, 0.50
tower_straight, 224, -128, 90, 0.50
straight, -224, -192, -90, 0.50
}
; COLLISION OBJECTS

roman_town_collision, 0, 0, 0, 0 ;the prior edited roman_town_collision

roman_tenamentB, -72.16, -23.75, 0.00, 0.500 ;tenement
roman_tenamentD, 50.83, -151.82, 180.00, 0.50 ;tenement
roman_tenamentE, 154.612, 48.753, -158.308, 0.5 ;tenement

tree_B, -24.74, -167.48, 0.00, 1.50 ;tree
}

Tittils
02-16-2006, 23:10
Thanks, I really appreciate your help:)
But I have one question...
If I want the enemy to deploy on only one side of a settlement, because it only has one gateway, how can I do that?

waitcu
02-17-2006, 04:05
yes ,you can ,use our tools
http://www.twcenter.net/forums/showthread.php?t=40060
but as i know , Hanben had made a experiment on building ,
long time ago , we didn't find out the way to selove this problem . so Hanben changed some building 3d models to mountain model . these models covered a big area amount 3 side or 2 side of the city , i mean inculding the gateway. so our early mountian pass was made like this .

Shigawire
02-17-2006, 11:06
Very impressive. Thanks for your brilliant analysis and friendly tutorial.
:2thumbsup:

PROMETHEUS
02-17-2006, 14:18
Nice tutorial , will try it as soon as I have time , but what can you tell us about pathways and edit them?

waitcu
02-17-2006, 18:07
pathways?
do you mean the mountain pass ?

Lord Adherbal
02-17-2006, 23:34
he means pathfinding maps / streetplans

waitcu
02-18-2006, 05:40
you can find in The Third Part of this artical

PROMETHEUS
02-20-2006, 22:23
I am having a problem , everytime I edit and export the underlay , even with very sm,all editing it gets this weird unassetment in the soil in fron tof the gate , or where will be the gate when there would be walls .... how can I fix this?

https://img458.imageshack.us/img458/7443/10og.jpg

SigniferOne
02-21-2006, 01:17
Prometheus, the underlay overrides the actual ground geography of an area. So if you insert a square of underlay data, in the side of a hill for example, you will notice that the area in the underlay will be perfectly flat, while area all around it will flow naturally into a hill. That's what I think is going on in your picture, notice how the ground is getting higher to the left, but the ground inside the underlay area is not following it and continues to be perfectly straight. Thus the difference between the actual ground and the underlay ground keeps increasing the further left you go, as can be seen happening in the picture.

PROMETHEUS
02-21-2006, 01:53
But I didn't even touched the underlay , I just reexported in this picture ...

snevets
08-03-2006, 19:50
Hmm, I started following the tutorial by messing with the underlay. Even when I didn't mess with anything and merely re-exported I got this error:

https://img190.imageshack.us/img190/3850/settlementerrorvm6.th.jpg (https://img190.imageshack.us/my.php?image=settlementerrorvm6.jpg)

Since the tutorial mentioned importing 'the normal way' I assumed that meant vercingtorix's .CAS tool, is there something else I should be using?

Seth Krn3ll
08-15-2009, 17:45
Ok I have a question here.

I modded a brand new settlement plan, with many peculiar things which may be causing trouble, but as afr as now the problem is one i am missing.

I made the overlay things, the underlay things, the collision things, the pathfinding street plans thing, and put all of them in the proper directories. Given my city is brand new and not a remodding of an existing one, i added my own plan_set in descr_settelent_plans and called it for the right city in descr_strat, then started the game expecting a thousand crashes and errors, but the game loaded properly until i tried the atctical view of the city, then...

The error message says: "non existing item dummy"

In my own dbb_ files i added the new city model for collisions, with those lines:


k_minas_tirith_collision
{
stat_cat indestructable
localised_name none
level
{
min_health 0
battle_stats
item dummy
physical_info k_minas_tirith_INFO.CAS
}
}

so i am puzzled: in this tutorial the author says:


item dummy ;the associated item MODEL

and given i was not sure which model i had to set there i just used the "dummy" that is set in all other cities in original dbb fiels... how come it works for them and not for my one?

Have i maybe to create a .cas file with the city itself and put it in the ITEMS folder like normal buildings?

BUT, here's a pic of the model of the city model:
http://digilander.libero.it/krnell/lotrmod/minas%20tirith%20working%2001.jpg