![]() |
Templates: what a room can place |
The 31 kinds of thing a room record can place -- the templates the builder (BUILD_ROOM) makes object records from, after the scenery. A room gives a group header, bits 3-7 a template number (an index into OBJECT_TABLE) and bits 0-2 how many copies less one, then a position byte for each copy: U = 72 + 16 times bits 0-2, V = 72 + 16 times bits 3-5, and Z the floor plus 12 times bits 6-7, so a room is an 8 by 8 grid of cells, four levels high.
A template is a list of 5-byte parts ended by a zero: the graphic, the half-sizes in U and V, the height (Z is an object's base, not its middle) and the flags, which go to +0 and +4 to +7 of a record, the position to +1 to +3 and the room to +8. The builder would make a record of each part at the same place, but every template in the game has just one. The graphic decides everything else: its update routine and its sprite (see every graphic). The flags set here are bit 4, to be drawn; bit 2, pushable, which the collision code reads when something walks into it (ADJ_DU_FOR_OBJ_INTERSECT); and bit 6, mirrored.
A template number of 31 is not a template: it moves the builder on to a second page of templates, 64 bytes further on, and skips a byte; no room uses it. Templates 9 and 22 share one set of bytes.
Each is drawn here by the game, on its own near the middle of an empty room (cell 3, 3, on the floor), from a one-off room record the game builds and draws its first turn of, in SkoolKit's simulator; a thing that moves has had one turn. Knight Lore's templates are the same idea with a sixth byte, an offset, and several parts to some (see Knight Lore's templates).
0: A stone block -- OBJECT0
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 11 | 8, 8, 12 | $10 (to be drawn) | JUMP_L16_D8 |
114 copies in 30 rooms: 0, 2, 4, 16, 27, 31, 37, 38, 41, 42, 54, 55, 56, 59, 62, 69, 72, 73, 74, 80, 86, 87, 94, 108, 129, 141, 142, 145, 146, 147.
1: A tree stump -- OBJECT1
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 10 | 8, 8, 12 | $10 (to be drawn) | JUMP_L16_D8 |
68 copies in 15 rooms: 5, 11, 18, 26, 44, 46, 70, 73, 74, 99, 112, 117, 120, 123, 130.
2: A ghost -- OBJECT2
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 48 | 5, 5, 5 | $10 (to be drawn) | HOMER |
No room places it.
3: A bed of spikes -- OBJECT3
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 23 | 7, 7, 10 | $10 (to be drawn) | STILL_DEADLY |
270 copies in 35 rooms: 0, 7, 12, 13, 15, 16, 18, 31, 34, 37, 38, 41, 44, 47, 51, 53, 54, 55, 56, 59, 67, 71, 80, 83, 87, 92, 93, 94, 96, 100, 108, 141, 146, 147, 149.
4: A tree stump -- OBJECT4
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 72 | 8, 8, 12 | $14 (pushable, to be drawn) | PUSHABLE |
53 copies in 17 rooms: 3, 5, 9, 11, 13, 18, 22, 29, 70, 71, 73, 74, 107, 120, 126, 130, 133.
5: A toothed trap -- OBJECT5
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 30 | 7, 7, 10 | $10 (to be drawn) | STILL_DEADLY |
179 copies in 28 rooms: 1, 2, 4, 5, 20, 21, 27, 28, 29, 36, 46, 52, 61, 62, 64, 69, 70, 74, 84, 86, 101, 107, 108, 109, 117, 120, 126, 130.
6: A smooth block -- OBJECT6
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 63 | 8, 8, 12 | $14 (pushable, to be drawn) | PUSHABLE |
7: A table -- OBJECT7
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 73 | 8, 14, 12 | $14 (pushable, to be drawn) | SLIDING_TABLE, in HEAVY_BLOCK |
8: A tree stump -- OBJECT8
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 76 | 8, 8, 12 | $10 (to be drawn) | JUMP_L16_D8 |
9: A stone block -- OBJECT9
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 91 | 8, 8, 12 | $10 (to be drawn) | HEAVY_BLOCK |
The same bytes as template 22.
10: A stone block -- OBJECT10
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 78 | 8, 8, 12 | $10 (to be drawn) | SINKING_BLOCK |
11: A stone block -- OBJECT11
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 79 | 8, 8, 12 | $14 (pushable, to be drawn) | PUSHABLE |
12: A stone block -- OBJECT12
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 84 | 8, 8, 12 | $10 (to be drawn) | LIFT |
13: A dark patch on the ground -- OBJECT13
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 74 | 12, 12, 1 | $10 (to be drawn) | STILL_DEADLY |
14: A bed of spikes -- OBJECT14
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 28 | 7, 7, 11 | $14 (pushable, to be drawn) | SPIKES |
15: A horned head -- OBJECT15
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 86 | 8, 8, 12 | $10 (to be drawn) | DEADLY_BOBBER |
16: A stone block -- OBJECT16
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 87 | 8, 8, 12 | $10 (to be drawn) | PACER_U, in DEADLY_PACER_U |
12 copies in 12 rooms: 2, 4, 15, 27, 38, 46, 56, 59, 69, 93, 101, 129.
17: A stone block -- OBJECT17
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 88 | 8, 8, 12 | $10 (to be drawn) | PACER_V, in DEADLY_PACER_V |
18: A spider -- OBJECT18
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 89 | 8, 8, 10 | $10 (to be drawn) | SPIDER |
18 copies in 16 rooms: 3, 9, 13, 14, 15, 24, 26, 53, 69, 98, 106, 109, 111, 133, 142, 145.
19: The well -- OBJECT19
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 120 | 10, 10, 12 | $10 (to be drawn) | WELL |
20: A spider -- OBJECT20
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 16 | 8, 8, 10 | $10 (to be drawn) | ROAMER |
21: A hand reaching out of a dark patch -- OBJECT21
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 75 | 12, 12, 1 | $10 (to be drawn) | STILL_DEADLY |
56 copies in 11 rooms: 63, 77, 78, 99, 103, 112, 123, 125, 129, 131, 134.
22: A stone block -- OBJECT9
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 91 | 8, 8, 12 | $10 (to be drawn) | HEAVY_BLOCK |
The same bytes as template 9.
No room places it.
23: A smooth block -- OBJECT23
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 82 | 8, 8, 12 | $10 (to be drawn) | JUMP_L16_D8 |
24: A stone block -- OBJECT24
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 136 | 8, 8, 12 | $10 (to be drawn) | CRUMBLING_BLOCK |
50 copies in 18 rooms: 4, 15, 16, 27, 47, 54, 55, 62, 64, 69, 80, 87, 93, 94, 141, 142, 146, 149.
25: A stone block -- OBJECT25
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 140 | 8, 8, 12 | $10 (to be drawn) | CONVEYOR_PLUS_U |
26: A stone block -- OBJECT26
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 141 | 8, 8, 12 | $10 (to be drawn) | CONVEYOR_MINUS_U |
No room places it.
27: A stone block -- OBJECT27
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 142 | 8, 8, 12 | $10 (to be drawn) | CONVEYOR_PLUS_V |
28: A stone block -- OBJECT28
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 143 | 8, 8, 12 | $10 (to be drawn) | CONVEYOR_MINUS_V |
1 copy in 1 room: 108.
29: A horned head -- OBJECT29
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 92 | 8, 8, 12 | $10 (to be drawn) | DEADLY_PACER_U |