TRN (FileFormat)

From SWGANH Wiki
Revision as of 12:11, 1 May 2007 by Rouse (Talk | contribs) ('''Known Affectors''')

Jump to: navigation, search

TGEN - Terrain Generator

Terrain generator (form name : TGEN) There are 6 different sections.

- The Surface group     (SGRP)
- The Flora group       (FRGP)
- The Radial? group     (RGRP)
- The Environment group (EGRP)
- The -unamed- group    (MGRP)
- The Layers group      (LYRS)

SGRP - Surface Group

Where all the surfaces are declared.


It's sub-divied into multiple surface families (SFAM). Each one of them declare mutliple shaders using a surface file.

53 46 41 4D 00 00 00 70 04 00 00 00 66 72 73 74 5F 64 65 63 	SFAM...p....frst.dec
64 5F 72 6F 63 6B 6D 75 64 00 61 62 73 74 72 61 63 74 2F 74 	d.rockmud.abstract.t
65 72 72 61 69 6E 5F 73 75 72 66 61 63 65 2F 68 61 72 64 64 	errain.surface.hardd
69 72 74 2E 69 66 66 00 C7 AA 83 00 00 00 40 00 00 80 3F 02 	irt.iff.............
00 00 00 64 69 72 74 5F 72 6F 63 6B 6D 75 64 00 00 00 20 41 	...dirt.rockmud....A
64 69 72 74 5F 72 6F 63 6B 6D 75 64 5F 61 31 00 00 00 A0 40 	dirt.rockmud.a1.....

Here its declares 2 shaders: dirt.rockmud, dirt.rockmund.a1 using abstract/terrain_surface/harddirt.iff

FGRP - Flora Group

Where all the flora groups are decared using appearance files.

Each one of them decalre one flora group using multiple appearance files.

46 46 41 4D 00 00 01 CE 01 00 00 00 47 72 61 6E 69 74 65 20 	FFAM........Granite.
52 6F 63 6B 73 31 00 00 80 FF 00 00 80 3F 00 00 00 00 07 00 	Rocks1..............
00 00 72 6F 63 6B 5F 67 72 61 6E 69 74 65 73 6C 61 62 5F 6C 	..rock.graniteslab.l
61 72 67 65 2E 61 70 74 00 00 00 80 3F 00 00 00 00 0A D7 23 	arge.apt............
3C CD CC CC 3D 01 00 00 00 00 00 00 00 00 00 80 3F 00 00 80 	....................
                        [...]                                           [...]
00 00 80 3F 00 00 80 3F 72 6F 63 6B 5F 67 72 61 6E 69 74 65 	........rock.granite
73 6C 61 62 5F 73 6D 61 6C 6C 5F 61 31 2E 61 70 74 00 00 00 	slab.small.a1.apt...
A0 40 00 00 00 00 0A D7 23 3C CD CC CC 3D 01 00 00 00 00 00 	....................
00 00 00 00 80 3F 00 00 80 3F 	                                 ..........

Here it declares a group named 'Granite.Rocks1' wich contains graniteslab of different sizes.


RGRP - Radial Group

I Don't know much about this one yet.


EGRP - Environment Group

Declares the environement

45 46 41 4D 44 41 54 41 00 00 00 19 01 00 00 00 74 61 61 6E 	EFAMDATA........taan
61 62 5F 67 6C 6F 62 61 6C 00 FF FF 00 00 00 80 3F 	        ab.global........

MGRP - -unamed- Group

Where all the fractal are decalred. It's sub-divied into multiple groups (MFAM). Each one of them declare a labelled fractal.

4D 46 41 4D 44 41 54 41 00 00 00 27 01 00 00 00 2E 30 30 31 	MFAMDATA.........001
35 5F 6F 63 74 31 5F 6E 62 69 61 73 5F 42 61 73 65 52 6F 6C 	5.oct1.nbias.BaseRol
6C 69 6E 67 48 65 69 67 68 74 00 46 4F 52 4D 00 00 00 4C 4D 	lingHeight.FORM...LM
46 52 43 46 4F 52 4D 00 00 00 40 30 30 30 31 44 41 54 41 00 	FRCFORM....0001DATA.
00 00 34 A0 11 00 00 00 00 00 00 79 E9 E6 3E 00 00 00 00 00 	..4........y........
00 80 3F 01 00 00 00 C1 CA 61 40 FC A9 71 3D A6 9B C4 3A FA 	.........a...q......
ED EB 3A 00 00 00 00 00 00 00 00 00 00 00 00 	                ...............

This one decalres a fractal labeled 'oct1.nbias.BaseRolling Height' TODO: Add fractal notes here.

LYRS - Layers Group

Layers & Affectors

Basically the role of layers is to affect the data contained in the different families. They can contain any number of other sub-layers. Their order is important.

Trn layers.jpg

A layer deals with the families trough Affectors. There are different types of them, each one has it's own role. Can have Affector for texturing, flora, areas...

Known Affectors

Area Delimiters
BREC Boundary Rectangle Delimits a rectangle using 4 float: X1, Y1, X2, Y2 (Select rectangle boundary rule properties, including feathering distance, boundary left/right and near/far coords and local water table height, shader and sahder size.
BCIR Boundary Circle Delimits a circle using 3 float: Xo, Yo, Radius
BPOL Bondary Polygon Delimits a n-sided closed polygon area using 2 floats (Xo,Yo) for each point.
BPLN Boundary PolyLine Delimits a n-sided line area using 2 floats (Xo,Yo) for each point and a float for the width.
FFRA Filter Fractal Delimits an area generated by a 2d fractal on the ground.


Texture / Shaders
ASCN Shader Constant Affect a shader using the family_id and the shader_id this family.
ASCR Shader Replace Replace a shader with another shader (not tested yet)


Terrain
AHCN Height Constant Raises or lowers the ground using float for delta and float(scalar?) for slope-smooting.
AHFR Height Fractal Raises or lowers the ground irregulary using a fractal type from the Fractal Family.Float for delta and float(scalar?)


Flora
AFSC Collidable Constant Sets the amount of collidable flora.
AFSN NonCollidable Constant Sets the amount of Non-collidable flora.
Radials
AFDN Radial Constant I don't know much about those yet. Seems like they change the near/far radial displaying. They're often coupled to the flora affectors, for instance when cleaning an area for a city.
AFSN NonCollidable Constant Sets the amount of Non-collidable flora.


Unknown yet
AENV Environment Unknown
ACRF Affector Color Ramp Fractal Select rule family and color ramp.
FHGT Filter Height Select filter height rule properties, including feathering, distance, filter low height, and filter high height.

Examples

...