PDA

View Full Version : Tutorial: creating new vegetation for battlemaps



Duke John
02-07-2006, 10:37
Creating new vegetation for battlemaps


Mods are researching to create realistic/historical skins for their units and to see them besides the gamey trees of R:TW is in my opinion a waste of opportunity to have a certain style for the entire battlefield. This tutorial will show how to create your own trees for the use in battles.
Making new vegetation will probably be done after making (a few) unit models, so I will assume that you will know how to model in 3ds max. The method I am describing results in a model with relatively few polygons.

Cheers,
Duke John


Tools used in this tutorial
Notepad
3ds Max 6.0, the image http://files.upl.silentwhisper.net/upload0/tut_tree_3dsmax.jpg indicates that a 3ds max command or menu option is used.
PhotoShop
CAS Importorter/Exporter made by Vercingetorix.
In Appendix A below you can find some files that are probably helpfull when creating your own trees.

Step 1: reference material
Use google to search for images of trees and forests, or even better, take a walk in the woods. Do not use trees that are standing on their own, their growth and consequently shape is considerably different from trees growing in forests. Find a few close ups to extract a bark texture from.


Step 2: modelling
Yes, you will need to model your own tree and that is why you first needed to find reference material. First model a branch and a leaf. Give the branch a bark texture and the leaf a single colour.
http://files.upl.silentwhisper.net/upload2/tut_tree_model_branch.jpg http://files.upl.silentwhisper.net/upload2/tut_tree_model_leaf.jpg
Copy/paste/rotate/move/scale the branches just as many times as you like. The trunk must be going straight up. Then copy/paste the leaves along the branches. The result can be something like this:
http://files.upl.silentwhisper.net/upload2/tut_tree_model_tree.jpg http://files.upl.silentwhisper.net/upload4/tut_tree_model_tree_leaves.jpg
See Figure 7 to see how the branches and leaves should not be lying in the same plane. This results in nicer shadows.


Step 3: Creating the scene

Rendering options
http://files.upl.silentwhisper.net/upload0/tut_tree_3dsmax.jpg Rendering > Render... or press F10.
Set the output size to 512x512, or 256x256 if you want to use lower resolution textures.

http://files.upl.silentwhisper.net/upload0/tut_tree_render_options.jpg
Figure 5

Creating the camera
http://files.upl.silentwhisper.net/upload0/tut_tree_3dsmax.jpg Create > Cameras > Free Camera.
Put the camera in front of the tree.
http://files.upl.silentwhisper.net/upload2/tut_tree_view_front.jpg http://files.upl.silentwhisper.net/upload2/tut_tree_view_top.jpg
Figure 6: front view. Figure 7: top view

I don't know wether I changed anything but these were the settings I used:
http://files.upl.silentwhisper.net/upload4/tut_tree_camera_options.jpg
Now move the camera around until you have all the leaves and branches in view of your camera. The trunk does not need to be entirely in view as the actual ingame model will have a modelled trunk. Leave a bit of space empty so that you can place a bark texture later on. Check with a render to see wether this is the case:
http://files.upl.silentwhisper.net/upload0/tut_tree_3dsmax.jpg Rendering > Render... or press F10.
Or with the Camera01 viewport active:
http://files.upl.silentwhisper.net/upload0/tut_tree_3dsmax.jpg Press F9.

Creating light
Put the omni-light to the front of tree and play around on the horizontal/vertical axis until you get a satisfying casting of shadows on the branches. See Figure 6 and 7 to see how I placed it. I don't know wether I changed anything but these were the settings I used (do make sure that the shadow options are checked):
http://files.upl.silentwhisper.net/upload4/tut_tree_light_options.jpg

Setting the background
After rendering the tree you will probably notice that the background colour is different than your leaf colour. To avoid having the background influencing the colours of the tree you will need to change it:
http://files.upl.silentwhisper.net/upload0/tut_tree_3dsmax.jpg Rendering > Environment... or press 8.
Set the Background colour to something similar to your leaves and bark. You can play around with the Global Lightning Tint and Ambient level to get a nicer light effect.

http://files.upl.silentwhisper.net/upload0/tut_tree_environment_options.jpg
Figure #


Step 4: Rendering
http://files.upl.silentwhisper.net/upload0/tut_tree_3dsmax.jpg Rendering > Render... or press F10.
Make sure that the Viewport is set to Camera01, see Figure 5.
http://files.upl.silentwhisper.net/upload0/tut_tree_3dsmax.jpg Save the render by pressing the disk. Save as a 32-bit TGA file.
http://files.upl.silentwhisper.net/upload2/tut_tree_render.jpg


Step 5: Adding bark
Open the texture in PhotoShop. Now add the bark you used in step 2 to the rendered image from step 4. The bark texture should be large enough so there does not happen too much stretching. I use around 60x512 pixels. One third of the texture should gradually become darker to simulate the dirt at the base of the trunk.
http://files.upl.silentwhisper.net/upload5/tut_tree_bark.jpg
Make sure that the bark texture is not hidden by the alpha layer.
Save the texture as a TGA.DDS file.


Step 6: Modelling, part 2
Yes, more modelling is needed. This time you will create the model that is used in the game. Below you will see a few views of how I model my trees. I tried alot of other variants but this was the one that was lowpoly and gave a good view from most directions. Model a trunk from a box that has 3 segments. The lower segment should use the darker bit of the bark texture. The trunk should not go all the way up. Let it kind of merge with the branch and leave texture.
The textures showing the branches and leaves are placed on a big plus that has its ends split in two. Once you have modelled it for one side, copy the faces and flip them, so that the faces can be seen from all sides. The model below has just 64 faces. Make sure that the model only uses one texture which should be the one you made in step 5.
http://files.upl.silentwhisper.net/upload2/tut_tree_model_top.jpghttp://files.upl.silentwhisper.net/upload2/tut_tree_model_front.jpghttp://files.upl.silentwhisper.net/upload2/tut_tree_model_3d.jpg

Make sure that you have a scene root and attach the model to it. Now export the model as a CAS file using Vercingetorix' tool.


Step 7: Adding the new vegetation

Adjust the preferences of R:TW
In R:TW make sure that the colours are 16bit, for example 1024x768x16. And that anti-aliasing is off. I do not know wether both settings are needed, but it works that way. This is needed to let R:TW generate sprites and textures. Shut down R:TW.

Removing old vegetation files
I shouldn't be writing this by now, but back up in case you screw up. Remove the files in:
data\vegetation\
data\vegetation\sprites
data\vegetation\textures
Remove:
data\descr_vegetation.db

Adding the new vegetation
Place your CAS file in:
data\models_vegetation\
Place your TGA.DDS file in:
data\models_vegetation\textures\

Copy the folder:
data\models_vegetation\textures
And paste into:
data\vegetation\

Edit the vegetation entries
In descr_vegetation.txt edit any tree entry so that it points towards your new vegetation model. For example:

model super_tree
{
level models_vegetation/ntw_tree_03.cas
}
model super_tree_01
{
level models_vegetation/ntw_tree_01.cas
}
model super_tree_02
{
level models_vegetation/ntw_tree_04.cas
}
Now scroll further down and you arrive at the climate entries that hold the information which vegetation is used. Edit any climate entry so that it points towards your vegetation entries. For example:

vegetation default_forest
{
layout 128 forest_layout.tga
radius 1
height_range 0.9 1.4
aspect_range 0.9 1.1
lod trees
model super_tree_01
model super_tree_02
model super_tree
}
The layout entry points towards a tga that dictates how the trees are placed on the map (see the optional step below).
The radius entry represents the diameter/radius(?) of the collision box that is put around the vegetation model. It can be 0.
The height_range and aspect_range are multipliers to get the actual width and height of the vegetation model. The bigger the range the larger the variation.

Optional: editing vegetation layout
In data\battlefield\vegetation you will find two TGA files that have dots on them:
forest_layout.tga
scrub_layout.tga
Each dot will be a vegetation model on the battlefield as the tga is tiled over the battlefield. You can change these tga's to make them more dense or whatever. The number in the layout entry should be powers of 2; 128, 256, 512. The number represents the scaling of the tga; the larger the less trees will be placed in the same space.


Step 8: Generating the new vegetation
Everything should now be in place. Start R:TW again. Loading should take a bit longer as the vege files and sprites are generated automatically by the engine. Make a new custom battle that has the climate that uses the new vegetation and admire your work :grin:
http://files.upl.silentwhisper.net/upload6/tut_tree_ingame_1.jpg

http://files.upl.silentwhisper.net/upload6/tut_tree_ingame_2.jpg


Step 9: Postprocessing
You may notice that your bark texture is different in hue than the branches. You can fix this either in PhotoShop or in 3DS max by editing lightning.

The engine generates the sprites and textures as TGA files. When you are done with tweaking your vegetation I advise you to open the textures and sprites in data\vegetation\ and save them as TGA.DDS for better performance. The R:TW engine automatically reads the TGA.DDS files instead of the TGA ones.



That was the end of the tutorial. I hope I have included every step. If it is not working for you then please describe your problem in detail and include screenshots if needed. Anything less is not honouring the time I put in researching and writing this method and you might not get a reply from me.

Good luck,
Duke John




Appendix A: Tree creation tools
I have made a pack containing some tools to setup and render your trees. Follow this tutorial to understand the whole process:
https://forums.totalwar.org/vb/showthread.php?t=60901

User Agreement
None of the files included in the pack or the pack itself may be distributed without the consent of the Lordz, contact at:
forum.thelordz.co.uk
forums.totalwar.org/vb

Download
http://www.totalwar.org/Downloads/Rtw_Uploads/RTWupload/lordz_tree_tools.zip Please PM me if the link is broken.

Contents
ntw_tree_04.cas
An example model for a regular tree. Texture can be found in the textures folder.

rnj_pine_1.cas
An example model for a pine tree. Texture can be found in the textures folder.

setup_ntw_tree_04.max
This is a 3ds max scene that contains a 3D tree that can be rendered using the camera01 view. Textures can be found in the textures folder.

setup_rnj_pine_1.max
This is a 3ds max scene that contains a 3D pine tree that can be rendered using the camera01 view. Textures can be found in the textures folder.



I would love to see someone using my files to create a vegetation mod for R:TW. I am much too busy with Napoleonic: Total War 2 (forum.thelordz.co.uk) to do so myself. Have fun and good luck with making trees!

Cheers,
Duke John aka Lord Fishbone from the Lordz

snevets
02-07-2006, 15:10
Wow, very impressive work. I must admit that of all the things I've thought to make new models for I've never thought of vegetation. Is that a picture of a real forest or an ingame screenshot? You are entirely right, with all the good work that is produced by modelers its a shame not to make the environment look realistic. Well done.

Duke John
02-07-2006, 15:32
Is that a picture of a real forest or an ingame screenshot?
Which modder doesn't like to hear that kind of compliments :shy: Hopefully with this tutorial more people will see that it isn't that hard and the result is far more effective at setting an atmosphere than adding another unit.

professorspatula
02-07-2006, 15:40
Well that's a fascinating and well presented tutorial. I'd raise my hat to you, except I don't have it on my head, but you get the general idea. Probably.

Myrddraal
02-07-2006, 17:48
Very Very Very impressive, many thanks DJ, I've had a couple of conversations with other modders by MSN about this topic, lets just say they involved many smilies :grin:

Kagemusha
02-07-2006, 18:06
This is great news.Thanks a lot DJ!:2thumbsup:

Lentonius
02-07-2006, 18:09
it is fantastic when with the help of a great guide, thing previously unknown to most are simple to make. yay:2thumbsup: cheers again:2thumbsup:

Revolting Friendship
02-07-2006, 18:16
Duke John:

Thats some impressive stuff. I applaud your skills. This will surely help us enhance the battlefield experience of our mod greatly, if Prometheus and Kagemusha is up for the work.

:bow:

alpaca
02-07-2006, 19:06
Wow those trees look really nice :)
Great tutorial, too.

Lord Adherbal
02-07-2006, 20:33
very impressive stuff, happy to work with you in the Lordz team

snevets
02-08-2006, 02:41
Perhaps we could merely all borrow DJ's models, they're amazing as it is. Besides, they're fairly generic trees, so I imagine they would fit the needs of most mods.

BTW, what is the average vertex count of these models?

Monkwarrior
02-08-2006, 09:58
Perhaps we could merely all borrow DJ's models, they're amazing as it is. Besides, they're fairly generic trees, so I imagine they would fit the needs of most mods.

That's really a very good idea.:idea2:
Although only if Duke John agrees.:inquisitive:

I don't know how many types of trees can be included in RTW, but if it is so simple (for him) it is for sure that it would be faster than learning 3ds max (at least for me :no: ).

hoggy
02-08-2006, 15:54
Stunning job DJ, looks fantastic! I'll have a go at the tutorial when I get a mo.

PROMETHEUS
02-08-2006, 23:06
Great Tutorial , great mod , May be you are willing to create a new vegetation for the Ran No Jidai mod ? :sweatdrop:

snevets
02-09-2006, 05:33
Hehe, prometheus you've got to be the 10000 th person to ask already.

But while I'm at it would you care to make the vegetation for Hegemonia?

alpaca
02-09-2006, 15:46
You shouldn't have released that tutorial, now everyone's nagging you ~:cheers:

Dol Guldur
02-09-2006, 18:46
Duke,


Think you can do Fangorn Forest by the end of the week? Thx.

j/k

Yes, a good tutorial :)

If they brought out a patch for this would it be a vegetable patch?

SigniferOne
02-10-2006, 05:44
DJ, I have a question for you:

In what way are your trees different in a substantial way from vanilla trees? Because somehow your forests as a whole look a lot more realistic, and the tree density looks a lot better too...

Duke John
02-10-2006, 10:19
The biggest difference is that I use a texture that on its own already resembles a tree. My model is designed in such a way that the texture looks good from almost all sides (flying high looking straight down is the exception).

Most of the textures used by CA which on their own have little to do with trees and are applied to models that have little to do with trees. The result is recognized as being a tree but when put next to a real tree the mistakes become very visible. I guess that the artist thought that vegetation did not matter much and came up with a quick solution.

I might release my trees as a minimod useable by any mod, but that won't happen before NTW2 has its first release.

Duke John
02-13-2006, 12:06
A new example of what you can achieve:
http://files.upl.silentwhisper.net/upload9/rnj_pine_2.jpg
http://files.upl.silentwhisper.net/upload9/rnj_pine_3.jpg

waitcu
02-13-2006, 20:33
wow!!!! we just thinking of this question , thanks very much !!!!
btw , do you know how to change the trees 3d model on campaign map ??
i don't know where to setting it .:(

Dol Guldur
02-13-2006, 20:40
Yes, I would be interested in that too.

Great work, Duke.

Duke John
02-14-2006, 15:09
The source models will be released, probably next week.

Tux
02-17-2006, 12:19
wow!!!! we just thinking of this question , thanks very much !!!!
btw , do you know how to change the trees 3d model on campaign map ??
i don't know where to setting it .:(
Well the models used in the camp map are in: data\terrain\aerial_map\tree_models
So you just have to change them and export them after with a new skin path and new mesh. Also i think you can use the descr_climates.txt to create new forest types and the path of the models.

Looks good there DJ, great job on the trees and on the tutorial.:2thumbsup:

hoggy
02-18-2006, 11:19
Hi DJ, I had a go at following your excellent tutorial with some blossom trees. The tutorial works really well and I got them in game. Unfortunately I can’t seem to get RTW use the sprite files. It generated a sprite tga for the tree which looks correct, but as you can see it doesn’t appear to use it in game.
http://www.awrate.com/chrishogg/images/btree.jpg
It still uses an old pine sprite file even though default_forest_0 has the blossom tree on it. I’m using 1.5, I turned anti-aliasing off and have it set to 16bit colours. Also curiously, the game still has shadows for the old pine trees.

- One section I’m unclear about is:
Removing old vegetation files
I shouldn't be writing this by now, but back up in case you screw up. Remove the files in:
data\vegetation\
data\vegetation\sprites
data\vegetation\textures
Remove:
data\descr_vegetation.db
When I remove all the contents of these folders the world has disappeared and the units are hovering in space. So to get my result I just deleted individual files that related to my tree. Should I only be deleting certain file types from these folders?

Hope you can help.

waitcu
02-18-2006, 18:55
Well the models used in the camp map are in: data\terrain\aerial_map\tree_models
So you just have to change them and export them after with a new skin path and new mesh. Also i think you can use the descr_climates.txt to create new forest types and the path of the models.

thanks Alin , try it asap

PROMETHEUS
02-20-2006, 09:22
DJ what u think of the new trees of MTW2 ? do they look like the RTW ones in way of construction or something better? may be they can be improved later with ur technique?

https://img106.imageshack.us/img106/1494/11an1.jpg

wlesmana
02-20-2006, 16:14
Super mega ultimo thank you to Duke John for this tutorial. I have tried making new trees for a week now. This is the result:
https://img377.imageshack.us/img377/408/newforest19cu.th.jpg (https://img377.imageshack.us/my.php?image=newforest19cu.jpg)
https://img97.imageshack.us/img97/641/newforest26vq.th.jpg (https://img97.imageshack.us/my.php?image=newforest26vq.jpg)
https://img377.imageshack.us/img377/976/newforest34ok.th.jpg (https://img377.imageshack.us/my.php?image=newforest34ok.jpg)

It's not much yet since I still need to tweak them a lot and make more than one model, but looks better than vanilla so far. I would've been pretty much impossible for me to come up with something like without the tutorial. Thanks again.

Geoffrey S
02-20-2006, 16:26
Excellent tutorial! As you said it's a shame seeing so many beautiful models in so many great mods in contrast to the rather poor vegitation and landscapes of RTW; thanks to this tutorial I look forward to seeing many mods using this technique and looking all the better for it.

I presume these new trees also have a noticeable effect on formations, such as phalanxes? Should be rather good for gameplay, making terrain more important than in regular RTW.

Encaitar
02-21-2006, 02:54
Prometheus: the trees in that screenshot look identical to the trees from MTW (I spent quite a bit of time making maps with MTW, so I recognise the various models). Whether they're just placeholders for now or not, who knows (the look may well stay the same, but with a more 3-d model than the MTW ones).

Soviet_Warlord
02-21-2006, 06:05
The source models will be released, probably next week.

You promised us!! :juggle2:

Duke John
02-21-2006, 09:40
Hoggy, you should delete all files in the vegetation folder (note NOT the directories). You should then paste the textures folder in models_vegetation into the vegetation as the included images are used ingame. (The models_vegetation folder is only used to generate the vegetation files.) It works every time for me, so you are missing something.

The TGA.DDS files in the sprites and texture folders override the TGA files. This is done by CA since DDS files are better for system performance. That is why you are seeing the old sprites. The bit about deleting the contents of those folders will avoid this happening. Once you have finished your trees you can see the sprites and textures as DDS files to get better performance.

Prometheus, looking at the screenshots I guess they are using the same type of model as used for the highland trees and trees in towns. They have tweaked it a bit and does look better. But I am not bothered with the M2:TW trees at the moment. If they look good, fine. If not, then I'll just edit them.

They are certainly not the same models as from M:TW as they were just 2D sprites with a photo like texture.

Soviet_Warlord
02-21-2006, 22:50
Hoggy, you should delete all files in the vegetation folder (note NOT the directories). You should then paste the textures folder in models_vegetation into the vegetation as the included images are used ingame. (The models_vegetation folder is only used to generate the vegetation files.) It works every time for me, so you are missing something.

The TGA.DDS files in the sprites and texture folders override the TGA files. This is done by CA since DDS files are better for system performance. That is why you are seeing the old sprites. The bit about deleting the contents of those folders will avoid this happening. Once you have finished your trees you can see the sprites and textures as DDS files to get better performance.

Prometheus, looking at the screenshots I guess they are using the same type of model as used for the highland trees and trees in towns. They have tweaked it a bit and does look better. But I am not bothered with the M2:TW trees at the moment. If they look good, fine. If not, then I'll just edit them.

They are certainly not the same models as from M:TW as they were just 2D sprites with a photo like texture.

Please don't forget to release your vegetation! It looks awesome, and I don't have 3dsmax or any of those programs needed to make them myself. ~:cool:

Dr Octo
02-27-2006, 13:54
You mention there's a dotmap that relates to how many trees appear on a map. Is it possible then to edit this map and nothing else? I don't think I have the skill to make my own trees, but I would really like to see more vegitation on the battle map.

Presumably all I need to do is add more dots onto the dot map and hey presto, bigger woods?

Tux
02-28-2006, 21:19
You mention there's a dotmap that relates to how many trees appear on a map. Is it possible then to edit this map and nothing else? I don't think I have the skill to make my own trees, but I would really like to see more vegitation on the battle map.

Presumably all I need to do is add more dots onto the dot map and hey presto, bigger woods?
You just have to increase the resolution of the dotmap, the vanila res. of the dotmap is 128 so 256 is enough to get some pretty dense forests on the battle map.

Dr Octo
03-04-2006, 15:40
Ok, so increasing the resolution will make the forests that would have been generated in vanilla RTW appear denser.

But how can you make new forests appear? Also, is it possible to add trees to terrain that would usually have few or none?

Duke John
03-04-2006, 16:53
To increase the density you can indeed edit forest_layout.tga. Then backup and remove descr_vegetation.db (16bit colours and no anti-alias settings). It will be generated again by R:TW with the new density.

It is not possible to add trees to ground types other than forest or scrub. Although I wouldn't advise you to use the scrub groundtype since the models will not project shadows.

Soviet_Warlord
03-06-2006, 22:30
Duke John, I can't stop staring with wonder and awe at this picture:

http://files.upl.silentwhisper.net/upload6/tut_tree_ingame_2.jpg

Can you please release your vegetation mod? Sadly, I don't have any modding skills, and I don't have 3ds max, so I'm unable to do the work myself :embarassed:

Duke John
03-07-2006, 08:19
I updated my Tree Tutorial with a link to a pack containing some helpfull files for creating your own trees:
https://forums.totalwar.org/vb/showpost.php?p=1060245&postcount=1

Cheers,
Duke John

Monkwarrior
03-07-2006, 12:26
Link working and tool downloaded.

Thanks a lot DJ.:2thumbsup:

Prof
03-07-2006, 19:42
when I try to test some stuff, I made (I just changed the texture) it says "error in reading scene file"

Duke John
03-07-2006, 19:45
I feared that already... to be honest I just collected my files and hoped that it still worked but apparently one cas file is corrupted, I guess the pine tree, right?

I shall upload tomorrow a new version that works.

Prof
03-07-2006, 20:10
yes...it is the pine tree...I can't load it in max either

Teleklos Archelaou
06-02-2006, 19:10
How does the whole "Tree_A"/"Tree_B" system work? If a group or set of models references a tree like "tree_A_palm", and the entry for that palm looks like this:


tree_A_palm
{
stat_cat indestructable
localised_name none
level
{
min_health 0
battle_stats
item tree_A_palm
physical_info info_tree_A.cas
}
}

How does it pull up a palm tree specifically when it looks at the cas file "info_tree_A.cas"? I thought one might just be able to look up all the palm types (4 apparently in vanilla), by looking for their CAS files, but there are only two that I can see, and I'm wondering where these other two come from, since they seem to be referencing CAS files like the one above. It is clear this same CAS file is used for other non-palms too:


tree_A_deciduous_summer
{
stat_cat small_wooden
localised_name none
level
{
min_health 0
battle_stats
item tree_A_deciduous_summer
physical_info info_tree_A.cas
}
}

What I'm really wondering I guess is is it possible to use these "Tree_A"/"Tree_B" trees on the battlefield outside of groups. As the trees referenced in descr_vegetation.txt.

Teleklos Archelaou
06-06-2006, 20:24
Another question that I'm very curious about. Maybe someone has an idea on this.

Is there any chance at all of making the game recognize trees for climates like sandy_desert or swamp? Swamp has entries in descr_vegetation.txt, but they are blank. I referenced some trees there, and the sprites were created for the swamp trees then, but they didn't actually show up in game. It would be **tremendous** if we could get them to pull up trees (for example, vegetation swamp_dense_forest could populate the space with thick trees instead of the totally stupid flat ground it shows now; and vegetation sandy_desert_dense_forest could pull up the desert oasis trees where the desert does intersect with forest ground cover).

Any ideas about what other file needs changing to get these to work? These are not new climate types - but just attempts to specify the vegetation referenced when an existing climate type intersects with an existing ground cover type.

shifty157
06-06-2006, 20:40
As to your first post. The entries you pointed out direct the game to .ITEM files.


item tree_A_palm
means

data/items/tree_A_palm.ITEM

.ITEM files are used in settlement plans. Every building is loaded from a .ITEM file.

The .CAS files that it points to arent actually .CAS files. They are .BPI files which are similar to .CAS files but the game uses them to create the physical data about an object so that troops cant walk through it and the camera gets bumped up by it. You can find those .BPI files in "data/models_building/INFO/" but they won't do any good.

What I actually did for our palm thing was open up these .ITEM files and resave the models in .CAS format.


As to your second post I can only make a guess as to what may be happening because i dont know enough about vegetation. Did you specify a layout texture for the entry to use? If not then it will come up empty.

Teleklos Archelaou
06-07-2006, 00:22
Here is the entry I tried:



vegetation sandy_desert_dense_forest
{
layout 320 palm_layout.tga
radius 1
height_range 0.7 1.2
aspect_range 0.7 1.3
lod trees
model sa_tree_03
model sa_tree_04
}

This references palm trees that are already in-game and working for the semi-arid terrain. It also, upon startup, causes a sprite to form for this type: sandy_desert_dense_forest_0.tga, and also a vege file for this type: sandy_desert_dense_forest.vege These would appear to be ingame just as any other climate/terrain type set.

Now, the key file I would think that 'spawns' these forests would be descr_landscape_ground_types.txt. It sets chances for pulling rocks, trees, etc. for any given climate type. I put forests in the sandy desert slot just the same as in other slots too. Still can't get them. Here is the entry:


sandy_desert
{
types
{
caked_sand sand
sand sand
sand_blown sand
rock rock
forest forest_dense

}

bands
{
caked_sand MIN MAX 0.5 1.0
sand MIN MAX 1.0 1.0
sand_blown MIN MAX 1.0 1.0
rock 1000 MAX 1.0 1.0
forest 10.0 MAX 0.2 1.0
}
}

What makes it weirder, is that when I go to the campaign map, the land that is sandy desert climate with a forest covering over it (ground cover) actually shows up with palm trees instead of just bare desert. It is listed as being "Woodland" all across this area - but on battle map it's barren sandy desert.

I thought it might have something to do with our inability to reconstitute the descr_geography.db file, but if it is deleted (or rather renamed), a battle on this terrain/cover type still pulls up grass that is visible on the battlefield, and also a rock outcropping. So it's still pulling things up on the code I put above.

Makanyane
06-07-2006, 18:04
Teleklos, I think you are right though about descr_geography.db being the problem, when you've deleted it try battle in a standard climate in woodland, I've just tried to do this (trying to find spot in vanilla map - really need to edit map to make sure what you're getting):
https://img273.imageshack.us/img273/7567/nogdb0fv.th.jpg (https://img273.imageshack.us/my.php?image=nogdb0fv.jpg)
I'm sure this should have been woodland but the only trees its pulling up look to be on special tile - tried one attacking city and similarly only city had trees.

Taking out geography.db doesn't seem to effect strat map at all, so that must read from text files - hence your palms appear there.

Teleklos Archelaou
06-07-2006, 18:31
If that image you are showing was from a tile that was 'woodland' and should have had trees, then yeah, that would seem to be the problem. But I wonder why it can pull up grass (down close it's visible), but can't pull up trees. They seem to be referenced in the files the same way and given special stats (chance to pull it, etc.) in these files that can be altered.

Is there any hope of finding a way to parse the .db file?

shifty157
06-07-2006, 21:57
The problem looks to be here within descr_geography.txt.



table
{ ; QUAL_NONE QUAL_VERY_LOW QUAL_LOW QUAL_NORMAL QUAL_HIGH QUAL_VERY_HIGH
; --------- ------------- -------- ----------- --------- --------------
SWAMP rock mud swamp swamp grass_short shrub_dense ; . x x . . .
SAND rock sand_caked sand grass_dry shrub_dense forest_dense ; . . x x . .
SOIL rock grass_short grass_long shrub_dense forest_dense forest_dense ; . x . x . x
CLAY dirt grass_long grass_long grass_long forest_dense forest_dense ; x . . x . .
SHALE rock gravel grass_dry grass_long shrub_dense forest_dense ; . x . . . .
ROCK rock gravel grass_dry grass_short grass_short grass_long ; x . . . . .
}


You can see tha while the other entires place "forest dense" at the highest setting, "SWAMP" only has "shrub dense" at its highest setting. It never even touches "forest dense". I have no doubt the placement of "x" has soemthing to do with it as well. I have no doubt this is also alot more complicated than it looks.

Its a start though i guess. Either way this is definitly the file thats the source of the problem.

Doesnt descr_geography regenerate from the text file when you start the game if you delete it? Perhaps there are some differences between the .db file and the .txt file causing for the change in appearance (the .txt file may be an older version than the .db file).

Makanyane
06-07-2006, 22:19
originally posted by shifty 157
Doesnt descr_geography regenerate from the text file when you start the game if you delete it? Err no, if it did I wouldn't be getting see through battleground (the funny blue and white bits in pic are 3d clouds). I think some of the other .db's do but that one doesn't, unless you know some trick to create it??

On a completely different quest
https://forums.totalwar.org/vb/showthread.php?t=63086
I had previously tried changing and also deleting descr_geography.txt but (for what I was changing) that seemed to make no difference to anything at all, so it looks like that's amalgamated into the .db but as yet don't see way to amend that.

still need to double check fighting in 100% definitely woodland area....

Dol Guldur
06-07-2006, 22:22
I do not think is as simple as a regeneration. I changed some of the text files and then deleted the db file. It regenerated but the battlemap showed a more-or-less sky terrain. So I copied the vanilla files back in and deleted the db file. It regenerated but the sky terrain (blue ground) remained and would not revert.

This would lead me to believe that there is something in the db file that does not exist in the files, or does or does not regenerate - wasn't there a discussion on this topic in the earlier days of r:tw modding? I am not au fait this area.

shifty157
06-07-2006, 23:17
So what we're saying is we need someone to make an editor. It wont be an easy task at all because the file is so complex unlike descr_items which just a simple list.

I dont nearly have the necessary skills to even guess at what would have to be done.

Makanyane
06-07-2006, 23:18
Dol Guldur - would be really interested in what you deleted / changed to get geography.db to regenerate at all. If I just re-name it I definitely do not get a new file in /data (in 1.5)

Have just done proper test on a woodland area, painted large area in ground_types on gaul/julii border to woodland and set up two armies in descr_strat in middle of woodland, same battle with 'descr_geography.db'
https://img411.imageshack.us/img411/189/with5vf.th.jpg (https://img411.imageshack.us/my.php?image=with5vf.jpg)
with 'xdescr_geography.db'
https://img411.imageshack.us/img411/8517/without6xn.th.jpg (https://img411.imageshack.us/my.php?image=without6xn.jpg)

Teleklos Archelaou, is it possible that grass we are seeing in close up comes from another file i.e.
descr_grass.txt? - Not sure about boulders, could that be a special tile thing?

Dol Guldur
06-07-2006, 23:26
I recently had a big spring clean on my pc and no longer have the test files. I cannot be certain which db file it was. But it defintely regenerated because I had to keep on deleting it.

I have a feeling it may have been descr_vegetation.

shifty157
06-07-2006, 23:31
Makanyane. When you delete DG and go into battle do the units still move around spaces where trees would ahve been or can they walk unhindered?

descr_vegetation does regenerate as normal. It seems DG is only .db file that does not regenerate.

Makanyane
06-07-2006, 23:55
Shifty, troops seem to move in line without avoiding invisible trees, the bouldery bit that you can still see still counts as an obstacle though.

shifty157
06-08-2006, 00:00
So basically the conclusion is that we're completely stuck until someone comes along and manages to create a descr_geography.db editor.

Its really too bad considering how much that file controls.

iberus_generalis
07-31-2006, 15:59
when can we expect this mini mod out to the public??

any ppl who have done more trees is welcome to post them...=) i tried adding this two trees to the game but it won't load...must have done something wrong...but i tryed twice, in separate occasions and the game CTD....=(

iberus_generalis
08-04-2006, 22:57
i've got new trees in game...yupi!!!! lol

i got a question to someone who knows a bit about the vegetation and the trees...is it possible to include more than one kind of tree in a type of forest?

for example, pine trees of diferent kinds, or oaks, aspen, and yey trees in the same forest? just to give a little more diversities to this already awesome forests....

Duke John
08-07-2006, 06:52
Hmm, I thought I had replied to this...

You can use up to 3 models for trees. Look up the original descr_vegetation_db.txt file to see how. You can use up to 4 models for the scrub type. I used these entries for birch trees to create sparse forests in NTW2.

Asean
08-15-2006, 16:19
Has any created a vegetation mod yet with this tutorial?

kharshan
08-16-2006, 22:14
Can someone release what they made with this tutorial? Or has Duke John uploaded a working version of what he made yet?