Jump to content
Official BF Editor Forums
Sign in to follow this  
Shipwreck

3dSM: Vegitation Overgrowth Tutorial

Recommended Posts

OK. First of all let me explain that I am not a wiz at 3dsm or BF2 coding at all. I am not explaining how to do everything the absolutely best way I am simply explaining how I did this. It took me probably 2 months to figure this out 100% so I am simply trying to help others out. If you have suggestions on how things could have been done better feel free to post them, but if you are going to bash me or the way I did this then bite me. :P

Special thanks to Croupier for his help and initially posting what the heirarchy looks like and some of the workings of vegitation. I will post this in segments as to how I think it breaks up the best. Play EoD! :P

Shipwreck

Share this post


Link to post
Share on other sites

OK. Here we go guys. I'm gonna start assuming that you have gone through the bunker tutorial so you should generally know your way around 3dSM and have a UVmapped visible mesh with 3 COL meshes. I will walk you through setting up the textures and materials correctly and setting up the LOD's in this first part of the TUT.

Download my model here: http://www.eodmod.com/shipwreck/VegTut/VegTut.rar

Im gonna assume that you DL my 3dsm scene with my textures but if you want you can start with your own scene as long as it has a visible mesh and 3 COL's. You will also need a base texture and a detail texture for your trunk and a base texture for your leafs where the alpha chanel controls the transparency. Anything that is white in the alpha chan will be visible in game and anything that is black will be transparent in game.

Take my rar with all of my scenes and textures and extract it somewhere that will be handy to navigate to and open my scene with 3dSM.

Ok first of all we will go through setting up the textures. Open your material editor and choose the first shader ball. I named this shader ball trunk and changed the shader type to a bf2staticmesh2. Apply the chpinetrunk_c.dds to the base and the chpinetrunk_de.dds to the detail slot on this shader ball. Now select the Second shader ball and name it Leaf and make it a bf2staticmesh2 shader as well. This one we will apply only the base texture as leaf_vinetree_c.dds. Now select the 3rd shader ball and name it wood_col. This one we will leave a standard shader and apply the wire peramiter. Select the 4th shader ball and name it leaf_col and apply the same wire peramiter. Make sure that ll 4 shader balls have the show in map viewport selected so that when we apply the shaders they will show up.

Now either close or miniumize the material editor and click select only the visible mesh (tree1.) What we want to do now is apply the proper textures to the visible mesh so for purpous of ease we will break the model up a bit. I personally hid all of the col's to make it easier to select parts. switch to modify mode and expand the editable mesh modifier and select element. Now select all of the leaf planes so that only the main trunk and all 4 branches are NOT selected. Your scene should look something like this now.

tutorial1.jpg

Now detatch all of the planes that you have selected. I named it leaf just to make things easier. Make sure that you have the tree1 still selected and open your material editor again. Now click and drag the trunk shader ball onto the tree1 object. Select the leafs part and do the same with the leaf shader ball. Now select the tree1 object again and right click and attach then selct the leaf object and it should bring up a window like this: Select the same settings I have here and hit OK.

tutorial2.jpg

Now our textures are set up properly and its time to move on to the COL's. Unhide all and selct the col0 object and hide unselected again. Now you should see a mesh that looks like your main trunk and 4 branches and a large stop sign shaped ball. This is our projectile collision mesh. select the ball part and detatch it like you did with the leafs. Now with the trunk still selected open your material editor again and drag the wood_col shader ball onto the trunk. Now select the part that you detatched and drag the leaf_col onto that part. Now as before select the col0 (tunk part) and attach the leafs back on.

Now do the same thing with both col1 and col2.

Your scene should now look like this:

tutorial3.jpg

Now select your tree1 visible mesh again and hide everything else so that only this mesh is visible. At this point we want to rename the trees visible mesh correctly. It should be called nc_tree1 so go ahead and rename this mesh. It doesnt matter what its called as long as there is an nc_ before the name.

Now with nc_tree1 selected right click and clone the mesh. Select "copy" and name the object nc_tree02. This will be our second LOD so we want to crop down the polies a bit. Select nc_tree02 and hide everything else.

Since the branches will be hidden by the leavs go ahead and select them by element and delet them all except for the main trunk Now go to modifiers- mesh editing- multires and you will see a multires modifier in the modifier list now. Expand this modifier and click on vertex and select all of the vertecies on the mesh. Now click generate in your generation perameters. You will see now that you can change some of the values in the generation perameters. I'm going to change my vert percent to 60 and hit generate again. This is good enough for your 2nd LOD that will be viewed at fair distances.

Now right click and convert this mesh to an editable mesh. Clone it again with the same copy method and name it the default nc_tree03. This is our lowest LOD and should really be fairly low poly as it will only be seen at really great distances. Use the same method of mulitresing and crop this one down even farther. It doesnt get much lower but make it as low as possible while retaining the general shape. Right click again and convert to editable mesh and unhide all.

Now we have our mesh ready to set up the heirarchy. I will continue and finish the tutorial tonight as I have to go to work ATM. sorry this is taking me son long. I will also go back and add more pics as I think they are needed.

Share this post


Link to post
Share on other sites

OK. On to setting up the heirarchy which is probably the most important part of vegitation. When I last left off hopefully I had adequately explained how to set up your materials, your collision meshes and your lod's (level of details.) Please if anything is lacking detail or explination politely ask for a better explination and I will do my best to further explain how things work.

OK. Now select your nc_tree1(main visible mesh) and all 3 of your cols and hide everything else. Make sure that all 4 items are highlighted and open your BF2 utilities and on the right you will see a drop down menu that says Static/Building. Click the Run Wizard button to the right of that and this will set up most of your heirarchy automatically for you. Now unhide all again so that all of your scene is visible. your heirarchy should look like this when everything is unhidden.

tutorial4.jpg

Now on the right at your create menu you should be in geometry mode and a sphere will be highligted in yellowish orange color. Four buttons to the right of that is your helpers button(looks like a tape measurer). Click that and you will now see a new list of object types. Unselect everything in your scene and click on the dummy object type. Now we need to create a dummy. To do this click anywhere in your scene and drag and you will see a cube shape appear. rename this dummy to lod1. Now you need to make this a child of your geom0. To do this you will need to click on Graph Editors-New Schematic view. Now this will bring up a new window that looks like those dreaded spiderwebbrainstorming things you used to have to make in english class in high school. At the top of this window you will see a bunch of buttons to click and the current one will be a black arrow highlighted in yellow. Click the one right to the right of thats called connect. Now click and drag your lod1 dummy that you made ontop of the geom0 of your main heirarchy. Lod1 should now be a child of geom0. Now click on nc_tree02 and connect it to lod1 so that it is a child of it. Your heirarchy should now look like this in schematic view and select view is shown below.

tutorial5.jpg

This is the complete heirarchy for the first part of the overgrowth object. For some reason and Im not sure why your 3rd and lowest LOD needs to be exported seperately so we are going to set up the heirarchy for it next. Now close the schematic view or minimize it and select nc_tree03 (your lowest lod) and hide everything else. Create another dummy and name it root_staticMesh_nc_tree1_lod. Now create another dummy and name it geom0 and make it a child of root_staticMesh_nc_tree1_lod. Create another dummy and call it lod0 and make it a child of geom0. Now make nc_tree03 and rename it nc_tree1_lod and make it a child of lod0 of this heirarchy. Your heirarchy should now look like this in schematic view with select view again right below. You will see that anything that is hidden has a kind of matte appearance in schematic view and wont appear at all in select objects view.

tutorial6.jpg

Now we are ready for export. Close or minimize schematic view. Unhide all again and select the first heirarchy we put together and hide everything else so that you see only these objects in select object view.

tutorial7.jpg

now go ahead and go to BF2-BF2 Exporter and it will bring up your exporter window. Change the objects subfolder path to /vegitation/ and your object name should be nc_tree1 if you set everything up correctly. Export the object now.

Now navigate to your "C:Program FilesEA GAMESBattlefield 2modsyourModsNameHereObjectsVegitation" folder and you should see an nc_tree1 folder. Inside the folder should be a meshes folder a nc_tree1.con and a nc_tree1_col.con. Inside the meshes folder should be a nc_tree1.collisionmesh a nc_tree1.staticmesh and 2 samples files for lightmap generation. If this is all there you are doing great so far. Now we need to go back to 3dsm and unhide all and select the other heirarchy we set up with the lowest LOD. So your select objects view should look like this:

tutorial8.jpg

Now open your BF2 Exporter again and leave the objects subfolder path set to /vegitation/ and the objects name should now be nc_tree1_lod. Export and navigate to your "C:Program FilesEA GAMESBattlefield 2modsyourModsNameHereObjectsVegitation" folder again and you should see a "nc_tree1_lod" folder. Take the nc_tree1_lod.con and copy it and past it into your nc_tree1 folder. Now take the files from the nc_tree1_lodmeshes folder and place them into the nc_tree1meshes folder with the first set of meshes you exported. You should now have combined everything from both exports together. You should have 3 .cons in the nc_tree1 folder and 6 files in the meshes folder.

Now go ahead and fire up the BF2 Editor. In the object editor resources screen on the left extend the "yourmod-objects-vegitation-nc_tree1 folders and you should see 3 .cons (nc_tree1, nc_tree1_col and nc_tree1_lod). Drag nc_tree1 into the window. Yay! There is myyour perty tree! :P

Now on the left again in the tweaker bar expand the default tab and scroll all the way down to the bottom and you will see MapMaterials .... Click on the ...'s and it will bring up your Map Materials Window that will look like this.

tutorial9.jpg

Click on the Default to the right of leaf_col and a dropdown menu will appear. Click on it again and you will see all of your materials to choose from. Scroll all the way up to bushes_leavs and select that material. Now click on the one for col_wood and select tree_trunk and hit OK. Now drag the nc_tree1_col into the window and map the materials the same way. Now drag the nc_tree1_lod into the window and you will see that you cant assign any materials to the object but thats ok as there is no collision. Now click file-save all and it hit OK to save all 3 of the meshes. This should have generated your .tweak files for all 3 objects. Navigate back to the nc_tree1 folder and make sure that you now have 3 new .tweak files (one corresponding to each its own .con) This is it. Your vegitation is set up. You should now be able to select any treeovergrowth object you import this way as an overgrowth material when mapping.

Please please if you see any mistakes or have any suggestions in this tutorial ASIDE FROM GRAMMAR please point them out and I will do my best to fix them. If you have any questions on my explinaion of a certain step or need a picture of a certain functionbutton let me know and I will go back and add the info needed to better explain my actions to perform a certain task. Thank you to all for your patience and help!! Happy modding and I cant wait to see some of the beautiful trees you will all make to put mine to shame. :P

Shipwreck

P.S. Play EoD. :P

Share this post


Link to post
Share on other sites

well done there shipwreck,i got it workin first time round..thanx mate,awesome tut!.

if ya find out anymore about vegatation be sure to post the info here,seems like its all here in the tut though.

Share this post


Link to post
Share on other sites

I dont know if you guys noticed but one thing I noticed when modelling overgrowth is that the alpha transparent planes dont have to be double sided(mirrored) like other alpha transparencies in BF2. I find that very interresting as the BF2 engine seems to recognize the planes as leafs and automatically mirrors them. It is also possible to use a normal map on the trunk I think. I havnt tested it but some BF2 trees have them and some dont. It just so happens that the one that I disected to find the workings out didnt have one so I didnt include a ndetail texture.

Share this post


Link to post
Share on other sites

Very, very nice tutorial solving yet another mystery about BF2 :D. Thanks to shipwreck and [bF:A]Croupier for sorting this tricky thing out. I put it in the 'Hall of Fame' (the User tutorial index) , together with Croupier's original 'vegetation info' thread.

If anyone has successfully created swaying antennas and pennants, let us know :D

Share this post


Link to post
Share on other sites

Another thing I would like to point out is that you will probably want to put your anchor slightly above the bottom of the trees trunk so that if you place it on an incline the base of the trunk will be completely under the terrain. This is something that was pointed out to me by one of our mappers and I fixed the issue by simply opening the scene and moving everything down and re-exporting

]Very, very nice tutorial solving yet another mystery about BF2 :D. Thanks to shipwreck and [bF:A]Croupier for sorting this tricky thing out. I put it in the 'Hall of Fame' (the User tutorial index) , together with Croupier's original 'vegetation info' thread.  

If anyone has successfully created swaying antennas and pennants, let us know :D

You mean antennas on vehicles? OUr M151A2 has a swaying antenna. :P

Share this post


Link to post
Share on other sites

this is slightly off topic but still concrens the creation of vegitation,hmmm maybe i should post this somewhere else,well a moderator can move it if it doesnt fit here.

k now ive made a bunch of trees,but how do i make them cast shadows and lightmaps?

Share this post


Link to post
Share on other sites
this is slightly off topic but still concrens the creation of vegitation,hmmm maybe i should post this somewhere else,well a moderator can move it if it doesnt fit here.

k now ive made a bunch of trees,but how do i make them cast shadows and lightmaps?

In game? You have to go to comile-generate lightmaps or something of the sort in your editor with the map opened. Then I think you want "trace groud" and "trace objects" selected and then there should be 3 levels of quality to choose from.

Share this post


Link to post
Share on other sites

i have to say again "this is an awesome tut",ive got some bloody good results so far,but heres a tip,this is more inregaurds to generating overgrowth.

if you want to make a dense jungle you will have to keep the overgrowths density to 20 or just above or else you will get polies flying around.

like so!..argh..or use clustered models of plants to get the desired effect.

messuptrees18nz.jpg

.

i have gone over every aspect of the model making sure its right,so its deffinetly an editor/game related bug,density setting at 60 is way to high..lmao

just thought this might help some with the same issue.

and once again nice tut there shipwreck!

Share this post


Link to post
Share on other sites

Congrats, Shipwreck! Awesome Tutorial and thanks to Croupier as well. Been trying to figure that out for quite a while. Since I'm using Maya, I hope your steps can be easily translated to. If not, maybe I can put a Maya one together. Anyway, probably won't get a chance to try it within the next few weeks, but when I do, I'll try to update everyone.

Share this post


Link to post
Share on other sites

Hey Ship...need some help with this..I have done ferns and they came out great using ur method, I tried doing a tree next, followed ur tut closely, go all the files I was supposed to including the .con files. For some reason, they dont show up in the editor in my resource bar, when I try to add manually they never show up, just the col version. Any ideas? I have tried doing 7 different times, I am ready to give up. Any help would be appreciated! Thanks :)

Share this post


Link to post
Share on other sites

They dont show up in your resouces bar? Whats your object path look like?

Make sure they dont share the same names as any bf2 veg.

Check your mod manager, although you have probably done this.

Could be so many things, sometimes it's the content.ini in the editor settings.

Spelling mistakes in the .con, although this should be Ok if export created your .con? Post some more info, directory structure, .con text, screen grab from ed for starters.

Share this post


Link to post
Share on other sites

object path is modname/vegitation/nc_tree100m

They dont share any names, and the mod manager is setup correctly. I dont understand I did a fern 2 min before.

It did create my .con and a col.con

all meshes are accounted for, I just cant get the .con file to show up in the editor. the col.con shows up but nothing else.

I exported to a separate path, this time to modname/testing and viola the .con file shows up, I can drag it in and the tree shows up, it just doesnt show transparency. Its set up with dxt5, static object base shader, so I dont know what the problem is!

edit: the testing export doesnt have a col.con like when I exported to vegitation. Thanks for any help!

Share this post


Link to post
Share on other sites

You should have a path like <MyMod>/objects/vegitation . As the exporter truncates the texture pathes, all your models (and textures) should reside inside the /objects folder of a mod.

Share this post


Link to post
Share on other sites

OK, I guess 10th times a charm, I used another mesh and now its working. However, the whole thing is swaying and I have not found any definative info on how to get just the leaves to move and not the trunk as well. Any ideas?

Share this post


Link to post
Share on other sites

When making overgrowth I found a few very important things that need to be followed. The first one is that you must export to a vegitation folder as mschoeldgen suggested. another is that you name the tree nc_whatever. And the third is that you have SEPERATE materials for your leaves and trunk. You must have 1 material for that trunk that has a COLOR texture and a DETAIL texture. If you just add a color texture the trunk will be recognized as leaves and will sway and be transparent if you dont add an alpha chanel. Then for the leaves you must have a material (shader ball) with only a COLOR texture assigned. My guess would be that you only assigned a color texture to your trunk. Also I never tried putting both leaf and trunk textures on the same texture. I always used seperate textures for each. Let me know if this works.

Ship

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×