How to read specific data from a map file (in your own program)?

Level 2
Joined
Feb 3, 2007
Messages
13
Hi. I'm making a program that calculates some data about heroes created in a popular map "DotA All Stars". Right now I'm making a database on those heroes myself (I read hero's stats at 'dota-allstars.com/heroes.php' and then write that data in my database), which consumes a lot of time. But each time, with a new map version release I would have to repeat that process all over again, and that is the reason I started to think about improving my program's database update.

Here is my question:
How can I read heroes stats (base hp, intelligence, agility...) from a .w3x map file? What do I need to do that?

Please note that I need to do it INSIDE MY PROGRAM written in C# (at run time or whatever you may call it :)).
If it's not possible, then please explain me why.
 
Level 2
Joined
Feb 3, 2007
Messages
13
1. I agree that by using the source code of mpq-readers I can read files inside a map. But, I do not know what files contains data about heroes, and the structure of those files :). I'll just see some strange binary data if I'll try to read them, right?
Can you tell me where can I get the info about hero's stats storage?

2. Is mpqmaster considered as map deprotector?

3. Is this the right forum for such questions? "no1 will like you here for doing that..." - meaning people here are only map makers, not map-tool developers?
 
Level 2
Joined
Feb 3, 2007
Messages
13
Ok, I'll try to contact Ralle.
Thanks for your replies.
Any additional information will still be appreciated, because I don't know a thing about maps and their storage structure (I used MpqView long ago but that's different :)).
 
Level 2
Joined
Feb 3, 2007
Messages
13
OK, I have managed to open and work with mpq archive, but now I have another question:

1.How can I convert .blp files to bmp/jpg/png/gif (one of them will be fine) AT RUNTIME? To be more specific I need to decode blp file content in my program and use decoded data immediately to display it on my Form using the Image object (which accepts only bmp/jpg/gif/png data format).

2.Is there any ".dll" library for converting blp files to other formats?

3.Does someone know where can I find detailed info on how do I decode blp to, say, .bmp format.
 
Level 11
Joined
Oct 13, 2005
Messages
233
If you need information on file formats used in Wc3, I suggest taking a look at this link. The blp format isn't listed in there, but there are links to sites containing info on the blp format. You can probably find information on another specific format by just searching for it on google. Anyways, good luck with your program.
 
Level 2
Joined
Feb 3, 2007
Messages
13
@wyrmlord: Google search showed me pages that contain general but not detailed info about blp, like "blp is a BLizzard Picture format that uses different compression techniques: DXT1, DXT2, ...". Thank you for the link. Funny thing is that I have already spent some time trying to understand "war3map.w3u","war3map.w3t" strorage structure (and I have understood it), and there it is - complete format specification provided by your link :). Guess I have wasted my time :)

@Tonks:
unit data is stored in "somethingsomething.doo"
I can provide more info about this now :). Unit data such as gold cost, intelligence, agility.. is stored in *.slk files (example: Units\UnitData.slk). This slk file contains fourCC code "PWXL" which I think stands for "Power Excel" (well, excel opens it by default :)), and that format is very easy to understand and thus implement reading funcs in program's source code, since all its data are strings (not binary data), like
C;X1;Y1;"string data for cell[0,0]"
 
Last edited:
Level 8
Joined
Feb 4, 2007
Messages
389
@Tonks: I can provide more info about this now :). Unit data such as gold cost, intelligence, agility.. is stored in *.slk files (example: Units\UnitData.slk). This slk file contains fourCC code "PWXL" which I think stands for "Power Excel" (well, excel opens it by default :)), and that format is very easy to understand and thus implement reading funcs in program's source code, since all its data are strings (not binary data), like

Oh, yea. I know all about that (I wrote a tutorial on it), I thought you meant reading the placed unit data. My bad ;)
Where did you get the Unitdata.slk? Your War3.mpq or War3x.mpq? 'Cause I don't think that the full SLK is in the map file, just the .doo file.
 
Level 2
Joined
Feb 3, 2007
Messages
13
Where did you get the Unitdata.slk?
I have opened the "DotA Allstars v6.40.w3x" and found some .slk files there (using the proper listfile ofcourse :), because dota maps does not have it to increase protection), like UnitAbilities.slk, UnitData.slk, UnitBalance.slk, UnitWeapons.slk...
Since DotA does NOT contain any hero from Warcraft's campaign/ladder, all of DotA's heroes must be described inside that map file, and thus I beleive that those *.slk files contain full data about DotA heroes's stats. I think that everything else that can be loaded from the War3.mpq of War3x.mpq instead than loading it from the map itself, is removed from it to decrease file size.
 
Last edited:
Level 15
Joined
Nov 1, 2004
Messages
1,058
You should consider just using Blizzard's storm.dll for all your MPQ manipulation, and then use the Intel JPEG Library DLL (ijl15.dll) for converting the CMYK JPEG images used in BLP to regular bitmaps or RGB JPEGs.
 
Level 8
Joined
Feb 4, 2007
Messages
389
I have opened the "DotA Allstars v6.40.w3x" and found some .slk files there (using the proper listfile ofcourse :), because dota maps does not have it to increase protection), like UnitAbilities.slk, UnitData.slk, UnitBalance.slk, UnitWeapons.slk...
Since DotA does NOT contain any hero from Warcraft's campaign/ladder, all of DotA's heroes must be described inside that map file, and thus I beleive that those *.slk files contain full data about DotA heroes's stats. I think that everything else that can be loaded from the War3.mpq of War3x.mpq instead than loading it from the map itself, is removed from it to decrease file size.

You're right. Now if you can make your program open the files at runtime, you can create a script to read the data and display it in an easier context, like Wc3 does.
 
Level 2
Joined
Feb 3, 2007
Messages
13
You should consider just using Blizzard's storm.dll for all your MPQ manipulation, and then use the Intel JPEG Library DLL (ijl15.dll) for converting the CMYK JPEG images used in BLP to regular bitmaps or RGB JPEGs.
Unfortunately ;) I do not want my program to be dependent on some dll-s like storm (I have read somewhere that I may need to install staredit or smth like that for it to work). I am using SFmpqapi library for manipulation with MPQ archive (thx Ralle :)), which does not need storm or any other dll to work. I'll try to gather more info about this "Intel JPEG Library DLL" you mentioned.
Now if you can make your program open the files at runtime, you can create a script to read the data and display it in an easier context, like Wc3 does.
Well, reading heroes's stats from map file and displaying them in my program's user interface is already implemented, since yesterday (success :)). A few bugs ofcourse (because some heroes are mentioned in more than one file, and I need to gather all that info), but it works :).
Actually, right now I'm questioning myself - "do I really need to display blp files?" :). It's because I wanted my program to be able to work without warcraft being installed on the computer, so just the map file would be needed. But if I'll try to display blp images, like hero icons, then I would definately need to read the War3.mpq or War3x.mpq file, because DotA uses standard hero icons as well as standard skill icons, item icons...
Right now, my program uses those images saved in .gif format, so I think if I will ever gonna implement reading of blp files directly from a map, it would be like "cool, but unnecessary feature" to decrease total program size (exe without .gif images would be enough then for it to work).

Here is a link to a thread on the official dota forum, about my program: DotaHIT - program to calc various stuff
I have not uploaded any newer versions yet, so downloading it from there right now is a bit useless :). But this is the place where you can get it later, when I will finish it.
 
Level 15
Joined
Nov 1, 2004
Messages
1,058
You may also want to talk with BahamutZero over at macstorm.org because he's written a BLP library that relies on no DLLs (only a link to libjpeg).
 
Top