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

optimize suicide bomber zeus module #6314

Merged
merged 3 commits into from
May 4, 2018
Merged

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Apr 29, 2018

When merged this pull request will:

  • increase check delay from 0/each frame to 1 seconds (reset to 0 in debug mode for line drawing)
  • use more appropriate skillFinal
  • changed spotting distance formula to increase distance linearly starting from 0 skill instead of .5 skill
  • remove some very redundant parenthesis
  • re-formated if control structure for readability

- decrease check frequency from each frame to 1 per second
- simplify some math
- remove some very redundant parenthesis
- re-formated if control structure for readability
@commy2 commy2 added the kind/enhancement Release Notes: **IMPROVED:** label Apr 29, 2018
@commy2
Copy link
Contributor Author

commy2 commented Apr 29, 2018

Btw. this module uses PosZ0 distance OBJECT, so it will not work correctly inside buildings or when swimming in > 1 m deep water.

@commy2
Copy link
Contributor Author

commy2 commented Apr 29, 2018

On second thought, I don't think the math turns out to be the same. But the original one is kind of weird, I'm not sure what was intended.

Original:

skill range
0 100
0.25 100
0.5 100
0.75 150
1 200

This PR:

skill range
0 100
0.25 125
0.5 150
0.75 175
1 200

@jonpas
Copy link
Member

jonpas commented Apr 29, 2018

@mharis001

@kymckay
Copy link
Member

kymckay commented Apr 29, 2018

I think the maths makes more sense after this

@kymckay kymckay added the kind/optimization Release Notes: **IMPROVED:** label Apr 29, 2018
@commy2
Copy link
Contributor Author

commy2 commented Apr 29, 2018

Also I'm pretty sure one wants to use skillFinal, not just skill.
skill is something to be used only in conjunction with setSkill for manipulated scripted skill, while a script that only evaluates the skill should use skillFinal, which includes the skill coefficients of the Difficulty settings.

@commy2
Copy link
Contributor Author

commy2 commented Apr 29, 2018

One could also argue that the area the suicide bomber scans around him should grow linearly with skill, instead of the distance, but that's probably pedantic at that point.

@mharis001
Copy link
Member

The distance scaling in this PR is what was intended and skillFinal should be used. The PFH frequency could be changed to a macro based on if DEBUG_MODE_FULL so that the draw commands work during debug. The position format is a good point, unsure if there is one format that solves the problems or if other checks need to be performed.

- revert to intended spotting distance formula, clarify in comment
- use more appropriate skillFinal
- macro to change check delay, set to 0 in debug mode for debug line drawing
@commy2
Copy link
Contributor Author

commy2 commented Apr 29, 2018

Done.

@mharis001
Copy link
Member

mharis001 commented Apr 29, 2018

Oh no! Sorry for the confusion, I meant the changes introduced in this PR (100 + 100 * (_unit skill "spotDistance"); where 0.25 skill = 125 range is what was intended, not the original PR that added this module.

- revert the revert of the suicide bomber spotting distance calculation
@kymckay kymckay merged commit 898c015 into master May 4, 2018
@kymckay kymckay deleted the zeus-suicide-bomber-optimization branch May 4, 2018 15:35
BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
- decrease check frequency from each frame to 1 per second
- simplify some math
- remove some very redundant parenthesis
- re-formated if control structure for readability
- use more appropriate skillFinal
- macro to change check delay, set to 0 in debug mode for debug line drawing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:** kind/optimization Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants