Skip to content

Conversation

@thekovic
Copy link
Contributor

Fixes #10

Quick and dirty implementation plugs delta time into every line of code changing yaw in reaction to left/right arrow key. Up for discussion whether this should be behind a macro and whether the turn rate should be configurable - perhaps modern player sensibilities would prefer a higher than "intended" turn rate to make the game feel snappier.

@HeilanMo
Copy link
Collaborator

HeilanMo commented Jan 2, 2026

This doesn't correctly make the turning rate independent of the framerate. The sithPlayerControls_CalculateAngularVelocity function looks like this:

static inline float sithPlayerControls_CalculateAngularVelocity(SithActorInfo* pActor, float axisDirection, float keyDirection, float speedFactor)
{
    speedFactor = J3DMIN(speedFactor, 1.0f);

    return (axisDirection * sithTime_g_fps) + (pActor->maxRotVelocity * keyDirection * speedFactor);
}

So just appyling delta time to the speed factor doesn't remove framerate dependency because axisDirection is still multiplied with the current framerate. Also, all rotation assignments which are using this function are constant assignments, which means there's no need of using delta time for this function. I already talked with Urgon about this issue and there's not a perfect way of fixing it. But we thought the best way is to assume an "intended" framerate of 30FPS for the game and replace sithTime_g_fps with just 30.0f. Then you get 30FPS turning rate behaviour on all framerates. I've already did that here:

return (axisDirection * SITHPLAYERCONTROLS_ANGULARVEL_FPS) + (pActor->maxRotVelocity * keyDirection * speedFactor);

And yes I agree it's probably the best to make that rate adjustable. I also prefer the faster turning rate you normally get with 60FPS. Also I guess for speedrun builds, SITHPLAYERCONTROLS_ANGULARVEL_FPS should be fixed to 60.0f.

@thekovic
Copy link
Contributor Author

thekovic commented Jan 2, 2026

Ugh, that's what I get for going off the API instead of checking the implementation.

I wish we could ask the devs what they intended by adding the frame rate to the velocity because it gives "quick hacky fix". Declaratively, the formula really should be probably just return pActor->maxRotVelocity * axisDirection * speedFactor; but that's calibrated to be inhumanly slow. Also, is there any instance where axisDirection != keyDirection?

I'd say the default speed should be return (axisDirection * 60.0f) + (pActor->maxRotVelocity * keyDirection * speedFactor); because that's how people have experienced this game for 25+ years but I'd like to see the exact value configurable in the Jones.cfg config.

@thekovic thekovic marked this pull request as draft January 2, 2026 17:13
@HeilanMo
Copy link
Collaborator

HeilanMo commented Jan 2, 2026

Yeah, I also would love to know the intention of that framerate multiplication. They must knew that this makes turning rate heavily framerate dependant. I also can't find any occurance where axisDirection != keyDirection. Maybe it's a strangle left over from the original SithEngine. I have no clue why you would need both values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants