## Chapter 19. XFFExp - 3D Studio MAX exporter

## Introduction

XFF Exporter (XFFExp for short) is the second generation exporter for X-Forge technology. It exports 3DS Max worlds to the X-Forge file format (XFF).

## Installation

Installation is simple. Just copy the exporter plugin to max's plugins-directory (usually c:\3dsmax5\plugins)

## Configuration screen

The following settings are available:

    Export hidden nodes - forces the export of hidden nodes
    Export animations - enables / disables PRSAnimationGroup exports
    Remove scaling - forces all scale values to (1,1,1)
    Optimize output - optimizes vertex buffers for optimal cache use, also removes unused chunks.
    Output log to c:\xffexp.log - outputs the export log to c:\xffexp.log
    Display log after export - displays a log window after the export

    Export scale - global multiplier to resize the world
    Animation sample rate (frames / sample) - defines the sample rate of the animation
    Threshold for vertex duplication - controls the amount of cache optimization vs. creating duplicate vertices

### Group

X-Forge does not allow helper nodes to be parents of other nodes. If you need to create a game graph hierarchy without any actual geometry, you can use helpers and prefix the name of the helpers with "GR_". XFFExp will export such helpers as group nodes. It has the following parameters:

    "sceneroot"                 Make this node scene root and discard everything not its child.

### Particle System

Use "PS_" as a prefix in helper name to export helper as a particle system. Particle systems have the following parameters:

    "fn: [filename.pr3]"        Filename of particle sytem.
    "s: [scale]"                Scale of particle system, default = 1.0.
    "sceneroot"                 Make this node scene root and discard everything not its child.

## Material Settings

A few material options have special meaning in exported file.

    Max option:   XFF option:
    ------------------------------------
    Filter color  Emissive color
    Wire units    Perspective correction (units=on,pixels=off)
    Wire size     Polygon offset
    Falloff       Shading (out=gouraud,in=flat)

## Node attributes

To allow expansibility, node's user properties in MAX are exported as node attribute chunks. Each line of text in user properties -field creates a node attribute chunk with the line as string data.

### X-Forge engine reserved words

The full XFFExporter that is used with X-Forge Engine has special meanings for some user properties. To ensure compatibility with the full version, it is recommended that the following user properties are not used:

    t:
    fn:
    s:
    w:
    h:
    t:
    sb:
    tb:
    c:
    m:
    r1:
    r2:
    l:
    r:
    col:
    sn:
    bl:
    f:
    sc:
    dc:
    min:
    max:

## Common Problems

Sometimes, the XFF files produced with XFFExp fail to load or possibly load but not work as expected. There are a number of reasons why this could happen.

Possibly the most common reason is that the world is too large or too small. X-Forge uses fixed point math, which limits the range and accuracy of numbers and sets limits for the size of worlds. The world has a radius of roughly 100 units. Going over this limit causes the objects to appear to be folded in various ways. Too small objects will suffer from math inaccuracy and will appear to shake and jump around. It's hard to give a guideline for minimum object size since it depends on the camera view (distance, field of view etc.).

Another common problem is that some objects are exported that don't have materials set in 3DS Max. This causes an invalid XFF file that cannot be loaded.

Also make sure that you have at least one camera in your scene. In particular if you have a complex "chain" of files with loader nodes that load other files, it's easy to forget to have a camera. Without a camera, the world will still be loaded fine but rendering will fail.

|  | X-Forge Documentation Confidential Copyright © 2003 Fathammer