HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Inside the w3m/w3x (the 2nd)

05-03-2006, 09:39 PM#16
Vexorian
Most likelly if the world editor ever tells you that some file is corrupt, then you modiffied the map's MPQ without removing / updating (Attributes) file correctly
05-03-2006, 09:57 PM#17
RaeVanMorlock
Quote:
Originally Posted by Vexorian
Most likelly if the world editor ever tells you that some file is corrupt, then you modiffied the map's MPQ without removing / updating (Attributes) file correctly

I tried recreating the error again, but it's not happening--oddly enough. I made a doodad file from scratch and placed a tree and it loaded and showed up just fine.

But now I'll know what to look for if it does happen again--'cause that wasn't the first time. Thanks, Vex.


Update
It happened again and deleting the (attributes) file fixed it... yay!
05-03-2006, 11:00 PM#18
PitzerMike
Quote:
Originally Posted by RaeVanMorlock
You might want to try contacting him and asking him to update it.

The link you gave is in fact Zepir's old site. Unfortunately he's not around any more and has quit war3 editing. But I can see if I can get in contact with him again.

Quote:
Originally Posted by RaeVanMorlock
- Is this really just trees and cliff doodads? Where are all the other doodads/destructibles stored at?

This file contains all doodads and destructables.

Quote:
Originally Posted by RaeVanMorlock
- It says the 3rd int is rarely set to 7--I've never seen this.. I've only seen it set to 9.. so when have you ever seen it set to 7? I'd imagine if this has been set (primarily) to 9 since '04 (according to the older version above) then it's not just a subversion

I guess in pre-release versions this was the case. Anyway the value doesn't have any apparent meaning, so you could simply ignore it.

Quote:
Originally Posted by RaeVanMorlock
- In reference to the flags, how can you set a doodad to be anything other than solid and visible?

The selectable flag might be set by the "Editor - selectable" field in the doodad/destructable editor. Or it it might simply be true for destructables and false for doodads. The solid flag can't be set through the standard WE i think. You'd need a hex editor to change it.

Quote:
Originally Posted by RaeVanMorlock
- The "special" doodads could be explained a little better... From testing, I gather that they're cliff doodads--is it possible to add custom ones though?

I agree that they should be called cliff doodads, and that the others shouldn't be called trees. To my knowledge the type is hardcoded though.

Quote:
Originally Posted by RaeVanMorlock
Big question: What's the "NEW 'Frozen Throne expansion pack beta' format" thing?

The documentation was created back in TFT beta times. Nowadays it should be replaced by something appropriate like "Frozen Throne expansion format".

Quote:
Originally Posted by RaeVanMorlock
So then after the trees, there's a sub-header section that has an integer (always set to 0?) followed by an integer for the number of special doodads. Then, if there are doodads, they're defined by the cliff ID and three unknown integers (12 bytes) which you're saying (guessing?) are the x-y-z coordinates. If they are coordinates, shouldn't they be listed as floats instead of ints? And why would the Z be before X and Y here and after X and Y in the tree section? This isn't making a whole lot of sense.

These are guesses by observation. The first one has always been set to 0 that's why it might be Z. The others are the w3e-Coordinates of the cliff doodad, that's why they are ints and not floats. we3-Corrdinates simply use the cell-number. One cell in war3 is 32.0 units wide and high.

Quote:
Originally Posted by RaeVanMorlock
Has anyone thoroughly tested what types of doodads/destructables go into which section?

Only cliff doodads are in the second section, all others are in the other section. Basically the second type can't be moved freely because it requires a cliff at its position. In turn the coordinates are saved via the cell numbers. In the editor you can find out if it's a special doodad by trying to select and edit it after having placed it.


Thanks for the input anyway, I'll update the docs sooner or later, or if you have time feel free to do that yourself.

And I'll put add a note about the (attributes) file to the top of the file, it seems this is a common mistake that many newcomers don't know about.
05-03-2006, 11:31 PM#19
RaeVanMorlock
Quote:
Originally Posted by PitzerMike
The link you gave is in fact Zepir's old site. Unfortunately he's not around any more and has quit war3 editing. But I can see if I can get in contact with him again.

Hehe.. bummer.



Quote:
Originally Posted by PitzerMike
I guess in pre-release versions this was the case. Anyway the value doesn't have any apparent meaning, so you could simply ignore it.

Yeah.. that's bugging me. A map with doodads but no item tables uses 0x07 and 0x09 for those first two unknowns, but a map with item tables uses 0x08 and 0x0b ... what's more, it doesn't even seem to depend on those values when loading the file--just when placing the doodads (if you use 0x07 and 0x08 [as the editor does when no item tables are present] but you put item tables into the structure, then it still loads perfectly fine except the doodads won't have the item tables present on them).

There's alot of other stuff that seems extrenuous too... alot of integers could simply be bytes (those two, the percent chance for an item to drop, even many of the "number of (something)" properties could be one or two bytes... who's really going to have 592,240,896. If everything was stored as a set of 4 bytes then that would make sense, but even that's not the case... the Doodad file has a set of 4 bytes for the Z-scale, then follows it with 2 single bytes for the flag and life percentage, and then goes back to 4 bytes for either the table pointer or unique ID number--so it's not like keeping everything nice and uniform was a primary concern when designing this.

*rant rant rant*



Quote:
Originally Posted by PitzerMike
The selectable flag might be set by the "Editor - selectable" field in the doodad/destructable editor. Or it it might simply be true for destructables and false for doodads. The solid flag can't be set through the standard WE i think. You'd need a hex editor to change it.

Ah.. I'll have to play around with that a bit more.



Quote:
Originally Posted by PitzerMike
I agree that they should be called cliff doodads, and that the others shouldn't be called trees. To my knowledge the type is hardcoded though.

Hardcoded where? Can't you just give 'em whatever name you want to for the purposes of the doc? Or were the names trees and "Special" doodads obtained from a DLL or something?



Quote:
Originally Posted by PitzerMike
The documentation was created back in TFT beta times. Nowadays it should be replaced by something appropriate like "Frozen Throne expansion format".

Well do that!

Though actually... from what I've noticed thus far, the format is the same for both RoC and TFT 1.20d. In ROC, you have to use a custom table defined on the doodad itself, but it still uses the 0xFF FF FF FF pointer thing--the file structure is exactly the same.



Quote:
Originally Posted by PitzerMike
These are guesses by observation. The first one has always been set to 0 that's why it might be Z. The others are the w3e-Coordinates of the cliff doodad, that's why they are ints and not floats. we3-Corrdinates simply use the cell-number. One cell in war3 is 32.0 units wide and high.

Oh right! I forgot that cliffs had to be aligned to a cell block while (most) other doodads can be placed (nearly) anywhere.





I have another question... do you happen to know how to read floats? I learned how to do conversions of whole numbers in Assembly, but we never did quite make it to floats--just mentioned that they existed (duh!). Adding this to the documentation would be pretty darn useful--or at least a link to another site that teaches it, I couldn't find one.



I'm also a little confused about the use of short integers.

The doc says:
Quote:
-Short Integers

Short Integers are stored using 2 bytes in "Little Endian" order.
They are close to the C++ signed short but their range is from -16384 to 16383. It means the 2 highest bit are free of use for a flag for example.
Size: 2 bytes

Okay.. so one byte is 8 bits. These are 2 bytes, so that's 16. Now you're reserving the top two for flags, which leaves 14. But then the third one needs to be reserved for the sign, right? Which leaves 13.. that gives range of -8192 to 8191. To reach the range stated above, you'd only be able to reserve 1 bit for a flag.




I hope Blizzard's next mod-friendly game is more... mod-friendly... and less utterly confusing.
05-04-2006, 12:40 AM#20
PitzerMike
Quote:
Originally Posted by RaeVanMorlock
Hardcoded where? Can't you just give 'em whatever name you want to for the purposes of the doc? Or were the names trees and "Special" doodads obtained from a DLL or something?

Sorry for the confusion, I didn't mean the names were hardcoded. I meant it's hardcoded for each doodad in which section it belongs.

Quote:
Originally Posted by RaeVanMorlock
I have another question... do you happen to know how to read floats? I learned how to do conversions of whole numbers in Assembly, but we never did quite make it to floats--just mentioned that they existed (duh!). Adding this to the documentation would be pretty darn useful--or at least a link to another site that teaches it, I couldn't find one.

Their format is equal to the format of standard C++ floats (ie 4 bytes). So you can simply obtain them by directing your file stream to a float variable. In VB it would be the data type Single.

I don't know about short ints, that part of the documentation is from Zepir and I've never really had to deal with those.
05-04-2006, 02:07 AM#21
RaeVanMorlock
Quote:
Originally Posted by PitzerMike
Their format is equal to the format of standard C++ floats (ie 4 bytes). So you can simply obtain them by directing your file stream to a float variable. In VB it would be the data type Single.

Ah.. good idea. I'm used to doing everything by hand.



Quote:
Originally Posted by PitzerMike
I don't know about short ints, that part of the documentation is from Zepir and I've never really had to deal with those.

Heh.. okay.





So with all this information available... what has anyone done with it? I started this the other day (and so many times before then) just in order to understand how they work--but is there really any use that we could put the information to other then creating a new World Editor?

I suppose there are advantages in being able to better compress maps for play--taking out the stuff that only the editor uses... for instance, destructables could be stripped out of the war3map.doo file since they're actually created through Jass along with their item tables and such--only the cliffs and doodads need to be in there. But that seems like alot of work for something that may or may not improve performance.
05-04-2006, 07:14 AM#22
PitzerMike
Quote:
Originally Posted by RaeVanMorlock
So with all this information available... what has anyone done with it? I started this the other day (and so many times before then) just in order to understand how they work--but is there really any use that we could put the information to other then creating a new World Editor?

I suppose there are advantages in being able to better compress maps for play--taking out the stuff that only the editor uses... for instance, destructables could be stripped out of the war3map.doo file since they're actually created through Jass along with their item tables and such--only the cliffs and doodads need to be in there. But that seems like alot of work for something that may or may not improve performance.

Well, there are far more interesting files than the .doo file. For example w3u/w3a... (the object definitions from the object editor). Just take Widgetizer as an example. There's a lot one could do with those files.

Another use of the format specs would be a listfile generator that could find all file names of protected maps by parsing the files inside (which btw already exists).

But you're right stripping out the destructables would be an option for map optimizers, I don't know if Vexorian's already does that. HeavyLocker used to strip the 0-int for the empty item table (if no tables existed in the file) by setting the file version to an earlier version (7 I think).

The .imp file would be interesting for an external import manager (that would for example allow importing a whole folder structure withouth having to set the path for every single file. With some immagination I'm sure you could find a whole lot of other use cases ...
05-04-2006, 10:56 AM#23
RaeVanMorlock
Quote:
Originally Posted by PitzerMike
Well, there are far more interesting files than the .doo file. For example w3u/w3a... (the object definitions from the object editor). Just take Widgetizer as an example. There's a lot one could do with those files.

Another use of the format specs would be a listfile generator that could find all file names of protected maps by parsing the files inside (which btw already exists).

But you're right stripping out the destructables would be an option for map optimizers, I don't know if Vexorian's already does that. HeavyLocker used to strip the 0-int for the empty item table (if no tables existed in the file) by setting the file version to an earlier version (7 I think).

The .imp file would be interesting for an external import manager (that would for example allow importing a whole folder structure withouth having to set the path for every single file. With some immagination I'm sure you could find a whole lot of other use cases ...

Hrmm.. true true true. Kinda makes ya wonder why Blizzard doesn't supply any of this functionality though--those lazy bastards!
07-28-2006, 01:04 PM#24
Zoxc
war3map.wtg format for Regin of Chaos

Found a few new things while I was messing with my map editor.
08-08-2006, 04:53 AM#25
mendzm
dude i think the war3map.imp's
[n] is not an int or the one that tells how many files are inside

i'm not that good on data types cos im a kid
01 00 00 00 d1 00 00 00

isnt d1 a hexadecimal number and d1 00 00 00 is a long?
not quite sure but d1 stands for 209 in decimal so if n is an integer would be 32 30 39 00?

im not quite sure but please check it..

this is my vesion
Code:
Header:
int: file format version (commonly 01)
int: number "n" of imported files

long?: n = number of imported files

Data:
1byte: tells if the path is complete or needs "war3mapImported\" (08= standard path(world editor adds war3mapImported\), 0d: custom path)
String["n"]: the path inside the w3m of each imported file (like "war3mapImported\mysound.wav")

Note: Any file added in the W3M and added in the .imp will NOT be removed by the World Editor each time you save your map.
This file can also be found in Warcraft campaign files with the name war3campaign.imp with the only difference that the standard path for imported files is "war3campaignImported\".
11-07-2006, 05:22 PM#26
ara
don't ask me why my nickname is so stupid...

ehrm.. I've created a map then my hdds got formatted.
Now I can't edit my map coz it was protected by vexorians 3.9d....
what would you suggest... plz write to [email protected]



no i don't lie...

again NO I DONT LIE :)...
11-07-2006, 05:35 PM#27
Vexorian
you don't lie! But no one can believe you anyways.

IF `you´ used the 'merge' method then there is no tool available able to rebuild your GUI triggers , if you used 'Shortest names' then all the names of functions and variables are lost forever.

you have options:
- Edit the map in JASS completelly.
- Regret not making backups of your stuff before formatting the hard drive
- Try to make the map again, unless you made a lot of things, it is easy to do so , and in the process you might improve your map.
- Start a new map
11-07-2006, 10:13 PM#28
PitzerMike
Quote:
Originally Posted by mendzm
dude i think the war3map.imp's
[n] is not an int or the one that tells how many files are inside

i'm not that good on data types cos im a kid
01 00 00 00 d1 00 00 00

isnt d1 a hexadecimal number and d1 00 00 00 is a long?
not quite sure but d1 stands for 209 in decimal so if n is an integer would be 32 30 39 00?

im not quite sure but please check it..

Well, whenever int is used in this document we mean a 4-byte integer (= long integer). So it's not really an error. The first few paragraphs of the document should clear up any questions about data types.
01-02-2007, 02:30 AM#29
wyrmlord
After messing with the war3map.doo file long enough, I found that the life value for a doodad isn't always 1-100. I would sometimes find the value -1 (ff), so my guess is that any doodad found in a war3map.doo file with the life being -1 is a doodad since doodads (non-destructables) cannot be destroyed. Also, for the 'flags' byte I sometimes found the flag to be '3'. I placed 4 trees outside camera bounds and all of those had the value '3', so my guess is 3 means that the destructable is outside of the camera bounds.
01-12-2007, 09:26 AM#30
Ralle
I don't understand the integers, they are said to be 4 bytes in endian order. So I made this php function to convert them to integers:
PHP Code:
function convert_endian($str) {
    
$str strrev($str);
    
$str str_split($str,1);
    
    for(
$n 0$n count($str); $n++) {
        
$str[$n] = ord($str[$n]);
    }
    
    
$val $str[3] + 256 $str[2] + 65536 $str[1] + 4294967296 $str[0];
    
    return 
$val;


But when the whole string converted to hex looks like 'ff ff ff ff' it is supposed to be -1. But I don't see why.

Maybe you can fix my function?