-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathz_file format.txt
144 lines (132 loc) · 3.87 KB
/
z_file format.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
conventions:
_data [
int32 - number of bytes
byte[] - bytes
Write with:
bw.Write(data.Length);
bw.Write(data);
Read with:
int _len = bw.ReadInt32();
byte[] data = bw.ReadBytes(_len);
]
_vector3 [
float(single) - x
float(single) - y
float(single) - z
Write with:
[BinaryExtensions]
bw.Write(v);
[Default]
bw.Write(v.x);
bw.Write(v.y);
bw.Write(v.z);
Read with:
[BinaryExtensions]
Vector3 v = bw.ReadVector3();
[Default]
Vector3 v = new Vector3(bw.ReadSingle(), bw.ReadSingle(), bw.ReadSingle());
]
_color [
float(single) - r
float(single) - g
float(single) - b
float(single) - a
Write with:
[BinaryExtensions]
bw.Write(c);
[Default]
bw.Write(c.r);
bw.Write(c.g);
bw.Write(c.b);
bw.Write(c.a);
Read with:
[BinaryExtensions]
Vector3 v = bw.ReadColor();
[Default]
Vector3 v = new Color(bw.ReadSingle(), bw.ReadSingle(), bw.ReadSingle(), bw.ReadSingle());
]
_group [ (This is a complex format, which is primarly used to store the new object groups)
Written with BinaryWriter / Read with BinaryReader
string - group name
_vector3 - group's GameObject local position
_vector3 - group's GameObject local rotation
_vector3 - group's GameObject local scale
int32 - number of editor objects
foreach [number of editor objects] (currently, almost the same as v2 format)
bool - prefab
string - name
if [prefab]
int32 - prefab id
_vector3 - position
_vector3 - rotation (euler)
_vector3 - scale
int32 - prefab data (used for enemies, gun id)
else
_vector3 - position
_vector3 - rotation (euler)
_vector3 - scale
int32 - texture index
_color - mesh renderer material color
boolean - bounce
boolean - glass
boolean - lava
boolean - coll disable trigger
boolean - mark as object
int32 - number of groups
foreach [number of groups]
_group as _data - child group
]
[.kme] Karlson Map Editor (v3 format)
Encoded with LZMA: Decompress before reading, Compress before writing.
Written with BinaryWriter / Read with BinaryReader
int32 - Level Data Version (currently 2)
float(single) - grid align
int32 - starting gun
_vector3 - spawn position
float(single) - spawn orientation
int32 - number of custom textures
foreach [number of custom textures]
string - texture name
_data - texture data (Texture2D.EncodeToPNG())
_group as _data - global object group
[.kme] Karlson Map Editor (v2 format)
Encoded with LZMA: Decompress before reading, Compress before writing.
Written with BinaryWriter / Read with BinaryReader
int32 - Level Data Version (currently 2)
float(single) - grid align
int32 - starting gun
_vector3 - spawn position
float(single) - spawn orientation
int32 - number of custom textures
foreach [number of custom textures]
string - texture name
_data - texture data (Texture2D.EncodeToPNG())
int32 - number of objects
foreach [number of objects]
bool - prefab
string - name
string - group
if [prefab]
int32 - prefab id
_vector3 - position
_vector3 - rotation (euler)
_vector3 - scale
int32 - prefab data (used for enemies, gun id)
else
_vector3 - position
_vector3 - rotation (euler)
_vector3 - scale
int32 - texture index
_color - mesh renderer material color
boolean - bounce
boolean - glass
boolean - lava
boolean - coll disable trigger
boolean - mark as object
[.kwm] Karlson Workshop Map
Written with BinaryWriter / Read with BinaryReader
byte[] - "KWM" (ascii encoding, magic)
string - Name
string - Author
_data - thumbnail [compressed]
_data - .kme data (already compressed)