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

add a factor to scale fatigue up and downhill #4492

Closed
wants to merge 2 commits into from

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Sep 30, 2016

When merged this pull request will:

  • pls no bully, baer
  • renamed _velocity to _speed so it's not confused with the velocity command I use for this and one is not inclined to replace it.
  • loosely based on this graph:
    http://jap.physiology.org/content/jap/93/3/1039/F1.large.jpg?width=800&height=600&carousel=1

@commy2 commy2 added the kind/feature Release Notes: **ADDED:** label Sep 30, 2016
@commy2 commy2 added this to the 3.8.0 milestone Sep 30, 2016
Copy link
Contributor

@nicolasbadano nicolasbadano left a comment

Choose a reason for hiding this comment

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

The finite diference based on getTerrainHeightASL could be replaced by surfaceNormal.

Also this coefficient is based on terrain height, and might be wrong when walking inside/over structures (e.g. walking along a pier). It might not be a huge deal though. To overcome that, actual height could be based on lineIntersect if getPosATL select 2 > 0

@commy2
Copy link
Contributor Author

commy2 commented Sep 30, 2016

surfaceNormal doesn't change whether you go up or down though.
good point about getPosATL and pathway lods

Currently this goes to zero if you walk along the slope, which we don't want.
I'll be waiting for baers feedback before doing anything though.

@nicolasbadano
Copy link
Contributor

nicolasbadano commented Sep 30, 2016

doesn't change whether you go up or down though.

_slope = (surfaceNormal _pos) vectorDotProduct (vectorNormalized velocity ACE_player);

Vector algebra 😄

@nicolasbadano
Copy link
Contributor

nicolasbadano commented Sep 30, 2016

Currently this goes to zero if you walk along the slope, which we don't want.

I think that's not bad. But if you really want to take into account that walking along a slope is a bit more tiresome than walking on a flat surface you could add a coefficient based on 1 - (surfaceNormal _pos select 2) that's independent of walking direction.

EDIT: that's exactly what the original code did.

@BaerMitUmlaut
Copy link
Member

Don't quite see the need for renaming _velocity, there's also a speed command after all. You've also kept in the old slope penalty as it is right now, that should be changed.

@commy2
Copy link
Contributor Author

commy2 commented Sep 30, 2016

You've also kept in the old slope penalty as it is right now, that should be changed.

What part of this is the "old slope penalty"? _terrainGradient ? Of course that should stay, because the surface normal isn't part of my factor.

@commy2
Copy link
Contributor Author

commy2 commented Sep 30, 2016

Don't quite see the need for renaming _velocity, there's also a speed command after all.

I just think it's weird to use velocity when you already have a variable named _velocity. Usually it's like this: Absolute value -> speed, Vector -> velocity (that's what the commands return, except that speed is using the 3.6 factor for km/h)
This is totally unofficial commy-SQF-variable-naming though.

@BaerMitUmlaut
Copy link
Member

_terrainGradient was the main factor that penalized slopes which provided decent results. Your factor adds another penalty, but without changing the _terrainGradient factor - that punishes the player too much, because you're essentially punishing him twice.

@commy2
Copy link
Contributor Author

commy2 commented Sep 30, 2016

_terrainAltitudeFactor is always smaller or equal than 1. It's supposed to make walking downwards easier. You said walking uphills should stay the same.

@BaerMitUmlaut
Copy link
Member

That doesn't work though. For example, let's say I walk parallel to a slope.

private _terrainAltitudeFactor = 2 * abs _terrainAltitudeDelta min 1;

In that case _terrainAltitudeDelta would be 0 because I don't actually climb, so _terrainAltitudeFactor would then also be 0. Later you do

_terrainGradient * _terrainAltitudeFactor

which would then also become 0, so no penalty for walking on slopes, which is the opposite of what we want.

@commy2
Copy link
Contributor Author

commy2 commented Sep 30, 2016

Wanna trade with the weather issue report?

@BaerMitUmlaut
Copy link
Member

Sure 😄

@thojkooi thojkooi modified the milestones: 3.8.0, 3.9.0 Oct 8, 2016
@@ -32,6 +32,14 @@ private _gearMass = ((loadAbs _unit + _virtualLoad) * 0.1 / 2.2046) * GVAR(loadF
private _terrainFactor = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

_terrainFactor -> dead code?

@PabstMirror PabstMirror modified the milestones: Ongoing, 3.9.0 Feb 11, 2017
ulteq added a commit that referenced this pull request Oct 31, 2017
ulteq added a commit that referenced this pull request Nov 2, 2017
* Fixes fatique calculation when walking across structures (bridges, ...)
* Prevents sprinting on very steep terrain
* Adds more in-depth debug output
* Fixes the terrain gradient calculation
* Closes #4492
ulteq added a commit that referenced this pull request Nov 4, 2017
* Fixes fatique calculation when walking across structures (bridges, ...)
* Prevents sprinting on very steep terrain
* Adds more in-depth debug output
* Fixes the terrain gradient calculation
* Closes #4492
ulteq added a commit that referenced this pull request Nov 4, 2017
* Fixes fatique calculation when walking across structures (bridges, ...)
* Prevents sprinting on very steep terrain
* Adds more in-depth debug output
* Fixes the terrain gradient calculation
* Closes #4492
ulteq added a commit that referenced this pull request Nov 6, 2017
* Fixes fatique calculation when walking across structures (bridges, ...)
* Fixes the terrain gradient calculation
* Fixes the 'wattsPerATP' constant
* Implements the respiratory system
* Prevents sprinting on very steep terrain
* Adds more in-depth debug output
* Closes #4492
ulteq added a commit that referenced this pull request Nov 8, 2017
* Fixes fatique calculation when walking across structures (bridges, ...)
* Fixes the terrain gradient calculation
* Fixes the 'wattsPerATP' constant
* Implements the respiratory system
* Prevents sprinting on very steep terrain
* Adds more in-depth debug output
* Closes #4492
@commy2 commy2 closed this Dec 18, 2017
@commy2 commy2 deleted the scale-fatigue-depending-on-alitude-change branch December 18, 2017 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Release Notes: **ADDED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants