Guide Explanation of W3M and W3X Files

martix

There is no spoon
Reaction score
49
Yea, right. If you put it here you gotta be able to answer a few questions.
I got one.
Whats a block and whats the exact structure of the (attributes). How are files stored and what are those "file slots" I've seen mentioned.
 

Chocobo

White-Flower
Reaction score
409
>replays

I don't specialize in replays. I redirected in a .txt file.

2.09 The W3G file (replays)

Read there : Explanation on Replays


>block

Called "Statement block". It's a whole section of code that are together, and can consist in statements increasing readability.

About "Attributes", it's an Archive.


>how are file stored?

Each file has it's own # (number), it's hash number [#], and 2 codenames (Codename1 and Codename2). It has also a Seed if the file can not be named for unknown reasons, and it's extension (xxx if unknown file). Each file has also a filename.


>file slots?

A cycling redundancy check (CRC32 Conversion Algorithm) and a Filetime.
 

martix

There is no spoon
Reaction score
49
When I asked about the (atrributes) file I expected you to tell me more than the format description, not less...
 
D

deerchao

Guest
I've read that, and I've written a w3g file parser already.

This is what I'm curious:
In a replay file, there is a field called "Map checksum", following the map file path field, which should be used to determine if the map you've got at the specify path of your local computer is the map with which the replay is made(for instance, if I made a replay with losttemple.w3m, and then delete losttemple.w3m, and rename legends.w3m to losttemple.w3m, War3 will tell me I don't have the proper map file losttemple.w3m if I want to watch that replay).

I wonder what's the algorithm to generate that checksum for use in replay from the map file. What I already know is that it's not a hash to the map file content(If I modify the war3map.wts, I can still use that map to watch replay). In ReplayInfomation.txt, it says nothing but:
0x0009 | 4Byte | Map Checksum //TODO: find algorithm
For LostTemple.w3m(comes with TFT 1.21), the checksum is 0x5043FB53.

Do you have any hint for me?

And, another question: If I export the war3map.w3i(or some other stuff, but not war3map.wts) from a war3 map, modify it, and then import it back(with mpq tools), the map can't be use for play any more, it says "file war3map.w3i corrupt", do you know how can I edit the inner files while not breaking the map?
 

martix

There is no spoon
Reaction score
49
Try CRC32 or MD5, we know WC3 can make use of them both.
The second question is somewhat connected to mine - it says its broken because it doesn't match the checksum in the attributes file. Deleting it would allow the map to work, but for updating it - I don't know. You just have to find out on what exactly the CRC32 is performed.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
wow...chocobo...u work as a programer? @.@
How come u can investigated all of these thing ....
Though i dont need it...just + rep for the effort :D
 
D

deerchao

Guest
Value Variable Type Value Format
0 Integer int
1 Real float (single precision)
2 Unreal (0 <= val <= 1) float (single Precision)
3 String string (null terminated)

What are Unreals?
If I treat them as normal float, I get values like 0, 3, 200, 9999. How am I supposed to get the "real" value of it?
Thanks!
 
D

deerchao

Guest
Thanks, Chocobo.
I know what unreal numbers are in math, but I don't know how and why they're stored inside w3a/w3u/... files.
Is that because wc3 have to store two relative numbers in together(like point.x, point.y or something)?
I read these unreal values from war3map.w3a of DotA 6.52 map:
Code:
Hex				as int					as float(single)
0					0						0
3ea8f5c3	1051260355	0.33
3ee66666	1055286886	0.45
3f000000	1056964608	0.5
3f800000	1065353216	1
40b00000	1085276160	5.5
43a28000	1134723072	325
43c80000	1137180672	400
461c3c00	1176255488	9999
How can I get the real part and image part of a unreal number from 4 bytes data(well, if it means unreal number takes 4 bytes by saying "Unreal (0 <= val <= 1) float (single Precision)")?
And more,
remove imaginary number (so you have only between 0 and 1)
If I remove the image part from 2+3i, I get real number 2, but it's not between 0 and 1, what's wrong?
Thanks again!
 
D

deerchao

Guest
After studying the slks I think I should treat unreal float just like float in my program, though I still don't understand what 0<=val<=1 mean.

However I have another question. In section 1.23(w3u/w3a... files):
*Object definition structure:
char[4]: original object ID (see table at the bottom where you can get the object IDs*)
char[4]: new object ID. (if it is on original table, this is 0, since it isn't used)
If the new object id is not 0(which is true for the second table), what does the old object id in the same structure mean? Is there any relationship between these two ids? Can I treat them just like the old id is not threre when writing a program to display information about all the items in a map?
Thanks again!
 

d07.RiV

New Member
Reaction score
0
I know that someone knows how the checksum is computed (at least for replay blocks). Any info?
 

PitzerMike

poo kaka
Reaction score
38
After studying the slks I think I should treat unreal float just like float in my program, though I still don't understand what 0<=val<=1 mean.

However I have another question. In section 1.23(w3u/w3a... files):

If the new object id is not 0(which is true for the second table), what does the old object id in the same structure mean? Is there any relationship between these two ids? Can I treat them just like the old id is not threre when writing a program to display information about all the items in a map?
Thanks again!

Imagine you make a copy of the peasant unit which has the original id 'hpea'.
The new id will be generated by the WE and be something like 'h000' whereas the original id will be 'hpea'. The new h000 unit will inherit all base stats from hpea + apply its own changes.
Unreals can be treated like any other real.
 
O

Ozzapoo

Guest
Does anyone know how the war3map.wtg file is compressed? I really need to know. Thanks!

P.S. Sorry for bumping the topic ><
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top