-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
300 lines (198 loc) · 6.16 KB
/
index.html
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
<!DOCTYPE html>
<html>
<head>
<title>Rust Meetup [date] - Chariot</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body {
font-family: 'Droid Serif';
}
h1,
h2,
h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.remark-code,
.remark-inline-code {
font-family: 'Ubuntu Mono';
}
img[alt=screenshot] {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<textarea id="source">
class: center, middle
# Rust meetup [date here]
---
# Agenda
1. Screenshot!
2. Introduction to Chariot
3. History of the project
4. The DRS format
5. The SLP format
6. The BIN format
The source for these slides can be found at [ChariotEngine/meta-presentations](https://github.com/ChariotEngine/meta-presentations).
---
![screenshot](./images/player2.png)
???
Q: Who here knows which game this is?
Q: Who has played it?
---
# Introduction to Chariot
* General information
* RTS game engine
* https://github.com/ChariotEngine
* Written in (stable) Rust
* MIT licensed
* Lots of work to do
* Graphics engine rewrite (SDL2 → OpenGL)
* More SLP decoding (shadow tricks, extended opcodes)
* Fix terrain on/off-screen calculation to account for Z axis
* Convince *you* to work on at least one piece of the project
* Social media
* [Twitter](https://twitter.com/ChariotEngine)
* [Reddit](https://reddit.com/r/ChariotEngine)
???
Explain that the windowing/input system will remain SDL2 but that the rendering will no longer use the fixed-function pipeline.
Be prepared to explain the differences between the fixed-function pipeline and OpenGL's pipeline if anyone asks.
---
# History of Chariot
* [Initial commit](https://github.com/angered-ghandi/OpenAOE/commit/8ba57c1781dca2cd1b5a5dcfed8c437ac9781ed4) by [Kevin Fuller](https://github.com/angered-ghandi) on June 17th of 2016
* [My first PR for the project landed](https://github.com/angered-ghandi/OpenAOE/commit/44462131133bcb3b8c5fa572c20ed546696ca689) on July 11th 2016
* I said ["hey I'm going to maintain this!"](https://github.com/angered-ghandi/OpenAOE/issues/16#issuecomment-269776872) on December 30th of 2016
* I was too busy to continue working on it :-( (until about April 11th of 2017)
* Now we are here and I devote many hours to the project
???
Note for future readers: The "I/Me/My"s here refer to [Taryn Hill](https://github.com/Phrohdoh/)
---
# History of Chariot
The project was named `OpenAOE` before being renamed to `Chariot`
*TODO: Explain why it was renamed (social media handles and domain availability)*
---
# The DRS Format
`DRS` is a container format created by [Ensemble Studios](https://en.wikipedia.org/wiki/Ensemble_Studios).
`DRS`es consist of "tables" for each file type (for example: all `SLP`s are stored together in an `SLP` table).
```sh
GAME/DATA/BORDER.DRS:
6 slps
GAME/DATA/GRAPHICS.DRS:
683 slps
GAME/DATA/INTERFAC.DRS:
50 bins
10 shps
98 slps
17 wavs
GAME/DATA/SOUNDS.DRS:
144 wavs
GAME/DATA/TERRAIN.DRS:
4 slps
```
---
# The DRS Format
You can use [`drs-utility`](https://github.com/ChariotEngine/drs-studio) to manipulate DRS archives.
```sh
$ drs-studio list --drs-path graphics.drs
1.slp
2.slp
[..snip..]
714.slp
715.slp
```
```sh
$ drs-studio extract --drs-path graphics.drs --file-names 00412.slp
Wrote 171241 bytes to ./00412.slp
```
---
# The SLP Format
`SLP` is a graphics format created by [Ensemble Studios](https://en.wikipedia.org/wiki/Ensemble_Studios).
---
# The SLP Format
`SLP` is a graphics format created by [Ensemble Studios](https://en.wikipedia.org/wiki/Ensemble_Studios).
![Chariot unit](./images/chariot-opengl.png)
---
# The SLP Format
An `SLP` is a container for paletted, animated images (think `GIF`).
Q: Why didn't Ensemble Studios use `GIF`?
---
# The SLP Format
An `SLP` is a container for paletted, animated images (think `GIF`).
Q: Why didn't Ensemble Studios use `GIF`?
A: Storage and rendering optimizations!
---
# The SLP Format (decoding)
`SLP` frame data consists of opcodes, palette indices, and renderer commands.
```rust
// SLP opcodes are stored in the lowest 4 bits of the command byte.
let opcode = cmd_byte & 0b00001111;
match opcode {
// Block copy
0b0000 | 0b0100 | 0b1000 | 0b1100 => {
let length = try!(SixUpperBit.decode(cmd_byte, cursor));
for _ in 0..length {
shape.pixels[(y * width + x) as usize] = try!(cursor.read_u8());
x += 1;
}
}
// Skip pixels
0b0001 | 0b0101 | 0b1001 | 0b1101 => {
x += try!(SixUpperBit.decode(cmd_byte, cursor)) as u32;
}
...
}
```
SLP decoding code lives at [ChariotEngine/Slp](https://github.com/ChariotEngine/Slp)
---
# The SLP Format (rendering)
The end result is a 2D array of palette indices that we use to render color.
```glsl
index = getValueAt(spriteData, xy); // integer 0..255
color = getValueAt(palette, index); // RGBA
```
---
# The SLP Format (rendering)
The end result is a 2D array of palette indices that we use to render color.
```glsl
index = getValueAt(spriteData, xy); // integer 0..255
color = getValueAt(palette, index); // RGBA
```
![frag-zoom-color](./images/frag-zoom-color.png)
???
00412.slp frame index 18
---
# The SLP Format (rendering + debugging)
The end result is a 2D array of palette indices that we use to render color.
```glsl
index = getValueAt(spriteData, xy); // integer 0..255
color = rgba(index, 0.0, 0.0, 1.0); // RGBA
```
![frag-zoom-debug](./images/frag-zoom-debug.png)
???
00412.slp frame index 18
---
# The BIN Format
`BIN` files are Paint Shop Pro palettes (`JASC`) which are textual RGB triples.
I do not know why Ensemble Studios used the 'bin' suffix.
```sh
JASC-PAL
0100
256
0 0 0
[..snip..]
255 255 255
```
`BIN` reading code lives at [ChariotEngine/Palette](https://github.com/ChariotEngine/Palette).
---
</textarea>
<script src="./remark.min.js"></script>
<script>
var slideshow = remark.create();
</script>
</body>
</html>