Making and Exporting Overgrowth

Information and tutorials related to modding BF2.
Post Reply
GhostDance101
Retired PR Developer
Posts: 473
Joined: 2008-05-24 20:19

Making and Exporting Overgrowth

Post by GhostDance101 »

I thought I would make a tut on how to make and export overgrowth. The process will vary greatly depending on what you are trying to make. but in this tut I will just make a simple tree.

The tools I will be using are :
3ds Max 9 with the poe2 tools
Photoshop CS3


Modeling the Tree


Well I start off by drawing out a cylinder. In this example I used 8 sides And 5 height sections. Then converted it into an editable poly.
Scaled and rotated the verts in till i got what I wanted.

Image

Draw out a plane for the leaf texture. I used 4 height segments. But depending on what your trying to do it you might do it differently.

Image


Press M On the keyboard to bring up the material editor. click on one of the ball things to select it, then click where it says standard.
Click on BF2Staticmesh2.
Then add you leaf texture into the base slot. drag this onto your planes. You will need too add a Unrap-UVW modifier and adjust it to the texture your using.
I wont be covering uv mapping in this tut. check Rhinos postfor more info.

Image


Click on the hierarchy tab then on affect pivot only. then move the pivot point to the bottom of the steam. do this for both.

Image

Then adjust the verts on the planes to give the branch a curve.

Image

Add another BF2Staticmesh2 in the mat editor for the truck. I'm going to use base, Detail and Ndetail slots. Make sure the base texture is
just a gray scale image as it will make the lod match much better.
The detail texture must be named like so: tile_junglebark_03_de.dds. With tile_ as a prefix.
If your planing to just use the base slot. You will need to add the pr texture null_de.dds on
the detail slot. So it wont sway like the leaves.
Then Do your uvmaping...


Image


Then You will need to move, rotate, and clone your leaves planes it to position. Tbh this part is a bit of a dark art, and it will take some experimentation to make it look good.


Image

Once you have it like you want it. Rename the truck to whatever the tree is to be called. Then with the trunk selected use the attach function to merge all the leaves.
Then position the tree so the leaves are centered to the middle of your max scene. Recenter the pivot point for the tree to the center of the scene.


Image

Image

Then with your tree selected. Use the PoE2 Utilities. Under wizards click on Staticmesh to do your hierarchy for you.

Image

Then make sure you export into the Vegitation Folder or it will not work as veg!!!

Image

Load up the editor and take a look.

Image

The reason you want to export it at this early stage is to make sure it looks good. Before spending time making the cols and lods .


The Cols

Select your tree in element mode. Select the trunk and clone via copy to an new object. Call it col0 (which is the projectile collision mesh).

Image

Rename a blank texture slot wood or trunk and drag it onto your col mesh.

Image

Add a multires modifier to the mesh. click generate
then reduce the verts. still making sure to keep the basic shape.

Image

Now to got to tools-Channel info and clear the uv coordinates for channel 2 and 1 . Then collapse all in the stack.
Image

Now as there are no solid branches sticking out of the truck. The physics and Soldier mesh can just be clones of col0.
Clone the col0 mesh two more times naming them col1(which is the Physics mesh) and col2 (which is the Soldier mesh)

Image

Next delete your hierarchy leaving just your tree and 3 cols, select all these and run the staticmesh wizard again.

Image

Now you export it like before. And reload the editor or click reload Geometry if you still have it open.
In the tweaker bar select default then Material maps.Then select your material, I'm using the tree trunk material.

Image

Last thing to do is edit the jungle_tree_06.con file and add an anchor point. Do the same for the jungle_tree_06_col.con. On this tree the anchor point is 1.6 meters higher than we want it.
so add:
ObjectTemplate.anchor 0/-1.6/0


(Example only don't copy and paste!)
jungle_tree_06.con code:

Code: Select all

GeometryTemplate.create StaticMesh jungle_tree_06
CollisionManager.createTemplate jungle_tree_06

ObjectTemplate.create SimpleObject jungle_tree_06
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.creator COM:Administrator
ObjectTemplate.collisionMesh jungle_tree_06
ObjectTemplate.mapMaterial 0 wood 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType 3
ObjectTemplate.geometry jungle_tree_06
ObjectTemplate.anchor 0/-1.6/0

include jungle_tree_06.tweak

jungle_tree_06_col.con code

Code: Select all

CollisionManager.createTemplate jungle_tree_06

ObjectTemplate.create SimpleObject jungle_tree_06_col
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.creator COM:Administrator
ObjectTemplate.collisionMesh jungle_tree_06
ObjectTemplate.mapMaterial 0 wood 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType 3
ObjectTemplate.anchor 0/-1.6/0

include jungle_tree_06_col.tweak
I'll be adding Info on making the lods soon.
Last edited by GhostDance101 on 2009-08-17 22:51, edited 6 times in total.
IronTaxi
Retired PR Developer
Posts: 4925
Joined: 2006-05-31 12:56

Re: Making and exporting overgrowth.

Post by IronTaxi »

great contribution.. I migth even make some overgrwoth now that I dont have to go through Rhino!!

:P
Outlawz7
Retired PR Developer
Posts: 17261
Joined: 2007-02-17 14:59

Re: [Tutorial] Making and exporting overgrowth.

Post by Outlawz7 »

Would be nice if you wrote what programs are required, I can guess that's 3ds Max obviously, but to select the bf2staticmesh from the materials, don't you need to dl some bf2 3ds tools beforehand and install...?
Image
DankE_SPB
Retired PR Developer
Posts: 3678
Joined: 2008-09-30 22:29

Re: [Tutorial] Making and exporting overgrowth.

Post by DankE_SPB »

[R-CON]Outlawz wrote:Would be nice if you wrote what programs are required, I can guess that's 3ds Max obviously, but to select the bf2staticmesh from the materials, don't you need to dl some bf2 3ds tools beforehand and install...?
i think you need this
RapidShare Webhosting + Webspace
there is a link somewhere in community modding section but i'm to lazy to look for it now, so i uploaded it for ya :smile:
also look here
Bf2 Tools For 3ds Max - Setup - Official BF Editor Forums
Image
[R-DEV]Z-trooper: you damn russian bear spy ;P - WWJND?
Outlawz7
Retired PR Developer
Posts: 17261
Joined: 2007-02-17 14:59

Re: [Tutorial] Making and exporting overgrowth.

Post by Outlawz7 »

Cheers :)
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Tutorial] Making and exporting overgrowth.

Post by Rhino »

very nice GD! good to see that all that work I put into you is paying off ;)
Image
GhostDance101
Retired PR Developer
Posts: 473
Joined: 2008-05-24 20:19

Re: [Tutorial] Making and exporting overgrowth.

Post by GhostDance101 »

Thanks Guys.
I still need to add the part about making the lod which will be the longest part . Will probably end up editing it a few more times before I'm done :) .
Amok@ndy
Retired PR Developer
Posts: 5144
Joined: 2008-11-27 22:13

Re: [Tutorial] Making and exporting overgrowth

Post by Amok@ndy »

i read this tut over and over but i cant find the step how i get the texture on both sides of the faces
would be really nice if anyone could explain this to me
€: ok seems like i should practise my britishenglish ;-) after reading it 50 times i got this lol

and is it necessary to name the texture tile_ ?
The detail texture must be named like so: tile_junglebark_03_de.dds. With tile_ as a prefix.
thx for help
greez @ndy
Last edited by Amok@ndy on 2009-11-02 20:51, edited 1 time in total.
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Tutorial] Making and exporting overgrowth

Post by Rhino »

providing the texture only has a colour texture and no detail, crack or dirt etc and is exported into the Vegetation folder it will have the texture on both sides of a face.
Image
Amok@ndy
Retired PR Developer
Posts: 5144
Joined: 2008-11-27 22:13

Re: [Tutorial] Making and exporting overgrowth

Post by Amok@ndy »

is there a chance to let the leaves sway slower ?
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Tutorial] Making and exporting overgrowth

Post by Rhino »

its not directly controllable no. But it can be slightly controlled via the size of the object I think.
Image
Insanitypays
PR:BF2 Developer
Posts: 753
Joined: 2009-06-13 09:23

Re: [Tutorial] Making and exporting overgrowth

Post by Insanitypays »

Okay, now how do you delete it? I tried to and I cant delete any of my overgrowth.

"Go to Heaven for the climate, Hell for the company." -Mark Twain
[/CENTER]
Amok@ndy
Retired PR Developer
Posts: 5144
Joined: 2008-11-27 22:13

Re: [Tutorial] Making and exporting overgrowth

Post by Amok@ndy »

then you should go to bfeditor.org and try some tutorials about over/undergrowth !

this tutorial is about creating a tree and not about over/undergrowth in the editor
Image
Outlawz7
Retired PR Developer
Posts: 17261
Joined: 2007-02-17 14:59

Re: Making and Exporting Overgrowth

Post by Outlawz7 »

Creating the final LOD

This post picks up where original post ends.

What you'll need:
-3ds Max 9 with PoE2 and PR Max tools installed and set up
https://www.realitymod.com/forum/f189-m ... -40-a.html
-Photoshop CS3 or higher with DDS plugin for Photoshop
https://developer.nvidia.com/nvidia-tex ... -photoshop

- a finished tree/overgrowth model in need of a final LOD



Load up the 3ds Max scene with your tree.
Open the Material Editor (press M).
You should have at least two materials for your model, a tree bark and a leaf material.

Your bark material should be a BF2 static mesh material with the bark texture on channel 2, with channel 2 visible.

Your leaf material or materials should be Standard material with your leaf texture loaded as diffuse (blue line) and opacity (green line). Click and make sure Mono Channel Output is set to Alpha.

Your Ambient and Diffuse color (red line) should be black (completely black, not gray).

Image

Your viewport layout should be Top, Front, Left and Perspective (as can be seen in the picture).

We'll start by making a quick render to grab the background color.

Select your Front viewport then click the Quick render (production) buttom to make a quick render.

Image

Image

Zoom in your viewport (by mouse scroll) until the tree fits the render then save using the disk icon.

Image

Save the render as TGA to your desktop (or some other place you can access it easily) then open the saved TGA in Photoshop. Using the sample tool, grab the color near the edges of the tree.

Image

Switch back to 3ds Max and go to Rendering>Environment (or press 8 ). There set the background color to the RGB value of what you got from the sample tool and close the dialog.

Image

Open the Render scene dialog again and under Common Parameters, make sure "Force 2-Sided" is enabled. Set the render size as 300x300. Then press the Render button to make a new render which should now have background color of your sample. Make sure the render fits as before.

Image

Save the render as TGA with alpha enabled and name it accordingly, this case it's the front viewport render, then repeat this process for the other two viewports (select viewport, render, save).

Image

Open all three saved renders in Photoshop then create a new image (File>New or Ctrl+N), sized 900x300 and RGB 8-bit. In the new image, go to Channels tab then click Create new channel to add an Alpha channel.

Image

Select your first opened image, go to Channels tab and select the RGB channels, press Ctrl+A to select the image with the Rectangular Marquee tool and copy. Switch to new image, make sure RGB channels are selected and paste then align with Move tool.

Image

Switch to the image you just copied and switch to Alpha channel. Copy then switch to new image, make sure Alpha channel is selected and paste then align.

Image

Repeat last two steps for other two renders. Enable both RGB and Alpha channels to ensure there's no misalignment. Switch to Layers tab and flatten your image (or Layers>Flatten image). Your result should be this:

Image

(Disregard white lines seen in RGB channels, screenshot was taken before I actually flattened the image. And that's why you flatten it.)


Now right click on the top bar of your image window and open Image size dialog (or press Alt+Ctrl+I). With Constrain proportions enabled resize width to 512.

Image

Create a new 512x256 image, RGB 8bit.
(make sure it's RGB, sometimes with Alpha channels last selected the new image dialog gives Gray 8bit instead)

As before, create an Alpha channel on new image then copy RGB and Alpha channels
from your resized render to the new image. You should not need to align, keep the image where it's pasted in the middle.

Image

With sample tool take a sample of the background color then fill the transparent bits with bucket tool.

Image

Save a .psd for backup, then name your image as yourtreename_lod and save your image as .dds, DXT5 with all mipmaps into the directory where your tree's other textures are located, for me in this case C:\Program Files (x86)\Project Reality\Project Reality BF2\mods\pr_edit\objects\vegitation\pr\textures.

You can now close Photoshop and switch back to your 3ds Max scene of your tree.

Open Material editor and make a new standard material using your newly saved render texture, diffuse only.

Freeze your tree so you don't select or modify it by accident.

Start creating a new plane that fits your tree in each of the three viewports you rendered (top, left, front). Make sure plane has only one lenght and width segment (one poly/two tris plane).

Don't worry if it doesn't fit right away, convert to editable poly and move the edges to align. Make sure the plane is in the middle of the tree trunk.

Image

Once you've created all three planes, attach them together and apply the material using the render texture then unwrap UV on channel 1.

Image

In the Edit UVW window, go into Face selection mode, then Mapping>Flatten Mapping and uncheck Normalize clusters. This ensures the UVs aren't scaled according to the image we'll load soon.

Image

At top right of the Edit UVW window where it says Checker Pattern, click to get the drop down list and select our texture. Zoom out to see all the UVs.

Image

I won't cover basics of UV editing here, so edit the UVs to fit the texture, top render to top plane etc. Make sure the UVs do not touch the edge or go over the border. UVs must be inside the 0-1 range (no tiling). Enable Smooth+Highlights on all viewports to adjust the renders to fit the frozen tree model. Rotate, don't flip UVs. Make sure the trunk part of render fits the trunk.

Image

With the UVing complete, name your model as your render texture, yourtreename_lod and center its pivot point.
Do not move the model after adjusting pivot.

Image

Open the BF2 Utilities and use the StaticMesh button to set the model up for export.

Image

Export the model to the same directory as your tree using the BF2 Exporter.

Once exported, open the directory where the model was exported to, cut the .con and meshes folder in it and paste them to your tree's folder.

Image

With the lod model done, your tree is now ready to be used in BF2 editor.
Image
Post Reply

Return to “Modding Tutorials”