Heroes of Might and Magic II

Edit: As of November 2010, this information is grossly outdated and I haven’t added much of the knowledge I gained on the subject yet.

Heroes of Might and Magic II Reverse Engineering

Recently, I’ve been trying to work out how the main files to Heroes of Might and Magic II (HoMMII) work.

If anybody has any information on any of the formats, please contact me.

Game Archive File: .AGG

I am able to unpack all files from a HoMMII type AGG game archive file.

There are the following file types in an AGG file:

  • 82M (Raw Wave Sound files)
  • BIN (?)
  • BMP (? Not a typical Microsoft Bitmap file)
  • FNT (? Not a typical Microsoft Font file)
  • ICN (Sprite Archives)
  • TIL (?)
  • XMI (Miles Sound System eXtended MIDI File)

Here is what I know about each of the file formats so far:

Raw Wave Sound Files: .82M

The .82M files can be played with any sound editor capable of reading raw wave data at a rate of 22050Hz / 8-Bit Unsigned / Mono.

I am now able to output the raw data as a standard Windows PCM Wave file.

Bin Files: .BIN

Unknown

BMP Files: .BMP

Unknown

FNT Files: .FNT

Unknown

Sprite Archives: .ICN

I’ve been creating a small application to read .ICN files and have made significant progress:

Heroes of Might and Magic II ICN Sprite File Viewer

There are still quite a few unknown control codes as well as pallete colours I have yet to discover.

Til Files: .TIL

Unknown

Music Files: .XMI

XMI files are similar to standard MID files and can typically be converted to MID

There are also certain files that exist outside of the main AGG game archive files:

  • MP2 / MX2 (Map files)

Map Files: .MP2 / .MX2

I’ve made decent progress with the HoMMII map file format, especially regarding the basic tile type, such as Grass, Ice, Swamp, etc.

I created a small Visual Basic demonstration application to test my findings.

Heroes of Might and Magic Mini-Map Viewer

Although I can distinguish the different tile types (Grass, Ice, Swamp, etc) I am unable to distinguish the various tile items that add shading detail to the mini-map (e.g. mountains, trees, etc).

Downloads

Extraction utility for reading the contents of Heroes of Might and Magic I AGG game archive files.

Heroes 1 AGG Extractor / Reader

Extraction utility for reading the contents of Heroes of Might and Magic II AGG game archive files.

Heroes 2 AGG Extractor / Reader

(Last updated: 4th Jan 2008)

22 comments

  1. could you explain to me how to edit creature statistics and building costs and other variables like that?

    i want to balance the game out as certain aspects are fairly strong when used in certain ways..

  2. I don’t actually have much knowledge of this particular area of HoMMII. I get the feeling that stuff would be in the executable, however, but don’t go quoting me on that.

    Try searching for the names of the creatures and look for numbers that match their statistics. I’ll try this myself if I get time and report on my HoMMII page 🙂

  3. I was digging through some old files on a cleanup and I happened to come across something that I forgot all about!

    I vaguely recall digging through the main executable for the game and this is what I figured out on my cursory glance at the time.

    00..04 - Creature ID (with null terminator e.g. "titn"\0)
    5
    6
    7
    8
    09..10 - Gold Value
    15 - 
    16 - 
    17..18 - Hit Points
    19 - ?
    20 - Speed (6 = Very Fast, 7, = Ultra Fast, 8 = Blazing, 9 = Instant)
    21 - attack or defence
    22 - attack or defence
    23 - Speed Min
    24 - Speed Max
    25 - Number of shots
    

    It’s pretty bare information, but you should be able to find reference to “titn”, which for me lies at offset 985243 (0xF089B) for Heroes II Gold v2.1.

    I might pick this up again soon if I can find the time. I also can’t verify that it’s 100%, but I would have modified data and then checked the results in-game, so it should be okay.

  4. would you know anything about starting hero secondary abilities?

    for example, making Sorceress start with something other than Navigation?

  5. Hey thanks for the info,

    I know about fHeroes2. It’s a great project 🙂

    This page is totally out of date and I’ve not put up half of what I know. I’m just looking for some free time to update it.

  6. sorry, but i was just told to come here to extract the music from homm2 and now i can’t do that, could u tell me what are the files’ names and do i need to convert them into other formats??? If I do, can u tell me some freeware that works good because i tried a lot of them and many of them disappoint me…good luck with the fheroes2! Btw, does somebody know something about refixes for other homm games like heroes 3 in the wake of gods???

  7. would really love a update on the info you have… if your willing to share… would love to port HOMM to various platforms but can’t figure out any of the decompress/filetype info

  8. @Chris:
    As mentionend, fheroes2 does just what you are searching for. You should check out the code at sf.net or ask your questions to the developers.

  9. I am trying to change the Heroes 2 gameplay. I want to edit the game statistics for personal use but I have no way of opening the files with your “Heroes 2 AGG Extractor / Reader” in Windows 7. Could you offer help of tell me where I can find programs to open the AGG Archive and it’s files. I edit almost every game I own and half the time I succeed. I never am satisfied to leave game play alone. If you could help with heroes 3 and 4, that would be helpful.

  10. Hi Ensrick,

    I posted some information above about editing the game stats for Heroes 2 at least. I hope at the very least it may yield better results on Google.

    It is a job for a hex editor though yeah. Later versions of Heroes (3 and 4) I have no idea about.

  11. Hello Terry, I’m working on a mod for heroes. And I really need to know how to read the files from the AGG archives and how to convert them to other formats. I need help on many aspects when creating this mod, but this is a priority right now. So, could you please tell me how to do this? And I use another program in reading these files because your AGG extractor doesn’t work on my computer. I especially need to know how to convert some sprites and some of them, I can’t even find. Could you please help me?

    Please email me

  12. Hi Nikola

    The editor does need some work to allow it to be possible to replace sprites easily.

    I don’t have time to embark on this at the moment. What does the editor do to not work on your computer by the way?

  13. Thank you for answering me fast.

    Well, I might be running the program incorrectly, but I’m not sure. I just download from the link that says AGG extractor/reader, and when I unpack it. I don’t know what to do with it. I just run it and it just says press any key to continue, and exits itself. And you say editor, is that the same program, because I cannot find it anywhere. Please tell me what to do, because I just can’t do it. Also the mod isn’t using AGG files, I’m just having a problem of reading some file formats inside the AGG, like terrain or trees.

    Excuse me if I’m asking too much, do you have anything to do with the fheroes2 project?

  14. Nikola, You can drag the HEROES2.AGG onto the AGGExtractor and you will see the program starts reading the files.. But I cant be able to extract it from there it seems?

    Terry, thanks for the program, but i want your help. I need the .82M sound effect files, I’m creating a HoMM II Fangame and I need those. Music is easy to find on internet, but havnt been able to get the sound effects.. Kind regards

  15. It seems it extraced after all. But its very weird, i dont see it in the windows explorer. But my 7-zip extraction program see the files in the directory lol. Windows might just need a restart or something

  16. Hey Magnus, I could help you, I’m also trying to make something for H2. I need to know how to unpack the .icn files, so I can get separate pictures. I also have all the sound effects you need, in case you haven’t found them yet. I had many problems in my life during this time, and that’s why I didn’t manage to answer you. Please answer as soon as you can. If you would be kind to give me your email, we can continue to comunicate and share info on email, since this site seems to have no progress, or very slow progress.

    Thank you for your time.

  17. I must say you have hi quality articles here.
    Your content can go viral. You need initial boost only.
    How to get massive traffic? Search for: Murgrabia’s tools go viral

Leave a Reply

Your email address will not be published. Required fields are marked *