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.
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air

      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