Results 1 to 30 of 63

Thread: Tutorial: creating new vegetation for battlemaps

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Post Tutorial: creating new vegetation for battlemaps

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

    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:

    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
    Rendering > Render... or press F10.
    Set the output size to 512x512, or 256x256 if you want to use lower resolution textures.


    Figure 5

    Creating the camera
    Create > Cameras > Free Camera.
    Put the camera in front of the tree.

    Figure 6: front view. Figure 7: top view

    I don't know wether I changed anything but these were the settings I used:

    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:
    Rendering > Render... or press F10.
    Or with the Camera01 viewport active:
    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):


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


    Figure #


    Step 4: Rendering
    Rendering > Render... or press F10.
    Make sure that the Viewport is set to Camera01, see Figure 5.
    Save the render by pressing the disk. Save as a 32-bit TGA file.



    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.

    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.


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





    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/Rt...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 to do so myself. Have fun and good luck with making trees!

    Cheers,
    Duke John aka Lord Fishbone from the Lordz
    Last edited by Duke John; 08-07-2009 at 22:47.

  2. #2

    Default Re: Tutorial: creating new vegetation for battlemaps

    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.
    Hegemonia Lead Modeller.

  3. #3
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Default Re: Tutorial: creating new vegetation for battlemaps

    Is that a picture of a real forest or an ingame screenshot?
    Which modder doesn't like to hear that kind of compliments 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.

  4. #4
    Chief Biscuit Monitor Member professorspatula's Avatar
    Join Date
    Oct 2004
    Location
    Inside a shoe.
    Posts
    1,158

    Default Re: Tutorial: creating new vegetation for battlemaps

    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.
    Improving the TW Series one step at a time:

    BI Extra Hordes & Unlocked Factions Mod: Available here.

  5. #5
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: Tutorial: creating new vegetation for battlemaps

    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

  6. #6
    Shadow Senior Member Kagemusha's Avatar
    Join Date
    Mar 2005
    Location
    Helsinki,Finland
    Posts
    9,596

    Default Re: Tutorial: creating new vegetation for battlemaps

    This is great news.Thanks a lot DJ!
    Ja Mata Tosainu Sama.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO