Difference between revisions of "TRN (FileFormat)"
(→'''<font color="orange">RGRP</font>''' - Radial Group) |
ThePowerking (Talk | contribs) (→'''<font color="orange">MGRP</font>''' - Fractal Family Group) |
||
(111 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{PageHeader|FileFormat|TRN}} | |
+ | ='''<font color="darkgreen">File Header</font>'''= | ||
+ | |||
+ | The general map parameters, as well as flora parameters are defined here | ||
+ | |||
+ | <pre> | ||
+ | 4A 3A 5C 73 77 67 5C 63 75 72 72 65 6E 74 5C 64 61 74 61 5C J..swg.current.data. | ||
+ | 73 6B 75 2E 30 5C 73 79 73 2E 73 68 61 72 65 64 5C 62 75 69 sku.0.sys.shared.bui | ||
+ | 6C 74 5C 67 61 6D 65 5C 74 65 72 72 61 69 6E 5C 64 61 6E 74 lt.game.terrain.dant | ||
+ | 6F 6F 69 6E 65 2E 74 72 6E 00 00 00 80 46 00 00 00 41 02 00 ooine.trn....F...A.. | ||
+ | 00 00 01 00 00 00 CD CC CC BD 00 00 00 40 77 74 65 72 5F 64 ..............wter.d | ||
+ | 61 6E 74 5F 6C 61 6B 65 00 00 30 04 46 00 00 00 00 00 00 00 ant.lake..0.F....... | ||
+ | 43 00 00 00 41 00 00 00 40 00 00 00 00 00 00 00 00 00 00 80 C...A............... | ||
+ | 42 00 00 80 40 00 00 00 3F 00 00 00 00 00 00 00 00 00 00 F0 B................... | ||
+ | 41 00 00 80 3F 00 00 00 00 00 00 00 00 00 00 00 43 00 00 00 A...............C... | ||
+ | 44 00 00 00 42 00 00 00 41 00 00 00 00 D...B...A.... | ||
+ | </pre> | ||
+ | |||
='''<font color="darkgreen">TGEN</font>''' - Terrain Generator = | ='''<font color="darkgreen">TGEN</font>''' - Terrain Generator = | ||
+ | <pre> | ||
+ | The rules in the terrain generation system are also referred to as affectors,and | ||
+ | are organized into layers. Boundaries refer to terrain designer- or artist-defined | ||
+ | regions of virtual terrain for which the desired rules have effect. Filters refer | ||
+ | to conditions to be considered when applying affectors. Layers can be arranged | ||
+ | in a hierarchy with a parent-child or tree-leaf relationship. Examples of boundaries | ||
+ | include circles, rectangles, and polygons. Examples of filters include filtering | ||
+ | by slope, height, shader, direction and fractal. Examples of affectors include | ||
+ | those that affect height, color, shader, flora, and radial flora. Boundaries, filters | ||
+ | and layers are described in greater detail below. | ||
+ | |||
+ | The terrain generation system also includes families, which refer to groups of | ||
+ | assets such as textures, geometry or even algorithms. Families can include children | ||
+ | with weights. This could involve choosing an asset by selecting a one weighted child. | ||
+ | For example, this could allow the users to choose a "grass" family for a region, but | ||
+ | when the terrain system generates the grass family, it can choose one of the children | ||
+ | of the grass family, which results in the rendering of a single grass shader. | ||
+ | |||
+ | Examples of families include shader families, blend families, flora families, | ||
+ | radial flora families, and fractal families. Shader families refer to grouping | ||
+ | shaders for placing textures. Blend families refer to grouping shaders for selecting | ||
+ | alpha blend masks. Flora families refer to grouping geometry for selecting flora. | ||
+ | Radial flora families refer to grouping shaders for placing radial flora. | ||
+ | Fractal families refer to grouping fractals for reuse within different rules. | ||
+ | </pre> | ||
+ | |||
Terrain generator (form name : TGEN) | Terrain generator (form name : TGEN) | ||
Line 6: | Line 49: | ||
<pre> | <pre> | ||
− | - The | + | - The Shader family (SGRP) |
− | - The Flora | + | - The Flora family (FRGP) |
− | - The Radial | + | - The Radial Flora family (RGRP) |
− | - The Environment | + | - The Environment family (EGRP) |
− | - The | + | - The Fractal family (MGRP) |
− | - The Layers | + | - The Layers family (LYRS) |
</pre> | </pre> | ||
− | =='''<font color="orange">SGRP</font>''' - | + | =='''<font color="orange">SGRP</font>''' - Shader Family Group== |
− | + | ||
− | + | ||
+ | Shader families refer to grouping shaders for placing textures | ||
It's sub-divied into multiple surface families (SFAM). | It's sub-divied into multiple surface families (SFAM). | ||
+ | |||
Each one of them declare mutliple shaders using a surface file. | Each one of them declare mutliple shaders using a surface file. | ||
+ | |||
+ | SGRP has x children (SFAM), SFAM has x children (Shaders) | ||
+ | |||
+ | '''Family break-down:''' | ||
<pre> | <pre> | ||
− | 53 46 41 4D 00 00 00 | + | 53 46 41 4D 00 00 00 55 22 00 00 00 73 6E 6F 77 5F 6D 74 6E SFAM...U....snow.mtn |
− | + | 73 70 65 61 6B 00 61 62 73 74 72 61 63 74 2F 74 65 72 72 61 speak.abstract.terra | |
− | + | 69 6E 5F 73 75 72 66 61 63 65 2F 73 6E 6F 77 2E 69 66 66 00 in.surface.snow.iff. | |
− | + | FF FF 00 00 00 00 40 00 00 80 3F 01 00 00 00 ............... | |
− | 00 00 00 | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | (int) Family ID (This ID is user by the layers to select this family) | |
+ | (String) File Name | ||
+ | (byte)(byte)(byte) unk ?Color? | ||
+ | (float) unk | ||
+ | (float) unk | ||
+ | (int) Child Count | ||
+ | </pre> | ||
− | + | '''Child break-down:''' | |
+ | <pre> | ||
+ | 73 6E 6F 77 5F 6D 74 6E 73 70 65 61 6B 00 00 00 80 3F snow.mtnspeak..... | ||
+ | |||
+ | (string) Shader Name | ||
+ | (float) unk | ||
+ | </pre> | ||
+ | |||
+ | =='''<font color="orange">FGRP</font>''' - Flora Family Group== | ||
+ | |||
+ | Flora families refer to grouping geometry -apt files- for selecting flora. (Select flora group properties, including flora family data) | ||
Each one of them decalre one flora group using multiple appearance files. | Each one of them decalre one flora group using multiple appearance files. | ||
+ | FGRP has x children (FFAM), FFAM has x children (Appearance Files) | ||
+ | |||
+ | '''Family break-down:''' | ||
<pre> | <pre> | ||
− | 46 46 41 4D 00 00 | + | 46 46 41 4D 00 00 00 9D 01 00 00 00 66 65 72 6E 73 00 FF 80 FFAM........ferns... |
− | + | 40 00 00 80 3F 00 00 00 00 02 00 00 00 ............. | |
− | + | ||
− | + | (int) Family ID (This ID is user by the layers to select this family) | |
− | + | (String) Family Name | |
− | + | (byte)(byte)(byte) ukn ?Color? | |
− | + | (float) ukn | |
− | + | (float) ukn | |
− | + | (int) Child Count | |
− | + | ||
</pre> | </pre> | ||
− | |||
+ | '''Child break-down:''' | ||
+ | <pre> | ||
+ | 70 74 63 68 5F 65 6E 64 72 5F 66 72 73 74 5F 63 6C 75 73 74 ptch.endr.frst.clust | ||
+ | 65 72 5F 61 31 2E 61 70 74 00 00 00 80 3F 00 00 00 00 0A D7 er.a1.apt........... | ||
+ | 23 3C CD CC CC 3D 01 00 00 00 01 00 00 00 00 00 40 3F 00 00 .................... | ||
+ | 20 40 .. | ||
− | + | (String) Appearance File Name | |
+ | (float) ukn | ||
+ | (int) ukn | ||
+ | (float) ukn | ||
+ | (float) ukn | ||
+ | (int) ukn | ||
+ | (int) ukn | ||
+ | (float) ukn | ||
+ | (float) ukn | ||
+ | </pre> | ||
− | + | =='''<font color="orange">RGRP</font>''' - Radial Flora Family Group== | |
+ | Radial flora families refer to grouping shaders for placing radial flora. | ||
− | + | '''Family break-down:''' | |
+ | <pre> | ||
+ | 52 46 41 4D 00 00 01 06 01 00 00 00 67 72 61 73 73 79 20 70 RFAM........grassy.p | ||
+ | 6C 61 69 6E 73 00 FF FF 00 00 00 80 3F 04 00 00 00 lains............ | ||
− | + | (int) Family ID (This ID is user by the layers to select this family) | |
+ | (String) Family Name | ||
+ | (byte)(byte)(byte) ukn ?Color? | ||
+ | (float) ukn | ||
+ | (int) Child Count | ||
+ | </pre> | ||
+ | |||
+ | '''Child break-down:''' | ||
+ | <pre> | ||
+ | (String) Shader Name (dds file) | ||
+ | (float) ukn | ||
+ | (float) ukn | ||
+ | (float) ukn | ||
+ | (float) ukn | ||
+ | (int) ukn | ||
+ | (float) ukn | ||
+ | (float) ukn | ||
+ | (int) ukn | ||
+ | (?) ukn | ||
+ | TODO.. | ||
+ | </pre> | ||
− | =='''<font color="orange">EGRP</font>''' - Environment Group == | + | =='''<font color="orange">EGRP</font>''' - Environment Family Group== |
Declares the environement | Declares the environement | ||
+ | EGRP has x children (EFAM) | ||
+ | |||
+ | '''Child break-down:''' | ||
<pre> | <pre> | ||
− | + | 01 00 00 00 6D 61 69 6E 5F 62 61 73 65 00 FF FF 00 00 00 80 3F ....main.base........ | |
− | + | ||
+ | (int) Environment ID (This ID is user by the layers to select this environment) | ||
+ | (String) Environment Name | ||
+ | (byte)(byte)(byte) ukn ?Color? | ||
+ | (float) ukn | ||
</pre> | </pre> | ||
− | =='''<font color="orange">MGRP</font>''' - | + | =='''<font color="orange">MGRP</font>''' - Fractal Family Group== |
− | + | Fractal families refer to grouping fractals for reuse within different rules. | |
It's sub-divied into multiple groups (MFAM). | It's sub-divied into multiple groups (MFAM). | ||
Each one of them declare a labelled fractal. | Each one of them declare a labelled fractal. | ||
+ | MGRP has x children (MFAM) | ||
+ | |||
+ | '''Child break-down:''' | ||
<pre> | <pre> | ||
− | 4D 46 41 4D 44 41 54 41 00 00 00 | + | 4D 46 41 4D 44 41 54 41 00 00 00 1C 01 00 00 00 41 66 66 65 MFAMDATA........Affe |
− | + | 63 74 6F 72 48 65 69 67 68 74 46 72 61 63 74 61 6C 5F 31 00 ctorHeightFractal.1. | |
− | + | 46 4F 52 4D 00 00 00 4C 4D 46 52 43 46 4F 52 4D 00 00 00 40 FORM...LMFRCFORM.... | |
− | 46 52 43 46 4F 52 4D 00 00 00 40 30 30 30 31 44 41 54 41 00 | + | 30 30 30 31 44 41 54 41 00 00 00 34 00 00 00 00 00 00 00 00 0001DATA...4........ |
− | 00 00 34 | + | 00 00 00 3F 00 00 00 00 33 33 33 3F 02 00 00 00 00 00 80 40 ........333......... |
− | 00 | + | 00 00 00 3F 0A D7 23 3C 0A D7 23 3C 00 00 00 00 00 00 00 00 .................... |
− | + | 00 00 00 00 | |
− | + | ||
− | This | + | (int) Fractal ID (This ID is user by the layers to select this family) |
− | + | (String) Fractal Label | |
+ | |||
+ | MFRC FORM [...] DATA, byte count | ||
+ | |||
+ | (int) seed | ||
+ | (int) use_bias | ||
+ | (float) bias | ||
+ | (int) use_gain | ||
+ | (float) gain | ||
+ | (int) octaves | ||
+ | (float) octaves_arg | ||
+ | (float) amplitude | ||
+ | (float) freq_x | ||
+ | (float) freq_z | ||
+ | (float) offset_x | ||
+ | (float) offset_z | ||
+ | (int) combination_type | ||
+ | </pre> | ||
− | =='''<font color="orange">LYRS</font>''' - Layers | + | =='''<font color="orange">LYRS</font>''' - Layers== |
=== Layers & Affectors === | === Layers & Affectors === | ||
Line 101: | Line 225: | ||
Can have Affector for texturing, flora, areas... | Can have Affector for texturing, flora, areas... | ||
− | ==''' | + | <pre> |
+ | Boundaries, filters, and affectors can be defined in layers and sublayers, | ||
+ | such that a single location in the terrain can have multiple terrain rules. | ||
+ | A layer without boundaries (or filters) is "unbounded," and can affect as much | ||
+ | as the entire landscape. A layer with a boundary allows the affectors in the | ||
+ | layer and sublayers to be applied to the region specified by the boundary. | ||
+ | </pre> | ||
+ | |||
+ | =='''Affectors'''== | ||
+ | |||
+ | <pre> | ||
+ | 46 4F 52 4D 00 00 00 70 41 46 53 43 46 4F 52 4D 00 00 00 64 FORM...pAFSCFORM...d | ||
+ | 30 30 30 34 46 4F 52 4D 00 00 00 3C 49 48 44 52 46 4F 52 4D 0004FORM....IHDRFORM | ||
+ | 00 00 00 30 30 30 30 31 44 41 54 41 00 00 00 24 01 00 00 00 ...00001DATA........ | ||
+ | 41 66 66 65 63 74 6F 72 46 6C 6F 72 61 43 6F 6C 6C 69 64 61 AffectorFloraCollida | ||
+ | 62 6C 65 43 6F 6E 73 74 61 6E 74 00 44 41 54 41 00 00 00 14 bleConstant.DATA.... | ||
+ | 05 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 80 3F .................... | ||
+ | </pre> | ||
+ | Note: Every Affector has an IHDR child wich is holding the user-custom name of the affector (here AffectorFloraCollidableConstant). | ||
+ | |||
+ | The 4 bytes Before the name is a Bool wich enable/disable the affector. | ||
+ | |||
+ | The affector-specific data is conatined After the IHDR in the last DATA form, it always starts with a byte counter. | ||
+ | |||
{| class="wikitable" align="center" | {| class="wikitable" align="center" | ||
− | |+ ''' | + | |+ '''Boundaries''' |
|- | |- | ||
||'''<font color="purple">BREC</font>'''||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.) | ||'''<font color="purple">BREC</font>'''||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.) | ||
+ | <pre> | ||
+ | 00 00 7A 44 00 00 7A 44 00 00 AF 44 | ||
+ | 00 00 AF 44 00 00 00 00 00 00 80 3F | ||
+ | |||
+ | (float) X1 | ||
+ | (float) Y1 | ||
+ | (float) X2 | ||
+ | (float) Y2 | ||
+ | (int) Feathering Type | ||
+ | (float) Feathering Amount | ||
+ | </pre> | ||
|- | |- | ||
||'''<font color="purple">BCIR</font>'''||Boundary Circle||Delimits a circle using 3 float: Xo, Yo, Radius (Select circle boundary rule properties, including feathering distance, boundary center coords, and boundary radius.) | ||'''<font color="purple">BCIR</font>'''||Boundary Circle||Delimits a circle using 3 float: Xo, Yo, Radius (Select circle boundary rule properties, including feathering distance, boundary center coords, and boundary radius.) | ||
+ | <pre> | ||
+ | 00 00 48 43 00 00 48 43 00 00 48 43 | ||
+ | 01 00 00 00 CD CC CC 3D | ||
+ | |||
+ | (float) X | ||
+ | (float) Y | ||
+ | (float) Radius | ||
+ | (int) Feathering Type | ||
+ | (float) Feathering Amount | ||
+ | </pre> | ||
|- | |- | ||
||'''<font color="purple">BPOL</font>'''||Boundary Polygon||Delimits a n-sided closed polygon area using 2 floats (Xo,Yo) for each point. (Select polygon boundary rule properties, includibng feathering distance and including local water table height, shader and shader size.) | ||'''<font color="purple">BPOL</font>'''||Boundary Polygon||Delimits a n-sided closed polygon area using 2 floats (Xo,Yo) for each point. (Select polygon boundary rule properties, includibng feathering distance and including local water table height, shader and shader size.) | ||
+ | <pre> | ||
+ | Water Area example | ||
+ | |||
+ | 04 00 00 00 00 00 00 00 00 00 00 00 00 00 15 C3 00 00 00 00 .................... | ||
+ | 00 00 15 C3 00 00 15 C3 00 00 00 00 00 00 15 C3 03 00 00 00 .................... | ||
+ | 00 00 48 42 01 00 00 00 00 00 20 C1 00 00 00 40 77 74 65 72 ..HB............wter | ||
+ | 5F 73 70 65 63 00 .spec. | ||
+ | |||
+ | (int) Point Count | ||
+ | |||
+ | - List ----------- | ||
+ | (float) X | ||
+ | (float) Y | ||
+ | ------------------ | ||
+ | |||
+ | (int) Fethering Type | ||
+ | (float) Shore smoothness (0 is vertical, 50 looks normal. I don't know what scale mesurement is used) | ||
+ | (int) Bool Water On/Off | ||
+ | (float) Water Height | ||
+ | (float) Water Shader Size (Common size = 2) | ||
+ | (string) Water Shader (wter_spec = Look in the file header??) | ||
+ | </pre> | ||
+ | |||
|- | |- | ||
||'''<font color="purple">BPLN</font>'''||Boundary PolyLine||Delimits a n-sided line area using 2 floats (Xo,Yo) for each point and a float for the width. (Select polyline boundary rule properties, including feathering distance and width.) | ||'''<font color="purple">BPLN</font>'''||Boundary PolyLine||Delimits a n-sided line area using 2 floats (Xo,Yo) for each point and a float for the width. (Select polyline boundary rule properties, including feathering distance and width.) | ||
− | + | <pre> | |
− | + | 08 00 00 00 00 00 80 3E 00 00 00 3F 00 00 00 00 00 00 74 41 | |
+ | 00 00 0C C1 00 00 E8 41 00 00 0C C1 00 00 50 42 00 00 78 C1 | ||
+ | 00 80 85 42 00 00 D8 C1 00 80 91 42 00 00 12 C2 00 00 93 42 | ||
+ | 00 00 41 C2 00 00 94 42 01 00 00 00 00 00 80 3F 00 00 20 41 | ||
+ | |||
+ | (int) Point Count | ||
+ | |||
+ | - List ----------- | ||
+ | (float) X | ||
+ | (float) Y | ||
+ | ------------------ | ||
+ | |||
+ | (int) Feathering Type | ||
+ | (float) Feathering Amount | ||
+ | (float) Line Width | ||
+ | </pre> | ||
|- | |- | ||
|} | |} | ||
+ | Note: '''Boundaries can have a special footer allowing them to behave as a water area.'''(TODO) | ||
− | {| class="wikitable" | + | {| class="wikitable" align="center" |
− | |+ ''' | + | |+ '''Filters''' |
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">FDIR</font>'''||Filter Direction||Select filter direction rule properties, including feathering distance, and min and max angle settings for filter setting to have effect. |
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">FFRA</font>'''||Filter Fractal||Delimits an area generated by a 2d fractal on the ground. (Select filter fractal rule properties incuding fractal family, low and high fractal settings and feathering distance.) |
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">FHGT</font>'''||Filter Height||Select filter height rule properties, including feathering, distance, filter low height, and filter high height. |
+ | |- | ||
+ | ||'''<font color="purple">FSLP</font>'''||Filter Slope||Select filter slope rule properties, including feathering distance, filter min angle, and filter max angle. | ||
+ | <pre> | ||
+ | 00 00 00 00 00 00 C8 41 01 00 00 00 CD CC 8C | ||
+ | |||
+ | (float) Minimum Angle | ||
+ | (float) Maximum Angle | ||
+ | (int) Type? | ||
+ | (byte) ? | ||
+ | (byte) ? | ||
+ | (byte) ? | ||
+ | Note the 3 last bytes may be a color. | ||
+ | </pre> | ||
|- | |- | ||
|} | |} | ||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
− | |+ ''' | + | |+ '''Texture / Shaders Affectors''' |
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">ASCN</font>'''||Affector Shader Constant||Affect a shader using the family_id and the shader_id this family. (Select rule shader and family and feathering parameters.) |
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">ASRP</font>'''||Affector Shader Replace||Replace a shader with another shader (Select rule shader replace families, including source family (the family to be replaced), destination family (the family to replace with), and feathering parameters.) |
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">ACCN</font>'''||Affector Color Constant||Select color for rule. |
+ | |- | ||
+ | ||'''<font color="purple">FSHD</font>'''||Filter Shader||Select filter shader rule properties, including shader family. | ||
|- | |- | ||
|} | |} | ||
Line 144: | Line 365: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | |+ ''' | + | |+ '''Terrain Affectors''' |
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">AHCN</font>'''||Affector Height Constant||Raises or lowers the ground using float for delta and float(scalar?) for slope-smooting. (Select terrain height value for rule.) |
+ | <pre> | ||
+ | 01 00 00 00 00 00 C8 C2 | ||
+ | |||
+ | (int) ukn | ||
+ | (float) Final Height | ||
+ | </pre> | ||
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">AHFR</font>'''||Affector Height Fractal||Raises or lowers the ground irregulary using a fractal type from the Fractal Family. Float for delta and float(scalar?) (Select terrain height value for rule for fractal family.) |
+ | <pre> | ||
+ | 50 41 52 4D 00 00 00 0C 02 00 00 00 00 00 00 00 00 00 48 C2 | ||
+ | |||
+ | (String) PARAM | ||
+ | (int) Byte Count | ||
+ | (int) Index of a Fractal Family in MGRP -non regular- | ||
+ | (?) ukn | ||
+ | (float) Height Delta, can be negative | ||
+ | </pre> | ||
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">AHTR</font>'''||Affector Height Terrace||Select terrace height and flat ratio values for rule. |
− | + | ||
− | + | ||
|- | |- | ||
|} | |} | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
− | |+ ''' | + | |+ '''Flora Affectors''' |
− | + | ||
− | + | ||
|- | |- | ||
+ | ||'''<font color="purple">AFSC</font>'''||Affector Flora Static Collidable||Sets the amount of collidable flora. (Select to add/remove flora, specify flora type and set flora density for static collidable flora.) | ||
+ | <pre> | ||
+ | 05 00 00 00 01 00 00 00 00 00 00 00 | ||
+ | 01 00 00 00 00 00 80 3F | ||
+ | (int) Index of a family in FGRP -not regular- | ||
+ | (int) ukn | ||
+ | (?) ukn | ||
+ | (int) ukn | ||
+ | (float) Feathering | ||
+ | </pre> | ||
|- | |- | ||
− | + | ||'''<font color="purple">AFSN</font>'''||Affector Flora Static Non-Collidable||Sets the amount of Non-collidable flora. (Select to add/remove flora, specify flora type and set flora density for static non-collidable flora.) | |
+ | |- | ||
+ | ||'''<font color="purple">AFDN</font>'''||Affector Flora Dynamic Near||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. (Select to add/remove flora, specify flora type and set flora destiny for dynamic near flora.) | ||
+ | |- | ||
+ | ||'''<font color="purple">AFDF</font>'''||Affector Flora Dynamic Far|| (Select to add/remove flora, specify flora type and set flora density for dynamic far flora.) | ||
|- | |- | ||
|} | |} | ||
Line 169: | Line 416: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | |+ '''Unknown | + | |+ '''Unknown''' |
|- | |- | ||
||'''<font color="purple">AENV</font>'''||Environment||Select enviroment group rule properties. | ||'''<font color="purple">AENV</font>'''||Environment||Select enviroment group rule properties. | ||
|- | |- | ||
− | ||'''<font color="purple"> | + | |
+ | ||'''<font color="purple">AEXC</font>'''||Affector Exclude||This one shows up on the Patent App. | ||
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">AROA</font>'''||Affector Road||Select road rule properties, including width, shader, feathering height distance, and feathering shader distance. |
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">ARIV</font>'''||Affector River||Select river rule properties, including width, trench depth, flow velocity, bank and bottom shaders, water shader, water depth, water width, feathering distance. |
|- | |- | ||
− | ||'''<font color="purple"> | + | ||'''<font color="purple">ACRF</font>'''||Affector Color Ramp Fractal||Select rule family and color ramp. |
+ | |- | ||
+ | ||'''<font color="purple">ACRH</font>'''||Affector Color Ramp Height||Select rule color ramp and height low/high values. | ||
|- | |- | ||
|} | |} | ||
− | == | + | == Example == |
− | ... | + | <pre> |
+ | |||
+ | 1. Layer | ||
+ | |||
+ | a. AffectorHeightConstant, 10 | ||
+ | |||
+ | b. AffectorShaderConstant, Rock | ||
+ | |||
+ | 2. Layer | ||
+ | |||
+ | a. BoundaryCircle, x=500, y=500, r=500, feather=InOut | ||
+ | |||
+ | b. AffectorHeightConstant, 0 | ||
+ | |||
+ | c. AffectorShaderConstant, Mud | ||
+ | |||
+ | d. Layer | ||
+ | |||
+ | i. FilterHeightmin=13,max=17 | ||
+ | |||
+ | ii. AffectorColorConstant, BLACK | ||
+ | |||
+ | 3. Layer | ||
+ | |||
+ | a. BoundaryRectangle, min=-500, -500, max=500, 500 | ||
+ | |||
+ | b. AffectorFloraStaticCollidableConstant, Conifer | ||
+ | |||
+ | c. AffectorFloraDynamicNearConstant, Dead grass | ||
+ | |||
+ | </pre> | ||
+ | '''Description''' | ||
+ | <pre> | ||
+ | Using the example rules listed above, the corresponding rule | ||
+ | description can perform the following: | ||
+ | |||
+ | 1. Set the height of the terrain everywhere to 10 meters(1a) and assign the rock shader(1b). | ||
+ | |||
+ | 2. Then, in a 500 meter circle(2a) originating from coordinates (500, 500), | ||
+ | gradually decrease the height from 10 meters to 0 meters(2b), place the mud shader(2c), | ||
+ | and create a black band where the height of the terrain at a given sample point is between 13 and 17 meters.(2d, 2di, 2dii) | ||
+ | |||
+ | 3. Finally, in a rectangle(3a) from coordinates (-500, -500) to (500, 500), place | ||
+ | conifer trees(3b) and dead grass(3c) within the rectangle. | ||
+ | </pre> |
Latest revision as of 15:36, 2 July 2011
FileFormat - TRN
SWGANH Wiki is a repository of Star Wars Galaxies Developer information. This site is only meant to be used by SWGANH Developer team.
File Header
The general map parameters, as well as flora parameters are defined here
4A 3A 5C 73 77 67 5C 63 75 72 72 65 6E 74 5C 64 61 74 61 5C J..swg.current.data. 73 6B 75 2E 30 5C 73 79 73 2E 73 68 61 72 65 64 5C 62 75 69 sku.0.sys.shared.bui 6C 74 5C 67 61 6D 65 5C 74 65 72 72 61 69 6E 5C 64 61 6E 74 lt.game.terrain.dant 6F 6F 69 6E 65 2E 74 72 6E 00 00 00 80 46 00 00 00 41 02 00 ooine.trn....F...A.. 00 00 01 00 00 00 CD CC CC BD 00 00 00 40 77 74 65 72 5F 64 ..............wter.d 61 6E 74 5F 6C 61 6B 65 00 00 30 04 46 00 00 00 00 00 00 00 ant.lake..0.F....... 43 00 00 00 41 00 00 00 40 00 00 00 00 00 00 00 00 00 00 80 C...A............... 42 00 00 80 40 00 00 00 3F 00 00 00 00 00 00 00 00 00 00 F0 B................... 41 00 00 80 3F 00 00 00 00 00 00 00 00 00 00 00 43 00 00 00 A...............C... 44 00 00 00 42 00 00 00 41 00 00 00 00 D...B...A....
TGEN - Terrain Generator
The rules in the terrain generation system are also referred to as affectors,and are organized into layers. Boundaries refer to terrain designer- or artist-defined regions of virtual terrain for which the desired rules have effect. Filters refer to conditions to be considered when applying affectors. Layers can be arranged in a hierarchy with a parent-child or tree-leaf relationship. Examples of boundaries include circles, rectangles, and polygons. Examples of filters include filtering by slope, height, shader, direction and fractal. Examples of affectors include those that affect height, color, shader, flora, and radial flora. Boundaries, filters and layers are described in greater detail below. The terrain generation system also includes families, which refer to groups of assets such as textures, geometry or even algorithms. Families can include children with weights. This could involve choosing an asset by selecting a one weighted child. For example, this could allow the users to choose a "grass" family for a region, but when the terrain system generates the grass family, it can choose one of the children of the grass family, which results in the rendering of a single grass shader. Examples of families include shader families, blend families, flora families, radial flora families, and fractal families. Shader families refer to grouping shaders for placing textures. Blend families refer to grouping shaders for selecting alpha blend masks. Flora families refer to grouping geometry for selecting flora. Radial flora families refer to grouping shaders for placing radial flora. Fractal families refer to grouping fractals for reuse within different rules.
Terrain generator (form name : TGEN)
There are 6 different sections.
- The Shader family (SGRP) - The Flora family (FRGP) - The Radial Flora family (RGRP) - The Environment family (EGRP) - The Fractal family (MGRP) - The Layers family (LYRS)
SGRP - Shader Family Group
Shader families refer to grouping shaders for placing textures
It's sub-divied into multiple surface families (SFAM).
Each one of them declare mutliple shaders using a surface file.
SGRP has x children (SFAM), SFAM has x children (Shaders)
Family break-down:
53 46 41 4D 00 00 00 55 22 00 00 00 73 6E 6F 77 5F 6D 74 6E SFAM...U....snow.mtn 73 70 65 61 6B 00 61 62 73 74 72 61 63 74 2F 74 65 72 72 61 speak.abstract.terra 69 6E 5F 73 75 72 66 61 63 65 2F 73 6E 6F 77 2E 69 66 66 00 in.surface.snow.iff. FF FF 00 00 00 00 40 00 00 80 3F 01 00 00 00 ............... (int) Family ID (This ID is user by the layers to select this family) (String) File Name (byte)(byte)(byte) unk ?Color? (float) unk (float) unk (int) Child Count
Child break-down:
73 6E 6F 77 5F 6D 74 6E 73 70 65 61 6B 00 00 00 80 3F snow.mtnspeak..... (string) Shader Name (float) unk
FGRP - Flora Family Group
Flora families refer to grouping geometry -apt files- for selecting flora. (Select flora group properties, including flora family data)
Each one of them decalre one flora group using multiple appearance files.
FGRP has x children (FFAM), FFAM has x children (Appearance Files)
Family break-down:
46 46 41 4D 00 00 00 9D 01 00 00 00 66 65 72 6E 73 00 FF 80 FFAM........ferns... 40 00 00 80 3F 00 00 00 00 02 00 00 00 ............. (int) Family ID (This ID is user by the layers to select this family) (String) Family Name (byte)(byte)(byte) ukn ?Color? (float) ukn (float) ukn (int) Child Count
Child break-down:
70 74 63 68 5F 65 6E 64 72 5F 66 72 73 74 5F 63 6C 75 73 74 ptch.endr.frst.clust 65 72 5F 61 31 2E 61 70 74 00 00 00 80 3F 00 00 00 00 0A D7 er.a1.apt........... 23 3C CD CC CC 3D 01 00 00 00 01 00 00 00 00 00 40 3F 00 00 .................... 20 40 .. (String) Appearance File Name (float) ukn (int) ukn (float) ukn (float) ukn (int) ukn (int) ukn (float) ukn (float) ukn
RGRP - Radial Flora Family Group
Radial flora families refer to grouping shaders for placing radial flora.
Family break-down:
52 46 41 4D 00 00 01 06 01 00 00 00 67 72 61 73 73 79 20 70 RFAM........grassy.p 6C 61 69 6E 73 00 FF FF 00 00 00 80 3F 04 00 00 00 lains............ (int) Family ID (This ID is user by the layers to select this family) (String) Family Name (byte)(byte)(byte) ukn ?Color? (float) ukn (int) Child Count
Child break-down:
(String) Shader Name (dds file) (float) ukn (float) ukn (float) ukn (float) ukn (int) ukn (float) ukn (float) ukn (int) ukn (?) ukn TODO..
EGRP - Environment Family Group
Declares the environement
EGRP has x children (EFAM)
Child break-down:
01 00 00 00 6D 61 69 6E 5F 62 61 73 65 00 FF FF 00 00 00 80 3F ....main.base........ (int) Environment ID (This ID is user by the layers to select this environment) (String) Environment Name (byte)(byte)(byte) ukn ?Color? (float) ukn
MGRP - Fractal Family Group
Fractal families refer to grouping fractals for reuse within different rules. It's sub-divied into multiple groups (MFAM). Each one of them declare a labelled fractal.
MGRP has x children (MFAM)
Child break-down:
4D 46 41 4D 44 41 54 41 00 00 00 1C 01 00 00 00 41 66 66 65 MFAMDATA........Affe 63 74 6F 72 48 65 69 67 68 74 46 72 61 63 74 61 6C 5F 31 00 ctorHeightFractal.1. 46 4F 52 4D 00 00 00 4C 4D 46 52 43 46 4F 52 4D 00 00 00 40 FORM...LMFRCFORM.... 30 30 30 31 44 41 54 41 00 00 00 34 00 00 00 00 00 00 00 00 0001DATA...4........ 00 00 00 3F 00 00 00 00 33 33 33 3F 02 00 00 00 00 00 80 40 ........333......... 00 00 00 3F 0A D7 23 3C 0A D7 23 3C 00 00 00 00 00 00 00 00 .................... 00 00 00 00 (int) Fractal ID (This ID is user by the layers to select this family) (String) Fractal Label MFRC FORM [...] DATA, byte count (int) seed (int) use_bias (float) bias (int) use_gain (float) gain (int) octaves (float) octaves_arg (float) amplitude (float) freq_x (float) freq_z (float) offset_x (float) offset_z (int) combination_type
LYRS - Layers
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.
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...
Boundaries, filters, and affectors can be defined in layers and sublayers, such that a single location in the terrain can have multiple terrain rules. A layer without boundaries (or filters) is "unbounded," and can affect as much as the entire landscape. A layer with a boundary allows the affectors in the layer and sublayers to be applied to the region specified by the boundary.
Affectors
46 4F 52 4D 00 00 00 70 41 46 53 43 46 4F 52 4D 00 00 00 64 FORM...pAFSCFORM...d 30 30 30 34 46 4F 52 4D 00 00 00 3C 49 48 44 52 46 4F 52 4D 0004FORM....IHDRFORM 00 00 00 30 30 30 30 31 44 41 54 41 00 00 00 24 01 00 00 00 ...00001DATA........ 41 66 66 65 63 74 6F 72 46 6C 6F 72 61 43 6F 6C 6C 69 64 61 AffectorFloraCollida 62 6C 65 43 6F 6E 73 74 61 6E 74 00 44 41 54 41 00 00 00 14 bleConstant.DATA.... 05 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 80 3F ....................
Note: Every Affector has an IHDR child wich is holding the user-custom name of the affector (here AffectorFloraCollidableConstant).
The 4 bytes Before the name is a Bool wich enable/disable the affector.
The affector-specific data is conatined After the IHDR in the last DATA form, it always starts with a byte counter.
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.)
00 00 7A 44 00 00 7A 44 00 00 AF 44 00 00 AF 44 00 00 00 00 00 00 80 3F (float) X1 (float) Y1 (float) X2 (float) Y2 (int) Feathering Type (float) Feathering Amount |
BCIR | Boundary Circle | Delimits a circle using 3 float: Xo, Yo, Radius (Select circle boundary rule properties, including feathering distance, boundary center coords, and boundary radius.)
00 00 48 43 00 00 48 43 00 00 48 43 01 00 00 00 CD CC CC 3D (float) X (float) Y (float) Radius (int) Feathering Type (float) Feathering Amount |
BPOL | Boundary Polygon | Delimits a n-sided closed polygon area using 2 floats (Xo,Yo) for each point. (Select polygon boundary rule properties, includibng feathering distance and including local water table height, shader and shader size.)
Water Area example 04 00 00 00 00 00 00 00 00 00 00 00 00 00 15 C3 00 00 00 00 .................... 00 00 15 C3 00 00 15 C3 00 00 00 00 00 00 15 C3 03 00 00 00 .................... 00 00 48 42 01 00 00 00 00 00 20 C1 00 00 00 40 77 74 65 72 ..HB............wter 5F 73 70 65 63 00 .spec. (int) Point Count - List ----------- (float) X (float) Y ------------------ (int) Fethering Type (float) Shore smoothness (0 is vertical, 50 looks normal. I don't know what scale mesurement is used) (int) Bool Water On/Off (float) Water Height (float) Water Shader Size (Common size = 2) (string) Water Shader (wter_spec = Look in the file header??) |
BPLN | Boundary PolyLine | Delimits a n-sided line area using 2 floats (Xo,Yo) for each point and a float for the width. (Select polyline boundary rule properties, including feathering distance and width.)
08 00 00 00 00 00 80 3E 00 00 00 3F 00 00 00 00 00 00 74 41 00 00 0C C1 00 00 E8 41 00 00 0C C1 00 00 50 42 00 00 78 C1 00 80 85 42 00 00 D8 C1 00 80 91 42 00 00 12 C2 00 00 93 42 00 00 41 C2 00 00 94 42 01 00 00 00 00 00 80 3F 00 00 20 41 (int) Point Count - List ----------- (float) X (float) Y ------------------ (int) Feathering Type (float) Feathering Amount (float) Line Width |
Note: Boundaries can have a special footer allowing them to behave as a water area.(TODO)
FDIR | Filter Direction | Select filter direction rule properties, including feathering distance, and min and max angle settings for filter setting to have effect. |
FFRA | Filter Fractal | Delimits an area generated by a 2d fractal on the ground. (Select filter fractal rule properties incuding fractal family, low and high fractal settings and feathering distance.) |
FHGT | Filter Height | Select filter height rule properties, including feathering, distance, filter low height, and filter high height. |
FSLP | Filter Slope | Select filter slope rule properties, including feathering distance, filter min angle, and filter max angle.
00 00 00 00 00 00 C8 41 01 00 00 00 CD CC 8C (float) Minimum Angle (float) Maximum Angle (int) Type? (byte) ? (byte) ? (byte) ? Note the 3 last bytes may be a color. |
ASCN | Affector Shader Constant | Affect a shader using the family_id and the shader_id this family. (Select rule shader and family and feathering parameters.) |
ASRP | Affector Shader Replace | Replace a shader with another shader (Select rule shader replace families, including source family (the family to be replaced), destination family (the family to replace with), and feathering parameters.) |
ACCN | Affector Color Constant | Select color for rule. |
FSHD | Filter Shader | Select filter shader rule properties, including shader family. |
AHCN | Affector Height Constant | Raises or lowers the ground using float for delta and float(scalar?) for slope-smooting. (Select terrain height value for rule.)
01 00 00 00 00 00 C8 C2 (int) ukn (float) Final Height |
AHFR | Affector Height Fractal | Raises or lowers the ground irregulary using a fractal type from the Fractal Family. Float for delta and float(scalar?) (Select terrain height value for rule for fractal family.)
50 41 52 4D 00 00 00 0C 02 00 00 00 00 00 00 00 00 00 48 C2 (String) PARAM (int) Byte Count (int) Index of a Fractal Family in MGRP -non regular- (?) ukn (float) Height Delta, can be negative |
AHTR | Affector Height Terrace | Select terrace height and flat ratio values for rule. |
AFSC | Affector Flora Static Collidable | Sets the amount of collidable flora. (Select to add/remove flora, specify flora type and set flora density for static collidable flora.)
05 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 80 3F (int) Index of a family in FGRP -not regular- (int) ukn (?) ukn (int) ukn (float) Feathering |
AFSN | Affector Flora Static Non-Collidable | Sets the amount of Non-collidable flora. (Select to add/remove flora, specify flora type and set flora density for static non-collidable flora.) |
AFDN | Affector Flora Dynamic Near | 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. (Select to add/remove flora, specify flora type and set flora destiny for dynamic near flora.) |
AFDF | Affector Flora Dynamic Far | (Select to add/remove flora, specify flora type and set flora density for dynamic far flora.) |
AENV | Environment | Select enviroment group rule properties. |
AEXC | Affector Exclude | This one shows up on the Patent App. |
AROA | Affector Road | Select road rule properties, including width, shader, feathering height distance, and feathering shader distance. |
ARIV | Affector River | Select river rule properties, including width, trench depth, flow velocity, bank and bottom shaders, water shader, water depth, water width, feathering distance. |
ACRF | Affector Color Ramp Fractal | Select rule family and color ramp. |
ACRH | Affector Color Ramp Height | Select rule color ramp and height low/high values. |
Example
1. Layer a. AffectorHeightConstant, 10 b. AffectorShaderConstant, Rock 2. Layer a. BoundaryCircle, x=500, y=500, r=500, feather=InOut b. AffectorHeightConstant, 0 c. AffectorShaderConstant, Mud d. Layer i. FilterHeightmin=13,max=17 ii. AffectorColorConstant, BLACK 3. Layer a. BoundaryRectangle, min=-500, -500, max=500, 500 b. AffectorFloraStaticCollidableConstant, Conifer c. AffectorFloraDynamicNearConstant, Dead grass
Description
Using the example rules listed above, the corresponding rule description can perform the following: 1. Set the height of the terrain everywhere to 10 meters(1a) and assign the rock shader(1b). 2. Then, in a 500 meter circle(2a) originating from coordinates (500, 500), gradually decrease the height from 10 meters to 0 meters(2b), place the mud shader(2c), and create a black band where the height of the terrain at a given sample point is between 13 and 17 meters.(2d, 2di, 2dii) 3. Finally, in a rectangle(3a) from coordinates (-500, -500) to (500, 500), place conifer trees(3b) and dead grass(3c) within the rectangle.