Weapons Frames
Moderator: InsideQC Admins
15 posts
• Page 1 of 1
Weapons Frames
I have made 24 frame weapon animation.In game is to slow when the animation play.So i want to ask if there is some way to speed up the animation(without deleting frames)?
________
mflb
________
mflb
Last edited by lukas2288 on Thu Feb 03, 2011 6:18 am, edited 1 time in total.
- lukas2288
- Posts: 42
- Joined: Sun Jun 14, 2009 4:40 pm
I think he's talking about a .weaponframe weapon, no? Also, the .nextthink trick behaves better if you use a new field in which you store time upon creating the entity, and increasing that by 0.05 every animation frame, and just setting .nextthink to that.
self.animtime = self.animtime + 0.05;
self.nextthink = self.animtime;
Resetting animation timings to world time will throw it off a tiny bit all the time, eventually resulting in minor twitches or slower/faster animation than expected. In general, this applies to pretty much all timing-related issues which are done frequently, such as movement, AI thinking, rapid fire weapons, animation... One off timers such as a flag capture timer or a trigger of some sort does fine with basing on time. In some cases it's even necessary, can't think of a good example for this, but if things in the world are meant to sync somehow, I can imagine this being a good case.
self.animtime = self.animtime + 0.05;
self.nextthink = self.animtime;
Resetting animation timings to world time will throw it off a tiny bit all the time, eventually resulting in minor twitches or slower/faster animation than expected. In general, this applies to pretty much all timing-related issues which are done frequently, such as movement, AI thinking, rapid fire weapons, animation... One off timers such as a flag capture timer or a trigger of some sort does fine with basing on time. In some cases it's even necessary, can't think of a good example for this, but if things in the world are meant to sync somehow, I can imagine this being a good case.
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
Urre wrote:Resetting animation timings to world time will throw it off a tiny bit all the time
Actually it doesn't (evidence in SV_RunThink). The time global is set to the entity's prior nextthink value before your think function happens.
So your code does nothing that wasn't already done. :P
The only reliable way to get the actual current time is via the StartFrame event. But that's offtopic.
The viewmodel weapons are animated at the same framerate that the player model is animated at.
You have three options.
1: Change the player model animation speeds and the weapon animation speeds at the same time by adding that self.nextthink=time+0.05; line in your player.qc file.
2: As 1, but insert extra player frames which are duplicates of the original ones, changing the viewmodel frame in each one, but the player model every other function in the sequence.
3: Take the viewmodel animation code out of there entirely, and animate it yourself in PlayerPostThink, using a separate timer.
Option 1 is broken, unless you're replacing player animations too. Option 2 works fine. Option 3 is more extensible (attack speed modifiers etc are that much easier).
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
So, when the think code is called thinktime is sv.time + host_frametime..
I've used code like this in my online mods
but this makes everything ticrate dependant. Thus that little bit of timing to world isnt effected.
- Code: Select all
qboolean SV_RunThink (edict_t *ent)
{
float thinktime;
thinktime = ent->v.nextthink;
if (thinktime <= 0 || thinktime > sv.time + host_frametime)
return true;
I've used code like this in my online mods
- Code: Select all
self.nextthink = time + sys_ticrate;
but this makes everything ticrate dependant. Thus that little bit of timing to world isnt effected.
- r00k
- Posts: 1110
- Joined: Sat Nov 13, 2004 10:39 pm
I think it is ~10fps but that might be utterly wrong. Some engines interpolate between those frames more or less well.
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
- Spirit
- Posts: 1031
- Joined: Sat Nov 20, 2004 9:00 pm
Boss429 wrote:out of curiosity, what fps rate does quake play its animations?
Generally 10Hz as Spirit said, but this is entirely dependant on Quakec -- in theory you can have different entities with different framerates, by editing the quakec. Crucified zombies have a randomly varying framerate, for example.
- metlslime
- Posts: 316
- Joined: Tue Feb 05, 2008 11:03 pm
vertex interpolation is just blending the transform of vertices over updates so that they're smooth, it shouldn't have anything to do with nextthink
Benjamin Darling
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
- Electro
- Posts: 312
- Joined: Wed Dec 29, 2004 11:25 pm
- Location: Brisbane, Australia
Electro wrote:vertex interpolation is just blending the transform of vertices over updates so that they're smooth, it shouldn't have anything to do with nextthink
nextthink tells you when the next frame is coming from the server. Useful to know when deciding what time interval you want to spend lerping from the last frame to the current frame. Ideally you finish one lerp right at the moment you are ready to start the next lerp.
- metlslime
- Posts: 316
- Joined: Tue Feb 05, 2008 11:03 pm
metlslime wrote:Electro wrote:vertex interpolation is just blending the transform of vertices over updates so that they're smooth, it shouldn't have anything to do with nextthink
nextthink tells you when the next frame is coming from the server. Useful to know when deciding what time interval you want to spend lerping from the last frame to the current frame. Ideally you finish one lerp right at the moment you are ready to start the next lerp.
So I was right?
Pwn't.
-

Downsider - Posts: 621
- Joined: Tue Sep 16, 2008 1:35 am
15 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
