Author Topic: Flag animation frames  (Read 2929 times)

Toolwut

  • Stingray
  • Posts: 60
Flag animation frames
« on: March 25, 2020, 09:21:23 AM »
Hello there,

I started looking a bit into md2's and realized that they don't contain the times between two frames .. I tried finding them in the dp code but didn't have any success with finding them (please don't tell me they're in the .dll ...).

Can someone post them please?

Also, just wondered, are flags the only animated md2 models in the game, is everything else static or .skm?

One last thing: Are flag models (6 frames) limited to exactly these 6 frames or could you add more to create more complex animations?

Thanks in advance :)
« Last Edit: March 25, 2020, 01:07:43 PM by Toolwut »

Toolwut

  • Stingray
  • Posts: 60
Re: Flag animation frames
« Reply #1 on: March 26, 2020, 07:10:23 AM »
I'm already this far, it seems like all I need is this frame time information .. :)

3lf

  • Map Committee
  • VM-68
  • Posts: 121
Re: Flag animation frames
« Reply #2 on: March 26, 2020, 08:58:06 AM »
Flags and players are skm you tool

Toolwut

  • Stingray
  • Posts: 60
Re: Flag animation frames
« Reply #3 on: March 26, 2020, 11:09:38 AM »
Hello sir,

my eyes must be fooling me. And what have I done the past hours? Please help me!!

From my understanding .skm models are skeletal models which are good e.g. for player models (they have actual bones :o) while they're not really suitable for regular models like flags .. where should bones be placed and how would that make the animation better / more realistic?

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Flag animation frames
« Reply #4 on: March 27, 2020, 01:37:49 AM »
Flags are md2 still, though I plan to make them SKM at some point so they can properly attach to the character and follow its animations.  Old flag model followed the Quake2 character animations and doesn't exactly follow the current player well.  If you grab one of the old Quake2 model editors like qME or Milkshape, you should be able to determine the frames of animation for the flag.  Basically it has all the player animations + an animation for waving.

Toolwut

  • Stingray
  • Posts: 60
Re: Flag animation frames
« Reply #5 on: March 27, 2020, 03:28:27 AM »
The md2 header contains the number of frames stored in the file (see http://tfc.duke.free.fr/old/models/md2.htm, matches other sources). The flag model contains 6 frames which have a name from wave1 to wave6 assigned. What I don't get is where the other animations are stored (e.g. when the flag is carried by a player) .. otherwise I guess I can use these values:

// ----------------------------------------------
// initialize the 21 MD2 model animations.
// ----------------------------------------------

anim_t CMD2Model::animlist[ 21 ] =
{
    // first, last, fps

    {   0,  39,  9 },   // STAND
    {  40,  45, 10 },   // RUN
    {  46,  53, 10 },   // ATTACK
    {  54,  57,  7 },   // PAIN_A
    {  58,  61,  7 },   // PAIN_B
    {  62,  65,  7 },   // PAIN_C
    {  66,  71,  7 },   // JUMP
    {  72,  83,  7 },   // FLIP
    {  84,  94,  7 },   // SALUTE
    {  95, 111, 10 },   // FALLBACK
    { 112, 122,  7 },   // WAVE
    { 123, 134,  6 },   // POINT
    { 135, 153, 10 },   // CROUCH_STAND
    { 154, 159,  7 },   // CROUCH_WALK
    { 160, 168, 10 },   // CROUCH_ATTACK
    { 196, 172,  7 },   // CROUCH_PAIN
    { 173, 177,  5 },   // CROUCH_DEATH
    { 178, 183,  7 },   // DEATH_FALLBACK
    { 184, 189,  7 },   // DEATH_FALLFORWARD
    { 190, 197,  7 },   // DEATH_FALLBACKSLOW
    { 198, 198,  5 },   // BOOM
};

Toolwut

  • Stingray
  • Posts: 60
Re: Flag animation frames
« Reply #6 on: March 27, 2020, 03:42:49 AM »
I tried Milkshape + its MD2 viewer (http://www.milkshape3d.com/ms3d/download.html) and qME (https://gamebanana.com/tools/2544) but none of them are working on my device. I was hoping to dodge reading the old blender 2.6 or something md2 IO scripts because I don't even know what exactly it is I'm looking for ...

Toolwut

  • Stingray
  • Posts: 60
Re: Flag animation frames
« Reply #7 on: March 28, 2020, 04:15:08 AM »
What I don't get is where the other animations are stored (e.g. when the flag is carried by a player)

Okay this mystery is solved, pball/players/male contains flag0.md2 - flag5.md2 (all of which seem to be identical except for the linked skin, I thought that's why .md2's can store multiple skin names?).

So the original question remains, how many frames to insert between each keyframe (that blender import script is doing well btw, only needs a .pcx importer and uv coordinates are loaded mirrored ... and that piece of information this thread is about)?

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Flag animation frames
« Reply #8 on: March 29, 2020, 12:26:10 AM »
I don't know why we had separate md2 files instead of just 1 with different skins.  The original pb2 mod was slapped together in like 17 days, and there were a lot of things implemented poorly.  As for the frames, you just need to match the frames up with the ones you listed:

0-39 are for the flag on a player standing
40-45 for the flag on a player running
etc.

Framerate should be set to 10fps.  I don't know that it matters if the frames are keyed or not.

Toolwut

  • Stingray
  • Posts: 60
Re: Flag animation frames
« Reply #9 on: April 16, 2020, 12:53:29 PM »
As for the frames, you just need to match the frames up with the ones you listed:

0-39 are for the flag on a player standing
40-45 for the flag on a player running
etc.

Just went through the right flag model (was always testing with the one in pball/models/items/flags before and didn't realize it's not the right one), the animation frames apparently are a bit different:

        "stand": [0, 39, 9],  # STAND
        "run": [40, 45, 10],  # RUN
        "attack": [46, 53, 10],  # ATTACK
        "pain1": [54, 57, 7],  # PAIN_A
        "pain2": [58, 61, 7],  # PAIN_B
        "pain3": [62, 65, 7],  # PAIN_C
        "jump": [66, 71, 7],  # JUMP
        "flip": [72, 83, 7],  # FLIP
        "salute": [84, 94, 7],  # SALUTE
        "taunt": [95, 111, 10],  # FALLBACK
        "wave": [112, 122, 7],  # WAVE
        "point": [123, 134, 6],  # POINT
        "crstnd": [135, 153, 10],  # CROUCH_STAND
        "crwalk": [154, 159, 7],  # CROUCH_WALK
        "crattak": [160, 168, 10],  # CROUCH_ATTACK
        "crpain": [169, 172, 7],  # CROUCH_PAIN
        "idle": [173, 188, 5],  # CROUCH_DEATH

-> some were renamed and over all there are less keyframes than originally