misc_documentation

Texture Munge

Parameters for tga.option files

Below is complete list of all the texture munge parameters will a brief description. A more detailed description of more complicated parameters can be found in the next section.

Parameter Details

-format <string>

A full list of format strings and properties follows below.

Note that many PC cards do not support all of the luminosity and alpha only textures such as A8, L8, or A8L8 in game.

The size of a texture will be width*height*bits_per_pixel/8. For a 256x256 texture, this ranges from 32kb for 4bpp DXT1 compressed to 256kb for 32bpp A8R8G8B8 format.

-detailbias <int>

On the PC, this option controls how the texture is reduced if the user sets texture quality to low or medium.

Textures are capped to a maximum byte size based on the texture quality – 128K for medium, 64K for low quality. Setting the bias will raise the cap for this texture by a factor of 2 for each detail bias step.

-detailbias 7 will keep any but the largest textures from resizing down.

The following chart summarizes the results of this operation for square textures. Non-square textures are handled according to total size, so a 64x256 will resize down as many steps as a 128x128.

Bump Map Options

Every bump map needs to have an option file. Each bump map should have the following options:

-format bump (or terrain_bump, or bump_alpha, or terrain_bump_alpha)

If the input image file is a grayscale height map, as opposed to a normal map generated by some tool, it should also specify:

-bumpmap or –hiqbumpmap

-bumpscale <value> to set the steepness of the bumps (6.0 is a good starting value)

One more note about bump mapping: a lot of the time a diffuse texture will have shadowing burned into the texture. Ideally, for bump mapped materials, you should try to remove any shadowing from the diffuse texture, since the bump mapping will put in shadows dynamically.

Model Munge

Parameters for msh.option files

Below is complete list of all the texture munge parameters will a brief description. A more detailed description can be found in the next section.

In-Game Console Commands

The new command console commands are:

Lighting.SunColor <red> <green> <blue>

Lighting.SunDirection <heightangle> <directionangle>

Lighting.ShadowColor <red> <green> <blue>

For static/buildings:

Lighting.AmbientColor <red> <green> <blue>

For dynamic/characters:

Lighting.TopAmbientColor <red> <green> <blue>

Lighting.BottomAmbientColor <red> <green> <blue>

Any of these can be used without any parameters to just print the current value.

I added console command for all the parameters above so you can tweak the parameters on the fly here are the commands

Blur.Enable

Blur.MinDepth

Blur.MaxDepth

ColorControl.Enable

ColorControl.GammaContrast

ColorControl.GammaBrightness

ColorControl.WorldContrast

ColorControl.WorldBrightness

ColorControl.WorldSaturation

ODF Parameters

Ordnance Collision

Add this line to an odf and the ordnances will ignore the collision:

OrdnanceCollision = "none"

Water Effects

For Soldiers, the water effect will happen whenever a foot of a soldier goes into the water. Add the following line to a soldier odf:

FootWaterSplashEffect = "particle effect name"

For Hover Vehicles, the water effect will happen whenever a hover goes on the water. Add the following line to a hover odf:

WaterEffect = "particle effect name"

I finished adding the code for the water effects. You can add water effects to soldiers, explosions, and bullets

For Soldiers, the water effect will happen whenever a soldier falls into water such as jumping. Add the following line to a soldier odf:

WaterSplashEffect = "particle effect name"

For explosions, the particle effect will happen at the surface of the water whenever an explosion happens underneath the water. Add the following line to an explosion odf:

WaterEffect = "particle effect name"

For bullets, the particle effect will happen at the surface of the water whenever a bullet hits the water. Add the following line to a bullet odf:

ImpactEffectWater = "particle effect name"

Effects in the world ENVFX file

Blur

I added parameters so you can tweak the xbox parameters for color and bluring

Effect("Blur")
{
Enable(0); // enables/disables blur effect
       MinMaxDepth(0.95,1.0); // the distance where blurring starts and stops
}

Color Control

Effect("ColorControl")

{

Enable(1); // enables/disables color adjustments

GammaContrast(0.53); // changes the gamma curve to introduce more contrast

//effects everything on screen (including interface)

GammaBrightness(0.5); // changes the gamma curve to add more brightness

WorldContrast(0.5); // changes the contrast of the world (excludes interface)

WorldBrightness(0.5); // changes the brightness of the world (excludes interface)

WorldSaturation(0.5); // changes the saturation of the world (excludes interface)

}

notes:

0.5 is neutral for all color controls

Changing the gamma controls is free (but changes the interface images as well), changing the world controls is a lot more expensive.

If you don’t want to change the world controls set them to 0.5, this effectively turns them off.

Sun Flare

The sun flare is now in the game.

Here is a description of the tunable parameters.

They are located in yavin.fx.

The sky with the sun flare built in need to be taken out because it will make the sun really big with the new flare.

Color(255, 255, 255); The color of the sun (the beams use this color as well)

Size(5.0); The size of the sun

FlareOutSize(40.0); The length of the light beams

NumFlareOuts(40); This is a smoothing factor for the light beams (if the number is too low you will see steps in the beams). Don’t make this value too high because it will make the sun expensive to render.

InitialFlareOutAlpha(70); This will control how dark the light beams are

The halo around the sun consists of three rings.

You can make one ring fade into another one in order to get more color complexity.

The first number is the size of the ring and the rest is the color of the ring

HaloInnerRing(0.0, 255, 255, 255, 255);

HaloMiddleRing(5.0, 255, 150, 0, 128);

HaloOutterRing(40.0, 255, 0, 0, 0);

SpikeColor(230,230,0,128); The color of the sharp spike coming out the of the sun

Water

Here is the description of the video options that you may need to tweak:

Tile => how much the main texture gets tiled (used on all qualities)

Velocity => how fast the main texture is moving (used on low quality)

RefractionColor => the color of the water (used on all qualities)

SpecularMaskTile => the tiled amount for the specular texures (used on low quality)

SpecularMaskScrollSpeed => the scroll speed for the specular textures (used on low quality)

Go through all the worlds with water on them (yav1, kas1, kas2, nab2) and try all three qualities for each world. You can change the quality by pressing "ESC" and selecting "Video Options" then select the water quality you want.

Lighting in the world SKY file

Lighting with the current engine works differently on the three supported platforms. It is important to understand the differences in order to get the best looking results.

Ambient Light

Ambient light is used to brighten the overall scene. The ambient light should not be too bright because it causes the world to look more flat by removing depth cues in the lighting.

Certain objects in the world can receive different ambient levels as well as there can be regions which override the ambient light.

Character Ambient

Vehicle Ambient

World Ambient

I added a directional ambient feature to the PC and Xbox.

If it works out, Salah can add it to the PS2 version.

This is how it works:

in the sky file (in the sky info section) you can specify two new ambient colors: TopDirectionalAmbientColor() and BottomDirectionalAmbientColor().

These colors only affect objects that use the character ambient color.

If no directional ambient colors are specified everything will render the same as before.

The way the directional ambient works is the top parts of an object will use the top ambient color and the bottom parts will use the bottom ambient color.

All the other parts will use some blending of the two colors.

You can also override the directional ambient colors in shadow region in a similar manner you can override the character ambient color.

In the name of the shadow region you can specify "colortop" and "colorbottom".

If you have any questions come see me.

Static Lighting

Statically lit objects take lighting from non-static lights (any light that isn’t marked as static).

However it is required that these objects are vertex lit offline.

Below are the instructions on how to create a statically lit object in the game:

1. Open the mesh you want to statically light in XSI

2. Place exact replicas of the static lights in XSI using the same position and radius

3. Light the mesh using XSI.

4. Add the "-vertexlighting" option in the MSH option file for that mesh

5. Add "Static = 1" in the light odf

Anything that is tagged with "-vertexlighting" will not be affected by the light.

Light ODF

In order to create a light in the game there must be an associated light ODF. The ODF holds all the parameters for a light. Lights can then be attached to hard points by using attached ODFs. Light ODFs are also responsible for putting a light beam or light flare on a light. The follow lists all the different type of light parameters that can be used. Parameters and values are in ODF format (ie. Parameter = Value).

Below are some examples of various types of lights and effects along with the light ODF parameters. These examples only show snippets of the ODF parameters, such as color and radius, can be set to whatever the user desires.

Example 1

FlareIntensity = 1.0

BeamIntensity = 0.0

OmniLightRadius = 0.0

ConeLength = 1.0

ConeWidth = 5.0

ConeInitialWidth = 1.0

Turns off the light beam and light, but leaves a flare. The ConeInitialWidth and ConeWidth parameters control the size of the flare when looking at it from the side versus directly down the axis, respectively.

Example 2

ConeLength = 10.0

ConeFadeFactor = 0.3

ConeFadeLength = 0.6

Creates a beam with a very diffuse rounded end. You probably want to decrease the fade factor a bit if you make the fade length small.

Example 3

ConeLength = 10.0

ConeFadeFactor = 0.05

ConeFadeLength = 0.05

Creates a beam with a very square bottom edge. You probably want to decrease the fade factor a bit if you make the fade length small.

Example 4

ConeWidth = “2.0 4.0”

ConeInitialWidth = “0.5 1.0”

Specifies an oblong light beam which has aspect ratio 2.0. If you only specify one value, you’ll get a circular source or cone.

Console Commands in the Editor

High Resolution Terrain Map

Editor.savehiresmap <width> <height>

This command allows arbitrary dimensions for saving a top down snapshot of the terrain.

Regions in the Editor

Shadow Regions

Name Prefix: shadow

Parameters: key=value, key matched to minimum number of characters

directional=<float(0.0-1.0)>

Set the intensity of the global directional light (sun light) in this region. Matches d=, di=, dir=, etc.

ambient=<float(0.0-1.0)>

Set the intensity of the global ambient light in this region, relative to the local ambient color. 0.0 means all local, 0.5 means a blend of half local, half global. Matches a=, am=, amb=, …

color=<int(red)>,<int(green)>,<int(blue)>

Set the local ambient color (top and bottom on xbox/pc) for this region. Matches c=, co=, col=, …

colortop=<int(red)>,<int(green)>,<int(blue)>

Set the local top ambient color for the xbox/pc for this region. Matches colort=, colorto=, …

colorbottom=<int(red)>,<int(green)>,<int(blue)>

Set the local bottom ambient color for the xbox/pc for this region. Matches colorb=, colorbo=, …

Usage: Use box, cylinder, or sphere type.

Results: Dynamic objects (characters, vehicles, and items) within the region will use the given lighting parameters instead of the global parameters. Lighting parameters will blend with the global parameters over a 5 meter radius on the outside edge of each region.

Questions to: Jason Scanlin or David Givone.

Reflection Regions

Name Prefix: reflection

Parameters: none

Usage: Use box or cylinder type; bottom plane represents reflection plane.

Results: Objects within region which support faked reflection will be rendered a second time, reflected by the bottom plane of the region.

Questions to: Jason Scanlin or David Givone.

Rain Shadow Regions

Name Prefix: rainshadow

Parameters: none

Usage: Use box, cylinder, or sphere type.

Results: Within the region, precipitation effects (rain or snow) will be disabled. Since the precipitation effect works by tiling one box of simulated rain or snow around the camera, the precipitation will be turned off only on box boundaries, leaving some artifacts. The size of the boxes is determined by the PrecipitationEffect parameters in the envfx file for the world.

Notes: rainshadow regions should not be rotated or they may break

Questions to: Jason Scanlin.

Fly/Danger Regions

Name Prefix: danger

Parameters: none

Usage: Use any type.

Results: Flyer AI will avoid these regions.

Questions to: Greg Walker.

Rumble Regions

Name Prefix: rumble

Parameters: <string(rumbleclassname)> <string(effectname)>

Usage: Use any type. Name must be “rumble” only (“rumble0” or “rumbleregion” will not work!)

Results: Create the given rumble effect and attached particle effects when the local player enters this region.

Questions to: Josh Verrall

Sound Trigger Regions

Name Prefix: soundtrigger

Parameters: <string(propertyname)>

Usage: Use any type. Name must be “soundtrigger” only (“soundtrigger0” or “soundtriggerregion” will not work!).

Results: Trigger a sound when a listener enters the region.

Questions to: Stewart Miles

Sound Space Regions

Name Prefix: soundspace

Parameters: <string(soundspaceid)>

Usage: Use any type. Name must be “soundspace” only (“soundspace0” or “soundspaceregion” will not work!).

Results: Change the sound space parameters when a listener enters the region.

Questions to: Stewart Miles

Static Sound Regions

Name Prefix: soundstatic

Parameters: <string(soundid)> <float(distance_divisor)>

Usage: Use any type. Name must be “soundstatic” only (“soundstatic0” or “soundstaticregion” will not work!).

Results: Trigger a static sound when a listener enters the region.

Questions to: Stewart Miles

Sound Stream Regions

Name Prefix: soundstream

Parameters: <string(soundid)> <float(distance_divisor)>

Usage: Use any type. Name must be “soundstream” only (“soundstream0” or “soundstreamregion” will not work!).

Results: Trigger a sound stream when a listener enters the region.

Questions to: Stewart Miles

Foley FX Regions

Name Prefix: foleyfx

Parameters: <string(groupid)>

Usage: Use any type. Name must be “foleyfx” only (“foleyfx0” or “foleyfxregion” will not work!).

Results: Trigger a foley change when a listener enters the region.

Questions to: Stewart Miles

Damage Regions

Name Prefix : damage

Parameters : key=value, key matched to minimum number of characters

damagerate=<float>

Damage per second applied to objects that enter the region

personscale=<float>

Scales the damage if the object in the region is a person

animalscale=<float>

Scales the damage if the object in the region is an animal

droidscale=<float>

Scales the damage if the object in the region is a droid

vehiclescale=<float>

Scales the damage if the object in the region is a vehicle

buildingscale=<float>

Scales the damage if the object in the region is a building

buildingdeadscale=<float>

Scales the damage if the object in the region is a dead building

buildingunbuiltscale=<float>

Scales the damage if the object in the region is an undamaged building

Usage: Use box, cylinder, or sphere type.

Results: Damage will be applied to objects within the region.

Questions to: Stewart Miles

Materials in XSI

Below is a complete list of all the materials that artists can set through XSI along with which platforms support them. In order to use any of these materials you first select the polygons that you want to tag in XSI and then select EditFlags. Adjust the render type field for choosing the appropriate material.

Normal

Render Type: Render Normal

Data 0: NOT USED

Data 1: NOT USED

Texture 0: diffuse texture

Description:

The simple default material.

Comments:

Detail Mapped

Render Type: Render Detail (Rendertype #11)

Data 0: detail tiling in the U direction

Data 1: detail tiling in the V direction

Texture 0: diffuse texture

Texture 1: detail map texture

Description:

Detail mapping an object will give the object the appearance of more texture resolution when close to the camera. It is useful for simulating finely, rough surface such as cement or rocks.

Comments:The detail map should have an average intensity of about 0.5, which insures that the overall brightness of the object will not be affected.

Bump Mapped

Render Type: Render Bumpmap (Rendertype #27)

Data 0: NOT USED

Data 1: NOT USED

Texture 1: bump map texture

Description:

A bump mapped object gives the object the appearance of more depth. Bump mapping an object is useful for surfaces that have groves such as tree bark and brick.

Comments:

Bump Mapped with Specular

Render Type: Render Bumpmap+Glossmap (Rendertype #28)

Data 0: NOT USED

Data 1: NOT USED

Texture 0: diffuse texture (gloss map in alpha channel)

Texture 1: bump map texture (gloss map in alpha channel)

Description:

A bump mapping object with specular is useful for shiny surfaces (such as metal) with groves where you want the groves to be highlighted. The gloss map is useful to give the surface an uneven shine.

Comments:In order to adjust the specular power associate the selected polygons with a XSI Phong material. The color of the material effects the specular color and the specular decay controls how big the specular spot is. The larger the specular decay the smaller the spot will be.

Refraction

Render Type: Render Ice Refraction (Rendertype #22)

Data 0: NOT USED

Data 1: NOT USED

Texture 0: diffuse texture

Texture 1: bump map

Description:

A refraction object behaves as transparent object except the transparency is distorted. The alpha channel of the diffuse texture is used to control the opacity while the bump map controls how much to distort an object.

Comments:Since a refraction object distorts the scene behind it suffers from sorting issues.

Scrolling

Render Type: Render Scrolling (Rendertype #3)

Data 0: scroll speed in the U direction

Data 1: scroll speed in the V direction

Texture 0: diffuse texture

Description: Scrolls the diffuse texture according to the scroll speeds.

Comments:

Specular

Render Type: Render Glossmap (Rendertype #4)

Data 0: NOT USED

Data 1: NOT USED

Texture 0: diffuse texture (gloss map in alpha channel)

Description: A specular object is useful for creating shiny surfaces (such as metal).

The gloss map is useful to give the surface an uneven shine.

Comments:In order to adjust the specular power associate the selected polygons with a XSI Phong material. The color of the material effects the specular color and the specular decay controls how big the specular spot is. The larger the specular decay the smaller the spot will be. If there is no alpha channel in the texture then it is assumed to be 1 and gloss mapping will be turned off.

-------------------------------------------------------------------additional info------------------------------------------------------------------

Animated

Render Type: Render Animated (Rendertype #7)

Data 0: Sets number of frames

Data 1: Sets the speed of animation

Texture 0: diffuse texture

Description: This render type is used for animated textures.

Comments: All the frames must be on the same texture.

Your UV’s should be mapped to the first cell (not the entire texture).

Each individual cell is always square and is determined automatically from the number of frames.

The number of frames must be a perfect square (ie. 4,9,16,25,36…).

Your animation sequence should go from top left to bottom right.

The animation must contain a minimum of 4 frames, therefore the minimum number that goes in data0 is 4.

Animation speed is determined by the data1 setting.

Example of a 64 frame (8x8) texture set up for this render type

http://www.facesandfacets.com/images/Flame64SeqLayout.jpg

Blink

Render Type: Render Energy (Rendertype #25)

Data 0: Specifies the minimum value to oscillate between diffuse intensity

Data 1: Frequency or speed of the throbbing or flashing can be adjusted

Texture 0: diffuse texture

Description: This render type is used for blinking the diffuse color.

Comments: The blink will oscillate between the original intensity and the min value specified according to the blink speed.