No I have no intentions of making an KCD2 version. I do not own KCD2, nor do I have time to play KCD2.
If nothing massive have changed in KCD2, I assume the primary thing people want from this mod can be achieved with a simple XML edit, so I suggest asking the guy that did that instead.
For 1.3, I originally wanted potions to optionally also advance time, however I scrapped that idea kind of mid-development as when I thought about it, it is a very, very bad idea.The reason for this is simple; Warhorse Studios have not given us any documentation and there aren't any known hooks outside of the UI hooks, so if you apply a potion to something, it'd count as consuming it in this mod(as it's no longer in the inventory, obviously).
Because of this, it just is better to keep potions the way they are(and in general make sense, you don't spend minutes consuming medicine when sick, you pretty much just get it over with).
--
There is still some delay in opening and closing inventory, sadly I can't do anything about this. The code has been made as performance efficient as is realistically possible when hooking to the UI(we HAVE to scan through the entire inventory, and we HAVE to scan the entire item and food database). However I've ensured to only do the database call for items once, so made it about 3 times as fast as it was before.
going through the food database every time is, however, unavoidable... As we need the nutritional value for the current food item we're searching. Essentially, the more food you have in the inventory, the slower it'll get to open and close your inventory, so suggest avoiding food hoarding. The total amount of food items is what counts, not stacks. so a stack of 15 dried meat = 15 loops, not 1(game actually keep track of individual spoilage, and just stack items with similar values together)!
--
I was unable to find a good way of seeing what perks the player have, so the mod does not take insomniac perk into account.
So as it currently stand, there's not really anything else I can think of doing with the mod, so it's finished unless some bugs pop up(though I have not noticed any, even with a heavy mod loadout).
Also a fair warning; The default values assumes the optional alcohol change, I suggest changing alcohol_multiplier to 2 or 3, rather than default 6. a beer takes 12minutes at 6 for my edited alcohol nutrition,it takes 36minutes without.
that's a shame, I really love this mod and I hate how games in general use such a short ingame day. For me it's extremely immersion breaking, and this mod exactly what I needed for my KCD1 playthrough. Thank you for your work! :)
I have a problem that's probably not from this mod or I'm not sure anyway
now when I sleep or wait, it takes almost a minute for the process, and when I press esc I get frozen game and have to manualy ctd, anyone have any suggestions?
I'm sure you already know this, but it seems messing with the timescale (at least for me) has permanently changed the timescale. I fully uninstalled the mod, game, and all of its files. Now, its more than likely because I'm using the old save, which makes sense, but now I understand why we're not meant to be touching the timescales.
This is by no means a bashing of this mod, or any others like it. it's just something I've run into.
The timescale will change\reset to normal in a situation where the timescale would normally change in-game.
For example; If you start Theresa's DLC portion, when you're done with that, Henry's timescale will be back to normal.
Alternatively; You can open up the zip-file, and edit the script to have the default\normal time-scale again (it sets on load), save&exit, and then uninstall.
Edit: To be a bit clearer. I know of 2 instances where the time-scale changes (might be more, but I don't know of it), after the prologue (Goes from static, to set timescale value), and When starting Theresa's DLC (timescale become static) and ending said DLC (timescale become whatever timescale value is set, which is not done by this mod, this mod overwrites the timescale on load to whatever is set in the script).
Thank you for your great mod! I dont understand mostly the part of horse inventory. Does this suggest that we should avoid moving food to horse's? What's the consequences if we did? And can we completed custom off the 'eating caused time advancing' by editing factor/multiplier to 0?
"The timescale only activates on loading, meaning starting of a new-game you'll probably have to save\load(rest an hour for instance, then load the save) once you've awaken at the mill in Rattay, before loading a save it'll retain the default game's timescale(15)."
This wording is confusing. do I need to start a completely new game to make this mod work?
ahh I see, thanks for the quick response! this timescale is how the game should've been in the first place. Much more immersive and I don't feel rushed to do a bunch of stuff during the day now.
The more junk I cart around with me, the longer the load times to open inventory/log/map become; I suspect that the base game has a script similar to yours which is updating each food item's "durability" when a menu is opened. I already edited yours to just return 0, but I'd like to do the same to the base game's script... if I can find it... any idea where it'd be in the data folder?
I already set all food items to never spoil by altering their item durations, but I believe the game is still iterating over the entire inventory list even when there is no updating required so neutering the script doing that *ought* to solve the lag issue
Short simple answer: It's most likely in the byte code (compiled C++), so you'll have to either reverse engineer it, or hijack the code in memory.
However, you'll not want to do either of these things, because what you think is causing the slowdown, isn't what's causing the slow down. The slow down is caused by the game quering the database each-time you open your inventory, both to get the inventory, but also get all properties of all items in your inventory. Therefore, more items in inventory = more queries to the database. You'd have to completely rewrite how items and inventory system works in the game (by again, reverse engineering the actual byte code).
If you circumvent this through memory manipulation (or reverse engineering), what'll happen is you'll have no inventory items, or no ability to see their properties, as it doesn't get loaded.
Hmmm I feel this needs to be paired with something to reduce energy drain, using the 2x Timescale option I'm completely exhausted and at risk of fainting before noon :S
Yeah, anything below x10 is not supported by me, and it's an "YMMV" situation. Much of the game is heavily designed and reliant on timescale, and using something below x10 could potentionally break a lot of things (I can imagine quests being completely broken with x2, same as "Bethesda-engine" games).
x10, which is a fairly 'minor' change, already has issues that can't be fixed (Rest-wheel time is directly linked to games timescale, rather than ticks, which is ridiculous).
This mod lists the variables I need... I'll just have to configure them to the timescale... would you be interested in hosting the result when I'm done or should I just release it as a standalone?
Well I've got that part done... but I went digging into this mod more to make sure it wouldn't conflict and realized we were approaching the problem from two different perspectives. This mod DOES attempt to manage energy etc... but the values I'm manipulating do not translate directly to what you are doing via scripts...
eg I would set "DefaultWorldTimeRatio' = 2 in rpg_param.xml vs your "timescale.time_ratio = 2" that part matches up but... timescale.energy_drain_factor = 0.06 When I run the numbers; ExhaustionSpeed in rpg_param.xml should be set to 0.00008 to maintain the default ratio, and so these two values do not seem to be referring to the same thing...
Hmm here is something interesting; the different versions of your mod all use the same values apart from that timescale.time_ratio So the 15x version has the exact same energy drain settings as the 2x version... there's the issue... I think
?Well I've got that part done... but I went digging into this mod more to make sure it wouldn't conflict and realized we were approaching the problem from two different perspectives. This mod DOES attempt to manage energy etc... but the values I'm manipulating do not translate directly to what you are doing via scripts...
Of course not, this mod doesn't touch, nor manage energy, at all.
I do my own calculation when you consume food or alcohol that advances time. This is a manual-energy drain enforced by me, as advancement of time through script, does not do any energy drain (if you move the game from 12 to 14, 0 energy is drained, doesn't matter if you're on x1 or x300 timescale), therefore I enforce my own manual drain after eating. That is the only energy manipulation in this mod, none other. Your issue is with the times standard passive-drain based on real-time (which works independant of timescale, weirdly enough it seems, instead using global tick cycle).
?eg I would set "DefaultWorldTimeRatio' = 2 in rpg_param.xml vs your "timescale.time_ratio = 2" that part matches up but... timescale.energy_drain_factor = 0.06
This is unecessary. There is no reason for you to change the timescale, this mod enforces timescale through script, and doesn't touch ANY global variables. No global variables is touched in this mod (but timescale is changed through it, meaning even if you set DefautlWorldTimeRatio= 5000, moment you load x2 version of this mod, x2 is what you get, as my mod loads after global variables). This is why the bugs in the Real Timescale mod, does not affect this mod.
?When I run the numbers; ExhaustionSpeed in rpg_param.xml should be set to 0.00008 to maintain the default ratio, and so these two values do not seem to be referring to the same thing...
And that'd be what to do. And RPG_Param overwrite, that sets ExhaustionSpeed to 0.00008. You now have a mod that works perfectly with this mod, and would also work for whomever uses cheats manual timescale command (if anyone still does this), another mod that doesn't touch table information.
?Hmm here is something interesting; the different versions of your mod all use the same values apart from that timescale.time_ratio So the 15x version has the exact same energy drain settings as the 2x version... there's the issue... I think
Seems you're confused to the difference between tables (global variables used by the game), and local script variables.
Timescale.[name] - are all local variables to the script. For all intents and purposes, the game doesn't know those exist. I change "DefaultWorldTimeRatio" into Timescale.TimeRatio at some point iirc (probably at load), but they are not the same.
There is no energy management in this mod, at all. But I do a manual energy-drain based on time-advanced after eating. Time advanced = Created by me, i.e; "You eat x-meal, so I push the clock to y-time". When you push time forward, the game doesn't do ANY energy drain at all, and so I manually enforce my own energy drain in this very specific circumstance (based on how much time has passed). This is the same for x1, x10 or x400, because I enforce the drain (when there would be none at all).
Simply making an rpg_param overwrite for "ExhaustionSpeed", would solve the issue for x2, and be 100% compatible with any mod that changes timescale only (this mod, and cheat mod). It would also be compatible with any mod that changes RPG_Param (except for exhaustionSpeed), and potentionally real timescale as well (if they do not change ExhaustionSpeed themselves, but they probably do).
Then zip the Tables folder into [whatevername].pak.
Create Data folder, place [whatevername].pak into it.
Create even another folder, named whatever (good form is to name it the same as __[whatever].xml).
Then place Data folder into that, and a mod.manifest file (or copy one from another mod and edit).
And done. You've fixed the exhaust, and is 100% compatible with this mod and cheat mod (for it's manual timescale override command).
You'll also be compatible with Real Timescale, if they do not alter energy drain (though they probably do).
--
Also to be clear, if this mod did change ExhaustionSpeed on the script level (it doesn't, as I said), no changes you make in a table would matter, as the script loads after all global variables. You can test this by attempt to enforce a different timescale in RPGParam
Ok ya, that seems to work. I had already set up one file for each timescale speed Here is the lot of them if you'd like em: https://www.dropbox.com/s/h8myrpj8hzbelrd/FixedEnergyDrain.rar?dl=1 They also correct the DigestionSpeed btw
But I had to gut that eating-time advancement function - it was causing longer and longer game freezes each time I opened or closed my inventory as the bag contents passed 15k lbs and it iterated over every item each time
I made get_total_nutrition() just return 0 and the lag is (mostly) gone, obviously the game never meant for the player to have this many items on them
Yeah, a known issue that can't be easily fixed with what we got as "mod support". Would need to reverse engineer the actual source to find and identify exactly when an item is being consumed, and then hijack this. Way beyond my skill set and not something I'd be willing to invest time into, lol (If I were to do this, there's other games I'd much rather mod).
What we really need, is an "script-extender" similar to Skyrim has. Which essentially does what I just described.
The only quest that the timescale has "broken" so far is the Playing with the Devil one; in it the game forces you to wait ~6 hours and by the time you regain control the "woodcutter" bodies have despawned, the quest still completes just fine but the narrative of waking up to find their bodies... well you have to use your imagination there
Not a big deal but this does have one dirty edit in it: Table 'food' is patched by 'food__timescalemod', lines added: 0, modified: 9, equal: 1, time: 0.000
This is just me guessing (as I can't really remember), but I'm fairly sure I added that dirty edit intentionally. It's to enforce the default-value in-cases where a mod may, or may not replace\change it. The intent of the mod is therefore to have it as an higher priority and overwrite other changes.
This is why I strongly dislike mods that are trying to do too many things at once.
Timescale is one thing, and food behavior/energy drain is another. And when they get lumped together and there are issues that the user doesn't necessarily want to deal with, well... there's no decoupling them.
"Just use 1.0" - nope, for some reason that breaks Cheat's quicksave functionality, anyone's guess as to why.
I can guess why(Infact I know why). It's because of how .lua files are loaded in the game, it reads the file-name, and then uses a priority based upon their names. I.e, two lua files with the same name(main.lua) will cause conflict(Horrible decision by Warhorse Studios btw), later version(s) renamed the .lua file to the mod name(so is unique). So you have 4 options.
1: Use another mod for quicksave \ timescale. 2: Make your own mod for timescale(it's not difficult at all). 3: Unpack the .pak file, rename the main.lua to timescale.lua, then repack the folder into .pak(it's a zip archive). 4: Same as above, except you use the 1.3 version, and you remove the code you do not wish to use.
As for your main complaint, "mods do too many things at once". A bit of an: "though titties", and because I'm not going to repeat the same code twice just to do something within the same concept. I mod for myself, and share it out(sometimes) to be nice, I don't mod for others. I felt increase in timescale removed a lot of purpose with the game, and it was difficult spending time(that'd normally just be spent naturally), such as sitting at a pub, so it made sense to have more filler-time(though sadly, we were given s#*! mod support for this title, and therefore can't properly implement such systems).
101 comments
No I have no intentions of making an KCD2 version. I do not own KCD2, nor do I have time to play KCD2.
If nothing massive have changed in KCD2, I assume the primary thing people want from this mod can be achieved with a simple XML edit, so I suggest asking the guy that did that instead.
Because of this, it just is better to keep potions the way they are(and in general make sense, you don't spend minutes consuming medicine when sick, you pretty much just get it over with).
--
There is still some delay in opening and closing inventory, sadly I can't do anything about this. The code has been made as performance efficient as is realistically possible when hooking to the UI(we HAVE to scan through the entire inventory, and we HAVE to scan the entire item and food database). However I've ensured to only do the database call for items once, so made it about 3 times as fast as it was before.
going through the food database every time is, however, unavoidable... As we need the nutritional value for the current food item we're searching. Essentially, the more food you have in the inventory, the slower it'll get to open and close your inventory, so suggest avoiding food hoarding. The total amount of food items is what counts, not stacks. so a stack of 15 dried meat = 15 loops, not 1(game actually keep track of individual spoilage, and just stack items with similar values together)!
--
I was unable to find a good way of seeing what perks the player have, so the mod does not take insomniac perk into account.
So as it currently stand, there's not really anything else I can think of doing with the mod, so it's finished unless some bugs pop up(though I have not noticed any, even with a heavy mod loadout).
now when I sleep or wait, it takes almost a minute for the process, and when I press esc I get frozen game and have to manualy ctd, anyone have any suggestions?
This is by no means a bashing of this mod, or any others like it. it's just something I've run into.
Great mod, good sir!
For example; If you start Theresa's DLC portion, when you're done with that, Henry's timescale will be back to normal.
Alternatively; You can open up the zip-file, and edit the script to have the default\normal time-scale again (it sets on load), save&exit, and then uninstall.
Edit: To be a bit clearer. I know of 2 instances where the time-scale changes (might be more, but I don't know of it), after the prologue (Goes from static, to set timescale value), and When starting Theresa's DLC (timescale become static) and ending said DLC (timescale become whatever timescale value is set, which is not done by this mod, this mod overwrites the timescale on load to whatever is set in the script).
This wording is confusing. do I need to start a completely new game to make this mod work?
I already set all food items to never spoil by altering their item durations, but I believe the game is still iterating over the entire inventory list even when there is no updating required so neutering the script doing that *ought* to solve the lag issue
However, you'll not want to do either of these things, because what you think is causing the slowdown, isn't what's causing the slow down. The slow down is caused by the game quering the database each-time you open your inventory, both to get the inventory, but also get all properties of all items in your inventory. Therefore, more items in inventory = more queries to the database. You'd have to completely rewrite how items and inventory system works in the game (by again, reverse engineering the actual byte code).
If you circumvent this through memory manipulation (or reverse engineering), what'll happen is you'll have no inventory items, or no ability to see their properties, as it doesn't get loaded.
x10, which is a fairly 'minor' change, already has issues that can't be fixed (Rest-wheel time is directly linked to games timescale, rather than ticks, which is ridiculous).
eg I would set "DefaultWorldTimeRatio' = 2 in rpg_param.xml vs your "timescale.time_ratio = 2" that part matches up but...
timescale.energy_drain_factor = 0.06
When I run the numbers; ExhaustionSpeed in rpg_param.xml should be set to 0.00008 to maintain the default ratio, and so these two values do not seem to be referring to the same thing...
So the 15x version has the exact same energy drain settings as the 2x version... there's the issue... I think
I do my own calculation when you consume food or alcohol that advances time. This is a manual-energy drain enforced by me, as advancement of time through script, does not do any energy drain (if you move the game from 12 to 14, 0 energy is drained, doesn't matter if you're on x1 or x300 timescale), therefore I enforce my own manual drain after eating. That is the only energy manipulation in this mod, none other. Your issue is with the times standard passive-drain based on real-time (which works independant of timescale, weirdly enough it seems, instead using global tick cycle).
And that'd be what to do. And RPG_Param overwrite, that sets ExhaustionSpeed to 0.00008. You now have a mod that works perfectly with this mod, and would also work for whomever uses cheats manual timescale command (if anyone still does this), another mod that doesn't touch table information.
Seems you're confused to the difference between tables (global variables used by the game), and local script variables.
Timescale.[name] - are all local variables to the script. For all intents and purposes, the game doesn't know those exist. I change "DefaultWorldTimeRatio" into Timescale.TimeRatio at some point iirc (probably at load), but they are not the same.
There is no energy management in this mod, at all. But I do a manual energy-drain based on time-advanced after eating. Time advanced = Created by me, i.e; "You eat x-meal, so I push the clock to y-time". When you push time forward, the game doesn't do ANY energy drain at all, and so I manually enforce my own energy drain in this very specific circumstance (based on how much time has passed). This is the same for x1, x10 or x400, because I enforce the drain (when there would be none at all).
Simply making an rpg_param overwrite for "ExhaustionSpeed", would solve the issue for x2, and be 100% compatible with any mod that changes timescale only (this mod, and cheat mod). It would also be compatible with any mod that changes RPG_Param (except for exhaustionSpeed), and potentionally real timescale as well (if they do not change ExhaustionSpeed themselves, but they probably do).
RPGParam__FixedEnergyDrain.xml
Inside it:
<?xml version="1.0" encoding="us-ascii"?>
<database name="hammerheart">
<table name="rpg_param" version="1">
<header>
<column name="rpg_param_key" type="character varying" />
<column name="rpg_param_value" type="real" />
</header>
<rows>
<row rpg_param_key="ExhaustionSpeed" rpg_param_value="0.00008" />
</rows>
</table>
</database>
Placed into folder structure: Tables\RPG\
Then zip the Tables folder into [whatevername].pak.
Create Data folder, place [whatevername].pak into it.
Create even another folder, named whatever (good form is to name it the same as __[whatever].xml).
Then place Data folder into that, and a mod.manifest file (or copy one from another mod and edit).
And done. You've fixed the exhaust, and is 100% compatible with this mod and cheat mod (for it's manual timescale override command).
You'll also be compatible with Real Timescale, if they do not alter energy drain (though they probably do).
--
Also to be clear, if this mod did change ExhaustionSpeed on the script level (it doesn't, as I said), no changes you make in a table would matter, as the script loads after all global variables. You can test this by attempt to enforce a different timescale in RPGParam
Here is the lot of them if you'd like em: https://www.dropbox.com/s/h8myrpj8hzbelrd/FixedEnergyDrain.rar?dl=1
They also correct the DigestionSpeed btw
But I had to gut that eating-time advancement function - it was causing longer and longer game freezes each time I opened or closed my inventory as the bag contents passed 15k lbs and it iterated over every item each time
I made get_total_nutrition() just return 0 and the lag is (mostly) gone, obviously the game never meant for the player to have this many items on them
What we really need, is an "script-extender" similar to Skyrim has. Which essentially does what I just described.
Table 'food' is patched by 'food__timescalemod', lines added: 0, modified: 9, equal: 1, time: 0.000
This is just me guessing (as I can't really remember), but I'm fairly sure I added that dirty edit intentionally. It's to enforce the default-value in-cases where a mod may, or may not replace\change it. The intent of the mod is therefore to have it as an higher priority and overwrite other changes.
Timescale is one thing, and food behavior/energy drain is another. And when they get lumped together and there are issues that the user doesn't necessarily want to deal with, well... there's no decoupling them.
"Just use 1.0" - nope, for some reason that breaks Cheat's quicksave functionality, anyone's guess as to why.
1: Use another mod for quicksave \ timescale.
2: Make your own mod for timescale(it's not difficult at all).
3: Unpack the .pak file, rename the main.lua to timescale.lua, then repack the folder into .pak(it's a zip archive).
4: Same as above, except you use the 1.3 version, and you remove the code you do not wish to use.
As for your main complaint, "mods do too many things at once". A bit of an: "though titties", and because I'm not going to repeat the same code twice just to do something within the same concept. I mod for myself, and share it out(sometimes) to be nice, I don't mod for others. I felt increase in timescale removed a lot of purpose with the game, and it was difficult spending time(that'd normally just be spent naturally), such as sitting at a pub, so it made sense to have more filler-time(though sadly, we were given s#*! mod support for this title, and therefore can't properly implement such systems).