diff --git a/README.md b/README.md index ec39610..354d1e4 100644 --- a/README.md +++ b/README.md @@ -42,21 +42,26 @@ The `view-map` binary attempts to render a map, and is the current focus of effort. Once I can render a whole map, including pre-placed characters (cultist scum), things can start to get more interesting. -Current status: map tiles are rendered at correct offsets. Some center objects -are rendered. Pixel data is not 100% accurate, left & right objects don't render +Current status: map tiles are rendered at correct offsets. Tiles (four per +coordinate: floor, centre, left, and right) are rendered, but the pixels for +those tiles are not 100% accurate. + +Characters and animations aren't touched at all yet. Rendering performance is +atrocious. No gameplay, no sound, no campaign logic. Interaction with the play +area is minimal and limited to pan, zoom, and click for basic console output. + +Still, I'm proud of myself. To run: ``` $ make view-map -$ ./view-map -map orig/Maps/Chapter01.MAP -text orig/Maps/Chapter01.TXT +$ ./view-map -map orig/Maps/Chapter01.MAP -txt orig/Maps/Chapter01.TXT ``` Use the arrow keys to scroll around the map, the mouse wheel to zoom, and the `1` - `7` keys to change Z level. -Unlike the game, currently I only render the Z level you're actually on. - Dependency management uses `govendor`. Unless you're contributing code you shouldn't have to worry about it. @@ -85,90 +90,3 @@ And we learn they can be "on".... 0. CHARACTER 1. VEHICLE 2. CANISTER - - -Hypothesis: Idx/WarHammer.idx points objects into bitmap data in Anim/WarHammer.ani - -We can use WH40K_TD.exe and investigate reads of .idx followed by reads of .ani -to test this. - -WH40K_TD.exe opens files in this order: - -1. Data/USEng.dta -1. WH40K_TD.exe (?) -1. Cursor/Cursors.cur - 1. pread64(fd, 23, 0) = 23 - 1. _llseek(fd, 0, [0], SEEK_CUR) = 0 - 1. _llseek(fd, 0, [0], SEEK_CUR) = 0 - 1. _llseek(fd, 40666, [40666], SEEK_SET) = 0 - 1. _llseek(fd, 0, [0], SEEK_SET) = 0 - 1. close(fd) = 0 - 1. read(fd, "\x26\x00\x00\x00\x20\x00\x00\x00\x30\x01\x00\x00\x50\x01\x00\x00\x8a\x9d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 32) = 32 - 1. (...) - 1. _llseek(15, 39868, [39868], SEEK_SET) = 0 - 1. read(15, "...", 798) = 798 -1. (some statting of Idx/WarHammer.idx, no reading that I saw) -1. Anim/WarHammer.ani - 1. read(15, "...", 32) = 32 -1. (some clones of child procs, I didn't follow them) -1. Sounds/wh40k.ds - 1. pread64(31, "...", 23, 0) = 23 - 1. read(31, "...", 417792) = 417792 - 1. read(31, "...", 4096) = 4096 -1. Data/Sounds.dat - 1. pread64(34, "#**********************", 23, 0) = 23 - 1. ... -1. Pic/wh40k.pcx - 1. read(34, "...", 168509) = 168509 -1. Sets/* - 1. (lots of statting these) -1. Data/Randchar.dat - 1. pread64(34, "#**********************", 23, 0) = 23 - 1. read(34, "#***************************************************************"..., 4096) = 4096 - 1. ... -1. Data/WeapDef.dat - 1. pread64(35, "#**********************", 23, 0) = 23 - 1. read(35, "#***************************************************************"..., 4096) = 4096 - 1. ... -1. Data/SpellDef.dat - 1. pread64(35, "#**********************", 23, 0) = 23 - 1. read(35, "#***************************************************************"..., 4096) = 4096 - 1. ... -1. Data/AniObDef.dat - 1. pread64(35, "# ******** ANIMATED OBJ", 23, 0) = 23 - 1. read(35, "# ******** ANIMATED OBJECT DEFINITIONS **************\r\n#\t\t0 : **"..., 4096) = 4096 - 1. ... -1. Data/VehicDef.dat - 1. pread64(35, "# ******** VEHICLE DEFI", 23, 0) = 23 - 1. read(35, "# ******** VEHICLE DEFINITIONS **************\r\n#\t\t0 : *** VEHICL"..., 4096) = 4096 - 1. ... -1. Data/StdWeap.dat - 1. pread64(35, "# ******** SQUAD STANDA", 23, 0) = 23 - 1. read(35, "# ******** SQUAD STANDARD WEAPONS **************\r\n#\t\t0 : *** SQU"..., 4096) = 4096 - 1. ... -1. Data/Ultnames.dat -1. Data/Chanames.dat -1. Data/keymap.dta -1. Filters/wh40k.flt - 1. _llseek(35, 0, [0], SEEK_SET) = 0 - 1. read(35, "\x01\x00\x00\x00", 4) = 4 - 1. _llseek(35, 4, [4], SEEK_SET) = 0 - 1. read(35, "...", 72) = 72 - 1. _llseek(35, 1444, [1444], SEEK_SET) = 0 - 1. read(35, "...", 327680) = 327680 -1. Misc/occlusio.lis - 1. pread64(35, "62 # Number of Absol", 23, 0) = 23 - 1. read(35, "62 # Number of Absolute Deltas.\r\n # These Deltas are off"..., 4096) = 982 - 1. read(35, "", 3114) = 0 -1. Data/GDestroy.dat -1. (stat Obj/destroy.obj) -1. Data/minimap.dat -1. Misc/occlusio.list -1. Obj/specials.obj -1. Obj/Man_Shadow.obj -1. Sets/map01.set -1. Data/Defs.dat -1. [`Assign/jungtil.asn`](docs/formats/obj.md#assign) -1. [`Obj/jungtil.obj`](docs/formats/obj.md) -1. (more assign + obj pairs) -1. Data/Cycle.cyc diff --git a/doc/WarHammer.ani.md b/doc/WarHammer.ani.md index f214480..6b34f0c 100644 --- a/doc/WarHammer.ani.md +++ b/doc/WarHammer.ani.md @@ -1,3 +1,89 @@ +Hypothesis: Idx/WarHammer.idx points objects into bitmap data in Anim/WarHammer.ani + +We can use WH40K_TD.exe and investigate reads of .idx followed by reads of .ani +to test this. + +WH40K_TD.exe opens files in this order: + +1. Data/USEng.dta +1. WH40K_TD.exe (?) +1. Cursor/Cursors.cur + 1. pread64(fd, 23, 0) = 23 + 1. _llseek(fd, 0, [0], SEEK_CUR) = 0 + 1. _llseek(fd, 0, [0], SEEK_CUR) = 0 + 1. _llseek(fd, 40666, [40666], SEEK_SET) = 0 + 1. _llseek(fd, 0, [0], SEEK_SET) = 0 + 1. close(fd) = 0 + 1. read(fd, "\x26\x00\x00\x00\x20\x00\x00\x00\x30\x01\x00\x00\x50\x01\x00\x00\x8a\x9d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 32) = 32 + 1. (...) + 1. _llseek(15, 39868, [39868], SEEK_SET) = 0 + 1. read(15, "...", 798) = 798 +1. (some statting of Idx/WarHammer.idx, no reading that I saw) +1. Anim/WarHammer.ani + 1. read(15, "...", 32) = 32 +1. (some clones of child procs, I didn't follow them) +1. Sounds/wh40k.ds + 1. pread64(31, "...", 23, 0) = 23 + 1. read(31, "...", 417792) = 417792 + 1. read(31, "...", 4096) = 4096 +1. Data/Sounds.dat + 1. pread64(34, "#**********************", 23, 0) = 23 + 1. ... +1. Pic/wh40k.pcx + 1. read(34, "...", 168509) = 168509 +1. Sets/* + 1. (lots of statting these) +1. Data/Randchar.dat + 1. pread64(34, "#**********************", 23, 0) = 23 + 1. read(34, "#***************************************************************"..., 4096) = 4096 + 1. ... +1. Data/WeapDef.dat + 1. pread64(35, "#**********************", 23, 0) = 23 + 1. read(35, "#***************************************************************"..., 4096) = 4096 + 1. ... +1. Data/SpellDef.dat + 1. pread64(35, "#**********************", 23, 0) = 23 + 1. read(35, "#***************************************************************"..., 4096) = 4096 + 1. ... +1. Data/AniObDef.dat + 1. pread64(35, "# ******** ANIMATED OBJ", 23, 0) = 23 + 1. read(35, "# ******** ANIMATED OBJECT DEFINITIONS **************\r\n#\t\t0 : **"..., 4096) = 4096 + 1. ... +1. Data/VehicDef.dat + 1. pread64(35, "# ******** VEHICLE DEFI", 23, 0) = 23 + 1. read(35, "# ******** VEHICLE DEFINITIONS **************\r\n#\t\t0 : *** VEHICL"..., 4096) = 4096 + 1. ... +1. Data/StdWeap.dat + 1. pread64(35, "# ******** SQUAD STANDA", 23, 0) = 23 + 1. read(35, "# ******** SQUAD STANDARD WEAPONS **************\r\n#\t\t0 : *** SQU"..., 4096) = 4096 + 1. ... +1. Data/Ultnames.dat +1. Data/Chanames.dat +1. Data/keymap.dta +1. Filters/wh40k.flt + 1. _llseek(35, 0, [0], SEEK_SET) = 0 + 1. read(35, "\x01\x00\x00\x00", 4) = 4 + 1. _llseek(35, 4, [4], SEEK_SET) = 0 + 1. read(35, "...", 72) = 72 + 1. _llseek(35, 1444, [1444], SEEK_SET) = 0 + 1. read(35, "...", 327680) = 327680 +1. Misc/occlusio.lis + 1. pread64(35, "62 # Number of Absol", 23, 0) = 23 + 1. read(35, "62 # Number of Absolute Deltas.\r\n # These Deltas are off"..., 4096) = 982 + 1. read(35, "", 3114) = 0 +1. Data/GDestroy.dat +1. (stat Obj/destroy.obj) +1. Data/minimap.dat +1. Misc/occlusio.list +1. Obj/specials.obj +1. Obj/Man_Shadow.obj +1. Sets/map01.set +1. Data/Defs.dat +1. [`Assign/jungtil.asn`](docs/formats/obj.md#assign) +1. [`Obj/jungtil.obj`](docs/formats/obj.md) +1. (more assign + obj pairs) +1. Data/Cycle.cyc + Adding a Librarian to the mission builder performs these seeks and reads: _llseek(15, 509440, [509440], SEEK_SET) = 0