WH40K: Chaos Gate

Re-implementation of the WH40K binary.

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

WH40K.exe is the existing game engine

WH40K_TD.exe is the map editor. Allows things to be saved as .MAP or as .SMF ("Super Macro File")

This README is a grab-bag of miscellaneous information about file formats at present. This is being migrated to the Formats overview as a precursor to making this file useful!

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!

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

Clone the source tree to $GOPATH/src/ur.gs/chaos-gate. You can then run make loader or make view-map to get the two 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

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.

Unmigrated text

"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%