o3d format

I found that if I'm careful with editing, I can get decent results from editing character models. I've not tried adding any more faces or vertices, I only manipulated the existing ones in the model. It was necessary to ensure that the vertices and faces kept the same order as they were in the original o3d file when editing and saving the obj file. This allowed me to copy and paste the weight and bones data from the original file without getting the weird distorting effects (or at least very little of them).

If the hasbones flag is set, it seems as if xdata and xxdata cannot be ignore and must be filled out. It appears that you can copy and paste the
Pos x,y,z data into the xdata, however I'm sure this is fairly inefficient for the GPU. I'm not sure how the xxdata affects the model.

I also attached an image of the program I've been working on to edit o3d's. If anyone's interested I'll clean up the code and and release a copy of it for people to use.

I also forgot to mention that on a model with the the faces and vertices re-arranged I managed to get the the edited model to move in sync and connect with the characters head. (kinda like a stick with a ball on the end you can roll around with your thumb and index finger, if the ball is the models head) I repeated the weight/bones data for accomplish this. the values weight1 and weight2 seems to affect the orientation of the bone?
 

Attachments

  • Nedes - o3d format - RaGEZONE Forums
    Nedes.webp
    63.3 KB · Views: 191
Last edited:
Not entirely sure on this, could not get animation to work right.
But in theory each verticle can be connected to atmost two bones. If its connected to one bone only, the weight to that bone is 1.0. So i would guess when its connected to two bones, the resulting animation is the weighted-avarage of the two independent bone's animation.

So in short, the orientations are comeing from the bones themselves, and weights are only used when a verticle is connected to two bones, and they are to interpolate between the two bone's orientations. (When a verticle is connected to one bone only, the than one of the weights is 1.0f, the orher is 0, so you can allways use the same equation)

Edit: updated animation states in first post

Also, make sure that you calculate the lod's transformation matrix specified by tLod2's lodlink attribute. It does not nececarily indexes a previous lod. I got the best results with a reqursive approach.

Code:
	//j is the object expression. ignore it, is not important now, i is the current lod
	void getCurrentAnim(unsigned int j, unsigned int i, matrix4x4<> &m)
	{
		tLod2 &lod = lod2[j][i];   //gets the current lod
		if(lod.currentAnimFrame != frame)    //checks if it already calculated the transformation matrix in the current frame
		{
			lod.currentAnimFrame = frame;

			lod.currentAnim = matrix4x4<>::identity();
			if(lod.parent < lod2[j].size()) getCurrentAnim(j, lod.parent, lod.currentAnim);  //if the parent (lodlink) is a valid lod, requests its current transformation matrix
			if(lod.localAnimation.size() > 0) lod.currentAnim *= lod.localAnimation[frame % lod.localAnimation.size()].toMatrix();  //if there is local animation, it applies it
		}

		m *= lod.currentAnim;  //current transformation matrix is calculated, adds to the given matrix
	}
 
Last edited:
I've been painstakingly trying to find the correlation between the bone data in "struct tvertex" or "struct VertPool" with the ukndata3 data. This is what I came up with.

Now I do not know if this holds true for all o3d files, and trying to find any correlation for this data hasn't been entirely fruitful for me.


Bone = Unkdata3[n]
0 = 0
3 = 1
6 = 2
9 = 3
12 = 4

24 = 5
27 = 6
30 = 7

15 = 8
18 = 9
21 = 10

42 = 11
45 = 12
48 = 13

33 = 14
36 = 15
39 = 16

Anyone recognize some weird mathematical pattern that is beyond me?

If only one weight is used (as in 1,0) then it appears only the first bone value is used and the second I suspect is ignored, even though the second bone value is often filled in. If two weights are used, both bone values are used? (This seems to correlate with the last post)

The value retained in ukndata3[n] seems to point at the animation used. if (ukndata3[n] == 6) appears to be for head animation. 0 appears to be for body. I imagine this only hold true for the file I was editing however... am I allowed to mention which file that was?

Anyhow, enough of that I wanna watch a video and go to bed.
 
seeing as muliples of 3 are used in bones could it be refering to the conetion of 3 points like lets say it was 12 so it means verti 11,12,13 make up the bone and unk as that bones identifier?, I don't know anything about grafics formats, and writing this a 5 am (didn't sleap) ,but thats my best guess or at least that the multples of signify somthing, while unk being some kind of identifier seeing as it clearly goes 1 through 13, anouther guess is those 3 points refers to a verticie triangle and unk being It's ID used to reference it?
 
I do not think that is it, since it seems to set whichever bone to which ever vertex you want without their being much of a pattern besides the whole 3's thing.

For example if I were to make a 3d model of a box in blender and convert it to a o3d, the converters will not give it any weights or bones. Now I was saying with the file i was editing the body animation was like (ukndata3[0] == 0). Say I want to make the box animate this way (it kind of moves in sync with feet and body without any manipulations to the box)
I could literally repeat the values 1 0 0 0 for Weight1, Weight2, Bone1 and Bone2 for every vertex x,y,z. If I wanted to make the animation follow the head afterward, I can changed the value in ukndata3[0] = 6. If I wanted to changed the location of the animation in ukndata3, lets say we use ukndata3[1] Now the bones/weights changed to 1 0 3 0. For ukndata3[2] it would be 1 0 6 0. [3] is 1 0 9 0. [4] is 1 0 12 0. [5] is 1 0 24 0.

I will put together a file later today to demonstrate this further.
 
I made a model demonstrating what I was talking about, and it is attached.

I noticed something else as well. If ukncount3 == 0, and hasbones == 1, it seems as if the values of the bones themselves reference some default animations since there is no data in ukndata3.

I added 2 models files, which will have (_ukndata3) and (_NO_ukndata3) appended to the filetype (o3d), just remove this. These models are exactly the same except one has unkdata3 and has ukncount3 set > 0 and the other does not have unkdata3 and has ukncount3 == 0.
 

Attachments

Is their a way to open the .o3d files for it to look like the document
in quotes at the beginning of this topic?
Because all I've been able to do is open it in wordpad/notepad,
and it's bare impossible to actually edit the file like that,
let alone view and work out what's actually in it.
How are you guys able to see/develop it's structure?
Is there a certain program that can actually view the code properly in text form?
 
Is their a way to open the .o3d files for it to look like the document
in quotes at the beginning of this topic?
Because all I've been able to do is open it in wordpad/notepad,
and it's bare impossible to actually edit the file like that,
let alone view and work out what's actually in it.
How are you guys able to see/develop it's structure?
Is there a certain program that can actually view the code properly in text form?

open it up in a hex editor and then look at both the ascii and the hex and try to determine what is what, i havent looked into reversion file types much but its trial and error and takes a lot of time and is not easy by any means
 
ahh okay, well thank you very much for that :).
Because the way the o3d reads it's texture files is quite confusing,
and Flyff must also get that information from the file to use in-game.
There's about 3 different layouts for textures too so they don't seem
to stay in one place, which has caused difficulties when trying to change
the type of monster (normal/pet/pickup) they are in-game through the ascii.
Even more so when I have a monster converted to a pet with 1 mention of it's
texture while the original pet's have 3 mentions of their texture.
This will hopefully make it easier ^^
 
Last edited:
ahh okay, well thank you very much for that :).
Because the way the o3d reads it's texture files is quite confusing,
and Flyff must also get that information from the file to use in-game.
There's about 3 different layouts for textures too so they don't seem
to stay in one place, which has caused difficulties when trying to change
the type of monster (normal/pet/pickup) they are in-game through the ascii.
Even more so when I have a monster converted to a pet with 1 mention of it's
texture while the original pet's have 3 mentions of their texture.
This will hopefully make it easier ^^

the 3 mentions of the texture are probably due to high, mid and low resolution textures, nmot sure how you would sort it without looking but if you made changes try all 3 different texture options in the options of the client to see if a texture shows up on one
 
the 3 mentions of the texture are probably due to high, mid and low resolution textures, nmot sure how you would sort it without looking but if you made changes try all 3 different texture options in the options of the client to see if a texture shows up on one

it is from them having more then one textures used in it's UV map
 
the 3 mentions of the texture are probably due to high, mid and low resolution textures, nmot sure how you would sort it without looking but if you made changes try all 3 different texture options in the options of the client to see if a texture shows up on one

it is from them having more then one textures used in it's UV map

As much as both of those are possible I don't think it's quite like that.
Because, from what I've looked at all the pet's from eggs seem
to have 3 textures, but I have a working steelknight pet that
was able to load and save through Pipelli's o3d editor, which
only has 1 image assigned.
Also in that case, the model kept apearing as white, when I realised that I shoudn't be loading the S class texture directly (unicorn-e02.dds or something) but loading the original unicorns texture for d class as soon as it's hatched (unicorn01.dds).
And that worked.
Which means even though the texture is seen 3 times in original
files, it only requires it to be mentioned once (as it was in the steelknight - renamed to unicorn01 after resaving it with the unicorn01.dds texture attached), to be able to load.
That also indicated that flyff interprets the file by adding
the '-e02' to it's search for the texture file after the game
indicates it has evolved.

In other cases, the mammoth monster only has it's texture mentioned once. But pukepuke, also a normal monster, which has
2 different textures assigned to the same model (you can tell
it's got more than 1 used in the uv map by opening them - one is the head and hat, etc texture while others are it's clothing), has both of these textures mentioned 3 times through the file.

Then there is the Meteonyker, which, even though it has 4 variations of it's texture "01/01-et01/01-et02/01-et03",
and is made up of 2 different textures in it's single UV,
is mentioned just once in the file.

And then again There is Augoo and Mammoth and Aibatt,
All of which only have the texture mentioned once, yet have different amounts and type of code before/after it.
This is about all that's similar between them, including the
pet's (even though pet's are shown 3 times)
Ç?..Ç?..Ç?......Ç?..Ç?..Ç?....fff?fff?fff?

But then the Meteonyker which has multiple textures and mentioned once, is different in that line, as well as pukepuke
which has multiple textures and mentioned 3 times different to
both Meteonyker and the others.
 
Back