(.NED) FILE FORMAT
v4.2(release) (c) Laurent CANCé Françis (LCF) 2002-2013
The format has been frequently updated during three years, so, informations stored
are parametrized by flags that aren't all explicited.
The form behind symbolize the current main informations of the file format.
HEADER
1 | dword | string "NED" | ||
256 | char | string comment | ||
1 | dword | WOs | ||
1 | dword | WOADDs | ||
1 | dword | Lights | ||
1 | dword | SHRs | ||
1 | dword | Textures | ||
1 | dword | Script | ||
1 | dword | BSP | ||
1 | dword | Bumpmap | ||
1 | dword | EditInfo | ||
1 | dword | Trees | ||
1 | dword | WP | ||
1 | dword | Lightmaps | ||
1 | dword | TempNodes | ||
1 | dword | WeightsIndices | ||
1 | dword | DATAS | ||
1 | dword | Compressed | ||
1 | byte | jpeg2000 compression | ||
1 | byte | var1 | ||
1 | byte | var2 | ||
1 | byte | scripted | ||
1 | byte | props | ||
1 | byte | vegetaux | ||
1 | byte | var4 | ||
1 | byte | var5 | ||
1 | byte | param1 | ||
1 | byte | param2 | ||
1 | byte | param3 | ||
1 | byte | param4 | ||
1 | byte | comment1 | ||
1 | byte | comment2 | ||
1 | byte | comment3 | ||
1 | byte | comment4 | ||
1 | byte | sndcomment1 | ||
1 | byte | sndcomment2 | ||
1 | byte | sndcomment3 | ||
1 | byte | sndcomment4 | ||
1 | byte | misc1 | ||
1 | byte | misc2 | ||
1 | byte | misc3 | ||
1 | byte | misc4 | ||
1 | byte | smooth | ||
1 | byte | misc5 | ||
1 | byte | misc6 | ||
1 | byte | misc7 | ||
1 | dword | persoscript | ||
1 | dword | persos |
SECTIONS ORDER
if (comment1) [GENERAL COMMENT]
4096 | char | string comment on file |
if (comment4) [THUMB]
1 | dword | size | ||
size | bytes | PNG thumbnail |
if (comment3) [ANIM SCRIPT SECTION]
1 | dword | size_script | ||
size_script | char | script anim |
if (smooth) [SMOOTHING FLAGS LIST]
2048 | char | smooth:1 no smooth on object:0 |
if (comment2) [ANIM SECTION]
4 | char | string "ANM" | ||
1 | dword | LZ Compress (see vc98 project) | ||
1 | dword | anim state | ||
1 | dword | n° key | ||
1 | dword | (reserved) | ||
1 | dword | nb keys | ||
1 | float | speed | ||
2048 | bytes | tags | ||
1 | dword | nbWO | ||
1 | dword | nbWOADD | ||
3 | float | vector start_camera | ||
3 | float | vector start_target | ||
3 | float | vector start_decal | ||
1 | float | start_zoom |
x (nb keys) (n)
. | 3 | float | vector array[n].camera | ||
. | 3 | float | vector array[n].target | ||
. | 3 | float | vector array[n].decal | ||
. | 1 | float | vector array[n].zoom |
x nbWO
. | 3 | float | vector start_position | ||
. | 3 | float | vector start_rotation | ||
. | x (nb keys) (n) | ||||
. | 3 | float | vector array[n].position[nk] | ||
. | 3 | float | vector array[n].rotation[nk] | ||
. | 3 | float | float array[n].keys[nk] |
x (nbWOADD)
. | 3 | float | vector start_position | ||
. | 3 | float | vector start_rotation | ||
. | x (nb keys) (n) | ||||
. | 3 | float | vector array[n].position[nk] | ||
. | 3 | float | vector array[n].rotation[nk] | ||
. | 4 | float | quaternion array[n].quaternion[nk] | ||
. | 3 | float | float array[n].keysadd[nk] |
if (EditInfo eq 1) [EDIT]
1 | dword | SelectedWO | ||
1 | dword | PrevWO | ||
1 | dword | Rendering | ||
1 | dword | Lights toggle | ||
1 | dword | SelectFaces toggle | ||
1 | byte | (reserved) | ||
1 | dword | XDep | ||
1 | byte | (reserved) | ||
1 | dword | YDep | ||
1 | byte | (reserved) | ||
1 | dword | Zoom | ||
1 | byte | (reserved) | ||
1 | dword | GLOW |
1 | dword | (reserved) | ||
1 | dword | (reserved) | ||
1 | dword | (reserved) | ||
1 | dword | (reserved) | ||
1 | dword | (reserved) | ||
1 | dword | (reserved) |
if (var4) [COLORS]
4 | float | AMBIENT RGBA | ||
4 | float | DAYLIGHT RGBA | ||
4 | float | DEFAULTLIGHTCOLOR RGBA | ||
3 | float | DAYLIGHTVECTOR (xyz) |
if (vegetaux eq 1) [GENERATED PLANTS SECTION]
(LZ77 buffer)
1 | dword | nPlants |
x (nPlants)
. | 1 | dword | dep | ||
. | 1 | float | p1 | ||
. | 1 | float | p2 | ||
. | 1 | float | p3 | ||
. | 1 | float | p4 | ||
. | 1 | float | p5 | ||
. | 1 | float | p6 | ||
. | 1 | float | p7 | ||
. | 1 | float | p8 | ||
. | 1 | float | size | ||
. | 1 | dword | tex[0] | ||
. | 1 | dword | tex[1] | ||
. | 1 | dword | tex[2] | ||
. | 1 | dword | tex[3] | ||
. | 1 | dword | tex[4] | ||
. | 1 | dword | bump[0] | ||
. | 1 | dword | bump[1] | ||
. | 1 | dword | bump[2] | ||
. | 1 | dword | bump[3] | ||
. | 1 | dword | bump[4] | ||
. | 3 | float | position |
if (vegetaux eq 2) [GENERATED PLANTS SECTION]
(LZ77 buffer)
1 | dword | nPlants |
x (nPlants)
. | 1 | dword | dep | ||
. | 1 | float | p1 | ||
. | 1 | float | p2 | ||
. | 1 | float | p3 | ||
. | 1 | float | p4 | ||
. | 1 | float | p5 | ||
. | 1 | float | p6 | ||
. | 1 | float | p7 | ||
. | 1 | float | p8 | ||
. | 1 | float | size | ||
. | 1 | dword | tex[0] | ||
. | 1 | dword | tex[1] | ||
. | 1 | dword | tex[2] | ||
. | 1 | dword | tex[3] | ||
. | 1 | dword | tex[4] | ||
. | 1 | dword | bump[0] | ||
. | 1 | dword | bump[1] | ||
. | 1 | dword | bump[2] | ||
. | 1 | dword | bump[3] | ||
. | 1 | dword | bump[4] | ||
. | 3 | float | position | ||
. | 1 | dword | onlyleafs |
if (vegetaux eq 3) [GENERATED PLANTS SECTION]
(LZ77 buffer)
1 | dword | nPlants |
x (nPlants)
. | 1 | dword | dep | ||
. | 1 | float | p1 | ||
. | 1 | float | p2 | ||
. | 1 | float | p3 | ||
. | 1 | float | p4 | ||
. | 1 | float | p5 | ||
. | 1 | float | p6 | ||
. | 1 | float | p7 | ||
. | 1 | float | p8 | ||
. | 1 | float | size | ||
. | 1 | float | m1 | ||
. | 1 | float | m2 | ||
. | 1 | float | m3 | ||
. | 1 | float | m4 | ||
. | 1 | float | m5 | ||
. | 1 | float | m6 | ||
. | 1 | float | m7 | ||
. | 1 | float | m8 | ||
. | 1 | dword | tex[0] | ||
. | 1 | dword | tex[1] | ||
. | 1 | dword | tex[2] | ||
. | 1 | dword | tex[3] | ||
. | 1 | dword | tex[4] | ||
. | 1 | dword | bump[0] | ||
. | 1 | dword | bump[1] | ||
. | 1 | dword | bump[2] | ||
. | 1 | dword | bump[3] | ||
. | 1 | dword | bump[4] | ||
. | 3 | float | position | ||
. | 1 | dword | onlyleafs |
if (WP) | [WORLD PARTS SECTION] |
if (param1) [PACK!]
(LZ77 buffer)
1 | dword | nbWO |
x nbWO
. | 1 | dword | nv | |||
. | 1 | dword | nf | |||
. | 3 | float | position | |||
. | 3 | float | rotation | |||
. | 3 | float | min | |||
. | 3 | float | max | |||
. | x | (nv) | ||||
. | . | 3 | word | x,y,z (min + c*(max-min)/65535) | ||
. | . | 2 | float | coo. mapping | ||
. | . | 2 | float | coo. lightmap | ||
. | x | (nf) | ||||
. | . | 3 | word | v0,v1,v2 | ||
. | x | (nf) | ||||
. | . | uint24 | (nT:11,tag:3,res:3,lock:4) | |||
. | x | (nf) | ||||
. | . | uint24 | nL | |||
. | x | (nf) | ||||
. | . | uint24 | nLV |
else [NOT PACK!]
if (Compressed)
(LZ77 buffer)
1 | dword | nbWO |
x nbWO
. | 1 | dword | nv | |||
. | 1 | dword | nf | |||
. | 3 | float | position | |||
. | 3 | float | rotation | |||
. | x | (nv) | ||||
. | . | 3 | float | x,y,z (min + c*(max-min)/65535) | ||
. | . | 2 | float | coo. mapping | ||
. | . | 2 | float | coo. lightmap | ||
. | x | (nf) | ||||
. | . | 3 | dword | v0,v1,v2 | ||
. | . | 1 | dword | nT | ||
. | . | 1 | dword | nL | ||
. | . | 1 | dword | nLV | ||
. | . | 1 | byte | ref | ||
. | . | 1 | byte | lock | ||
. | . | 1 | word | (reserved) | ||
. | . | 1 | dword | tag |
if (Lightmaps eq 3) [LIGTHMAPS SECTION]
1 | dword | size_lightmap | |||
1 | dword | nb | |||
x (nb) | |||||
. | 1 | dword | size : len=size_lightmap*size/4 | ||
. | 1 | dword | compressed size (cs) | ||
. | offset compressed data | ||||
. | (cs) | byte | data LZ77 (if var1=0 then SUB4 else SUB3) |
if (Lightmaps eq 5) [LIGTHMAPS SECTION]
1 | dword | size_lightmap | |||
1 | dword | nb | |||
x (nb) | |||||
. | 1 | dword | size : len=size_lightmap*size/4 : cs=len*len*3 | ||
. | offset (compressed [0,1,2] NORMAL,SUB,SUB4) | ||||
. | (cs) | byte | data RGB |
if (WOs) [WORLD OBJECTS]
[PACK!]
(LZ77 buffer)
1 | word | nb | |||
x | (nb) | ||||
. | 64 | char | Name | ||
. | 1 | word | nv | ||
. | 1 | word | nf | ||
. | 3 | float | position | ||
. | 3 | float | rotation | ||
. | 1 | byte | attribut | ||
. | 6x4 | float | a,b,c,d | ||
. | 1 | word | nP | ||
. | 1 | word | status | ||
. | 1 | word | affect | ||
. | 3 | float | min | ||
. | 3 | float | max | ||
. | x | (nv) | |||
. | . | 3 | word | x,y,z | |
. | . | 2 | float | u,v | |
. | x | (nf) | |||
. | . | 3 | word | v0,v1,v2 | |
. | . | 1 | word | nT | |
. | . | 1 | char | ref | |
. | . | 1 | char | lock | |
. | . | 1 | word | tag |
[NOT PACK!]
(LZ77 buffer)
1 | dword | nb | |||
x | (nb) | ||||
. | 128 | char | Name | ||
. | 1 | dword | nv | ||
. | 1 | dword | nf | ||
. | 3 | float | position | ||
. | 3 | float | rotation | ||
. | 1 | word | attribut | ||
. | 6x4 | float | a,b,c,d | ||
. | 1 | dword | nP | ||
. | 1 | dword | status | ||
. | 1 | dword | affect | ||
. | x | (nv) | |||
. | . | 3 | float | x,y,z | |
. | . | 2 | float | u,v | |
. | x | (nf) | |||
. | . | 3 | dword | v0,v1,v2 | |
. | . | 1 | dword | nT | |
. | . | 1 | char | ref | |
. | . | 1 | char | lock | |
. | . | 1 | dword | tag |
if (WOADDs) [WORLD OBJECTS ADDED]
[PACK!]
(LZ77 buffer)
1 | word | nb | |||
x | (nb) | ||||
. | 64 | char | Name | ||
. | 1 | word | nv | ||
. | 1 | word | nf | ||
. | 3 | float | position | ||
. | 3 | float | rotation | ||
. | 1 | word | status | ||
. | 1 | word | nkeys | ||
. | if (sndcomment2) | ||||
. | 1 | char | env mapping | ||
. | if (scripted) | ||||
. | x | char | string | ||
. | 1 | dword | |||
while ( not -1) | |||||
. | . | 3 | float | position[object][nn] | |
. | . | 3 | float | rotation[object][nn] | |
. | . | 3 | float | scale[object][nn] | |
. | . | 1 | dword | ||
. | . | if (nkeys eq 0) | |||
. | . | 3 | float | min | |
. | . | 3 | float | max | |
. | . | x (nv) | |||
. | . | . | 3 | word | x,y,z |
. | . | . | 2 | float | x,y |
. | . | if (nkeys sup 0) | |||
. | . | 3 | float | min | |
. | . | 3 | float | max | |
. | . | x nkeys | |||
. | . | . | x (nv) | ||
. | . | . | . | 3 word | x,y,z |
. | . | x (nf) | |||
. | . | . | 3 | word | v0,v1,v2 |
. | . | . | 1 | word | nT |
. | . | . | 1 | word | nT2 |
[NOT PACK!]
(LZ77 buffer)
1 | dword | nb | |||
x | (nb) | ||||
. | 128 | char | Name | ||
. | 1 | dword | nv | ||
. | 1 | dword | nf | ||
. | 3 | float | position | ||
. | 3 | float | rotation | ||
. | 1 | dword | status | ||
. | 1 | dword | nkeys | ||
. | if (sndcomment2) | ||||
. | 1 | char | env mapping | ||
. | if (scripted) | ||||
. | x | char | string | ||
. | 1 | dword | |||
while ( not -1) | |||||
. | . | 3 | float | position[object][nn] | |
. | . | 3 | float | rotation[object][nn] | |
. | . | 3 | float | scale[object][nn] | |
. | . | 1 | dword | ||
. | . | if (nkeys eq 0) | |||
. | . | 3 | float | min | |
. | . | 3 | float | max | |
. | . | x (nv) | |||
. | . | . | 3 | float | x,y,z |
. | . | . | 2 | float | x,y |
. | . | if (nkeys sup 0) | |||
. | . | x nkeys | |||
. | . | . | x (nv) | ||
. | . | . | . | 3 float | x,y,z |
. | . | x (nf) | |||
. | . | . | 3 | dword | v0,v1,v2 |
. | . | . | 1 | dword | nT |
. | . | . | 1 | dword | nT2 |
if (props)
1024 | byte | tags |
if (Lights)
1 | dword | nlights |
x (nlights)
. | 3 | float | position | ||
. | 3 | float | RGB | ||
. | 1 | float | attenuation | ||
. | 1 | float | range |
if (Trees)
1 | dword |
while ( not -1)
. | x | byte | [TREE] data | ||
. | 1 | dword |
if (TemporaryNodes)
1 | dword |
while ( not -1)
. | 1 | dword | nNodes | ||
. | if (nNodes sup 0) | ||||
. | x (nNodes) | ||||
. | 3 | float | pivot | ||
. | 1 | dword | nb | ||
. | . | x (nb) | |||
. | . | 1 | dword | id | |
. | 1 | dword |
if (WeightsIndices)
(LZ77 buffer)
1 | dword (n) |
while (n not -1)
. | 1 | dword | nv | ||
. | x (nv) | object (n) | |||
. | . | 4 | dword | index | |
. | . | 4 | dword | weights | |
. | 1 | dword (n) |
if (Textures)
1 | dword (n) |
while (n not -1)
. | 1 | dword | res | ||
. | if (res esup 0) [texture] | ||||
. | 1 | dword | fog | ||
. | if (jpeg2000 eq 0) | ||||
. | 1 | dword | opacite | ||
. | 1 | dword | size | ||
. | size | byte | compressed PNG | ||
. | if (jpeg2000 eq 0) | ||||
. | 1 | dword | opacite | ||
. | 1 | dword | size | ||
. | size | byte | compressed JPEG2000 | ||
. | if (res eq -2) [texture script] | ||||
. | . | ||||
. | 1 | dword (n) |
if (BumpMap)
1 | dword (n) |
while (n not -1)
. | 1 | dword | res | ||
. | if (res esup 0) [texture] | ||||
. | 1 | dword | x | ||
. | 1 | dword | y | ||
. | if (compressed) | ||||
. | . | if (jpeg2000 eq 0) | |||
. | . | 1 | dword | csize | |
. | . | csize | byte | LZ77 data | |
. | . | if (jpeg2000 not 0) | |||
. | . | 1 | dword | csize | |
. | . | if (x,y inf 32) | |||
. | . | csize | byte | void | |
. | . | else | |||
. | . | csize | byte | JPEG2000 data | |
. | if (compressed eq 0) | ||||
. | . | x*y | byte | RAW data | |
. | 1 | dword (n) |
END
more informations about:
[TREE]
1 | dword | nb | |||
1 | dword | tag | |||
3 | float | position | |||
3 | float | rotation | |||
3*(nb) | float | positions | |||
3*(nb) | float | eulers | |||
4*(nb) | float | quaternions | |||
18*(nb) int | corres [NB,-1=root,x,x,x,x,x...] | ||||
256*(nb) 3 float | eulers | // animation | |||
256*(nb) 3 float | trans | ||||
256*(nb) 3 float | scales | ||||
256*(nb) 4 float | quats | ||||
4*4*(nb) | float | palette |
[LZ77 buffer]
PNG LZ77 style buffer
1 | dword | CSize | |||
1 | dword | Size | |||
(CSize) byte | data |