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.
  • 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!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top