Wrecks

From WiCWiki

Revision as of 13:26, 22 November 2007 by Tabu (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Contents


Wrecks Introduction

This will go trough what it takes to make Wrecks for World in Conflict.

The workflow of making wrecks is basically the same for houses, props and bridges.


The Models

There are a couple of things you’ll need to do if you plan on making a proper wreck:

First we have the main model which of course will be what you see, the ruins of a house for example.

Then we have something we call the “gety” object, which is pretty much a simple model of how the height field will deform and tell the game where to add rubble.


The Gety object is usually made in the beginning before you make the wreck and then tweaked afterwards. It is good to start with a plane with a couple of subdivisions and make a small hill that fits the size of the house. The image below displays what a Gety-object could look like. Some of the polygons near the edge are deleted to make it a bit more irregular in shape. Remember, you can remove some geometry under the gety object, since it won’t be visible in game.

Gety objects only work on houses though, no slots equals no gety object. When you’ve made your gety object, save it in a separateGety ObjectLWO file and change the file extension from “.lwo” to “.gety”.

Remember, this is a special object, used to deform the height field when the building is destroyed, don’t make it too large or else buildings around your wreck can become covered in rubble!


You can also make dynamic parts using the physics engine of the game. All you have to do at this stage is to model the pieces you want to be dynamic and give them separate weight maps.

These dynamic parts should be saved into a scene of their own. Note that this should be used as a complementary for the wrecks. The pieces will fade away after some time and you probably want some kind of rubble after you’ve destroyed an object.


Image:getyObject.jpg


Textures:

There are some Generic textures that can be used for the most common wrecks. You may find them here in the “props\house\wreck_generic” directory.

The Scene

When your model is complete, you should embed it into the LWS scene of your un-wrecked house. To make life easier, you should set up your house like the image to the right, with a null object as parent for the different models in each state. Stand and hurt (and others if you use more states).

You don’t really need a parent for the FX nulls because they usually trigger in the same states as the wrecks, but it looks better. If you have a large hierarchy it’s always good to group your items and place them logically.

To import your LWO file into a scene, use the “+” key on your keyboard.


If you’ve made a scene with dynamic pieces, you’ll need to create bones and connect them to the weight maps. The placing of the bones in the scene is unimportant because the objects will use a physics-box that is placed in the showbox. Don’t forget to activate the bones and check “use weightmap only” in the properties for your bones in lightwave.


Add nulls where you want to place your explosions and effects.


Tips:

don’t forget that you can animate, it always brings more life to the game,

example: Split your building into smaller pieces and animate the pieces as they crumble to the ground and disappear in a cloud of smoke! Remember, this should also be made in a separate file and then scripted in so it can fade away accordingly.


Image:lwslayout.jpg


Wrecks and Showbox

A good way to begin is to open the MRE file of the house you made your wreck for.

Since the MRE file uses the LWS file, you should see your wreck and the un-broken house at the same time.



What you need to do first is to add a second state to your new hierarchy

Look at image 1 to the right. This represents the left part of the screen. If you click on the “objects” tab on top, you’ll see the button I marked in picture 2 on the bottom of the screen. Click this and select the LWS file you build your MRE on. You’ll now be able to add a new state to all the objects and layers in the MRE (by doing this you don’t have to add all the states separately).


When you have selected your state, you should go down to hurt-states in the list, (click h to find it or scroll down).


These are the states you can use as different levels of hurt-states:

Not hurt (HUR0) – this is the state your object goes to if it’s repaired in the game, (note that it doesn’t go back to stand)

Hurt a little (HUR1) – your object enters this state when it’s been damaged a little.

Somewhat hurt (HUR2) – this is also a state you can use when the object is a bit more damaged.

Hurt a lot (HUR3) - when the object has no health left.

You don’t need all of the states if you don’t want to use them. Normally you will only use the STND state and the Hurt a lot state.

Note that if you add one of these states, they will trigger automatically depending on the health bar of your object.


Now if you go back to the hierarchy tab (image1) and right click with your mouse somewhere in that area, select “full” from the menu. When you start clicking those +, your hierarchy will look pretty much like the one in image 1.


Since you don’t want the wreck to be visible when the house is intact, you’ll have to deactivate it in the STND state. Select the state right under the parent of the Wreck. In my case it’d be under “Wreck_Main”.

In the bottom of the screen it’ll look like image 3. Uncheck “active” and press “Apply to Childs” and your wreck will only be in HUR3.

Do the same thing with the un-damaged house only deactivate it in the HUR3 state, instead of the STND state.


You switch between the states using the F keys (F1, F2 etc.) to see if it works.


Now we can add effects, explosions, smoke etc. Do this by selecting the state of the null object you placed in lightwave, which you want them to spawn in.

For example, if you want your explosion to trigger in HUR3. simply select HUR3 state of your Null (press the + to see its internal states).

You can change position of the explosions by moving around and/or create new nulls in the LWS file.

Then click the “Add Particle Emittor” button, see image 3 to the right.


A library full of particle effects will pop up. Browse around and see if you can find the effect you’re looking for.


(More about Particles)

Image:Hierarchy.jpg
Image:CompleteState.jpg
Image:States.jpg


Physics in Wrecks

Wrecks usually don’t have physics, but if you want to be able to drive through your wreck you have to set up your Physics accordingly.

You will need a box-is-cutting element in the physics, it works the same way as it does with bridges. See here <LINK>

Also, if you did dynamic parts, you have to generate physic bodies, make sure you get one for each bone that you’ve placed in the LWS file.


To set up dynamic props, see the image below.

Image:PhysicsWindow.jpg

Start by pressing Generate, the Showbox will generate bodies for all your bones.

Make sure all bones are dynamic.

Bounciness controls how much energy will be lost when the physicbox touches the ground.

Friction controls how much the object will slide on the ground.

Layer should be set on 7 (house parts) for dynamic props.

Mass controls the weight of the object.

Has AI controls if the box will use AI pathfinding or not. Dynamic things shouldn’t have AI.

Touchkill controls how long it takes before it will fade away after it has been hit.


In the element, make sure Physics is on, LOS/LOF and AI should also be off.

Hint: Do not create lots of physic boxes that intersect. It can flip out and/or your pieces might fly in any direction. The same goes for placing dynamic elements underground.


Surfaces

There are a couple of surfaces to choose from. If you’re using “wreck_generic” texture, you can use “NormalMap Specular Bump (Ground col)”. If you’re using Wreck_Generic_2, we’re usually using one called “standard_house_burn_alphatest.sur (alphatest)”. That surface has support for “animated” flames. See the image on how to set it up correctly.

Image:Surface.jpg

Image:animatedTexture.jpg


LOD's and Wrecks

Don’t forget to lod your wrecks! It will improve performance of the game a lot! We usually make 3 lods. If it’s a really complex wreck you might also want to consider adding a detail-layer.


Scripting Wrecks

Take a look at Category:Juicemaker

Personal tools
User Created Content