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
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