Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Doomkid

Creating an "Auto-Dehacker" for vanilla?

Recommended Posts

I was hoping someone could help me out with this. I'm looking to create a .bat file that makes creating dehacked-modified EXEs even easier than it already is.

 

The idea is: you put example.wad, example.deh, dehacked.exe and this fancy .bat file in a clean vanilla Doom/Doom2 dir. When you run the .bat, it looks for any .deh file in the current dir (asks which one if there are multiple), automatically loads it into dehacked.exe, spits out a fresh doomhack.exe and renames it to "example.exe" (to match the name of the .deh that it loaded) all from simply running the .bat file.

 

Could someone help me in doing this, or at least point me in the right direction? I'm not exactly sure where to start and I'm nowhere near as familiar with DOS commands as I'd like to be. I just prefer this rather than dehacked's default way of doing it with a .INI where you have to specify directories and all that junk - just seems very clunky and old fashioned these days, even for the standards of running vanilla Doom running in DOS. Thanks for reading.

Share this post


Link to post

Oh man, it's been more than a decade since I've done any real DOS/batch file editing, or using real Dehacked for that matter. I'm not up for going down that rabbit-hole right now, sorry. I can tell you there's lots of DOS batch file resources around though, here's a basic menu thing and here's a more advanced one.

 

Actually making a menu out of a directory listing is a bit convoluted, you might need to output a second temporary batch file with the menu, to run from the first. If you don't mind just having the user write the full name of the .deh file you could skip that part.

 

Is there an easy way to make Dehacked work in the current directory?

Share this post


Link to post
On 5/30/2020 at 1:35 AM, Doomkid said:

Could someone help me in doing this, or at least point me in the right direction?

 

Is 486-era DOS compatibility important to you, or is modern Windows as a requirement an option?

 

I think what you are looking for is doable in a modern Windows command prompt. In older DOS, you most likely need a helper application.

Share this post


Link to post
On 5/30/2020 at 10:35 AM, Doomkid said:

The idea is: you put example.wad, example.deh, dehacked.exe and this fancy .bat file in a clean vanilla Doom/Doom2 dir. When you run the .bat, it looks for any .deh file in the current dir (asks which one if there are multiple), automatically loads it into dehacked.exe, spits out a fresh doomhack.exe and renames it to "example.exe" (to match the name of the .deh that it loaded) all from simply running the .bat file.

I could probably whip up a little windows program to do this if you want.

Share this post


Link to post
On 5/30/2020 at 10:35 AM, Doomkid said:

I was hoping someone could help me out with this. I'm looking to create a .bat file that makes creating dehacked-modified EXEs even easier than it already is.

 

The idea is: you put example.wad, example.deh, dehacked.exe and this fancy .bat file in a clean vanilla Doom/Doom2 dir. When you run the .bat, it looks for any .deh file in the current dir (asks which one if there are multiple), automatically loads it into dehacked.exe, spits out a fresh doomhack.exe and renames it to "example.exe" (to match the name of the .deh that it loaded) all from simply running the .bat file.

 

Could someone help me in doing this, or at least point me in the right direction? I'm not exactly sure where to start and I'm nowhere near as familiar with DOS commands as I'd like to be. I just prefer this rather than dehacked's default way of doing it with a .INI where you have to specify directories and all that junk - just seems very clunky and old fashioned these days, even for the standards of running vanilla Doom running in DOS. Thanks for reading.

So basically an extended version of what some older WADS tended to do - Creating a DoomHack executable, appending the dehacked patch, and then renaming the resultant exe, but applied in general.

 

Oddly enough this has been something that did exist. Myk apparently wrote an auto-Dehack patcher that did exactly what you described, as a 2013 post by Archy showed.

I think what also helps is including a blank copy of the executable as DoomHack. Since you obviously can't distribute the full executable, the shareware version could be used for that. That way people could safely toy around with that. Then again, just using Dehacked on your valid executable accomplishes the same thing - The shareware bit is just so that people without a legal copy of Doom can do something similar. It likely would have to be based off an advanced version of it because Doom II does not have a shareware release and relying on Doom.EXE comes with its own limitations.
 

1 minute ago, Lobo said:

I could probably whip up a little windows program to do this if you want.

That would be sublime. Especially if it can automaticaly rename itself after the .deh it is supplied with. That is how a lot of older WADS did it anyway.

 

However, for Windows, i reckon that you have to take into account if the patch is done through Whacked or DOS DeHackEd, in the latter case you may also need DeuSF aswell.

Share this post


Link to post

Why would he need deuSF? Isn't that for graphic patching?

 

I understood that he basically just wants a GUI for passing existing .deh files to Dehacked.exe, with renaming the resulting .exe as the only special part

Share this post


Link to post

dehacked has command line parameters? style "dehacked -load example.deh -write example.exe" or something like that?

Share this post


Link to post

 

1 minute ago, URROVA said:

dehacked has command line parameters? style "dehacked -load example.deh -write example.exe" or something like that?

yep, pretty much.

Share this post


Link to post

So the -load parameter makes dehacked load a patch and write it to the executable (eg doomhack), right? It could be used for the batch.

Share this post


Link to post

Do you still know it would be good? A program that does a DOOMHACK from a vanilla doom for windows/linux/etc, so you don't have to go to dosbox when you want to create one. And it is easier to make .bats for windows

Share this post


Link to post

Well, the program is done but I can't actually try it as I'm on Windows 64 bit and can't run dehacked.exe (or doom.exe for that matter).

 

I hard-coded that Dehacked is called "DEHACKED.EXE" and Doom is called "DOOM.EXE" and both are in the same folder as the program. I also assume that dehacked will spit out a file called "doomhack.exe": is that correct?

 

Want me to upload it to DoomShack?

Share this post


Link to post

Sure, that sounds excellent! The only suggestion I’d have is that it also look for “DOOM2.EXE” (afaik most DeHackEd mods are for D2)

 

Also yes, it spits out “doomhack.exe”, that’s correct.

 

Also, @plums, I meant to say earlier that if you just get rid of the INI that comes with DeHackEd, it seems to just assume everything is in the same dir as it is, which is convenient in most instances 

Share this post


Link to post

Just uploaded: called AutoDehacked.zip.

If it can't find "DOOM.EXE" it will try for "DOOM2.EXE".

 

Hope it works!

Share this post


Link to post
14 hours ago, Lobo said:

Why would he need deuSF? Isn't that for graphic patching?

 

I understood that he basically just wants a GUI for passing existing .deh files to Dehacked.exe, with renaming the resulting .exe as the only special part

I should clarify. It might also be worthwhile to detect whether a patch was done with Dehacked or Whacked. In the case of Dehacked, and if there are additional graphics present, it might be worthwhile to automate the process, for which you need DeusF.

 

A lot of Doomhacked executable also include graphic patches that have to be appended along with it, as far as i understand.

44 minutes ago, Lobo said:

Just uploaded: called AutoDehacked.zip.

If it can't find "DOOM.EXE" it will try for "DOOM2.EXE".

 

Hope it works!

In case the link falls off the DoomShack page, here it is directly: AutoDehacked.zip
 

EDIT: OH wow this is even better than expected. Really, really polished!

EDIT2: So tested this out:

  • Doom2.exe
  • Dehacked.exe (Both in the same directory as Autodehacked)
  • Roks.deh

 

It correctly sees Roks.deh but when i hit process, it will complain that DeHackEd is not a supported program. Which is logical since its DOS based. So AutoDehacked detects DeHackEd, but can't launch it, because it needs to launch DosBox.

 

EDIT3: So i crafted a Doomhack.exe from Doom2.exe.  So here is what i have now in folder:

  • Doom2.exe
  • Dehacked.exe
  • Roks.deh
  • Doom2.wad
  • Doomhack.exe

 

The first line of issue remains that AutoDehacked attempts to launch Dehacked which it obviously can't do.

 

When launching Dehacked, It says it can't find Doom.wad (obviously) but it offers to make a copy of Doom2.exe and call it Doomhack, which it does.

 

Now AutoDehacked still launches with the issue that it wants to launch Dehacked, but it now also recognizes the resultant Doomhack and wants to create Roks.exe, but now the following error pops up: ''argument NewName has to be a name and not an absolute path: C:\AutoDehacked\C:\AutoDehacked\Roks.exe''.

It seems it accidentially copies the full path name when it wants to write Roks.exe.

 

For the lesser informed, a small how-to use file would be recommended.

Edited by Redneckerz

Share this post


Link to post
20 minutes ago, Redneckerz said:

I should clarify. It might also be worthwhile to detect whether a patch was done with Dehacked or Whacked. In the case of Dehacked, and if there are additional graphics present, it might be worthwhile to automate the process, for which you need DeusF.

 

A lot of Doomhacked executable also include graphic patches that have to be appended along with it, as far as i understand.

I still don't see the link between DeusF and Whacked: using one does not imply needing the other. You can have pwads with custom graphics without having a corresponding .deh file and vice versa.

Unless you mean it would be nice to have a GUI for DeusF, but then you have various alternatives already which would no doubt handle it better anyway (Wintex, XWE, Slade)

Share this post


Link to post
Just now, Lobo said:

I still don't see the link between DeusF and Whacked: using one does not imply needing the other. You can have pwads with custom graphics without having a corresponding .deh file and vice versa.

Unless you mean it would be nice to have a GUI for DeusF, but then you have various alternatives already which would no doubt handle it better anyway (Wintex, XWE Slade)

You know nevermind, its irrelevant and i reckon i misremembered.

Please read the above edits as i have tested your prog :)

Share this post


Link to post

Cheers for trying it out and giving great feedback. I can fix the renaming bug, but the fact that dehacked.exe wont run is the reason I cant test it either: I'm on a 64bit windows box. I assume DoomKid isn't so hopefully he'll have no issues there.

I'll see if I can upload a new version in a bit to fix the renaming bug.

Share this post


Link to post
8 minutes ago, Lobo said:

Cheers for trying it out and giving great feedback. I can fix the renaming bug, but the fact that dehacked.exe wont run is the reason I cant test it either: I'm on a 64bit windows box. I assume DoomKid isn't so hopefully he'll have no issues there.

I'll see if I can upload a new version in a bit to fix the renaming bug.

You are welcome. I have quite a list of Dehacked wads that require renaming in DOS to a new exe using DoomHack, so a program that can do this in a GUI is definitely helpful enough, especially when the DOS process is cumber some.

 

The only thing i have yet to test is doing multiple .deh files in the directory. Does AutoDehacked retain the Doomhack.exe for each, or do you need to make a new one with every (renamed) executable? I obviously can't test this yet because of the renaming issue, but that was something i thought if you want to convert multiple dehacked files.

 

As it stands, DoomHack now gets renamed to Roks.exe - Leaving you without a blank Doomhack.

Share this post


Link to post

Each time you hit "process" it will try and get dehacked.exe to generate a new doomhack.exe, which will then be renamed. So if you have 3 .deh files, you will end up with 3 .exe, one for each. You should never end up with a blank doomhack.exe.

 

Just uploaded the bugfix version, with some basic in-built help and a quick readme.txt in the zip: https://www.doomshack.org/uploads/AutoDehackedV1.1.zip

Share this post


Link to post
1 minute ago, Lobo said:

Each time you hit "process" it will try and get dehacked.exe to generate a new doomhack.exe, which will then be renamed. So if you have 3 .deh files, you will end up with 3 .exe, one for each. You should never end up with a blank doomhack.exe.

By that accord, the standard DeHacked requirements do apply and are required:

Doom.exe or Doom2.exe (Most often D2)

Doom.wad or Doom2.wad

Dehacked ini technically is not needed. All it needs to make a DoomHack is these files, which then get renamed.

 

So if i get this correctly the only real issue is calling to DeHacked because that will always cough up an error in Windows. DOSBox has to be called instead, with Dehacked auto-loaded to it.

1 minute ago, Lobo said:

 

Just uploaded the bugfix version, with some basic in-built help and a quick readme.txt in the zip: https://www.doomshack.org/uploads/AutoDehackedV1.1.zip

Ill check this out :) Thanks.

Share this post


Link to post

Yes, any 16bit program will refuse to run in Windows 64bit.

I couldn't even install the shareware doom to test because the installer is 16 bit...

Share this post


Link to post

@Lobo Just tested your 1.1 out:

  • It still kicks up the error that DeHackEd can't be launched, but i noticed that it tries to call it from here: ''\??\C:\AutoDehacked\DEHACKED.EXE''. The bolded seems to be problematic.
  • The naming issue is resolved and does not kick up.
  • Weirdly enough, despite the error, the program does seem to continue, as i am left with a Roks.exe file. There is just no confirmation screen that says ''Roks.deh correctly converted to Roks.exe, using DOOMHACK'' or something to that note. There is no DOOMHACK.exe anymore.
  • To repeat, i will have to make a new Doomhack using Dehacked, which requires DOSBox.

 

I have not yet tested if this Roks.exe actually has the .deh applied because i realize Roks is not the best example for this. ill try it with one of the WolfenDoom episodes.

 

If that works, then the utility seems to work, i guess? :P

 

Share this post


Link to post
27 minutes ago, Lobo said:

Each time you hit "process" it will try and get dehacked.exe to generate a new doomhack.exe, which will then be renamed. So if you have 3 .deh files, you will end up with 3 .exe, one for each. You should never end up with a blank doomhack.exe.

 

Just uploaded the bugfix version, with some basic in-built help and a quick readme.txt in the zip: https://www.doomshack.org/uploads/AutoDehackedV1.1.zip

This program looks excellent and I love the icon, but unfortunately (as you already stated) DEHACKED.EXE will only run in DOS or super old versions of Windows, and AutoDehacker.exe will not run in DOS, causing a catch 22 where no matter which OS I use, one of the two programs won't work - I really should have specified that I was looking for something fully DOS compatible, just because that's the only environment which I know for sure dehacked.exe works in..

 

If Dehacked.exe and AutoDehacker.exe both run in a 16 bit version of Windows, then one could definitely get this combination working using a VM, but I'm worried that might be too obscure of a solution for most people.

 

I apologize, this whole situation is my fault for not being clearer. If AutoDehacker.exe could somehow work in DOS, or conversely if someone could "port" DeHackEd to modern 32/64 bit Windows, then this would be the perfect solution. (It's a shame WhackEd doesn't have the option to look for DOOM or DOOM2.EXE and generate a DOOMHACK.EXE)

Share this post


Link to post
4 minutes ago, Doomkid said:

This program looks excellent and I love the icon, but unfortunately (as you already stated) DEHACKED.EXE will only run in DOS or super old versions of Windows, and AutoDehacker.exe will not run in DOS, causing a catch 22 where no matter which OS I use, one of the two programs won't work - I really should have specified that I was looking for something fully DOS compatible, just because that's the only environment which I know for sure dehacked.exe works in..

 

If Dehacked.exe and AutoDehacker.exe both run in a 16 bit version of Windows, then one could definitely get this combination working using a VM, but I'm worried that might be too obscure of a solution for most people.

 

I apologize, this whole situation is my fault for not being clearer. If AutoDehacker.exe could somehow work in DOS, or conversely if someone could "port" DeHackEd to Windows, then this would be the perfect solution. (It's a shame WhackEd doesn't have the option to look for DOOM or DOOM2.EXE and generate a DOOMHACK.EXE)

See my earlier comment.  It might very well be that what i think works.

 

If that's the case, then all AutoDeHacked should be doing is making a copy of DoomHack (As opposed to generating one) after processing so you can batch convert. You would only need to generate a DoomHack exectuable once using DeHackEd then.

Share this post


Link to post

So, if I understand correctly: under DOS, you use Dehacked to generate a new DoomHack.exe, then in Windows running AutoDehacker.exe can do a batch conversion of all .DEH files present over to new DoomHack EXEs? If that's the case, that would be super useful as a batch converter, but really the main step I wanted to avoid was anyone having to run Dehacked themselves at all - sort of a "one run process" of generating all you need to play once the proper contents are all in your Doom or Doom2 dir.

 

The solution I have in mind right now is that, maybe instead of trying to run Dehacked.exe directly, the program could launch it in DosBox, run Dehacked that way, thus making it able to spit out the desired (and renamed) DoomHack.exe? It sounds kind of convoluted, but it would be one way to circumvent the OS incompatibility between Dehacked and AutoDehacker

Share this post


Link to post
2 minutes ago, Redneckerz said:

If that's the case, then all AutoDeHacked should be doing is making a copy of DoomHack (As opposed to generating one) after processing so you can batch convert. You would only need to generate a DoomHack exectuable once using DeHackEd then.

That doesn't make sense: think about it for a minute. Each .deh file will generate a unique .exe: they will never be the same. So you can't just use one doomhack.exe and make renamed copies.

To slightly automate you would need to have multiple .deh files and multiple doomhack.exe files in the same folder, which you can't because the filenames can't be the same. So you would have to rename them manually, which then defeats the purpose of  automatically renaming them.

 

Anyway, guess this is going nowhere: it will only be useful for someone who is on 32bit windows. Sorry folks!

Share this post


Link to post

I really appreciate the effort, just want you to know that! If only there was a 32bit variant of Dehacked.. Last time I was on 32bit Windows XP, even it couldn't run Dehacked.exe or Doom/Doom2.exe, which IIRC are 8bit programs that will also run in 16bit, but no greater.

Share this post


Link to post

So why do you even need this if you need an emulator to run Doom.exe anyway?

Just curious because I thought you were stuck on windows 98 or something :)

Share this post


Link to post
17 minutes ago, Doomkid said:

So, if I understand correctly: under DOS, you use Dehacked to generate a new DoomHack.exe, then in Windows running AutoDehacker.exe can do a batch conversion of all .DEH files present over to new DoomHack EXEs? If that's the case, that would be super useful as a batch converter, but really the main step I wanted to avoid was anyone having to run Dehacked themselves at all - sort of a "one run process" of generating all you need to play once the proper contents are all in your Doom or Doom2 dir.

 

The solution I have in mind right now is that, maybe instead of trying to run Dehacked.exe directly, the program could launch it in DosBox, run Dehacked that way, thus making it able to spit out the desired (and renamed) DoomHack.exe? It sounds kind of convoluted, but it would be one way to circumvent the OS incompatibility between Dehacked and AutoDehacker

My impression is that you only need to run DeHacked once. See below :)

16 minutes ago, Lobo said:

That doesn't make sense: think about it for a minute. Each .deh file will generate a unique .exe: they will never be the same. So you can't just use one doomhack.exe and make renamed copies.

I quite get that. The .deh file name will make a unique executable with the unique name. But first you need to have DoomHack in place, and that's the one you generate with DeHacked.

 

So basically, this is what i think you mean:

  • Generate a DoomHack.exe through DOS Dehacked
  • Run AutoDehack and select Roks.deh
  • Clicking on ''Process'': AutoDehack uses the Doomhack.exe that we generated by DeHacked and the resultant exe is Roks.exe
  • Done.

This is what ii suggest:

  • Generate a DoomHack.exe through DOS Dehacked
  • Run AutoDehack and select Roks.deh
  • Clicking on ''Process'': AutoDehack makes Roks.exe, but before it does this, it also makes a copy of DoomHack.exe (Which is still ''blank'' as its simply a copy of the generated executable) (This could be done with a toggle). Dehacked is only needed to generate DoomHack: Copying that same file isn't the same as generating one
  • You still get Roks.exe, but you also retain DoomHack.exe to use when you want to convert another .deh file. Else you continously need to generate a new DoomHack.exe from Doom2.exe using DOS.

The generated DoomHack.exe is always the same since its a copy of Doom2.exe. So a copy of DoomHack is also the same, its ''blank'', without the unique .deh patch applied.

 

Note that Generating DoomHack and Copying DoomHack aren't the same thing in here. You generate DoomHack with DeHacked, you copy DoomHack simply by copying it in Windows.

 

Quote

To slightly automate you would need to have multiple .deh files and multiple doomhack.exe files in the same folder, which you can't because the filenames can't be the same. So you would have to rename them manually, which then defeats the purpose of  automatically renaming them.

You technically don't have to with the above explanation. AutoDehacked just does a copy of the generated DoomHack executable, it basically ''stockpiles'' that exe by making a copy (of DoomHack) everytime you process a .deh (Which gets its unique name and a unique executable).

 

That way you only need to use Dehacked once, which is to generate DoomHack. After that, AutoDehacked can simply run without it since you just make a copy in advance in case you want to do multiple conversions.

 

Share this post


Link to post
16 minutes ago, Lobo said:

So why do you even need this if you need an emulator to run Doom.exe anyway?

Just curious because I thought you were stuck on windows 98 or something :)

The real reason is that, even in an OS where Doom.exe and Dehacked.exe work (either DOS or 16bit Windows), there's a bit of rigamarole: You have to run Dehacked, then confirm you want to generate a clean/new Doomhack, press W to write your changes to Doomhack.exe, close the program, then rename Doomhack to <insert name here>.exe.

 

I basically just wanted a tool that automated all of that crap with a single run (which would have to be able to run in DOS). I figured it could all be done with a batch file that just executes all of those commands in order, but the hard part - which would make it an "all purpose" tool - would be getting it to automatically detect whatever .deh file is in the same directory as the tool itself, so that it knows what .deh is to be loaded into Dehacked, and thus which .deh will be used to generate a new modified DoomHack.exe

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×