crispy-doom icon indicating copy to clipboard operation
crispy-doom copied to clipboard

Heretic: support automatic version selection of HEHACKED patches

Open kitchen-ace opened this issue 4 months ago • 2 comments

Crispy can load HEHACKED patches in wads automatically now, which is great. However it defaults to version 1.0 patches; 1.3 patches (needed to change the map and episode names of episodes 4 & 5) still need the parameter -hhever 1.3.

This should be fairly easy to change, and I'm willing to do it. But how best to implement it?

For reference here is the header for a HHE patch:

Patch File for HHE v1.1

# Note: Use the pound sign ('#') to start comment lines.

Heretic version = 10
Patch format = 1
  • Heretic version and Patch format numbers can be changed and read by Crispy Heretic currently, but trying to load them in HHE.EXE produces a warning and then defaults back to 10 and 1 when saved, respectively.
  • Comments do not produce errors and can be used as 'magic strings', these again do not get saved in HHE.EXE
  • A separate HHEVER lump could be used.
  • We could try to use heuristics to determine if the patch is for Heretic 1.3; any patch with strings for the 4th or 5th episode can safely be assumed to be 1.3, and anyone wishing to force 1.3 compatibility in their patch can include a replacement for one of these strings (even if the 'replacement' is the original string). Certain other features (code pointer changes etc.) can cause Crispy to error out and suggest using the hhever switch, if they don't match up with what it's expecting for a 1.0 patch.

Assuming any embedded HEHACKED lump is a 1.3 patch is a bad option IMO, especially since there already exist wads with HEHACKED lumps that use the 1.0 format, to avoid needing the -hhever switch.

Last option: someone can help me rewrite Dehacked to support Heretic. (Dehacked has its source released, but Hehacked does not.) Something I've thought of trying before, but a little ambitious for me I think.

kitchen-ace avatar Feb 16 '24 21:02 kitchen-ace

For my taste, HEHACKED text replacements are quite cryptic in general. You basically need to know the text ID for an entry, like an episode name or level title. DEHACKED is so much simpler in comparison, regardless whether it's vanilla or Bex.

NightFright2k19 avatar Feb 18 '24 21:02 NightFright2k19

For my taste, HEHACKED text replacements are quite cryptic in general.

Everything about HEHACKED is messy compared to DEHACKED, and most of it still would be even if there wasn't the multiple versions issue. It could be possible to write up a new standard for advanced ports, but in my ideal world we'd also have a replacement that works on vanilla Heretic and gets support in Chocolate. However maybe that's letting perfect be the enemy of good.

kitchen-ace avatar Feb 18 '24 22:02 kitchen-ace