Author Topic: Weapon animations and firing delays  (Read 2044 times)

Offline themuffinman

  • Carpal Tunnel Member
  • ******
  • Posts: 1935
    • View Profile
  • Rated:
Weapon animations and firing delays
« on: November 05, 2011, 01:54:55 AM »
I'm trying to get my head around how the weapon animations work in Q2. I take it that the animations control the pre- and post- firing delays too.

Let's use the BFG for an example, in p_weapon.c:

Code: [Select]
void Weapon_BFG (edict_t *ent)
{
static int pause_frames[] = {39, 45, 50, 55, 0};
static int fire_frames[] = {9, 17, 0};

Weapon_Generic (ent, 8, 32, 55, 58, pause_frames, fire_frames, weapon_bfg_fire);
}

Now according to Weapon_Generic it means that:
FRAME_ACTIVATE_LAST = 8
FRAME_FIRE_LAST = 32
FRAME_IDLE_LAST = 55
FRAME_DEACTIVATE_LAST = 58

Which corresponds to the md3 frames:
active08
pow23
idle23
putway04

So I understand where they get that from, but what do all the numbers in the pause_frames and fire_frames mean? What is the frame rate it runs at so I know how long the delay is?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: Weapon animations and firing delays
« Reply #1 on: November 05, 2011, 03:03:47 AM »
IIRC, the pause frames are intermittent idle animations. For example look at the Blaster while standing still. The hand will move around and adjust his wrist a little.

The timing is server frames, so I believe it's 0.1 sec.


If you are trying to modify the frames to change speeds, then altering the arrays is a visual nightmare. That's how WOD/LOX used to do it. So what you end up seeing are the wrong animations at put-away and occasionally a missing "Last Frame" error that shows up until the weapon switches.

You're right to take a look at weapon generic. I had a mod that adjusted the speed of firing based on a "Speed" player stat. What I did was change the way that generic handles the fire animation in order to replay some frames after the attack finished.

If you're just making new p view models, then I think you've got all the information that you need.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

Offline themuffinman

  • Carpal Tunnel Member
  • ******
  • Posts: 1935
    • View Profile
  • Rated:
Re: Weapon animations and firing delays
« Reply #2 on: November 05, 2011, 03:50:29 AM »
Yeah it seems a rather finicky way to do it. How about the fire frames?

Why I'm asking though is for a Q3 game and engine mod I've been working on for a while now. Part of my goal is to have it play more like Q2 with similar weapons and items etc.. Right now the animations aren't important as such since I don't have the gun models made. Just the delays I need to know, but the more I know of how Q2 handles the weapons the better. Then when I get the models and animations done I can take advantage of the more advanced MD3 animation system and animation files.

So maybe it's best to just have approximate delay values. I'm not looking at replicating it 100% in any case.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: Weapon animations and firing delays
« Reply #3 on: November 05, 2011, 06:05:07 AM »
I do have to agree. Running every individual frame animation on the server is a bad idea. There are some advantages to it, but those advantages are only due to a tight coupling between functionality and display concerns. Even the HUD is managed from the server in q2.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

 

El Box de Shoutamente

Last 10 Shouts:

 

|iR|Focalor

November 06, 2024, 03:28:50 AM
 

RailWolf

November 05, 2024, 03:13:44 PM
Nice :)

Tom Servo

November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.
 

Costigan_Q2

November 04, 2024, 03:37:55 PM
Stay cozy folks.

Everything is gonna be fine.
 

|iR|Focalor

October 31, 2024, 08:56:37 PM
 

Costigan_Q2

October 17, 2024, 06:31:53 PM
Not activated your account yet?

Activate it now! join in the fun!

Tom Servo

October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
 

|iR|Focalor

October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
 

rikwad

October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.
 

Costigan_Q2

October 09, 2024, 01:35:05 PM
Et tu rikwad?

Please don't feed the degenerate lies of a sexually-perverted devil-worshipping barking dog like Focalor.

Show 50 latest
Welcome, Guest. Please login or register.
November 10, 2024, 07:19:18 AM

Login with username, password and session length