1@node wap
2@chapter WurfelAnimator WAP
3This chapter is written by Felix Domke, the author of WAP.
4
5@section What is the so called WurfelMode?
6In version 1.0 of the famous Cubic Player, pascal got a nice idea of playing
7silly animations inside the Player.
8
9He invented the @emph{WurfelMode} (@emph{Wurfel} is the german word for
10cube). The WurfelMode was able to play animations with a resolution of
11160x100 pixels in 256 colors in a special tweaked vga-mode. The animation
12format was a special one.
13
14@section How can I create such animations by myself?
15
16Long time, only the cubic team (or even only pascal?) itself was able to
17create such animations. The reason for this was that, as said, the animations
18had to be in a very special format, and the only tool that was be able to
19create this format were the not-so-famous @emph{WurfelTools}. Included
20there was a tool called @file{makedmp.exe}. It  took  various @file{.tga}
21files, and made a @file{.dat} animation out of them. But noone checked how
22this tools worked, mainly because it had no command-line-help and the sources
23weren't available anymore.
24
25But times are changing. Today, you don't have to guess how to use a utility
26anymore. You just have to read the documentation (yes, even you, Realtime ;).
27Today, you can even use a resolution of 320x200 (wow, THAT's highres).
28
29For people who didn't guess how pascal's tool worked, I made a new one.
30This time @emph{with} source available to all interested people. This time
31with @file{.pcx} images, not @emph{.tga} one, because @file{.pcx} is much
32easier to read, and also more widely supported. This time even with some
33palette-aligning, so you don't have to care about same palettes anymore.
34
35@section And how can I use your tool?
36First, you have to render/paint/rip a animation. It HAS to be 320x200, or,
37if you want to make an old, $<$ OCP 2.0q, animation, 160x100.
38In case you didn't notice, the OCP 2.0q and higher has a new WurfelMode,
39called @emph{WurfelMode ][} , with support for 320x200 pixels
40images, instead of the lowres 160x100 ones.
41
42Your  animation should be in the form of many, many @file{.pcx} files,
43called for example @file{PIC000.PCX}, @file{PIC001.PCX},
44@file{PIC002.PCX} and so on. They  must have only 256 colors, and they
45should have all the same palette. If  they don't have the same palette, the
46palette will be aligned. But my calculation of this isn't very good (but it
47works :), so for BEST results you have to do this in your favourite
48picture-editing-program. Next,  you have  to create  a @emph{script}. This
49script contains informations about the filenames of your frames, and a some
50other stuff.
51
52The script has the following format:
53@example
54Version
55[SFO] RLECompression
56Title
57NumFrames Delay Filename
58[NumFrames Delay Filename]
59[NumFrames Delay Filename]
60[...                     ]
61@end example
62
63@emph{Version} is either 0 or 1, 0 for 160x100 animations, 1 for 320x200.
64If you want to create a Version 0-animation, @emph{SFO} should be set to 1,
65if you want to create a Version 1-animtion, @emph{SFO} has to be left out.
66@footnote{If  you're interested what  this value means, well, just get the
67original documentation for professionals, it's described there}
68@emph{RLECompression} should be set to 1, it compresses the Animation a little
69bit.
70@emph{Title} is the title of the animation, it shouldn't be longer than 31
71chars, it's displayed inside the fileselector of OCP.
72
73After this @emph{header}, a random number of section follows (but at least
74ONE ;).
75
76Every section describes a sequence of some PCXs. In the final animation,
77all sections are joint together.
78
79@emph{NumFrames} is the number of frames in this sequence. For example, if
80you have PCXs that are named from @file{PIC000.PCX} up to
81@file{PIC199.PCX}, NumFrames should be 200.
82@emph{Delay} is handled a little bit different in the two versions. If you
83want to create a Version 0-animation, a @emph{Delay} of 1 means a framerate
84of about 21.3 frames per second, a @emph{Delay} of 2 is about 10.65 fps (the
85half), a @emph{Delay} of 3 is about 7.1 (a third) and so on.
86
87If  you  want  to create a Version 1-animation, @emph{Delay} is 65536/desired
88fps, so if you want to have 15fps, "Delay" should be 4369. This value has to
89be BELOW 65536 (and above 0, of course :)
90@emph{Filename} is the filename of your sequence. Because most animations
91have more than 1 frame, you can use %d (and other C-printf placeholders).
92For people whose native language is not C, here some short examples:
93
94@multitable @columnfractions .34 .33 .33
95@item
96@b{filename}
97@tab
98@b{framenumber}
99@tab
100@b{real filename}
101@item
102pic%d.pcx
103@tab
1040
105@tab
106pic0.pcx
107@item
108@tab
1091
110@tab
111pic1.pcx
112@item
113@tab
1142
115@tab
116pic2.pcx
117@item
118@tab
1193
120@tab
121pic3.pcx
122@item
123@tab
1249
125@tab
126pic9.pcx
127@item
128@tab
12910
130@tab
131pic10.pcx
132@item
133@tab
13411
135@tab
136pic11.pcx
137@item
138pic%03d.pcx
139@tab
1400
141@tab
142pic000.pcx
143@item
144@tab
1451
146@tab
147pic001.pcx
148@item
149@tab
1502
151@tab
152pic002.pcx
153@item
154@tab
1553
156@tab
157pic003.pcx
158@item
159@tab
1609
161@tab
162pic009.pcx
163@item
164@tab
16510
166@tab
167pic010.pcx
168@item
169@tab
17011
171@tab
172pic011.pcx
173@end multitable
174The framenumber always starts with 0, not with 1, keep this in mind!
175
176Here is an example script: (version 0)
177@example
1780
1791 1
180a basic cubic-player animation
18111 2 intro%d.pcx
182200 1 ani%03d.pcx
183@end example
184
185This animation would have 211 frames (@file{intro0.pcx} to
186@file{intro10.pcx}, then @file{ani000.pcx} to @file{ani199.pcx}).
187
188And here again one for version 1:
189@example
1901
1911
192an enhanced OpenCP animation
19311 3072 intro%x.pcx
194200 1000 ani%03d.pcx
195@end example
196
197To create the animation, just type in
198@example
199wap <scriptfilename.scr> <outputfilename.dat>
200@end example
201and hit @key{Enter}.
202
203The WurfelAnimator will now try to make the animation.
204To view the animation inside OCP, rename the created @file{.DAT}-file
205to @file{CPANU001.DAT} (or @file{CPANI002.DAT} and so on...) and press
206@key{w} inside the player.
207
208@section This tool doesn't work!
209No problem,I have always an open ear for your problems. Just write your
210problems to @url{mailto:tmbinc@@gmx.net}.
211
212Maybe you have luck and meet me on IRC, usually I am in @url{irc://#coders.ger}
213and some other channels, but if you don't know those, well, maybe you're
214not welcome on them ;)
215
216Anyway, maybe you have some fun with this tool.
217