Navigation Menu

Skip to content

Commit

Permalink
- Fix weapon bobbing interpolation
Browse files Browse the repository at this point in the history
There was a visual issue where the weapon bobbing would only start interpolating after the player's movement velocity exceeds a certain value.

(Thanks to @Doom2fan for the solution)
  • Loading branch information
nashmuhandes authored and coelckers committed Oct 4, 2020
1 parent ff62d7a commit 56a387a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions wadsrc/static/zscript/actors/player/player.zs
Expand Up @@ -49,6 +49,7 @@ class PlayerPawn : Actor
double ViewBob; // [SP] ViewBob Multiplier
double FullHeight;
double curBob;
float prevBob;

meta Name HealingRadiusType;
meta Name InvulMode;
Expand Down Expand Up @@ -1572,6 +1573,7 @@ class PlayerPawn : Actor
virtual void PlayerThink()
{
let player = self.player;
prevBob = player.bob;
UserCmd cmd = player.cmd;

CheckFOV();
Expand Down Expand Up @@ -2351,9 +2353,14 @@ class PlayerPawn : Actor

if (curbob != 0)
{
double bobVal = player.bob;
if (i == 0)
{
bobVal = prevBob;
}
//[SP] Added in decorate player.viewbob checks
double bobx = (player.bob * BobIntensity * Rangex * ViewBob);
double boby = (player.bob * BobIntensity * Rangey * ViewBob);
double bobx = (bobVal * BobIntensity * Rangex * ViewBob);
double boby = (bobVal * BobIntensity * Rangey * ViewBob);
switch (bobstyle)
{
case Bob_Normal:
Expand Down

7 comments on commit 56a387a

@Talon1024
Copy link
Contributor

Choose a reason for hiding this comment

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

This commit, or some other recent change to weapon bobbing, seems to have caused the weapon bobbing in WolfenDoom: Blade of Agony to stutter for some reason...

@Talon1024
Copy link
Contributor

Choose a reason for hiding this comment

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

@Ozymandias81
Copy link

Choose a reason for hiding this comment

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

I still get those issues with recent build, wonder what we can do to let it prevent to happen... any idea @nashmuhandes ? Or @coelckers ?

@nashmuhandes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Talon1024 @Ozymandias81 can you please make me a minimal example file that easily reproduces the issue so I can debug it more conveniently?

@Talon1024
Copy link
Contributor

Choose a reason for hiding this comment

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

I found what was causing the issue in question: prevBob was not set in the overridden PlayerThink() method of the custom player class.

@nashmuhandes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found what was causing the issue in question: prevBob was not set in the overridden PlayerThink() method of the custom player class.

So this is a mod problem, then? @Talon1024

@Talon1024
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I fixed it in BoA with this commit.

Please sign in to comment.