Skip to content

Commit 41edfd3

Browse files
committed
added skmaster_dat and aiv
0 parents  commit 41edfd3

File tree

3 files changed

+321
-0
lines changed

3 files changed

+321
-0
lines changed

maps/structs/section1125.ksy

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
meta:
2+
id: section1125
3+
license: CC0-1.0
4+
endian: le
5+
seq:
6+
- id: player_names
7+
type: strz
8+
size: 90
9+
encoding: utf-8
10+
repeat: expr
11+
repeat-expr: 9
12+
- id: player_active
13+
type: u1
14+
repeat: expr
15+
repeat-expr: 9
16+
- id: padding0
17+
contents: [0x00]
18+
- id: gold
19+
type: s4
20+
repeat: expr
21+
repeat-expr: 9
22+
- id: max_population
23+
type: s2
24+
repeat: expr
25+
repeat-expr: 9
26+
- id: max_good_things
27+
type: s1
28+
repeat: expr
29+
repeat-expr: 9
30+
- id: padding1
31+
contents: [0x00]
32+
- id: time_alive
33+
type: s4
34+
repeat: expr
35+
repeat-expr: 9
36+
- id: kill_matrix
37+
type: s4
38+
repeat: expr
39+
repeat-expr: 81
40+
doc: |
41+
kill_matrix is a 9x9 matrix containing the kills of each player:
42+
for example, kill_matrix[1,2] are the number of losses player1 inflicted
43+
to player2
44+
- id: buildings_burned
45+
type: s4
46+
repeat: expr
47+
repeat-expr: 9
48+
- id: food_produced
49+
type: s4
50+
repeat: expr
51+
repeat-expr: 9
52+
- id: iron_produced
53+
type: s4
54+
repeat: expr
55+
repeat-expr: 9
56+
- id: stone_produced
57+
type: s4
58+
repeat: expr
59+
repeat-expr: 9
60+
- id: wood_produced
61+
type: s4
62+
repeat: expr
63+
repeat-expr: 9
64+
- id: pitch_produced
65+
type: s4
66+
repeat: expr
67+
repeat-expr: 9
68+
- id: max_bad_things
69+
type: s1
70+
repeat: expr
71+
repeat-expr: 9
72+
- id: killed_lords
73+
type: s1
74+
repeat: expr
75+
repeat-expr: 9
76+
- id: padding3
77+
contents: [0x00, 0x00]
78+
- id: weapons_produced
79+
type: s4
80+
repeat: expr
81+
repeat-expr: 9
82+
- id: buildings_destroyed
83+
type: s4
84+
repeat: expr
85+
repeat-expr: 9
86+
- id: troops_killed_weighted
87+
type: s4
88+
repeat: expr
89+
repeat-expr: 9
90+
- id: buildings_destroyed_weighted
91+
type: s4
92+
repeat: expr
93+
repeat-expr: 9
94+
- id: troops_produced
95+
type: s4
96+
repeat: expr
97+
repeat-expr: 9
98+
- id: goods_recieved
99+
type: s4
100+
repeat: expr
101+
repeat-expr: 9
102+
- id: goods_sent
103+
type: s4
104+
repeat: expr
105+
repeat-expr: 9
106+
- id: unknown0 # removed feature?
107+
type: s4
108+
repeat: expr
109+
repeat-expr: 9
110+
- id: date_of_death # year, month = divmod(death_date)
111+
type: s4
112+
repeat: expr
113+
repeat-expr: 9
114+
- id: year_start
115+
type: s4
116+
- id: month_start
117+
type: s4
118+
- id: year_end
119+
type: s4
120+
- id: month_end
121+
type: s4

stronghold_crusader/structs/aiv.ksy

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
meta:
2+
id: aiv
3+
title: AI Village
4+
application:
5+
- Stronghold Crusader
6+
- Stronghold Crusader Extreme
7+
- Village
8+
file-extension: aiv
9+
license: CC0-1.0
10+
endian: le
11+
doc: |
12+
The structure of the Stronghold Crusader AI Village file format is similar to
13+
the one of the map file format. It consists of a directory, specifying
14+
properties of the following data sections. Some sections are compressed using
15+
blast compression, an implementation of which can be found at
16+
https://github.com/ladislav-zezula/StormLib/tree/master/src/pklib.
17+
seq:
18+
- id: dir
19+
type: dir
20+
- id: x_view
21+
type: u4
22+
- id: y_view
23+
type: u4
24+
- id: random
25+
size: 40016
26+
- id: bmap_size
27+
type: compr_sec
28+
- id: bmap_tile
29+
type: compr_sec
30+
- id: tmap
31+
type: compr_sec
32+
- id: gmap
33+
size: 10000
34+
- id: bmap_id
35+
type: compr_sec
36+
- id: bmap_step
37+
type: compr_sec
38+
- id: step_cur
39+
type: u4
40+
- id: step_tot
41+
type: u4
42+
- id: parr
43+
type: s4
44+
repeat: expr
45+
repeat-expr: _root.dir.uncompr_size[11]/4 # always 10 or 50
46+
- id: tarr
47+
type: u4
48+
repeat: expr
49+
repeat-expr: 240
50+
- id: pause
51+
type: u4
52+
types:
53+
dir: # directory
54+
seq:
55+
- id: size # always 2036
56+
type: u4
57+
- id: fswd # file size without directory
58+
type: u4
59+
- id: sec_cnt # always 14
60+
type: u4
61+
- id: version # always 200
62+
type: u4
63+
- id: padding0
64+
contents: [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
65+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
66+
- id: uncompr_size
67+
type: u4
68+
repeat: expr
69+
repeat-expr: 100
70+
- id: compr_size
71+
type: u4
72+
repeat: expr
73+
repeat-expr: 100
74+
- id: id
75+
type: u4
76+
repeat: expr
77+
repeat-expr: 100
78+
- id: is_compr
79+
type: u4
80+
repeat: expr
81+
repeat-expr: 100
82+
- id: offset
83+
type: u4
84+
repeat: expr
85+
repeat-expr: 100
86+
- id: padding1
87+
contents: [0x00, 0x00, 0x00, 0x00]
88+
uncompr_sec: # uncompressed section
89+
params:
90+
- id: i
91+
type: u4
92+
seq:
93+
- id: data
94+
size: _root.dir.uncompr_size[i]
95+
compr_sec: # compressed section
96+
seq:
97+
- id: uncompr_size
98+
type: u4
99+
- id: compr_size
100+
type: u4
101+
- id: crc32
102+
type: u4
103+
- id: data
104+
size: compr_size
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
meta:
2+
id: skmaster_dat
3+
title: Skirmish Master Data
4+
application:
5+
- Stronghold Crusader
6+
- Stronghold Crusader Extreme
7+
file-extension: dat
8+
license: CC0-1.0
9+
endian: le
10+
imports:
11+
- ../maps/structs/section1125
12+
doc: |
13+
For
14+
- skmasters2.dat
15+
- skmastersEx.dat
16+
seq:
17+
- id: header
18+
type: header
19+
- id: entries
20+
type: entry
21+
size: 3056
22+
repeat: expr
23+
repeat-expr: header.num_entries
24+
types:
25+
header:
26+
seq:
27+
- id: magic
28+
contents: [0x00, 0x00, 0x40, 0x40]
29+
- id: num_entries
30+
type: s4
31+
entry:
32+
seq:
33+
- id: description
34+
type: description
35+
- id: preview_data
36+
type: preview_data
37+
- id: results
38+
type: section1125 # imported struct
39+
preview_data:
40+
seq:
41+
- id: score
42+
type: s4
43+
- id: num_players
44+
type: s4
45+
- id: team
46+
type: s4
47+
repeat: expr
48+
repeat-expr: 9
49+
- id: ai_id
50+
type: s4
51+
enum: ai_id_skmaster_dat
52+
repeat: expr
53+
repeat-expr: 9
54+
- id: survived
55+
type: s4
56+
repeat: expr
57+
repeat-expr: 9
58+
- id: player_lord_type
59+
type: s4
60+
- id: day
61+
type: s4
62+
- id: month
63+
type: s4
64+
- id: year
65+
type: s4
66+
- id: play_time_min
67+
type: s4
68+
- id: play_time_ticks
69+
type: s4
70+
description:
71+
seq:
72+
- id: map_description_index # encodes map name, 0 for user generated maps
73+
type: u4
74+
- id: map_name # used if map_description_index == 0
75+
type: strz
76+
size: 90
77+
encoding: utf-8
78+
enums:
79+
ai_id_skmaster_dat:
80+
0: no_ai # human or empty
81+
1: rat
82+
2: snake
83+
3: pig
84+
4: wolf
85+
5: saladin
86+
6: caliph
87+
7: sultan
88+
8: richard
89+
9: frederick
90+
10: philipp
91+
11: wazir
92+
12: emir
93+
13: nizar
94+
14: sheriff
95+
15: marshal
96+
16: abbot

0 commit comments

Comments
 (0)