Author Topic: Weapon animations and firing delays  (Read 2155 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:

 

Yotematoi

May 17, 2025, 08:33:15 AM
Yo desde el año 2007 me enfermé de Q2, es incurable  
Morir y revivir es costumbre, lástima q el QT estaba bueno
 

ImperiusDamian

May 12, 2025, 01:45:35 AM
Quake II is not 27 years old. I refuse to accept THAT much time has gone by.
 

|iR|Focalor

May 11, 2025, 02:33:39 PM
 

-Unh0ly-

May 03, 2025, 08:02:46 AM
198.179.6.200:30634
 

Yotematoi

May 02, 2025, 10:27:47 AM
Note for Player-4109 "Remember, the Guinness Book of Records does not include cowards who shot at someone by treachery." :D
 

|iR|Focalor

April 02, 2025, 02:47:07 AM
 

Yotematoi

February 14, 2025, 12:41:48 PM
 :-*
 

|iR|Focalor

February 13, 2025, 07:31:24 AM
I was on DM this morning for the first time in a pretty long time. Seemed fine to me.

0rbisson

February 13, 2025, 04:54:21 AM
DM server is fucked. 2 point blank rockets from spawn and lava damage and player survived? WTF?" Also someone has fucked with the spawn points, every single time no matter how big the map you spawn right in front of the person who killed you last

Show 50 latest
Welcome, Guest. Please login or register.
May 18, 2025, 01:16:28 PM

Login with username, password and session length