Jump to content

Terrain tutorial - From OGR to GRAW2


Biro

Recommended Posts

In this tutorial I will cover how a terrain from OGR can be ported into GRAW2. This is the method I used when recreating farm_day but it's for sure not the only way to do it. There's probably faster methods I'm not avare of as my knowledge in 3d max is limited. This is not some magic method to recreate all maps in an evening. This is hard work, but a terrain can be done on a couple of evenings!

Programs used in this tutorial:

Autodesk 3d Studio Max 8 (http://usa.autodesk.com/)

Autodesk Mudbox (http://usa.autodesk.com/)

Photoshop (http://www.adobe.com/)

3d RipperDX (http://www.deep-shad.../3DRipperDX.htm)

Polyboost (http://www.polyboost.com/)

World Machine 2 (http://www.world-machine.com/)

XML Marker (http://xml-marker.en.softonic.com/)

Backdrop

The backdrop or the horizon is used to simulate a bigger world then what's the actual case. A program that's really good for creating such backdrops is WorldMachine 2. Dice @Battlefield 3 for example uses this for their terrain layout. (http://blogs.battlef...de-dice-alborz/)

I'm not gonna go too deep into WM2, but my basic workflow was to sculpt up some very basic shapes in Mudbox where I wanted the mountains to be, then extract a displacement map. I then used this in WM2 and set up the different nodes and such to give me some better looking mountains with erosion effects. Check the screenshots below to see how I set it up and the result. It's possible to extract both a mesh and a displacement map from WM2 and it can be taken directly into 3d max from here or you can bring it into mudbox to give it further details. It's alot of possibilities here and it's just to start playing around with the different nodes and settings to see the results.

wm22.jpg

wm21.jpg

Landscape

To recreate the terrain of farm_day I used 3dRipperDX. This program lets you capture the visible geometry on the map and import it into 3dMax. One important thing here is that I used a fogless version of the farm to capture the whole map at once. It's a mod floating around here somewhere that atleast has the DS/IT maps made fogless and this is also possible to setup in IGOR.

Now I have all the geometry from our OGR map in 3d Max and I delete all unnecessary objects so I'm only left with the terrain. It's ofc possible to just use this terrain in GRAW2, but it will lack details and vertex paiting will be hard aswell. Running a meshsmooth on it will give some weird results aswell so I figured it was better to recreate a new terrain over the old one.

Now the trick is to have Polyboost installed. This is a small addon with some really great tools for max 8. (I think maybe some of the tools here have been included in newer versions of max, but as I only use max 8/9 I can't say for sure yet.) Polyboost lets you create a new mesh on another surface, check the screenshot below from 3d Max and you can see I have the terrain from OGR selected as a surface I'm drawing on. Try to use quads only when modelling shapes like this. Now it's just to lay out the basic shapes of the terrain. Use more quads where needed and take into consideration that you will apply atleast 1 meshsmooth modifier when it's all laid out.

3dmax1h.jpg

Next I did was to bring the terrain into mudbox and I started sculpting more details into it. Not gonna go too deep into how I did this, but looking at the screenshots I'm sure you will get the idea. More details is better, but think about the polycount!

mudboxterrain2.jpg

When I was satisfied with the terrain I brought it back into max for texturing and vertex painting. When working on steep mountains or curves it can be a good idea to use pelt mapping in 3dmax 8, but try to hide the seams as good as possible.

Because I had a high polycount after I was done with the landscape I had to break it up into 4 parts as the GRAW2 engine only allows for 65k vertices if I'm not wrong.

Importing into GRAW2

I think this is where people imagine GRAW2 is soooo difficult to mod for. It's not!

There probably has been tutorials on this earlier, but I gonna repeat it for the sake of how easy it actually is. Use XML Marker 1.1 for the xml files. This will help you avoid the basic mistakes as forgetting an " for example.

Then we need three XML files for the terrain.

1. Unit file

2. Model file

3. Material file

In addition we need to to setup the textures in "tdb_texture_set" files. 1 for diffuse and 1 for bumpmaps.

1. Unit file

The important thing here is where it's pointing to the model file. This need to be the correct path, if not the engine ain't going to find the model file.

<unit type="static" name="farm_day_terrain" slot="35">

<model file="world\landscapes\farm_day\farm_day.xml"/>

<script_class name="base" class="Base"/>

<script_class name="editor" class="Editor"/>

<stats block="base_data">

<var name="lightmap" value="true"/>

<var name="no_silhouette" value="true"/>

<var name="ambient_points" value="150"/>

</stats>

</unit>

2. Model file

The important thing here is again where it points to the material and the diesel engine file we extract from 3d max. You can see I have split my terrain up in 4 and the backdrop is called farm_day_05. These names needs to be identical in the model file and in 3d max.

<dynamic_object xmlns:xi="x">

<diesel file="Data\objects\world\landscapes\farm_day\farm_day.diesel" orientation_object="root_point" materials="Data\objects\world\landscapes\farm_day\materials.xml" viewports="default|crosscom"/>

<body fixed="true" name="farm_day" template="static_ground" max_walk_angle="35">

<object name="root_point"/>

<object name="farm_day_01" collision_type="mesh_mopp" hidden="false"/>

<object name="farm_day_02" collision_type="mesh_mopp" hidden="false"/>

<object name="farm_day_03" collision_type="mesh_mopp" hidden="false"/>

<object name="farm_day_04" collision_type="mesh_mopp" hidden="false"/>

<object name="farm_day_05" collision_type="mesh_mopp" hidden="false"/>

<object name="TheRiver" collision_type="mesh_mopp" hidden="false"/>

</body>

<editor_marker_manager>

<marker name="farm_day">

<offset x="0" y="0"/>

</marker>

</editor_marker_manager>

<decal_surfaces static="true">

<ds_mesh object="farm_day_01"/>

<ds_mesh object="farm_day_02"/>

<ds_mesh object="farm_day_04"/>

<ds_mesh object="farm_day_05"/>

<ds_mesh object="TheRiver"/>

</decal_surfaces>

<lightmap>

<object name="farm_day_01" height="256" width="256"/>

<object name="farm_day_02" height="256" width="256"/>

<object name="farm_day_03" height="256" width="256"/>

<object name="farm_day_04" height="256" width="256"/>

<object name="farm_day_05" height="256" width="256"/>

</lightmap>

</dynamic_object>

3. Material file

I'm not gonna post my whole material file here, but only for 2 materials. The material name needs to be the same in 3d max as it's in the material file. The diffuse and the bump texture will be shown where I have vertex painted on the landscape. It can be a good idea to use the same texture as a blender in several materials as this will make them blend together nicely. In the example below I have an acre texture and a grass texture together with a texture I called fd_blender.

<materials>

<material name="fd_acre" src="landscape" decal_material="grass">

<diffuse_texture file="fd_blender_df"/>

<bump_normal_texture file="fd_blender_bm"/>

<self_illumination_texture file="fd_acre_df"/>

<distorsion_texture file="fd_acre_bm"/>

</material>

<material name="fd_grass01" src="landscape" decal_material="grass">

<diffuse_texture file="fd_blender_df"/>

<bump_normal_texture file="fd_blender_bm"/>

<self_illumination_texture file="fd_grass01_df"/>

<distorsion_texture file="fd_grass01_bm"/>

</material>

</materials>

The "tdb_texture_set" files is done for all textures in GRAW2 so I'm not gonna go into this one.

Now it should only be left to scale the terrain up to the right size in 3d max. I use a command map from OGR for this as I know it's 400*400 meters and scale my terrain up to fit this one. Link the terrain to a helper called root_point, add alot of ambient points for correct lighting and it's all set.

Don't hesitate on asking questions!

Good luck!

Biro

Link to comment
Share on other sites

Well this tutorial is based on that you have a little bit of knowledge in 3d max and with modding GRAW2. If you have, I think it will be "understandable". I can't go through all little details, it's gonna end up with a book if I do.

But please ask questions and don't be afraid of trying. Start up with bringing one of the old terrains into max with 3d Ripper and we can take it from there.

Biro

Edited by Biro
Link to comment
Share on other sites

Yeah I have some experience in 3ds max 8, to date I've made 43 building for GR:AW2 and a handful of props but I think making landscapes is much harder.

There are a few things above that I don't understand like pelt mapping and vertex parting but I can look these type of things up on google.

Link to comment
Share on other sites

Nice tut Biro :)

Instead of using polyboost you can create mesh for terrain inside max like that with "conform" under "compound objects". That way you can conform high poly plane over ripped OGR terrain. Just make sure you do that in top view. But polyboost is a great set of tools so both methods will do the work.

What is poly count on your terrain Biro? You said you must chop it to 4 pieces. Why so high poly? If engine can handle it, it's fine but IMHO you wont even notice all that details in-game.

I loved the backdrop and if you can plz explain how did you set it for graw. Not the creation part, just xml stuff.

Thx

Link to comment
Share on other sites

There are a few things above that I don't understand like pelt mapping and vertex parting but I can look these type of things up on google.

Pelt mapping is an option under the Unwrap UVW modifier, which can help you setup the UVs for more difficult shapes as stones, faces, characthers and so on. It's not used much on buildings as they tend to have more straigth corners.

Vertex Painting is another modifier you can add and just paint what you want to blend with a black (0,0,0 (default)). If you look on the material file I posted above the texture called ""fd_blender_df" with the bumpmap texture "fd_blender_bm" will be shown where this black color is added.

There's loads of tutorials on this modifiers if you stumble into problems.

Nice tut Biro :)

Instead of using polyboost you can create mesh for terrain inside max like that with "conform" under "compound objects". That way you can conform high poly plane over ripped OGR terrain. Just make sure you do that in top view. But polyboost is a great set of tools so both methods will do the work.

What is poly count on your terrain Biro? You said you must chop it to 4 pieces. Why so high poly? If engine can handle it, it's fine but IMHO you wont even notice all that details in-game.

I loved the backdrop and if you can plz explain how did you set it for graw. Not the creation part, just xml stuff.

Thx

I kinda new there was something like conform aswell in max Zeko but I don't have knowledge of half of the stuff that's in there yet... :help:

This can maybe be easier to use, have to test a little to see how it works!

My polycount for the main terrain is 44k quads. I'm pretty sure aswell that this could be lower but then again this will give more problems with vertex painting and texturing as I like to create small spots here and there with different textures. As you can see I also used Mudbox on the terrain and it's great if you go over the terrain with a stamp tool to create small variations in it, but then again you need some polys to play with.

The backdrop was textured using the materials I used for the main landscape, but I didn't tile it that many times. In the model file I just set it up as "farm_day_05", so just consider it as the last part of the main landscape. It's offcourse possible to set it up as an own model aswell, but I didn't do that.

I'm just going to throw something out there, but would this be of an interest to you biro?

http://graw2.pbworks...15685/FrontPage

I can set you up with an account, I think....

It's interesting Rocky, didn't know about that one! After what I can see with a fast look this is more about mission scripting then mapping or am I wrong? I can't promise too many tutorials either as my time modding is limited nowadays. Maybe it's better if someone just copy tuts of interest into the wiki?

Biro

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...