Hocus Pocus beta - built in level editor?

Discuss game modding
Post Reply
Malvineous
8-bit mega nerd
Posts: 293
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Hocus Pocus beta - built in level editor?

Post by Malvineous »

Hi all,

I was just looking through the .exe from the Hocus Pocus beta and it seems to have a lot of text related to level editing - adding items, setting conditions, etc. Does anyone know whether it is possible to enter some kind of level editor from within the beta version?

Just playing around with certain key combinations revealed that Left Alt + F12 will run the game at high speed until F12 is released, although this works in the released games too.

Has anyone investigated this?
Calvero
5-bit member
Posts: 45
Joined: January 7th, 2008, 6:55 am

Re: Hocus Pocus beta - built in level editor?

Post by Calvero »

Malvineous wrote:Just playing around with certain key combinations revealed that Left Alt + F12 will run the game at high speed until F12 is released, although this works in the released games too.
Isn't that just the DOSBox-unlock-speed-shortcut?
Malvineous
8-bit mega nerd
Posts: 293
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: Hocus Pocus beta - built in level editor?

Post by Malvineous »

Oh it is! I didn't even know DOSBox had that shortcut. Well that's one mystery solved, but there sure is a lot of text in the .exe that sounds like it's for level editing...
User avatar
MrFlibble
Forum Administrator
Posts: 1816
Joined: December 9th, 2010, 7:19 am

Re: Hocus Pocus beta - built in level editor?

Post by MrFlibble »

Hmm, maybe the editor was supposed to run with a command line parameter, rather than a key combination from within the game? IIRC Rise of the Triad has a legacy TEDLEVEL parameter that was used with the TED (Tile EDitor), Apogee's in-house level editing tool.

In fact, many games have leftover editor code (Dune II, Command & Conquer, Red Alert to name just a few), but it's often not fully functional.
Malvineous
8-bit mega nerd
Posts: 293
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: Hocus Pocus beta - built in level editor?

Post by Malvineous »

Good point. There are a few games with the TEDLEVEL parameter but they are just used to warp straight to the level bypassing any intro/menu sequences. I couldn't find this in Hocus Pocus, but there appears to be a bunch of level-related filenames (perhaps for loading levels from outside the .DAT file) and some possible command line parameters: /BKG /SLD /FNC which seem to correspond to some of the map layers. But without reverse engineering it's impossible to say what these strings really are used for.

There's also text for what seems to be a warp menu, so I'm not sure how that could be activated either.
Frenkel
5-bit member
Posts: 41
Joined: March 3rd, 2007, 10:50 am

Re: Hocus Pocus beta - built in level editor?

Post by Frenkel »

I don't know how you're supposed to access the level editor, but I did manage to get into it with the aid of the DOSBox debugger:
  • At the main menu of Hocus Pocus press Alt+Pause to enter the debugger.
  • Then type SR CS B87 [Enter]
  • SR IP 1DE8 [Enter]
  • Press F5 to return to the game/enter the level editor
At least that works for me.

The function keys do something special and Alt+[a letter] does something else.


I don't know how to activate the warp menu either.
You do not have the required permissions to view the files attached to this post.
User avatar
DOSGuy
Website Administrator
Posts: 1064
Joined: September 2nd, 2005, 8:28 pm
Contact:

Re: Hocus Pocus beta - built in level editor?

Post by DOSGuy »

With no knowledge of the debugger whatsoever, it looks like you're putting 0B87h into the CS register and 1DE8h in the IP register to cause the program to jump to address 0B87:1DE8, which is apparently where the editor code starts. Are there any jumps to 1DE8h in the code?
Today entirely the maniac there is no excuse with the article.
Malvineous
8-bit mega nerd
Posts: 293
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: Hocus Pocus beta - built in level editor?

Post by Malvineous »

How did you find out this was the entry point to the editor? Also, don't these values depend on where the executable is loaded? For me when I adjust CS:IP to your values, it just crashes the game and dumps me back to the DOS prompt, with the background music still playing.
User avatar
DOSGuy
Website Administrator
Posts: 1064
Joined: September 2nd, 2005, 8:28 pm
Contact:

Re: Hocus Pocus beta - built in level editor?

Post by DOSGuy »

If the game was running in Real Mode, it would be an absolute address. I don't see DOS/4G or any Protected Mode extenders in the game folder. Even if it is running in Protected Mode, the software doesn't need to know where it has been placed it in memory: it just provides a relative address and the memory manager maps it to the right absolute address. If Frenkel was using the DOSBox debugger, 0B87:1DE8 is probably an absolute address, your copy of DOSBox could be putting the game in a different memory location.

The conversation seemed to be about a beta version of Hocus Pocus. Are you sure that you and Frenkel are using the same version, Malvineous? Maybe you should both post the file details and CRC32 or MD5 of your executables.
Today entirely the maniac there is no excuse with the article.
Frenkel
5-bit member
Posts: 41
Joined: March 3rd, 2007, 10:50 am

Re: Hocus Pocus beta - built in level editor?

Post by Frenkel »

I opened HOCUS.EXE in IDA Pro Free and saw that some strings related to level editing where used in seg005. I couldn't figure out how that code is reached, so I just tried jumping to the first unreachable (red in IDA) code in seg005 and it worked.
User avatar
MrFlibble
Forum Administrator
Posts: 1816
Joined: December 9th, 2010, 7:19 am

Re: Hocus Pocus beta - built in level editor?

Post by MrFlibble »

Malvineous wrote:Good point. There are a few games with the TEDLEVEL parameter but they are just used to warp straight to the level bypassing any intro/menu sequences. I couldn't find this in Hocus Pocus, but there appears to be a bunch of level-related filenames (perhaps for loading levels from outside the .DAT file) and some possible command line parameters: /BKG /SLD /FNC which seem to correspond to some of the map layers. But without reverse engineering it's impossible to say what these strings really are used for.

There's also text for what seems to be a warp menu, so I'm not sure how that could be activated either.
Wow, cool find! :D
User avatar
K1n9_Duk3
4-bit nibble
Posts: 31
Joined: March 26th, 2013, 8:12 am
Contact:

Re: Hocus Pocus beta - built in level editor?

Post by K1n9_Duk3 »

A year ago, I posted a similar message on the ModdingWiki.

Can this level editor only be found in the beta version or will it also work with the full game?
Malvineous
8-bit mega nerd
Posts: 293
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: Hocus Pocus beta - built in level editor?

Post by Malvineous »

I looked through the final registered and shareware versions and those strings aren't there. So it looks like they removed it completely for the final release, but didn't bother for the beta.

But quite possibly levels created with the beta will work in the final version, perhaps with a little modification. Of course Camoto is also able to perform basic editing of Hocus Pocus levels ;-)
Post Reply