Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wind deflection single pfeh #1886

Merged
merged 2 commits into from
Jul 25, 2015
Merged

Wind deflection single pfeh #1886

merged 2 commits into from
Jul 25, 2015

Conversation

PabstMirror
Copy link
Contributor

Switches fnc_updateTrajectoryPFH to be a master PFEH, bullets get added to an internal array instead of creating/deleting a new cba PFEH each time.

I believe this solves a big performance problem where the count cba_common_perFrameHandlerArray can grow too large.

In actual session I saw it hit >2000. Most entries are nil, but it sill takes time to process them, which happens each frame. (2000 is about 5.5ms each frame),

In a stress test mission with about 50 ai + disabling the isPlayer check in handleFired so all AI bullets are tracked. Unscientific results because AI are unpredictable, but I get a huge performance difference:

image
VS
image

With PFEH debug enabled:

ace_windDeflection_pfeh_counter: Average: 0.812859s / 2257 = 0.36015ms

@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Jul 22, 2015
@PabstMirror PabstMirror added this to the Ongoing milestone Jul 22, 2015
_bulletSpeed = vectorMagnitude _bulletVelocity;

if ((!alive _bullet) || {(_bullet isKindOf "BulletBase") && {_bulletSpeed < 100}}) then {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(_bullet isKindOf "BulletBase")
We are checking this when we add the bullets to the array. Is it necessary to check it again here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We track either BulletBase or GrenadeBase
I think we still wanted to track 40mm grenades even if they're on a low speed ballistic path.

@thojkooi thojkooi modified the milestones: 3.2.0, Ongoing Jul 25, 2015
PabstMirror added a commit that referenced this pull request Jul 25, 2015
@PabstMirror PabstMirror merged commit ffc5615 into master Jul 25, 2015
@PabstMirror PabstMirror deleted the windDeflectionSinglePFEH branch July 25, 2015 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants