Go Back   Project Reality Forums > Project Reality Mod Forums > PR Community Modding
PR Community Modding : Discussion on PR community mod projects.

Welcome to the Project Reality Forums! Join the Project Reality forums! Contact Us


Reply
 
LinkBack Thread Tools Display Modes
Old 05-11-2008, 08:27 PM   #1
PR Contributor

[R-CON]Wolfe's Avatar
Primary Objectives:
  1. Reduce/Eliminate prone spam.
  2. Reduce/Eliminate run'n gun.
  3. Promote realistic CQB weapons and tactics.
  4. Maintain weapon accuracy.

Definition of "Realistic Deviation":
BF2 does not have weapon sway. Realistic infantry combat cannot exist without it, so the only known way to create it is to simulate it through weapon deviation. This decreases the weapon accuracy but increases the realistic deviation when that weapon is in the hands of a soldier. So by "Realistic Deviation", I am referring to deviation when the weapon is in the hands of a soldier, not when it is locked down with clamps and firing down range in perfect lab conditions.

Coding Outline:
  • High deviation when non-zoomed (firing from the hip).
  • Low deviation when zoomed.
  • Increase zoom-in delays and zoom-in animation times.
  • Slightly increase v.75 max deviations (fire, turn, move).
  • Slightly increase v.75 recovery times (fire, turn, move).
  • Slightly reduce G3 recoil (Recoil is too easily negated with mouse movements, especially those who can adjust dpi on the fly. Reducing the recoil effect minimally affects deviation while simultaneously narrowing the gap between those who have a dpi mouse and those who don't.
  • Decrease turn rate for open sight weapons (iron sights, LAT, grenadier, etc.)
  • Add single-shot max fire rate to single-shot rifles.
  • Sniper: Decrease tracking deviation, increase move recovery time.
  • LAT: Slightly increase min and max deviation.
  • Grenadier: Slightly increase min and max deviation.
  • Support: Increase move recovery time.
  • Remove "auto return" recoil effect from assault rifles.

Special Coding Values:
The following information is being provided as a technical reference for myself as well as a reference for anyone who is interested in understanding deviation coding. I will be adding more to this section as time allows.

Per-shot delay*:
Located in the weapon.tweak file. Regulates how often pressing the "fire" or "zoom" key will be registered in a given amount of time. For example, a value of 10 will only allow the weapon to be fired/zoomed once every ~10 seconds. A value of 0.08 will only allow the weapon to fire 5-6 bullets per second. Firing a weapon as quickly as you can click a button is unrealistic. Using this code adds a valuable element of realism by limiting rapid single-shot to human-like abilities.
rem ---BeginComp:DefaultAnimationComp ---
ObjectTemplate.createComponent DefaultAnimationComp
ObjectTemplate.animation.useShiftAnimation 1
ObjectTemplate.animation.shiftDelay 0.08


Fire-Delay-From-Prone:
Located in the soldier/common/common.con file. Prevents a weapon from being fired when switching to the crouch/stand position from the prone position. Helps to prevent jack-in-the-box shooting from prone.
rem *** number of seconds the player must wait to fire weapon after being prone...
Vars.Set fire-delay-from-prone 1.2


Ironsight Zoom Factor:
Located in the weapon.tweak file. This removes 99% of the zoom effect; a vast improvement over the current 0.9 value.
ObjectTemplate.zoom.addZoomFactor 1.099

Zoom Delay:
Located in the weapon.tweak file. This is the delay (in seconds) before a weapon will switch to and from the final zoom view after the zoom key is pressed. During this delay, the weapon cannot be fired.
ObjectTemplate.zoom.zoomDelay 0.7

Zoom Field-of-View Delay:
Located in the weapon.tweak file. This prevents the background from slowly zooming in during the zoom delay so that once the zoom animation completes, the view instantly switches to the zoom mode (instead of slowly zooming in during the animation). This code should only be used for scopes where the scope view has black screen edges. This code should NOT be used for open scope weapons such as iron sights or reflex sights such as the spec ops weapon.
ObjectTemplate.zoom.changeFovDelay 0.7

Mouse Turning Rate:
Located in the weapon.tweak file. This regulates how quickly you can turn while zoomed in. Values range from 1.0 (no restriction) to 0.0 (no turning). This code is not used for scoped weapons and more useful for ironsights with a value of .8. The lower the number, the slowing the turning rate. Useful for preventing a soldier from doing rapid 180 degree turns.
ObjectTemplate.zoom.mouseSpeedMod 0.4

Deviation Calculation:
Documentation regarding how BF2 calculates deviation is rare, outdated, and often incorrect. For example, the BF2 wiki page states that deviation is calculated as [(Mindev * Stance) + (Fire + Speed + Turn) * Zoom] but have found this to be inconsistent with ingame results. If this were true, a (0 base dev), (2 stance), and (5 additional shot) should result: 0 * 2 + 5 = 5, but it does not. The in-game result is 10, not 5. This and other testing leads me to believe the deviation calculation is as follows (if anyone can confirm or correct this, please do):

[(Mindev + Fire,Speed,Turn) * Stance * Zoom]

Known Issues:

Development Status:
The following represents the latest deviation models:

Rifleman
Quote:
rem ---BeginComp:SoldierBasedRecoilComp ---
rem 556 Standard Recoil Assault Rifle
ObjectTemplate.createComponent SoldierBasedRecoilComp
ObjectTemplate.recoil.hasRecoilForce 1
ObjectTemplate.recoil.recoilForceUp CRD_UNIFORM/1.2/1.3/0
ObjectTemplate.recoil.recoilForceLeftRight CRD_UNIFORM/-0.1/-0.3/0
ObjectTemplate.recoil.zoomModifier 0.4
ObjectTemplate.recoil.goBackOnRecoil 0
rem ---EndComp ---

rem ---BeginComp:SoldierDeviationComp ---
rem 556 Optical Sight Standard Accuracy Assault Rifle
ObjectTemplate.createComponent SoldierDeviationComp
ObjectTemplate.deviation.minDev .333
ObjectTemplate.deviation.setFireDev 1.5 1.5 .038
ObjectTemplate.deviation.setTurnDev 3 .225 .225 .075
ObjectTemplate.deviation.setSpeedDev 1.5 .1 .1 .015
ObjectTemplate.deviation.setMiscDev 5 5 .05
ObjectTemplate.deviation.devModStand 1.6
ObjectTemplate.deviation.devModCrouch 1.5
ObjectTemplate.deviation.devModLie 1.3
ObjectTemplate.deviation.devModZoom .3
rem ---EndComp ---
[R-CON]Wolfe is offline
Last edited by [R-CON]Wolfe; 07-23-2008 at 04:26 PM..
Reply With Quote
Old 05-12-2008, 01:10 PM   #2
Gameserver Moderator

Jonny's Avatar
Re: [WIP] Realistic Deviation

Recoil:

See my ballistics spreadsheet, 4shared.com - online file sharing and storage - download (4) ballistic tables BC.xls for a model of the relative recoil effects.

Most of the values are obvious, to adjust them all find out what the recoil for the L85A2 should be and put that in box E144. Then just read off the values. This method has been decided to more accurate than energy methods by people who have shot the actual guns, but does not account for different dampening. It is the entire effect, no accounting for the time it actually takes.

The easiest way to fix this is to group all the dampning methods into a few groups and rate them according to effectiveness, then apply multipliers based on that.

Ballistics + Zeroing
!!!Nedlands1 for [R-CON]!!! (Done)
!!!Nedlands1 for [R-DEV]!!!
Jonny is offline Reply With Quote
Old 05-12-2008, 02:00 PM   #3
PR Coder Team

[R-DEV]Mosquill's Avatar
Re: [WIP] Realistic Deviation

Quote:
Originally Posted by Wolfe View Post
Known Issues:
  • Scope-in animation- ANIMATORS! HELP!
    When increasing the scope in delay (zoomDelay), you get a very neat and cinematic effect as the camera slowly zooms towards your target while your scope moves towards your eye. I thought this would be perfect until after a few hours of play testing. Because scoped rifles are zoomed in/out many times, our testers (including myself) began to get sick from vertigo. I wanted realism, and barfing due to combat is realistic, but this wasn't the realism I had in mind.

    The only alternative was to stop the camera from slowly zooming in. To do that, I added (changeFovDelay) but it changes the animation effect slightly. Instead, the rifle quickly moves to the eye and remains there while you stare at the scope bracket, after which, it then switches to looking through the scope.

    To correct this, my idea was to slow down the scope-in animation. Problem is, animators are in short supply and the time Involved to change every animation for every scoped weapon might be too much. Then again, this would only have to be done for the assult rifles with scopes.

    Another alternative would be to create a single generic animation that could be used for all scoped weapons... but not quite sure how that would work.. just an idea.

    Marksmen and snipers probably don't need any animation; they could keep the zoom-in effect because 1) they don't zoom/unzoom as often as riflemen (or do they?) and 2) it looks really really cool on a sniper weapon.. movie like.
You don't need new animations to solve this. Go to your weapon's AnimationSystem1p.inc and find something like this: animationSystem.createAnimation Objects/Weapons/Handheld/usrif_m16a4/animations/1p/1p_m16a2_tozoom.baf
animationManager.looping 0
animationManager.length 0.083333

Just change the lenght to what you want. If there is no 'animationManager.length' for the animation, add one. The animation you need usually has '_tozoom' at the end.
[R-DEV]Mosquill is offline Reply With Quote
Old 05-12-2008, 04:10 PM   #4

DeltaFart's Avatar
Re: [WIP] Realistic Deviation

will this interfere with the balistics?


WIPs: Minor helping of PMC mod, SPG9
DeltaFart is offline Reply With Quote
Old 05-12-2008, 04:25 PM   #5

spacemanc's Avatar
Re: [WIP] Realistic Deviation

Good sfuff - anything which reduces prone spamming has got to be good - I can hear the prone spammers crying now! - Good luck.
spacemanc is online now Reply With Quote
Sponsored Links
Old 05-12-2008, 04:38 PM   #6
Gameserver Moderator

Jonny's Avatar
Re: [WIP] Realistic Deviation

Quote:
Originally Posted by DeltaFart View Post
will this interfere with the balistics?
Not unless hell freezes over, thaws out, creates its own star in the centre, forms a seperate and quite pleasant earth like planet and then subsequently buds off our universe to become a seperate entity.

Short answer: no.

Ballistics + Zeroing
!!!Nedlands1 for [R-CON]!!! (Done)
!!!Nedlands1 for [R-DEV]!!!
Jonny is offline Reply With Quote
Old 05-12-2008, 04:48 PM   #7

DeltaFart's Avatar
Re: [WIP] Realistic Deviation

sheesh jonny I was just asking no need for that :'-(


WIPs: Minor helping of PMC mod, SPG9
DeltaFart is offline Reply With Quote
Old 05-12-2008, 04:51 PM   #8
PR Contributor

[R-CON]Wolfe's Avatar
Re: [WIP] Realistic Deviation

Quote:
Originally Posted by Jonny View Post
Recoil:
See my ballistics spreadsheet for a model of the relative recoil effects.
Thank you; that should save time. Are these values already in the game or is this something new?

Quote:
Originally Posted by [R-CON]Mosquill View Post
You don't need new animations to solve this. Go to your weapon's AnimationSystem1p.inc
Thanks, I'll try that.

Quote:
Originally Posted by DeltaFart View Post
will this interfere with the balistics?
No. Deviation and Ballistics are two different things and located in two different files. Deviation only affects the initial direction of the bullet based on stance and gun movement at the instant you pull the trigger. After the bullet leaves the gun, separate ballistics tell it how to behave based on gravity and other factors. I am only working on deviation.
[R-CON]Wolfe is offline
Last edited by [R-CON]Wolfe; 05-12-2008 at 04:58 PM..
Reply With Quote
Old 05-12-2008, 05:06 PM   #9

Waaah_Wah's Avatar
Re: [WIP] Realistic Deviation

Quote:
Originally Posted by Wolfe View Post
At 100 meters, a single shot can hit the center of a truck wheel.
Erm... The wheel is pretty large. Does this mean that we might have trouble with hitting a man sized target 100-150 meters away? In that case, whats the point of having ballistics if the bullet doesnt go where you aimed it anyway?

Never argue with an idiot, he will just drag you down to his level and beat you by experience

Killing for peace is like f*cking for virginity

I Jaymz
Waaah_Wah is offline Reply With Quote
Old 05-12-2008, 05:12 PM   #10
Gameserver Moderator

Jonny's Avatar
Re: [WIP] Realistic Deviation

Brand new values Wolfe, not in game yet.

Quote:
Originally Posted by DeltaFart View Post
sheesh jonny I was just asking no need for that :'-(
I was bored, it seemed like a funny response....

Ballistics + Zeroing
!!!Nedlands1 for [R-CON]!!! (Done)
!!!Nedlands1 for [R-DEV]!!!
Jonny is offline Reply With Quote
Sponsored Links
Reply


Bookmarks

Tags
coding, deviation, realistic, wip
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 02:42 PM.


Powered by: vBulletin. ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO.
All Content Copyright ©2004 - 2008, Project Reality.