DYO File Format

Just thought i would share something with all of you.
In xadets example code, the Y and Z axis's are mixed up.

It actually parses it in this order:
Code:
X Z Y

Instead of:
Code:
X Y Z

Also, I think that only the X and Y gets multiplied by 4.
Not sure about Z, but I will try out later.

The positioning is a tidy bit off, even when multiplying.
Just try it and you'll see. ^^
 
Last edited:
Just thought i would share something with all of you.
In xadets example code, the Y and Z axis's are mixed up.

It actually parses it in this order:
Code:
X Z Y

Instead of:
Code:
X Y Z

Also, I think that only the X and Y gets multiplied by 4.
Not sure about Z, but I will try out later.

The positioning is a tidy bit off, even when multiplying.
Just try it and you'll see. ^^
O.o ... i found that the order is X Y Z. And yea, only the X and Z (first and last) is multiplied by 4.
 
The order is not XYZ since if you try to teleport in-game using the X and Y generated from a DYO file, it will take you to some weird dungeon.
Another thing that kind of gives it away is that a lot of Spawns have similiar Z and if it is reverse parsed, then they would be in one line.
 
Positive.
Code example:
Code:
        static void ReadObject(BinaryReader fh)
        {
            Console.WriteLine("Y Rotation: {0}", fh.ReadSingle());
            Console.WriteLine("Axis Rotation: X: {0}; Y: {1}; Z: {2}", fh.ReadSingle(), fh.ReadSingle(), fh.ReadSingle());
            Console.WriteLine("Position: X: {0}; Y: {1}; Z: {2}", fh.ReadSingle(), fh.ReadSingle(), fh.ReadSingle());
            Console.WriteLine("Scale: X: {0}; Y: {1}; Z: {2}", fh.ReadSingle(), fh.ReadSingle(), fh.ReadSingle());
            Console.WriteLine("Set AI: {0}", fh.ReadInt32() == 5);
            Console.WriteLine("Object ID: {0}", fh.ReadInt32());
            Console.WriteLine("Unknown: {0}", fh.ReadInt32());
            Console.WriteLine("AI Type: {0}", (AIType)fh.ReadInt32());
            Console.WriteLine("Unknown: {0}", fh.ReadInt32());
        }
So, there is the xadet's example code "ReadObject" function.
Look at this code piece:
Code:
Console.WriteLine("Position: X: {0}; Y: {1}; Z: {2}", fh.ReadSingle(), fh.ReadSingle(), fh.ReadSingle());
This is what outputs the position, and as you see, it parses it in the "XYZ" order.
If we where to extract the WdMadrigal.dyo file and look up the NPC MaFl_Juria. With this code, we would get something similar to this:
Code:
X: 1739.609; Y: 100; Z: 802.9472
And what we do is we multiply X and Y with 4 so we would get something like this:
Code:
X: 6958.434; Y: 400; Z: 802.9472
Try teleporting to those X and Y coordinates and you will end up in some sort of "Void" dungeon.
But if we would switch out the Y and Z, we would get something like this:
Code:
1739.609; Y: 802.9472; Z: 100
Then we multiply X and Y with 4 and we get:
Code:
X: 6958.434; Y: 3211.788; Z: 100
If we teleport to those coords, we would end up next to Juria.

Have I proved my point yet? (;
 
What happen with flyff is that they made height being Y instead of Z as it usually is(at least everywhere I look it is x and y being the base and Z the height).
 
Back