-
Notifications
You must be signed in to change notification settings - Fork 4
/
appe.html
182 lines (156 loc) · 7.69 KB
/
appe.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
<!DOCTYPE html>
<html>
<head>
<title>The Z-Machine Standards Document</title>
<link rel="stylesheet" type="text/css" href="zspec.css">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>
<body class="appendix">
<img class="icon" src="images/iconae.gif" alt="">
<h1>Appendix E. Statistics</h1>
<blockquote>
<p>LORD DIMWIT FLATHEAD: "It must have two hundred thousand rooms, four
million takeable objects, and understand a vocabulary of every single word
ever spoken in every language ever invented."
</p>
<p><strong>The New Zork Times (Winter 1984)</strong></p>
</blockquote>
<p>[Note: the information below has not been updated since the 20th June 1997 revision of
this document.]
</p>
<p>To give some idea of the sizes found in typical story files, here are a few
statistics, mostly gathered by Paul David Doherty, whose "Infocom fact
sheet" file is the definitive reference.
</p>
<p>(i) <em>Length</em></p>
<p>The shortest files are those dating from the time of the 'Zork'
trilogy, at about 85K; middle-period Version 3 games are typically 105K,
and only the latest use the full memory map. In Versions 4 and 5, only
'Trinity', 'A Mind Forever Voyaging' and 'Beyond Zork' use the full 256K.
'Border Zone' and 'Sherlock', for instance, are about 180K. (The author's
short story 'Balances' is about 50K, an edition of 'Adventure' takes 80K,
and 'Curses' takes 256K (it's padded out to the maximum size with
background information; the actual game comprises only about 245K). Under
Inform, the library occupies about 35K regardless of the size of game.)
</p>
<p>(ii) <em>Code size</em></p>
<p>'Zork I' uses only about 5500 opcodes, but the number rises
steeply with later games; 'Hollywood Hijinx' has 10355 and, e.g.
'Moonmist' has 15900 (both these being Version 3). Against this, 'A Mind
Forever Voyaging' has only 18700, and only 'Trinity' and 'Beyond Zork'
reach 32000 or so. (Inform games are more efficiently compiled and make
better use of common code -- the library -- so perform much better here:
the old Version 3, release 10 of 'Curses' (128K long, and a larger game
than any Infocom Version 3 game) has only 6720 opcodes.)
</p>
<p>(iii) <em>Objects and rooms</em></p>
<p>This varies greatly with the style of game.
'Zork I' has 110 rooms and 60 takeable objects, but several quite
complex games have as few as 30 rooms (the mysteries, or 'Hitch-hikers').
The average for Version 3 games is 69 rooms, 39 takeable objects.
</p>
<p>'A Mind Forever Voyaging' contains many rooms (178) but few objects (30).
'Trinity', a more typical style of game, contains 134 rooms and 49
objects: the Version 5 'Curses' has a few more of each. Of the Version 6
games, only 'Zork Zero' scores highly here, with 215 rooms and 106
objects. The average for Version 4/5 games is 105 rooms and 54 objects.
</p>
<p>The total number of objects tends to be close to the limit of 255 in
Version 3 games. 'Curses' contains 508.
</p>
<p>(iv) <em>Dictionary</em></p>
<p>Early games such as 'Zork I' know about 600 words, but
again this rises steeply to about 1000 even in Version 3.
Later games know 1569 ('Beyond Zork') to the record, 2120 ('Trinity').
(This is achieved by heroic inclusion of unlikely synonyms: e.g. the
Japanese lady with the umbrella can be called WOMAN, LADY, CRONE,
MADAM, MADAME, MATRON, DAME or FACE with any of the adjectives
OLD, AGED, ANCIENT, JAP, JAPANESE, ORIENTAL or YELLOW.)
Version 6 games have smaller dictionaries. So has 'Curses', at 1364.
</p>
<p>(v) <em>Opcodes</em></p>
<p>(a) Of the 1426854 opcodes in the shipped Infocom story files in Paul David
Doherty's collection, here are the top and bottom ten most popular.
(Leaving out those which never occur and so score 0:
<strong>nop</strong>, <strong>art_shift</strong>, <strong>piracy</strong> and the two post-Infocom opcodes,
<strong>print_unicode</strong> and <strong>check_unicode</strong>.)
</p>
<pre>
Top Ten Opcodes Chart Bottom Ten Opcodes Chart
1. je 195959 1. print_form 2
2. print 142755 2. erase_picture 3
3. jz 112016 3. read_mouse 3
4. call_vs 104075 4. encode_text 7
5. print_ret 80870 5. make_menu 9
6. store 71128 6. not 14
7. rtrue 66125 7. scroll_window 16
8. jump 56534 8. pop_stack 17
9. new_line 52553 9. restore_undo 18
10. test_attr 46627 10. mouse_window 22
</pre>
<p>So about 2/3rds of all opcodes are those in the top ten; 1 in 8 opcodes is a
<strong>je</strong>, and only 1 in 710000 is a <strong>print_form</strong>.
</p>
<p>(b) An experiment (conducted with the help of Kevin Bracey) sheds some
light on the opcodes most frequently interpreted in typical play. Two
very different games ('Zork I', Version 5 "solid gold" edition;
'Museum of Inform', a complex Inform example game) were played for
about 50000 cycles of the Z-machine (about 20 moves in 'Zork I', rather
less in the 'Museum'). The following table records all opcodes with
a frequency of at least 1% (i.e., 0.01):
</p>
<pre>
Zork I Solid Gold (Infocom) Museum of Inform (Inform)
0.116110 loadb 0.104952 je
0.103990 storeb 0.101151 jz
0.101616 jz 0.092727 jump
0.074979 dec_chk 0.080985 jg
0.066375 add 0.079039 jl
0.066283 je 0.070550 inc
0.060760 store 0.070139 store
0.053867 loadw 0.047058 loadw
0.038095 storew 0.034137 get_prop_addr
0.036428 mul 0.024105 jin
0.032069 inc_chk 0.022734 rtrue
0.030243 jump 0.021583 storew
0.029170 test_attr 0.020075 add
0.020634 call_vs 0.018485 call_vs
0.011184 get_sibling 0.016731 and
0.016082 loadb
0.012061 call_vn
0.011879 test_attr
0.011824 dec
0.011687 ret
</pre>
<p>Adventure games spend most of the time parsing, and the differences
between these tables reflect different parser designs (byte arrays
versus word arrays and arrays stored in properties) as well as
different compiler code generators (Inform does not use <strong>inc_chk</strong>
or <strong>dec_chk</strong>, so it uses <strong>inc</strong>, <strong>dec</strong>, <strong>jl</strong> and <strong>jg</strong> correspondingly
more). In the case of 'Zork I', about a third of all opcodes are
branches: in the case of 'Museum', almost half.
</p>
<hr>
<p>
<a href="index.html">Contents</a> /
<a href="preface.html">Preface</a> /
<a href="overview.html">Overview</a>
</p>
<p>Section
<a href="sect01.html">1</a> / <a href="sect02.html">2</a> /
<a href="sect03.html">3</a> / <a href="sect04.html">4</a> /
<a href="sect05.html">5</a> / <a href="sect06.html">6</a> /
<a href="sect07.html">7</a> / <a href="sect08.html">8</a> /
<a href="sect09.html">9</a> / <a href="sect10.html">10</a> /
<a href="sect11.html">11</a> / <a href="sect12.html">12</a> /
<a href="sect13.html">13</a> / <a href="sect14.html">14</a> /
<a href="sect15.html">15</a> / <a href="sect16.html">16</a>
</p>
<p>Appendix
<a href="appa.html">A</a> / <a href="appb.html">B</a> /
<a href="appc.html">C</a> / <a href="appd.html">D</a> /
<a href="appe.html">E</a> / <a href="appf.html">F</a>
</p>
<hr>
</body>
</html>