C47edit - Scene editor for Hitman C47

Hi,

I am working on a scene editor for the first Hitman game (Codename 47) .



The editor works by extracting and modifying the Pack.SPK file from the ZIP file of a scene.

Loading works, and you can see all the models in the scene. It’s also possible to move, duplicate and delete objects. But at the moment there are no textures, and SPK files saved by the editor will often crash the game. The only thing that I managed to modify without the game crashing is the position of the plant and the camera in the first mission cutscene.

To do this editor, I first took a look at the Pack.SPK file with a hex editor. Then once I noticed that it uses a chunk system, I made a script in Python that would enumerate every chunk. Afterwards I found both object trees (in PROT and PCLP chunks) and wrote the code to enumerate every object in the scene (that you can also see when typing DIR or DIRCLIP in the game’s console after typing IP_DEBUG 1). Once I figured out how the 3D models were stored, I made a script for Blender that would import all the meshes of the scene.

Then when I managed to decode the rotation matrices and everything looked OK, I started making this editor in C++.

As you can see, it’s still a work in progress. But once it’s done, we can maybe make our new missions :sunglasses: .

Tell me your thoughts! :grinning:

As it’s incomplete, there’s no plan to release it yet, but if there is a lot of interest, I might give something to try, or the source code.


2018/08/03: The editor is now available on GitHub: https://github.com/AdrienTD/c47edit

27 Likes

Awesome! I think it would be an awesome tool. I can already see people remaking Sapienza in C47

4 Likes

Hohoho, this would be great for lots of things, especially HitmanWiki.

Excellent work! Keep it up!

1 Like

This is beyond cool, good work!

Edit: Please release the source on GitHub!

1 Like

Very interesting stuff. I just started playing C47, so it’s nice to hear something new about it for a change.

1 Like

Yes indeed, really fascinating what you have here!

1 Like

This looks very promising, as someone who loves C47 I’m excited to see what will become of this

3 Likes

Damn awesome!

@Thales_Kruger @Kcuts_Titogi @Rafaelito258

2 Likes

Good news: I managed to duplicate objects.

plantsman

The objects have to be put at the end of the object tree, otherwise the already existing ones will change their position index in the tree, and the game might have trouble referencing them and crash.

I hope I can make my editor work with other scenes other than the first cutscene.

8 Likes

Looks very promising so far! Can’t wait for Hitman: Codename Potted Plant.

4 Likes

If there’s a way for this to be compatible for Contracts, that’d be fuckin’ ace.

4 Likes

(To clarify I meant the 2004 game not Contracts mode)

1 Like

At the moment, the editor only works for Hitman Codename 47.

While Contracts and C47 share the same engine (Glacier 1), the game file formats used to store the levels are totally different, so it can take a while to decrypt them, but at least there are some similarities.

After the editor’s release (which is soon, maybe until tomorrow), I might take a look at the next Hitman games, but it can be more difficult to make editors for them.

3 Likes

Eh, makes sense. If you could do one for Contracts that’d be amazing. The lack of a freecam and other varieties make it a developmentally obscure game compared to the other games in its series. Anyway, how’d you manage to do this? I was under the impression Hitman modding was mostly impossible so to me this is outstanding work.

2 Likes

Well, I just opened the Pack.SPK file from the ZIP archives into a hex editor and looked around. Then I found out that the SPK was structured in chunks, with each chunk having a name, data, and subchunks.

So I made a simple Python script to show the chunk tree and information on every chunk, so I can verify that I read the files correctly, like this:


Then I found out that every chunk in PROT and PCLP represented an object in the game, and so I made my tool show the object tree and details on every object:

You can take a look at my tool at https://github.com/AdrienTD/47tools .
Then I made a Blender to import the scene, then wrote the editor.

Of course this took time, I started this 2-3 months ago, and sometimes there are things that are/were not obvious, but there are hints (like the name of chunks) and tricks. I did however have experience modding other games.

4 Likes

The editor is now released! It’s still in “pre-alpha” though.
You can get it here: https://github.com/AdrienTD/c47edit

4 Likes

You’re actually outstanding. I’m sure I speak for everyone on this forum when I say you’ve one a massive favour for all of us. Good luck on the other games if you do them.

2 Likes

Yo, I have a question in the meantime regarding Contracts. What file format (For the Meat King’s Party for example) would the level geometry be saved in? (in the MAIN.Zip) folder.

I think the level geometry is inside the PRM file, not totally sure.

At least I found a program that can extract models from PRM and GMS here: http://forum.xentax.com/viewtopic.php?f=16&t=15883

1 Like

Again, you don’t fail to impress. This is the shit I’ve been looking for for decades. I think you’re some sort of holy messiah for the Hitman modding community :stuck_out_tongue:

1 Like