This was done using the help of Xadet breaking down the LND file. My first attempts were in vain but after I completed the DYO Editor, I decided to tackle this big pile of crap.
Let me just start off by saying who the hell programs this way? In all my years in the business (programming), I've never had a file structure quite like this.
Let me break it down on how the LND file is made. Bear in mind there are many holes in this.
You will notice upon opening the word (wld) file you see something like this.
^^ This is the main file. It sets the stage for what is about to be loaded. The most important part of this file that pertains to the LND file is the size. Notice Madrigal is a 30 x 30 map size. You have one section at 128x128, 30 of those across and 30 of those down. That is one big ass array! Note that not every file is that big.Code:// World script size 30, 30 indoor 0 ambient 0xff808080 bgColor 0xffe0e0ff fly 1 camera 3800.164 89.044 4447.954 1.039 2.857 revival 0 "" diffuse 0xff000000 lightDir 0.000 0.000 0.000 fogSetting 70.000 400.000 0.000 bgm 0 pkmode 4194304
Height Restrictions
This tells the player where he/she can walk/no walk, fly/no fly, etc. It parses the entire heightmap and sets a restriction on EVERY COORDINATE!
Next is an 16x16 array that contains heights that I'm not too sure about. I know some are water and some are clouds so need some more info on that.
Next is an unknown 16x16 array which even xadet doesn't know about. More info is needed.
Next is a byte that tells how many layers are in the map. I'm guessing this is where there are ceilings, walls, caves, etc.
Next is an int for the amount of objects present on the map. Dyo file goes along with this later.
After that is an int for the amount of SFX objects. SFX I believe refers to particles, fog, steam, explosions, etc. Don't know the structure for the SFX so skipping that for now.
If you have followed me so far, then good. if not, I don't blame you honestly. This shit isn't for the beginner by far. Sorry, but its true.
Now we have the heightmap. This is what my 3d program will read and create the landscape.
OK. Take a Tylenol and a Pepsi and pat yourself on the back for learning one of the most complex, over the top, bad programming you will ever see.
If that wasn't enough, you still need to load in all the world objects, NPCs, models, doors, load lights, etc. But that is another thread way off.
OK. So when I get a more stable release I will post it. Right now I'm extracting the heightmaps from each file. Then I'm loading them into another program designed to create 3D landscapes from a grayscale height map. Made it myself in XNA.






