If you go to KingdomComeDeliverance\Mods\CutsceneFPSFixV2\Data, open Cutscene Fix.pak in WinRAR or 7zip or whatever, then go to Scripts\Entities, and open FPSFix.lua inyour notepad of choice, you can do Ctrl+F and search for whatever framerate the mod's locked to and change it to your screen's refresh rate.
Careful for those who want to play at higher frame rates. This was locking my FPS throughout the ENTIRE game, not just cutscenes, at 144fps. Maybe there's a fix, but I just removed it and now it feels SOOO much better. I had thought it was just a really demanding game even for a 4090, but when I opened my console I noticed there was a command being spammed to set max fps to 144.
It's pretty obvious. It's literally just spamming sys_maxfps in the console, so basically it overrides the 30 fps lock in cutscenes. If you don't want it to spam so much just change the lua script to spam it once per second for example. Right now it's spamming however many FPS are, so if it's 120 fps then it's spamming 120 times per second.
I added timer variables to the script so it accumulates 1 second between executions. Just change the sys_maxfps to the value you want and that's it. You're good to go.
Just open the .pak with 7zip (for example) navigate to Scripts > Entities > FPSFix.lua and replace it the below script so it only executes the command once per second. You can always change how long of an interval you want as well of course.
--- --- The FPSFix contains its own lifecycle, this way you can hook into the update method and call your logic every frame --- FPSFix = { Client = {}, Server = {}, Properties = { bSaved_by_game = 0, -- Warning: -- should the entity saved within a savegame? -- If a user deletes your mod and uses the last save game, the engine will quit and shows an error, that this entity is missing -- This can be solved by simply not saving the entity within the savestate of the game Saved_by_game = 0, bSerialize = 0 }, States = {},
-- Timer variables for throttling the command execution. lastUpdateTime = 0, -- Accumulates time between command executions. updateInterval = 1.0 -- Interval in seconds between executions (once per second). }
-- This is called every frame given the entity has been spawned. function FPSFix.Client:OnUpdate(frameTime) -- Accumulate elapsed time. self.lastUpdateTime = self.lastUpdateTime + frameTime
-- Execute the command if the interval has passed. if self.lastUpdateTime >= self.updateInterval then System.ExecuteCommand('sys_MaxFPS 116') self.lastUpdateTime = 0 -- Reset the timer. end end
-- Called once; use this for initializing stuff. function FPSFix:OnReset() -- Reset the timer. self.lastUpdateTime = 0 self:Activate(1) end
-- Called once on the server side for initialization. function FPSFix.Server:OnInit() System.LogAlways("FPSFix OnInit")
if (not self.bInitialized) then self:OnReset() self.bInitialized = 1 end end
-- Called once on the client side for initialization. function FPSFix.Client:OnInit() System.LogAlways("FPSFix OnInit")
if (not self.bInitialized) then self:OnReset() self.bInitialized = 1 end end
-- Called when the player saves or updates a save state. function FPSFix:OnPropertyChange() self:OnReset() System.LogAlways("FPSFix opc") end
function FPSFix:OnAction(action, activation, value) -- You can handle actions here if needed. end
FPSFix.Server.TurnedOn = { OnBeginState = function(self) BroadcastEvent(self, "TurnOn") end, OnUpdate = function(self, dt) -- Do something every frame if needed. end, OnEndState = function(self) -- Cleanup when turning off, if necessary. end, }
This is not true. You can even edit files within packages without unpacking them first. You don't need Winrar for anything. Just right-click on the pak and select 7zip -> open archive
Saying they should stop telling people to use a specific program to edit a file, because it can't edit said file directly, without need of repack. ...while the alternative program they're mentioning also can't direct edit the said file.
WinRAR can, in some case, directly edit PAK Files, without the need to repack them, like you need it in 7Zip. But what I have read, it can't edit directly the KCD Files, because they are, compressed and/or encrypted. At least that is what I had read about it. I used WinRAR in the past, but not anymore since years. And, if this is right, the only advantage of WinRAR, is not given.
like another comment says it caps the cape at whichever FPS file you choose. its also annoying as hell if you use the cheat console mode. i'll just stick to the 30 fps at this point
The mod works fine, however it doesn't seem to stay activated when starting a DLC. I just had it with "A Woman's Lot":
Playing main game --> Mod works just fine Starting DLC --> Mod isn't working anymore Saving and Exit inside the DLC + Restarting game to load the latest save --> Mod is working fine Ending the DLC and getting back to main game --> Mod isn't working anymore
Any idea how this could be fixed, like said it seems to happen whenever you are transitioning into the DLC or after getting back to the main game. Great mod by the way!
After installing this mod my fps in game become ~50, changing settings or resolution do nothing. LOW preset = 50 fps, Ultra preset = 50 fps. 2K resolution = 50 fps, 720p = 50 fps. Deleting this mod did nothing. Can't bring back normal fps like in was before.
72 comments
I added timer variables to the script so it accumulates 1 second between executions. Just change the sys_maxfps to the value you want and that's it. You're good to go.
Just open the .pak with 7zip (for example) navigate to Scripts > Entities > FPSFix.lua and replace it the below script so it only executes the command once per second. You can always change how long of an interval you want as well of course.
---
--- The FPSFix contains its own lifecycle, this way you can hook into the update method and call your logic every frame
---
FPSFix = {
Client = {},
Server = {},
Properties = {
bSaved_by_game = 0,
-- Warning:
-- should the entity saved within a savegame?
-- If a user deletes your mod and uses the last save game, the engine will quit and shows an error, that this entity is missing
-- This can be solved by simply not saving the entity within the savestate of the game
Saved_by_game = 0,
bSerialize = 0
},
States = {},
-- Timer variables for throttling the command execution.
lastUpdateTime = 0, -- Accumulates time between command executions.
updateInterval = 1.0 -- Interval in seconds between executions (once per second).
}
-- This is called every frame given the entity has been spawned.
function FPSFix.Client:OnUpdate(frameTime)
-- Accumulate elapsed time.
self.lastUpdateTime = self.lastUpdateTime + frameTime
-- Execute the command if the interval has passed.
if self.lastUpdateTime >= self.updateInterval then
System.ExecuteCommand('sys_MaxFPS 116')
self.lastUpdateTime = 0 -- Reset the timer.
end
end
-- Called once; use this for initializing stuff.
function FPSFix:OnReset()
-- Reset the timer.
self.lastUpdateTime = 0
self:Activate(1)
end
-- Called once on the server side for initialization.
function FPSFix.Server:OnInit()
System.LogAlways("FPSFix OnInit")
if (not self.bInitialized) then
self:OnReset()
self.bInitialized = 1
end
end
-- Called once on the client side for initialization.
function FPSFix.Client:OnInit()
System.LogAlways("FPSFix OnInit")
if (not self.bInitialized) then
self:OnReset()
self.bInitialized = 1
end
end
-- Called when the player saves or updates a save state.
function FPSFix:OnPropertyChange()
self:OnReset()
System.LogAlways("FPSFix opc")
end
function FPSFix:OnAction(action, activation, value)
-- You can handle actions here if needed.
end
FPSFix.Server.TurnedOn = {
OnBeginState = function(self)
BroadcastEvent(self, "TurnOn")
end,
OnUpdate = function(self, dt)
-- Do something every frame if needed.
end,
OnEndState = function(self)
-- Cleanup when turning off, if necessary.
end,
}
FPSFix.Server.TurnedOff = {
OnBeginState = function(self)
BroadcastEvent(self, "TurnOff")
end,
OnEndState = function(self)
-- Cleanup when turning off, if necessary.
end,
}
FPSFix.FlowEvents = {
Inputs = {
TurnOn = { FPSFix.Event_TurnOn, "bool" },
TurnOff = { FPSFix.Event_TurnOff, "bool" },
},
Outputs = {
TurnOn = "bool",
TurnOff = "bool",
},
}
Saying they should stop telling people to use a specific program to edit a file, because it can't edit said file directly, without need of repack.
...while the alternative program they're mentioning also can't direct edit the said file.
WinRAR can, in some case, directly edit PAK Files, without the need to repack them, like you need it in 7Zip.
But what I have read, it can't edit directly the KCD Files, because they are, compressed and/or encrypted.
At least that is what I had read about it. I used WinRAR in the past, but not anymore since years.
And, if this is right, the only advantage of WinRAR, is not given.
Playing main game --> Mod works just fine
Starting DLC --> Mod isn't working anymore
Saving and Exit inside the DLC + Restarting game to load the latest save --> Mod is working fine
Ending the DLC and getting back to main game --> Mod isn't working anymore
Any idea how this could be fixed, like said it seems to happen whenever you are transitioning into the DLC or after getting back to the main game.
Great mod by the way!
Thanks! :)