Nick Thomas 50d316b5eb Render multiple Z levels
Performance regression warning: this is now quite slow to render when showing
all 7 Z levels. Bounds clipping may be enough to get it back to acceptable
levels, or we may have to do something cleverer
2018-03-25 12:11:48 +01:00
2018-03-25 12:11:48 +01:00
2018-03-18 05:53:01 +00:00
2018-03-22 21:14:49 +00:00
2018-03-24 03:00:31 +00:00

Ordoor

Portmanteau of Order Door, a remake project for Warhammer 40,000: Chaos Gate, the game from 1998.

You must have a copy of the original game data to use this project

No game yet, nothing even close. I'm in the very early stages of trying to understand the various file formats. Until then, you can play WH40K: Chaos Gate in a WinXP VM, disconnected from the internet. It doesn't need 3D rendering!

WH40K.exe is the existing game engine, and WH40K_TD.exe is the map editor. Allows things to be saved as .MAP or as .SMF ("Super Macro File").

Building from source

I'm writing code in Go at the moment, so you'll need to have a Go runtime installed on your system:

$ go version
go version go1.10 linux/amd64

In addition, you'll also need the following packages installed, at least in Debian:

apt-get install libx11-dev libxcursor-dev mesa-common-dev libxrandr-dev \
  libxinerama-dev libgl1-mesa-dev libxi-dev

Clone the source tree to $GOPATH/src/ur.gs/ordoor. You can then run make all to get the binaries that exist at present.

They're not very interesting :D.

Place your WH40K: Chaos Gate installation in ./orig to benefit from automatic path defaults. Otherwise, point to it with -game-path

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

To run:

$ make view-map
$ ./view-map -map orig/Maps/Chapter01.MAP -text 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.

dep bug https://github.com/golang/dep/issues/1725 means I can't use it.

Miscellany

"Mission Setup" includes information about available squad types

From EquipDef.cpp Dumo: CEquipment we learn the following object types:

  1. DELETED
  2. WEAPON
  3. GRENADE
  4. MEDIPACK
  5. SCANNER
  6. GENESEED
  7. CLIP
  8. DOOR KEY
  9. DOOR KEY
  10. DOOR KEY
  11. DOOR KEY

And we learn they can be "on"....

  1. CHARACTER
  2. VEHICLE
  3. 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
  2. WH40K_TD.exe (?)
  3. Cursor/Cursors.cur
  4. pread64(fd, 23, 0) = 23
  5. _llseek(fd, 0, [0], SEEK_CUR) = 0
  6. _llseek(fd, 0, [0], SEEK_CUR) = 0
  7. _llseek(fd, 40666, [40666], SEEK_SET) = 0
  8. _llseek(fd, 0, [0], SEEK_SET) = 0
  9. close(fd) = 0
  10. 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
  11. (...)
  12. _llseek(15</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Cursor/Cursors.cur>, 39868, [39868], SEEK_SET) = 0
  13. read(15</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Cursor/Cursors.cur>, "...", 798) = 798
  14. (some statting of Idx/WarHammer.idx, no reading that I saw)
  15. Anim/WarHammer.ani
  16. read(15</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Anim/WarHammer.ani>, "...", 32) = 32
  17. (some clones of child procs, I didn't follow them)
  18. Sounds/wh40k.ds
  19. pread64(31</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Sounds/wh40k.ds>, "...", 23, 0) = 23
  20. read(31</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Sounds/wh40k.ds>, "...", 417792) = 417792
  21. read(31</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Sounds/wh40k.ds>, "...", 4096) = 4096
  22. Data/Sounds.dat
  23. pread64(34</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/Sounds.dat>, "#**********************", 23, 0) = 23
  24. ...
  25. Pic/wh40k.pcx
  26. read(34</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Pic/wh40k.pcx>, "...", 168509) = 168509
  27. Sets/*
  28. (lots of statting these)
  29. Data/Randchar.dat
  30. pread64(34</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/RandChar.dat>, "#**********************", 23, 0) = 23
  31. read(34</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/RandChar.dat>, "#***************************************************************"..., 4096) = 4096
  32. ...
  33. Data/WeapDef.dat
  34. pread64(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/WeapDef.dat>, "#**********************", 23, 0) = 23
  35. read(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/WeapDef.dat>, "#***************************************************************"..., 4096) = 4096
  36. ...
  37. Data/SpellDef.dat
  38. pread64(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/SpellDef.dat>, "#**********************", 23, 0) = 23
  39. read(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/SpellDef.dat>, "#***************************************************************"..., 4096) = 4096
  40. ...
  41. Data/AniObDef.dat
  42. pread64(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/AniObDef.dat>, "# ******** ANIMATED OBJ", 23, 0) = 23
  43. read(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/AniObDef.dat>, "# ******** ANIMATED OBJECT DEFINITIONS **************\r\n#\t\t0 : **"..., 4096) = 4096
  44. ...
  45. Data/VehicDef.dat
  46. pread64(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/VehicDef.dat>, "# ******** VEHICLE DEFI", 23, 0) = 23
  47. read(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/VehicDef.dat>, "# ******** VEHICLE DEFINITIONS **************\r\n#\t\t0 : *** VEHICL"..., 4096) = 4096
  48. ...
  49. Data/StdWeap.dat
  50. pread64(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/StdWeap.dat>, "# ******** SQUAD STANDA", 23, 0) = 23
  51. read(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Data/StdWeap.dat>, "# ******** SQUAD STANDARD WEAPONS **************\r\n#\t\t0 : *** SQU"..., 4096) = 4096
  52. ...
  53. Data/Ultnames.dat
  54. Data/Chanames.dat
  55. Data/keymap.dta
  56. Filters/wh40k.flt
  57. _llseek(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Filters/wh40k.flt>, 0, [0], SEEK_SET) = 0
  58. read(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Filters/wh40k.flt>, "\x01\x00\x00\x00", 4) = 4
  59. _llseek(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Filters/wh40k.flt>, 4, [4], SEEK_SET) = 0
  60. read(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Filters/wh40k.flt>, "...", 72) = 72
  61. _llseek(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Filters/wh40k.flt>, 1444, [1444], SEEK_SET) = 0
  62. read(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Filters/wh40k.flt>, "...", 327680) = 327680
  63. Misc/occlusio.lis
  64. pread64(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Misc/occlusio.lis>, "62 # Number of Absol", 23, 0) = 23
  65. read(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Misc/occlusio.lis>, "62 # Number of Absolute Deltas.\r\n # These Deltas are off"..., 4096) = 982
  66. read(35</home/lupine/.wine/drive_c/GOG Games/ChaosGate/Misc/occlusio.lis>, "", 3114) = 0
  67. Data/GDestroy.dat
  68. (stat Obj/destroy.obj)
  69. Data/minimap.dat
  70. Misc/occlusio.list
  71. Obj/specials.obj
  72. Obj/Man_Shadow.obj
  73. Sets/map01.set
  74. Data/Defs.dat
  75. Assign/jungtil.asn
  76. Obj/jungtil.obj
  77. (more assign + obj pairs)
  78. Data/Cycle.cyc
Description
Unofficial remake of the classic game, Warhammer 40K: Chaos Gate. Ordoor = Order Door = Chaos Gate. Obviously.
Readme 59 MiB
Languages
Go 94.4%
Ruby 5.2%
Makefile 0.4%