• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Import] war3map.shd file format

Status
Not open for further replies.
Level 19
Joined
Dec 12, 2010
Messages
2,070
This file has no header, only raw data.
Size of the file = 16*map_width*map_height
1 byte can have 2 values:
00h = no shadow
FFh = shadow
Each byte set the shadow status of 1/16 of a tileset.
It means that each tileset is divided in 16 parts (4*4).
But where is 0/0 point for this file?
I did math, that dota's shadows file is array of values for square with 512 points per side (dota's wide/high is 16384/16384).
I also tested, that bytes goes like 0,0 | 1,0 | 2,0, | 3,0 | 4,0 ...
So, 1st 4 bytes its (0;0) from map's bottom left, then (128;0) is 2nd 4 bytes, (256;0) is 3rd 4 bytes and so on.
Lets assume that we need to find out byte for 0,0 point of map.
1332455549-clip-12kb.jpg

But when i tried to blackmask that 0,0 point it was like "wtf where are shadow?".
I used system that
x=8192+x
y=8192+y

Number of byte for given coord = ((y/32)*511 + (x/32))

Desired byte number - 20000h.
I did write FF to bytes 20000h...20003h, 20200h..20203h, 20400h..20403h, 20600h..20603h, which means, black square at middle of map. Ive got wrong spot, cant even find where it is, but not in desired coords.
So, my question - what did i miss there?

Feel free to ask 'wtf', im not so good in english, but could rephrase something.
 
Status
Not open for further replies.
Top