Jump to content
Mana

H2otool - H20 Archive Archiver/Extraction Utility (Modding BR)

Recommended Posts

Guys, I need help :o

When I repack Models.H2O from the extracted files and play with the repacked file, I get a crash just after the first loading screen.

I did NOT change anything, just extracted and packed, to test. I tried with both cmd and GUI, nothing to do. I noticed the file changes its size a little (original = 97.477 KB, Repacked = 97.816 KB).

By any chance, do I need some kind of patch to Battle Realms in order to get it to work?

UPDATE:

Apparently i'm not the only one with this problem, and I tried to take action.

Opening the original file (this time interface_text.h2o) with the hex editor, all what i could see was a bunch of incomprensible bytes.

Opening the repacked file... surprise... the text was still perfectly readable, just like in the extracted files.

So I looked into the source code.

This is from cmd_extract.c, line 25 and following:

			if (node->file->entrytype == ENTRYTYPE_COMPRESSED) {
			printf("decompressing file: %s\n", node->name);
			dumpchunk(src, dst, node->file->checksum);
		} else 	if (node->file->entrytype == ENTRYTYPE_RAW) {
			printf("extracting file: %s\n", node->name);
			dump(src, dst, node->file->size_raw, node->file->checksum);
		}

This is from cmd_build.c, line 36:

entry->entrytype = ENTRYTYPE_RAW;

Not compressed. Just like the file I checked with hex editor.

Maybe I've figured it out, but i'm a noob (:P) and i can't c0mpile (usually that word gets you an error in forums) it.

I'd try to replace that line with

entry->entrytype = ENTRYTYPE_COMPRESSED;

... and have a test. Who knows.

  • Upvote 8

Share this post


Link to post
Share on other sites

I will like to add something here. The repacks tools are not always perfect because sometimes they use differents algorithms of compression to achieve the same result, the expected file may vary, while sometimes it will work fine in others it may crash the application (the game) because of misplaced bytes, loss of information in the compression data process and random errors.

You can check this just by extracting the file and then repacking without changing anything, most of the time the CRC and checksum of the file will be different of the original one unless is a well documented type of archive. In BR we don't have such luck, but H2Otool is a good and useful tool nonetheless.

Share this post


Link to post
Share on other sites
I will like to add something here. The repacks tools are not always perfect because sometimes they use differents algorithms of compression to achieve the same result, the expected file may vary, while sometimes it will work fine in others it may crash the application (the game) because of misplaced bytes, loss of information in the compression data process and random errors.

You can check this just by extracting the file and then repacking without changing anything, most of the time the CRC and checksum of the file will be different of the original one unless is a well documented type of archive. In BR we don't have such luck, but H2Otool is a good and useful tool nonetheless.

It extracts perfectly.

But the problem is packing.

I don't think the output is compressed at all; i was able to read each string of the text interface files I included.

While in the original packed .h2o i can't read any string, just some "ÿÿÿà 1•â" for example.

Oh well, i'll have a look at the algorythm and try to make my own VB6 program to extract/pack; i'd better not get my hopes up anyway.

Share this post


Link to post
Share on other sites
how can i make kenji appear in skirmish with h2otool?.. help pls i dont know what to do

You don't. But someone has made a mod for that. Try searching.

Share this post


Link to post
Share on other sites

Ok guys great tool thank you very much.

But I have a problem. I played around with the rice texture, repacked everything and started the game. Everything worked fine and the rice texture was the one I created, BUT when I play the game I see black tiles on the ground:

240209154920_wtf.JPG

So I unpacked the original textures again and repacked them immidiately without changing anything to test if the packer is the problem and it seems like it is the problem because the same shit happened again. I tested this with both packers and several times. Any suggestions are appreciated. Thanks!

EDIT: These tiles are under buildings aswell but in a lighter color. I painted the shadow of people green to see if it has an effect but it changed nothing. Black tiles again :-(

Share this post


Link to post
Share on other sites

Hi, im trying to edit the textures on the models.h2o file, but i cant rebuild this file, because when i launch the game , it crash, and says: "GATHERPOINT_DRAGON.lmd"

I know that im not the only with this problem, but i cant figure out, how to solve it, or i dont know if this file cant be repacked again, because i follow the tutorial of extract-build (Zymeth tutorial) with textures.h2o and works, but whit this file not...

Share this post


Link to post
Share on other sites

I checked HD textures made by soe guy I packed both, efftecs.h2o and effects2.h2o and replaced same files, old shitty ones with new ones, when I launch game NO crash :D, but ny textures in the gamr are kike invisible, warlocks bolts are not seen... the problem is packing :(

Share this post


Link to post
Share on other sites

can i requestt a mod here?

-dragon-

on keep:

-change garrin to Kenji 1, otomo, kazan, teppo, arah, tao

heroes train to keep: training cost will increase by 50% (not including yin and yang)

-kenji 1 = kenji one with the dragon, inc. att and def 25%

-tao =inc. mag.def and def by 15%

-otomo = inc. att 10% and def 15%

-kazan = inc. att 5% def 20%

-teppo = inc. def 15%

-arah = inc. att 5% and def 10% range 5%

-serpent-

on keep

-change budo to kenji 1, young taro?, shinja, utarah, vetkin

heroes train to keep: training cost will increase by 50% (not including yin and yang)

-kenji 1 = kenji 3(tattooed, same strenght w/kenji one with dragon)

young taro? = taro (increase att and def by 20%)

-shinja = att 15%

-utarah = att and def 10%

-vetkin = att 15% def 5%

-wolf-

on keep

-Grayback (slave), shalelord, wildeye, longtooth(slave), gaihla

heroes train to keep: training cost will increase by 50% (not including yin and yang)

-grayback (slave) = gryback (end, stats(resistance, att, mag.def, def, etc.) inc. by 20%)

-longtooth (slave) = longtooth (armored, inc. att and def by 10% range 5%)

-shalelord = def and mag.def 20%

-wildeye = att and def 10%

-gaihla = att 5% def 15%

-lotus

on keep

-Zymeth, change soban to Nightvol(ninja w/ attack and def of 5 ninjas), yvaine, issyl, koril

heroes train to keep: training cost will increase by 50% (not including yin and yang)

-zymeth = zymeth (with orb, att of 10 WL)

-nightvol(ninja) = nightvol (true form, w/att and def of 15 ninjas)

-yvaine = att 10% def 5% range 5%

-issyl and koril = att and def 10%

all peasants increase all stats by 15%

all warriors increase all stats(resistance, att, mag.def, def, etc.) by 15%

all buildings increase hp def 100% and fire resistance by 25%

all range warriors (archers, crossbowmens, hurlers, leafdesciples, etc.) increase range by 2%

AI should be able to use Kenji one w/the Dragon, Zymeth one with Orb and other Upgrades. Hope you can do it

Share this post


Link to post
Share on other sites

I hate to revive an old thread, but when extracting models.h2o, I noticed that the models,meshes,skeletons etc are all in formats like .LMS or .LSD.

Anyway to edit these?

Share this post


Link to post
Share on other sites

i have made a little unofficial update for the h2otool. it now reads user input from console and and has some minor bufixes

 

https://www.mediafire.com/folder/m3ilwb1j98hck/h2otool

 

my goal is to implement the pkware compression functions, but no sure how long it will take me or if i will even be able to do it, since im still a beginner at C

Edited by Blankname
  • Upvote 1

Share this post


Link to post
Share on other sites

i have made a little unofficial update for the h2otool. it now reads user input from console and and has some minor bufixes

 

https://www.mediafire.com/folder/m3ilwb1j98hck/h2otool

 

my goal is to implement the pkware compression functions, but no sure how long it will take me or if i will even be able to do it, since im still a beginner at C

 

Wow thanks for the update.

 

Even with the update i still getting problems with Interface_Text.H2O. The size without change anything (unpacked and packed), change from 183KB to 2718KB. When I try to enter to game then it closes.

 

I'd like to help you but i don't know about C programming.

 

Greetings!!

Share this post


Link to post
Share on other sites

in case anyone intersted

 

i have started researching the h2o format by reverse engineering the liquid exes (BR, LotR:WotR, Dragonshard) and found out that br and wotr h20 formats are different, although both have a version number of 6.0 (they probably didnt bother to change it to 7.0)

 

more finds:

 

unknown1 after 'number of files' is actually 'number of <unknown>' which stores a structure of 8 bytes at the end of the file (8 bytes x number of unknown1). the contents of this structure is unknown

 

since unknown2 is always 0x0CE34100 if there directories or 0x00000000 otherwise, it doesnt seem important to know the purpose of this variable

 

(where is unknown3?? lol)

 

unknown4 is also always 0x7CFC1200, neither seems important

 

surely offset and unknown5 are one only variable of 64 bits, since the (un)compressed sizes of h2o files are also stored in 64 bits variables

 

so we are only left with unknown6...

Share this post


Link to post
Share on other sites

in case anyone intersted

 

i have started researching the h2o format by reverse engineering the liquid exes (BR, LotR:WotR, Dragonshard) and found out that br and wotr h20 formats are different, although both have a version number of 6.0 (they probably didnt bother to change it to 7.0)

 

more finds:

 

unknown1 after 'number of files' is actually 'number of <unknown>' which stores a structure of 8 bytes at the end of the file (8 bytes x number of unknown1). the contents of this structure is unknown

 

since unknown2 is always 0x0CE34100 if there directories or 0x00000000 otherwise, it doesnt seem important to know the purpose of this variable

 

(where is unknown3?? lol)

 

unknown4 is also always 0x7CFC1200, neither seems important

 

surely offset and unknown5 are one only variable of 64 bits, since the (un)compressed sizes of h2o files are also stored in 64 bits variables

 

so we are only left with unknown6...

And what exactly does this information give us? :huh:

The h2o files have already been unpacked, what's the use of your research? I don't get it. h2o is just a "storage" file extension used to archive the game data.

It's better to investigate other unknown file extensions or battlerealms_f.exe, no? :wacko:

Share this post


Link to post
Share on other sites

I think the researchs are to improove H2O tool based on all files made by liqud H20 files, this my give as beter understanding compresion and decompresion errors  :)

Share this post


Link to post
Share on other sites

I think the researchs are to improove H2O tool based on all files made by liqud H20 files, this my give as beter understanding compresion and decompresion errors  :)

I.. still don't see any use of it, but probably because I'm not really into the technical part.

There is a packer/unpacker (h2otoolGUI) and it works fine, has never showed any errors. If we have it, why research further? :o

I mean I'm not against that but I think it's better to research other BR extensions or .exe itself instead.

Edited by KoMiKoZa

Share this post


Link to post
Share on other sites

researching the .exe is what im doing, as i already said

 

h2o tools are incomplete and causes the game to crash sometimes when using repacked h2o files

Share this post


Link to post
Share on other sites

researching the .exe is what im doing, as i already said

 

h2o tools are incomplete and causes the game to crash sometimes when using repacked h2o files

Alright, I got you. By "researching the .exe" I meant researching other game features, not h2o compressing system. But now I see, wasn't really aware that the h2o packs cause the crashes. You're doing the right thing! That might help us in the future as BRJokerz are preparing a huge project dedicated to BR.

Good luck! ^_^

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...