Author Topic: POE animation files  (Read 2719 times)

0 Members and 1 Guest are viewing this topic.

Offline digitaldeath

  • Major(1)
  • Posts: 24
POE animation files
« on: September 06, 2006, 06:01:41 pm »
Hey guys,
I'm looking into understanding how the POE files are interpreted by Soldat and have made some very small (no doubt already documented) observations.

First of all each POE file looks something like this...
Quote
1
1.55037403106689
0.39308666450233E-7
-0.0570624396204948
2
-0.807060599327087
4.34756408651538E-8
0.00432408880442381
3
-1.37380111217499
3.60858666681452E-6
1.39313840866089
Now what this means is that we're viewing the very first frame of our animation and these "header" numbers (1, 2, 3) are joint points on our character. The next frame of the animation is specified by the field NEXTFRAME. How do we know what joints are what without having to manually make ajustments and viewing them in the POE editor?
Load up the animation in a POE Editor (I use Michael Szewczyk's editor) and the body parts listed down on the left hand side of the editor are the joints listed in order as they appear in the POE files.
So for example, by looking at the animation in the editor, I see that the left foot is the first joint. If you open the POE file in something like Notepad the very first joint is the left foot and may appear as so:
Quote
1
1.55037403106689
0.39308666450233E-7
-0.0570624396204948

The first line is the joint number.
The second line is the horizontal position for the joint.
-
The fourth line is the vertical position of the joint.

I'm not entirely sure what the third line is for, but I have a feeling it may indicate a rotation value for the sprites that get positioned between 2 joints. If someone has further information on this could they please elaborate?
Many thanks.

Regards,
Digi.

Offline Anna

  • Soldier
  • **
  • Posts: 213
    • my dev blog
Re: POE animation files
« Reply #1 on: September 06, 2006, 07:07:48 pm »
At first I thought they were rotation values as well, but they seem to be useless. You can get the rotations by calculating the angles between certain pairs of points.

Offline digitaldeath

  • Major(1)
  • Posts: 24
Re: POE animation files
« Reply #2 on: September 06, 2006, 07:16:06 pm »
Anna,
Interesting that they're not used.
So by calculating the angle between two points you basically know the angle the sprite should be at, essentially attaching it to the bone, correct?
Do you happen to know what rotation takes place regarding sprites for the animated characters?

Regards,
Digi.

Offline Anna

  • Soldier
  • **
  • Posts: 213
    • my dev blog
Re: POE animation files
« Reply #3 on: September 06, 2006, 07:33:24 pm »
I can show you my code (VB6):

Code: [Select]
            'right foot (stopa)
            Frames(numFrames).Parts(1).X = tempFrame(2).X
            Frames(numFrames).Parts(1).Y = tempFrame(2).Y
            Frames(numFrames).Parts(1).r = GetAngle(tempFrame(18).X - tempFrame(2).X, tempFrame(18).Y - tempFrame(2).Y)
           
            'upper right leg (udo)
            Frames(numFrames).Parts(2).X = tempFrame(6).X
            Frames(numFrames).Parts(2).Y = tempFrame(6).Y
            Frames(numFrames).Parts(2).r = GetAngle(tempFrame(3).X - tempFrame(6).X, tempFrame(3).Y - tempFrame(6).Y)
           
            'lower right leg (noga)
            Frames(numFrames).Parts(3).X = tempFrame(3).X
            Frames(numFrames).Parts(3).Y = tempFrame(3).Y
            Frames(numFrames).Parts(3).r = GetAngle(tempFrame(2).X - tempFrame(3).X, tempFrame(2).Y - tempFrame(3).Y)

            'left foot (stopa)
            Frames(numFrames).Parts(4).X = tempFrame(1).X
            Frames(numFrames).Parts(4).Y = tempFrame(1).Y
            Frames(numFrames).Parts(4).r = GetAngle(tempFrame(17).X - tempFrame(1).X, tempFrame(17).Y - tempFrame(1).Y)
           
            'upper left leg (udo)
            Frames(numFrames).Parts(5).X = tempFrame(5).X
            Frames(numFrames).Parts(5).Y = tempFrame(5).Y
            Frames(numFrames).Parts(5).r = GetAngle(tempFrame(4).X - tempFrame(5).X, tempFrame(4).Y - tempFrame(5).Y)
           
            'lower left leg (noga)
            Frames(numFrames).Parts(6).X = tempFrame(4).X
            Frames(numFrames).Parts(6).Y = tempFrame(4).Y
            Frames(numFrames).Parts(6).r = GetAngle(tempFrame(1).X - tempFrame(4).X, tempFrame(1).Y - tempFrame(4).Y)
           
            'upper right arm (ramie)
            Frames(numFrames).Parts(7).X = tempFrame(11).X
            Frames(numFrames).Parts(7).Y = tempFrame(11).Y
            Frames(numFrames).Parts(7).r = GetAngle(tempFrame(11).X - tempFrame(14).X, tempFrame(11).Y - tempFrame(14).Y)
           
            'lower right arm (reka)
            Frames(numFrames).Parts(8).X = tempFrame(14).X
            Frames(numFrames).Parts(8).Y = tempFrame(14).Y
            Frames(numFrames).Parts(8).r = GetAngle(tempFrame(15).X - tempFrame(14).X, tempFrame(15).Y - tempFrame(14).Y)
           
            'right hand (dlon)
            Frames(numFrames).Parts(9).X = tempFrame(15).X
            Frames(numFrames).Parts(9).Y = tempFrame(15).Y
            Frames(numFrames).Parts(9).r = GetAngle(tempFrame(19).X - tempFrame(15).X, tempFrame(19).Y - tempFrame(15).Y)
           
            'torso (biodro)
            Frames(numFrames).Parts(10).X = tempFrame(8).X
            Frames(numFrames).Parts(10).Y = tempFrame(5).Y
            Frames(numFrames).Parts(10).r = GetAngle(tempFrame(7).X - tempFrame(8).X, tempFrame(7).Y - tempFrame(8).Y)
           
            'chest (klata)
            Frames(numFrames).Parts(11).X = tempFrame(8).X
            Frames(numFrames).Parts(11).Y = tempFrame(10).Y
            Frames(numFrames).Parts(11).r = GetAngle(tempFrame(11).X - tempFrame(10).X, tempFrame(11).Y - tempFrame(10).Y)
           
            'head (morda)
            Frames(numFrames).Parts(12).X = tempFrame(12).X
            Frames(numFrames).Parts(12).Y = tempFrame(12).Y
            Frames(numFrames).Parts(12).r = GetAngle(tempFrame(12).X - tempFrame(9).X, tempFrame(12).Y - tempFrame(9).Y)

            'upper left arm (ramie)
            Frames(numFrames).Parts(13).X = tempFrame(10).X
            Frames(numFrames).Parts(13).Y = tempFrame(10).Y
            Frames(numFrames).Parts(13).r = GetAngle(tempFrame(10).X - tempFrame(13).X, tempFrame(10).Y - tempFrame(13).Y)

            'lower left arm (reka)
            Frames(numFrames).Parts(14).X = tempFrame(13).X
            Frames(numFrames).Parts(14).Y = tempFrame(13).Y
            Frames(numFrames).Parts(14).r = GetAngle(tempFrame(16).X - tempFrame(13).X, tempFrame(16).Y - tempFrame(13).Y)
           
            'left hand (dlon)
            Frames(numFrames).Parts(15).X = tempFrame(16).X
            Frames(numFrames).Parts(15).Y = tempFrame(16).Y
            Frames(numFrames).Parts(15).r = GetAngle(tempFrame(20).X - tempFrame(16).X, tempFrame(20).Y - tempFrame(16).Y)[/font]

tempframe holds the POA data for the 20 points in the current frame of the animation. Frames holds the animation data for the 15 sprites that make up the gostek. It's in the correct draw order. The 'multipliers' I used to get the real X and Y coordinates are 2.6 and 3.2, but I'm not sure If they're right because I just found them by trying different values.

For some reason the animations look wrong; to fix it I had to come up with values for the rotation centers of the sprites by trial and error. It could be because the Delphi implementation of DirectX handles sprites differently, or there is animation data hard-coded into Soldat, or I am just missing something.
« Last Edit: September 06, 2006, 07:39:00 pm by Anna »

Offline digitaldeath

  • Major(1)
  • Posts: 24
Re: POE animation files
« Reply #4 on: September 06, 2006, 07:43:24 pm »
Nice one, thanks for the code Anna. I'll give it a shot. What exactly does Frames contain? I know you said the animation data, but could you be a bit more specific? Eg. the animation data may refer to every single joint position for every single frame.
Thanks again.

Regards,
Digi.

Offline Anna

  • Soldier
  • **
  • Posts: 213
    • my dev blog
Re: POE animation files
« Reply #5 on: September 06, 2006, 08:07:03 pm »
Frames holds the X and Y coordinates and rotation of the 15 sprites that make up the gostek, multiplied by the number of frames in the animation. For example: Frames(4).Parts(12).X is the X coordinate of the 12th sprite (the head) of the fourth frame of animation.

Also I forgot to mention that the X and Y coordinates are flipped vertically and horizontally as soon as they're loaded into tempframe.

Offline digitaldeath

  • Major(1)
  • Posts: 24
Re: POE animation files
« Reply #6 on: September 07, 2006, 05:02:41 am »
Thanks for the info Anna, much appreciated.

Regards,
Digi.

Date Posted: September 07, 2006, 05:55:55 AM
Annna, which way are the sprites flipped (code example)?
I'm having some trouble trying to piece the sprites together.
Thanks.

Regards,
Niall.

Offline rainrider

  • Soldier
  • **
  • Posts: 145
    • rrhp
Re: POE animation files
« Reply #7 on: September 07, 2006, 12:05:14 pm »
head (morda) :DDDDDDDDDDDDDDDDDD Nevermind, neverminD: :D: