LANVP icon indicating copy to clipboard operation
LANVP copied to clipboard

Any framerate above 30 breaks car handling.

Open DeadxWreckoning opened this issue 2 years ago • 12 comments

Like title states, if I leave the framerate unlocked, the cars handle like they are on ice. Very sensitive and can almost do a 180 simply turning without hitting the brakes. Tried locking FPS to 120 and also 60, same issue, and feels the same at both refresh rates. Capping it back to 30 fps grants the correct car handling.

DeadxWreckoning avatar Apr 19 '23 02:04 DeadxWreckoning

I'm currently playing through at 100fps, the way it runs for me I wouldn't say the handling is broken but it's definitely affected.

Perfectly playable but does behave oddly from time to time, like drifting at high speeds when driving only a very slight curve.

svetter avatar Apr 25 '23 14:04 svetter

Same over here. It's somewhat playable but it kinda ruins driving.

Filoppi avatar Aug 06 '23 20:08 Filoppi

I am looking into this. Sadly, it's not easy to solve, since the issue lies somewhere within the game's physics.

VaanaCZ avatar Apr 12 '24 11:04 VaanaCZ

Please retest with version 2.0

Saibamen avatar Aug 12 '24 07:08 Saibamen

Same issues with 2.0.

DeadxWreckoning avatar Aug 13 '24 04:08 DeadxWreckoning

The issue is not yet fixed in 2.0. I do not yet fully understand the driving physics logic, but hopefully I will be able to fix in the next version.

VaanaCZ avatar Aug 13 '24 16:08 VaanaCZ

@VaanaCZ: Can we have workaround for this? Set FPS lock to 30 when driving a car maybe?

Saibamen avatar Aug 14 '24 11:08 Saibamen

Same issue as OP. I still really appreciate this mod, and thank @VaanaCZ for its creation and upkeep.

RealKawfee avatar Feb 02 '25 17:02 RealKawfee

Also having this issue, and it was bad enough for me to uninstall the patch completely. Hope this gets fixed sometime.

TimerBunneh avatar May 11 '25 01:05 TimerBunneh

might be fixed by adjusting the division factor (5.0) in the forceFilter function. from testing, the car is not as grippy around corners anymore.

funkkiy avatar May 31 '25 23:05 funkkiy

@funkkiy we could try and dynamically adjust the division factor by the ratio between your fps and 30Hz. Or anyway set it to the target fps on boot. Did you test it more?

Filoppi avatar Sep 21 '25 18:09 Filoppi

@funkkiy we could try and dynamically adjust the division factor by the ratio between your fps and 30Hz. Or anyway set it to the target fps on boot. Did you test it more?

here's what I have right now:


diff --git a/lanvp/fix_fps.cpp b/lanvp/fix_fps.cpp
index 22e4e17..64be595 100644
--- a/lanvp/fix_fps.cpp
+++ b/lanvp/fix_fps.cpp
@@ -10,6 +10,8 @@
 #include "shared.h"
 #include <cassert>
 
+#include <Windows.h>
+
 DWORD sigFramerateDivisorConstructor[] =
 {
 		0x89, 0x5C, 0x24, 0x18,
@@ -160,6 +162,8 @@ static void* notebookClueVft;					// NotebookClue::__vftptr
 static float birdMaxSpeed;
 static float* defaultBirdMaxSpeed;
 
+static double forceFactor = 5.0;
+
 bool ApplyPatch_Framerate(Patch* patch)
 {
 	assert(patch->numSignatureIndices == 9);
@@ -276,6 +280,34 @@ bool ApplyPatch_Framerate(Patch* patch)
 		if (!MemWriteNop((BYTE*)braking + 5, 4))					return false;
 	}
 
+	// steering lol
+
+	union {
+		void* p;
+		BYTE b[4];
+	} u;
+	u.p = &forceFactor;
+
+#if true
+	BYTE steeringHook[] =
+	{
+		0xDC, 0x35, u.b[0], u.b[1], u.b[2], u.b[3]
+	};
+
+	MemWrite((void*)0xE1E99E, steeringHook, sizeof(steeringHook));
+	MemWrite((void*)0xE1E9D0, steeringHook, sizeof(steeringHook));
+#else
+	BYTE steeringHookAltXmm0[] = {
+		0xF2, 0x0F, 0x5E, 0x05, u.b[0], u.b[1], u.b[2], u.b[3]
+	};
+	BYTE steeringHookAltXmm1[] = {
+		0xF2, 0x0F, 0x5E, 0x0D, u.b[0], u.b[1], u.b[2], u.b[3]
+	};
+
+	MemWrite((void*)((char*)GetModuleHandle(0) + 0xA549C2), steeringHook, sizeof(steeringHook));
+	MemWrite((void*)((char*)GetModuleHandle(0) + 0xA549F7), steeringHook, sizeof(steeringHook));
+#endif
+
 	//
 	// PENCIL CLUE
 	//
@@ -383,6 +415,15 @@ void __stdcall Hook_Frame()
 	// Change bird speed limit
 	birdMaxSpeed = multiplier * *defaultBirdMaxSpeed;
 
+	double unclampedForceFactor = multiplier * 5.0;
+	if (unclampedForceFactor > 5.0) {
+		unclampedForceFactor = 5.0;
+	}
+	else if (unclampedForceFactor < 0.1) {
+		unclampedForceFactor = 0.1;
+	}
+	forceFactor = unclampedForceFactor;
+
 	lastTime = currTime;
 }

haven't commited it cuz the patch is a bit different in the RGL & Steam binaries, but from my testing it seemed to alleviate the issue a lot. only tested on RGL. would appreciate if someone tested & committed.

funkkiy avatar Sep 21 '25 19:09 funkkiy