# Physics Simulation Forum

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Counter strike recoil feelPosted: Sat Mar 17, 2012 8:14 pm

Joined: Fri Jan 27, 2012 10:57 am
Posts: 9

I would like to have the same recoil-feel counter strike has.

I'm currently focusing on the camera angle (the pitch, not the yaw) and not the bullet trajectories.

I had some feedback and code from a cspromod dev who reverse engineered counter-strike behavior, but it lacks the KickBack() function and I'm stuck for now.

I found some simple function f(t) = c*t*exp(1-c*t). c is a constant, t is time and it behaves like this https://www.google.fr/search?aq=f&ix=hc ... *e%5E(1-5x)+from+0+to+1

The function works for single shots, but for full automatic weapon it does not because it does not accumulate.

I wonder if I should use some other kind of algorithm, like some integration ? I thought that when shooting bullets, the body muscles work like springs and dampers, and I wonder if there are some facilities in bulletphysics to do that.

So 2 questions:

Have you any idea or experience about recoil simulation in FPS games like counter strike, call of duty ?
If not how would you simulate a spring+damper force in bullet (and is it a good idea) ?

Top

 Post subject: Re: Counter strike recoil feelPosted: Mon Mar 19, 2012 2:20 pm

Joined: Sun Jan 01, 2012 7:37 pm
Posts: 55
The player isn't actually moving, its all just an aim and camera effect.

No real forces are involved in this.

It looks like simple noise and pull-up with the gun.

Top

 Post subject: Re: Counter strike recoil feelPosted: Mon Jun 04, 2012 9:24 pm

Joined: Fri Oct 29, 2010 1:37 am
Posts: 48
yep, he pretty much got it. There is no actual physics used in classic CS to do the recoil (or ballistics for that matter). Its been years since I worked on a FPS, but as I recall when I implemented it for anothe CS style game from that era I used a simple meter that accumalted the kick. Every shot put it up a little bit and a decerementor brought it down, the rate of which would be based on the state the player was in (standing, crouching, runing, walking etc). The Pitch and Yaw variance of the spray was set based on the level of the kick meter and the state of the player, with an additional timer that started on state changes that would scale the inaccuracy up and down from the previous state. I used a random number generator to pick the pitch and yaw of each shot from the camera's dead center using the max extents computed as mentioned.

Like many things in games, you could put the time in to simulate them with real physics but its more often then not far more work then just faking it, far less controllable, more problematic and no one will notice anyways.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

#### Who is online

Users browsing this forum: Exabot [Bot] and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities