H4ResourceEditor

The old Heroes games developed by New World Computing. Please specify which game you are referring to in your post.
User avatar
TheFallenOne
Leprechaun
Leprechaun
Posts: 5
Joined: 31 Jan 2023

Re: H4ResourceEditor

Unread postby TheFallenOne » 06 Feb 2023, 10:18

iLiVeInAbOx05 wrote: 03 Feb 2023, 16:39
TheFallenOne wrote: 03 Feb 2023, 14:31 Hello. Can you tell me please how to change colors of hero's sprite with your tool?

Image

Hey there, your image is broken so I can't see what you're trying to show there.

As far as changing the colors of something, you should first export each of the sprites you want to update the colors on. There is a mass export feature to make this easier.

After you have exported all the sprites you want to color, then you'll have to use an external editor, such as Gimp or Photoshop, to make any color adjustments that you desire.

Finally, you can to a mass import of all of your newly updated sprites.

Let me know if you have anymore questions!
Thank you! Sounds easy enough. I will try at a leisure. Glad that people still remember this great game.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 788
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 06 Feb 2023, 14:51

TheFallenOne wrote: 06 Feb 2023, 10:18 Thank you! Sounds easy enough. I will try at a leisure. Glad that people still remember this great game.

No problem! Yeah the hardest part is (and should be) updating the image. Exporting and importing into game resources using the resource editor is pretty good to go :)

User avatar
TheFallenOne
Leprechaun
Leprechaun
Posts: 5
Joined: 31 Jan 2023

Re: H4ResourceEditor

Unread postby TheFallenOne » 14 Feb 2023, 11:35

It would be cool if you had some sort of guide or documentation on how to correctly import the files.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 788
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 14 Feb 2023, 15:21

TheFallenOne wrote: 14 Feb 2023, 11:35 It would be cool if you had some sort of guide or documentation on how to correctly import the files.

Yeah there are definitely examples, but unfortunately they are buried in the pages and pages of this thread and the one over on HeroesCommunity.

If what you want to do is edit the images of the heroes, you'll want to open heroes4.h4r with the resource editor, and navigate into actor_sequences and look for the heroes. When you find a hero you want to edit, you should be able to do a mass export of all sprites by right clicking the note and selecting either "mass export ora" or "mass export png" depending on which you prefer to work with.

Now you just use photoshop or gimp (or whatever your preferred image editor is) to make your adjustments.

When you're done with that, there is a mass import feature which will allow you to import your updated images into the h4d files they belong to.

Let me know when you get to the mass importing step and I'll help you out there. You need a certain directory structure, which I think the mass import dialogue actually specifies for you, but I'm sure it would still be helpful for me to walk you through the first time.

Just let me know when you get there or if you have any other questions along the way! I'll also look around here and find where I posted about the mass export and import features.

Edit. Here is the post explaining mass export / import using ora files. If you are working with pngs it's very similar.

Edit 2. Here is a post about importing using pngs. Basically the folder the pngs are in must be named as the h4d file they should be imported into.

Here is a post about mass png export / import with all files in a single directory.

User avatar
TheFallenOne
Leprechaun
Leprechaun
Posts: 5
Joined: 31 Jan 2023

Re: H4ResourceEditor

Unread postby TheFallenOne » 14 Feb 2023, 17:14

iLiVeInAbOx05 wrote: 14 Feb 2023, 15:21
TheFallenOne wrote: 14 Feb 2023, 11:35 It would be cool if you had some sort of guide or documentation on how to correctly import the files.

Yeah there are definitely examples, but unfortunately they are buried in the pages and pages of this thread and the one over on HeroesCommunity.

If what you want to do is edit the images of the heroes, you'll want to open heroes4.h4r with the resource editor, and navigate into actor_sequences and look for the heroes. When you find a hero you want to edit, you should be able to do a mass export of all sprites by right clicking the note and selecting either "mass export ora" or "mass export png" depending on which you prefer to work with.

Now you just use photoshop or gimp (or whatever your preferred image editor is) to make your adjustments.

When you're done with that, there is a mass import feature which will allow you to import your updated images into the h4d files they belong to.

Let me know when you get to the mass importing step and I'll help you out there. You need a certain directory structure, which I think the mass import dialogue actually specifies for you, but I'm sure it would still be helpful for me to walk you through the first time.

Just let me know when you get there or if you have any other questions along the way! I'll also look around here and find where I posted about the mass export and import features.

Edit. Here is the post explaining mass export / import using ora files. If you are working with pngs it's very similar.

Edit 2. Here is a post about importing using pngs. Basically the folder the pngs are in must be named as the h4d file they should be imported into.

Here is a post about mass png export / import with all files in a single directory.
Working on this amount of sprites is pretty time-consuming. I am not confident that I can pull this off, so i start with something I little bit easier, like changing the main menu picture. It's bitmap_raw option in heroes4.h4r archive.
I chose option "export PNG" but since those files are BMP format I did not get any picture out of it for photoshop. Just empty folders. Same with ora files. Only "Extract all" worked out for me and now I got:
H4ResourceEditor\files\bitmap_raw\menu\main
bitmap_raw.menu.main.0800.h4d
bitmap_raw.menu.main.1024.h4d
bitmap_raw.menu.main.1280.h4d

I tried to import changed versions of those files, but it didn't work for me. I couldn't save changed heroes4.h4r.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 788
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 14 Feb 2023, 17:49

So the main menu files are stored as bmp images, not png or ora. All you need to do to update those is to open up one of resources, such as bitmap_raw.menu.main.1280.h4d, then go to File->Import and then select the image you want as the main menu. I think any transparent areas in the imported image will be black, but I can't remember.

Once you've imported the image, then save bitmap_raw.menu.main.1280.h4d somewhere like on your desktop where you can find it easily.

Since this is the main menu you're wanting to update, you have to package bitmap_raw.menu.main.1280.h4d into a new h4r file, so in the resource editor you'll want to File->New and select h4r container.

From here, you'll want File->Add and then select bitmap_raw.menu.main.1280.h4d (and the others if you've saved them as well). Then File->Save and name it new.h4r if you're playing standard, or new_mod.h4r if you're playing Equilibris.

Copy the h4r file to your Heroes 4 Data directory, and then startup the game and take a look :D

The thing is that you do NOT want to mess with the actual game resource files, like heroes4.h4r. It's best, especially when you're just starting out, so use new.h4r/new_mod.h4r to try adding and updating things.

User avatar
TheFallenOne
Leprechaun
Leprechaun
Posts: 5
Joined: 31 Jan 2023

Re: H4ResourceEditor

Unread postby TheFallenOne » 15 Feb 2023, 11:20

iLiVeInAbOx05 wrote: 14 Feb 2023, 17:49 So the main menu files are stored as bmp images, not png or ora. All you need to do to update those is to open up one of resources, such as bitmap_raw.menu.main.1280.h4d, then go to File->Import and then select the image you want as the main menu. I think any transparent areas in the imported image will be black, but I can't remember.

Once you've imported the image, then save bitmap_raw.menu.main.1280.h4d somewhere like on your desktop where you can find it easily.

Since this is the main menu you're wanting to update, you have to package bitmap_raw.menu.main.1280.h4d into a new h4r file, so in the resource editor you'll want to File->New and select h4r container.

From here, you'll want File->Add and then select bitmap_raw.menu.main.1280.h4d (and the others if you've saved them as well). Then File->Save and name it new.h4r if you're playing standard, or new_mod.h4r if you're playing Equilibris.

Copy the h4r file to your Heroes 4 Data directory, and then startup the game and take a look :D

The thing is that you do NOT want to mess with the actual game resource files, like heroes4.h4r. It's best, especially when you're just starting out, so use new.h4r/new_mod.h4r to try adding and updating things.
God.... Finally it's worked! Thank you very much a such detailed explanation! So now I have to update every time my new.h4r file if I want to make some additional changes?

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 788
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 15 Feb 2023, 14:49

I think the best way currently is to keep all of your modded h4d files in a folder just for those files. Whenever you have an updated h4d file, or if you add a new modded h4d file to this folder, then create a new new.h4r / new_mod.h4r.

If you have all of the h4d files in a single folder, you can use File->Add All after creating the new h4r container in the resource editor, and everything from the selected directory will get added.

I don't think you can overwrite files within an h4r at the moment, but I do plan to get around to that eventually. I would still try to stay away from updating the actual game resource files, such as heroes4.h4r. It's just much cleaner to use your own new.h4r to override whatever you want.

User avatar
Grythandril
Leprechaun
Leprechaun
Posts: 19
Joined: 06 Jan 2006
Location: Grythandril

Re: H4ResourceEditor

Unread postby Grythandril » 09 Jul 2023, 09:39

I need advice

I have downloaded Heroes IV from GOG
I have downlaoded the latest H4ResourceEditor to try and replace the music files

The music files are .mp3 with the 44100 sample rate and stereo.
I have created a folder to pack my modified sound files into new.h4r and placed it in the data folder.
However when i change one of the music files it does no work it just comes up silent

Any suggestions

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 788
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 09 Jul 2023, 18:47

Grythandril wrote: 09 Jul 2023, 09:39 I need advice

I have downloaded Heroes IV from GOG
I have downlaoded the latest H4ResourceEditor to try and replace the music files

The music files are .mp3 with the 44100 sample rate and stereo.
I have created a folder to pack my modified sound files into new.h4r and placed it in the data folder.
However when i change one of the music files it does no work it just comes up silent

Any suggestions

Hello there! Which music files specifically are you trying to replace?

If possible, could you upload the h4r and h4d files? Maybe also the mp3 files so I can give it a try and see if it also doesn't work for me?

User avatar
Grythandril
Leprechaun
Leprechaun
Posts: 19
Joined: 06 Jan 2006
Location: Grythandril

Re: H4ResourceEditor

Unread postby Grythandril » 09 Jul 2023, 19:49

well I tried to replace the following but still call it the same file name with the same specs

sound.town.order with Heroes V end credits theme
sound.town.nature with either Heroes V Nature or Might & Magic Heroes VI Shades of Darkness OST - Elven Forest theme
sound.town.might with Heroes III stronghold theme
sound.town.life with Heroes IV Haven theme
sound.town.death with Heroes III necropolis theme
sound.town.chaos with Heroes III Dungeon Theme

I was able to achieve this when i had the cd versions but with gog complete its not possible

i must be doing something wrong

User avatar
Grythandril
Leprechaun
Leprechaun
Posts: 19
Joined: 06 Jan 2006
Location: Grythandril

Re: H4ResourceEditor

Unread postby Grythandril » 09 Jul 2023, 19:52

ho do i upload them here?

User avatar
Pol
Admin
Admin
Posts: 10258
Joined: 29 Nov 2005
Location: IN SOMNIS VERITAS
Contact:

Re: H4ResourceEditor

Unread postby Pol » 09 Jul 2023, 19:54

You need to use some upload service and then link the files here. ;)
Like here: https://uschovna.cz/en/?set_lang=en
"We made it!"
The Archives | Collection of H3&WoG files | Older albeit still useful | CH Downloads
PC Specs: A10-7850K, FM2A88X+K, 16GB-1600, SSD-MLC-G3, 1TB-HDD-G3, MAYA44, SP10 500W Be Quiet

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 788
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 09 Jul 2023, 23:44

Grythandril wrote: 09 Jul 2023, 19:49 well I tried to replace the following but still call it the same file name with the same specs

sound.town.order with Heroes V end credits theme
sound.town.nature with either Heroes V Nature or Might & Magic Heroes VI Shades of Darkness OST - Elven Forest theme
sound.town.might with Heroes III stronghold theme
sound.town.life with Heroes IV Haven theme
sound.town.death with Heroes III necropolis theme
sound.town.chaos with Heroes III Dungeon Theme

I was able to achieve this when i had the cd versions but with gog complete its not possible

i must be doing something wrong

Ah so just trying to replace the town themes. That should be doable, but I admit I haven't tried to replace them before. All I've replaced is the main menu theme.

I've been thinking about making some mini music mods, so maybe I'll take a look at that now :)

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 788
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 10 Jul 2023, 04:42

I just tried replacing sound.town.order with sound.town.death and it worked. I exported sound.town.death, then imported the .mp3 into sound.town.order and saved. I ended up needing to save it as a different name first for some reason, then renamed back to sound.town.order.h4d after removing the other one.

I also tried to import a different .mp3 file and it was unable to play. I remember at one point being able to import a random .mp3 for the main menu and it working fine, so I'll need to see if I can get that to work again.

The issue is not knowing everything about the H4 sound header for sound files, as well as my having very limited knowledge about stuff like bit rates and sample rates. Then there is also how those fields apply to .mp3 vs .wav files that I don't really differentiate between which is another issue.

User avatar
Grythandril
Leprechaun
Leprechaun
Posts: 19
Joined: 06 Jan 2006
Location: Grythandril

Re: H4ResourceEditor

Unread postby Grythandril » 10 Jul 2023, 20:17

I too was able to change music tracks within the GOG heroes IV game eg battle 3 music for life town theme and battle 2 music for Nature town theme and it works fine

but any outside sourcce music eg heroes III or Heroes V etc and it will not play.

Now this is strange as i was able to get it to work on the cd version of heroes IV ages ago

I will look out these cd and load them up and see if it owrk on that version

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 788
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 11 Jul 2023, 01:00

Grythandril wrote: 10 Jul 2023, 20:17 I too was able to change music tracks within the GOG heroes IV game eg battle 3 music for life town theme and battle 2 music for Nature town theme and it works fine

but any outside sourcce music eg heroes III or Heroes V etc and it will not play.

Now this is strange as i was able to get it to work on the cd version of heroes IV ages ago

I will look out these cd and load them up and see if it owrk on that version

It's more than likely something wrong with the h4 sound header that I'm filling out.

I was able to replace the main menu theme with the FF6 decisive battle theme and it worked fine, so possibly that particular mp3 file had the same specs as the h4 tracks.

If you upload some of the files you're trying to import I can try things out on my end and see if I can figure it out.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 788
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 11 Jul 2023, 04:48

After taking a closer look at the h4 sound headers for .mp3 and .wav files, I noticed that the headers are actually different between the two file types. H4 sound headers for mp3 files have an additional field at the end (which is the length of the .mp3 file). The field that I had written down as byte rate is actually the length of the .wav data, and I'm unsure of what the field is for .mp3 files.

So I have some work to do to clean this up.

User avatar
Grythandril
Leprechaun
Leprechaun
Posts: 19
Joined: 06 Jan 2006
Location: Grythandril

Re: H4ResourceEditor

Unread postby Grythandril » 11 Jul 2023, 22:58

I loaded in the cd version of heroes iv with patches and expansions etc
i tried to change the music but it failed
however i came across a old heroes music.h4r whic i created several years ago and i put into the data folder and it worked
i put the same file into GOG version and that worked too
it plays different sounds from various heroes music games
but when i alter the old sound files it failed on the new music.h4r
so am not sure how i managed it all those years ago
will need to look at this again

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 788
Joined: 21 Jul 2014

Re: H4ResourceEditor

Unread postby iLiVeInAbOx05 » 12 Jul 2023, 00:20

Grythandril wrote: 11 Jul 2023, 22:58 I loaded in the cd version of heroes iv with patches and expansions etc
i tried to change the music but it failed
however i came across a old heroes music.h4r whic i created several years ago and i put into the data folder and it worked
i put the same file into GOG version and that worked too
it plays different sounds from various heroes music games
but when i alter the old sound files it failed on the new music.h4r
so am not sure how i managed it all those years ago
will need to look at this again

You used something else other than the resource editor when you did it before.

Just relax, I should be able to get the resource editor back up and going for importing sounds :) I want to make a Lords of Magic music mod so I'll need to fix the sound stuff.


Return to “Heroes I-IV”

Who is online

Users browsing this forum: No registered users and 1 guest