dungeon.dat: decode the remaining residual bits #392
Labels
No labels
area/ci-release
area/cli
area/docs
area/dungeon
area/ftl
area/graphics
area/gui
area/music
area/saves
area/tooling
port/amiga
port/dos
port/fm-towns
port/mac
port/pc98
port/sega-cd
priority/high
priority/low
priority/medium
type/bug
type/chore
type/docs
type/feature
type/research
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#390 dungeon.dat: editable self-contained JSON for the web (#307)
jqueuniet/dm2-tools
Reference
jqueuniet/dm2-tools#392
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Prerequisite of #390 (schema v3): decode as many residual bits as possible first, so v3 carries named fields rather than residuals.
Counts are over the 16 fixture dungeons.
Identified in SKWINSPX: add accessors
flags_wordw2_2_2: map uses the invisible lower-pitfall graphicsflags_wordw2_6_6: map uses the message-board graphicsw2_a_f:graphics.dattext number; values above 1 replace thedungeon.dattext reference (sktext.cpp:646)behaviourActuatorToggler/IsDisabledb15skgame.cpp:3182)b14b14_7_7: when set, the creature doesn't drop its possessions on spawnNamed, meaning partial
dest_map_wordbit 0 (w4_0_0, set on 896): when set,skdungn.cpp:61returns early for teleporter tiles.b4_1_2, values 3 and 6 seen): when not 3, actions open and close the teleporter through tile bit 3.Unknown
w12bits 8–11 (unknown1, values 1–5 in 389 maps): no reader found, and no correlation with the other map fields.num_graphs_wordbits 12–15 (rFloors),w14bits 0–3,unused_4/unused_5, door bits 14–15.Tile attribute nibbles
Actuators
v3 decisions
map_offset,map_data_size,n_records,obj_list_size, the columns array and the object list follow from the rest. Keep them explicit or derive them.Order
w4bits and the tile nibbles.w12bits 8–11.Progress (branch
feat/392-residual-accessors):Decoded:
use_invisible_lower_pitfall, bit 6 isuse_message_board.gdat_text(bits 15:10).important(bit 10) andkeeps_possession_positions(bit 7; when set, possessions keep their stored positions on actuator spawn).shot_energy(bits 11:4) andshot_energy_decay(bits 15:12), as read byACTIVATE_SHOOTERand missile stepping.w4:blocks_passage(bit 0:IS_TILE_PASSAGEreturns blocked, and neighbouring maps see a map exit);activation(bits 2:1; at 3, actions leave the open bit alone).north_south; trick-wall bit 0 ismap_blink(the magic map blinks the tile as floor).Corrections to the inventory:
behaviourbit 11: only set on shooters (0x08, 0x0a, 0x0e).ActuatorToggleris SPX's DM1 compatibility, andACTIVATE_SHOOTERdoesn't read the bit. Still unknown.Conflicts with the current decoding (SKWINSPX
SUMMARIZE_STONE_ROOMagainst SKULLWINc_gui_vp.cpp):TileAttr::Walldecodes a 2-bit face selector in bits 1:0. Retail walls never set bits 3:2, which fits the selector, but this needs settling.TileAttr::Stairsclaims. Bit 2 is the separate flag.Tile conflicts resolved in favour of SKWINSPX, the maintained tree (SKULLWIN is retired). Its editor (
v4/skeditdn.cpp) documents each bit:TAG00a4a2).TileAttrwas rewritten to match. Still unknown: pit bit 1 (the editor marks it?).Confidence. SKWINSPX is a reimplementation; the retail engines are the truth.
Anchored to the original binary (
//^seg:offmarkers in the cited code):ACTIVATE_SHOOTER, missile step).w4:blocks_passage(IS_TILE_PASSAGE) andactivation(ACTUATE_TELEPORTER).important:SET_ITEM_IMPORTANCE.map_blink:DRAW_MAP_CHIP.SUMMARIZE_STONE_ROOM):SKWINSPX-only, to confirm in-game:
skeditdn.cpp): pit bit 2 "hidden", stair bit 2 "leads up", teleporter bit 2 "haze". The summary only passes bit 2 along.keeps_possession_positions: spawn code without anchors nearby.gdat_text != 0; SPX changed it to> 1. The doc now says non-zero.In-game (DOS EN): pit bit 2 is hidden. Of two open pits, only the one without bit 2 is drawn. With no map below, falling deals ~4.5k damage instead of changing level; the second fall killed the party. The stair bit 2 check is pending.
In-game (DOS EN): stair bit 2 is leads up. The up stair (bit 2 set) took the party to the map above. The down stair did nothing, since there is no map below, but it turned the party to the starting direction. Both were drawn with the debug placeholder graphic, likely because the start map's graphics set has no stair images.
Actuator catalog completed from SKWINSPX's handlers (branch
feat/392-actuator-catalog).New types:
0x00none;0x02creature trap floor (creatures only);0x09weapon shooter (creates the itemdatanames);0x1cladder (beta; data 5:0 is the destination map);0x28creature attacker (killer handler; attacks creatures whoseanim_seqmatches data 8:4, with argument 3:0);0x2eparty teleporter;0x33-0x37tick generators with the period multiplied by 8 to 128.Word-1 classes corrected:
0x03: party facing + 1, 0 for any;0x0b: the same creature filter as0x28;0x18/0x46: button delay in ticks;0x20: relay delay in ticks;0x2c: animation phase;0x42: 0..3 in retail data; SKWINSPX leaves the handler unimplemented, so the meaning is unconfirmed.Still uncatalogued:
0x29and0x3e(beta, one record each) and0x7d(DOS and Mac demos, 4 records); neither source documents them.Confidence: all cited dispatch sites carry original-binary anchors, except the ladder (SPX reworked its trigger condition) and
0x42(unimplemented).Remaining unknowns resolved in #395 and #396, checked against SKWINSPX's v5 code (derived from the DOS binary).
Map
w12bits 11:8 (#395)Map::num_leading_creature_types().IS_CREATURE_ALLOWED_ON_LEVELscans the wholeallowed_creature_typeslist, not a leading part of it.Corrections to earlier decoding (#396)
IS_TILE_BLOCKED), so it is DM1's "imaginary" wall.map_blinkis renamedimaginary.keeps_possession_positions(creatureb14bit 7): read inARRANGE_DUNGEONat new-game setup, for static creatures only. When clear, their possessions get random positions. It has nothing to do with actuator spawns. No retail record sets it.3A15:0D5C). It turns the creature on the target tile to facedata & 3. The trigger depends on the revert bit and the action. Each full game has exactly four 0x42 records, with data 0, 1, 2 and 3. Decoded asParamClass::Direction.Now backed by DOS-derived code, no longer SKWINSPX-only
CREATURE_GO_THERE, creatures never use an open pit with bit 0 set to go down a level. Not checked: whether the party falls through one.Newly catalogued
PLACE_OR_REMOVE_OBJECT_IN_ROOM. It fires when the side holds no other item, the any-item counterpart of 0x2a. Its data is unread. Its one record sits on a wall side holding a chest.Nothing in the retail engine reads these
behaviourbit 11: set only on shooters and 0x7d.INVOKE_ACTUATORtakes the delay from bits 10:7, the shooter code reads only words 2 and 6, and no other read of word 4 reaches bit 11.