Kingdom Come: Deliverance
0 of 0

File information

Last updated

Original upload

Created by

MrPMG

Uploaded by

MrPMG

Virus scan

Safe to use

Tags for this mod

About this mod

Changes NPC schedules so they start their days earlier and waste less daylight. NPC activities that start in the morning now start earlier, while afternoon and evening activities are only slightly altered. Monk schedules are not altered for fear of breaking quests. Optional Python script for batch rescheduling is provided.

Permissions and credits
Changelogs
I like to put Henry to bed just after dark and get him up just before sunrise, but all the NPCs sleep in like lazy bums! The Ratay Market doesn't open until late morning, and the farmers waste so much daylight that it's not even funny. This mod is my attempt to make the NPCs start the day sooner. Made and tested for version 1.8.2.

Features
  • Most NPC activities begin earlier. There is a big change in the early morning (~70 min), and only a small change after 13:00 (< 30 minutes).
  • Most NPCs start their daily schedules between 40 and 75 minutes earlier, but fall in-sync with their vanilla schedules by late afternoon/early evening.
  • Changes to times are order preserving. This means that if NPC A does X before NPC B does Y in vanilla, the same is true in this mod. This avoids problems like food being served at taverns before people arrive to eat it. (Monks are an exception, as they have not had their schedules touched.)
  • Because there are too many NPCs to edit each schedule by hand, I wrote some Python code to do it. I have included this code in the optional files. Feel free to tweak the code and use it to make your own rescheduling mod or to update this one if necessary. If you use this code to make a new mod or update, go ahead and post it (but credit would be nice)!

Rescheduling Details (For Nerds)
In the soul.xml file, each NPC is given up to eight activities, each with its own start time. I convert each activity start time to a decimal hour (so, e.g., 3:30pm would be 15.5) and plug that time into a function that spits out a new time. I write the new time to the replacement soul.xml file. The time changing function decreases the decimal time t by (t - a) * exp((a - t) / tau) if t > a, and leaves it alone otherwise. I have used a = 2.0 and tau = 3.5. The parameter a means do not make people do stuff before this time if they don't already. The parameter tau controls decay of time shift; the higher it is, the earlier in the day we stop making big changes to schedules. The maximum time shift is tau/e, which occurs when t=tau+a (e ~= 2.72). For the parameters I used, this shift maps 5:30am to 4:13am.

Hour-By-Hour Reschedule
Below is an ordered pair for each hour of the day. The first number is the vanilla time, and the second number is the modded time (in hours since midnight).
(0, 0.0)
(1, 1.0)
(2, 2.0) note: by design, times do not change between midnight and 2am.
(3, 2.248522706924714) note: max interval shrinkage between 2:00 and 3:00, ~4x for this hour
(4, 2.8705637559844814)
(5, 3.72688146296915) note: max change is at 5:30 and is 1h 17min (4:13)
(6, 4.724373770704118) note: near 5:30 has best interval length preservation; they shrink before, grow after
(7, 5.801744817791121)
(8, 6.919446127112286) note: most lazy bums will get up an hour earlier (most NPCs wake up around 8:00); Rattay market stands now open around 7:00-8:00
(9, 8.052653017343712) note: max interval growth is only ~8min/hour, happens at almost exactly 9:00
(10, 9.186388861566185)
(11, 10.312163417083088) note: most lazy merchants open 40min-1h earlier
(12, 11.425673807323827)
(13, 12.525247598124022) note: lunch and after is basically unchanged (max change < 30 min)
(14, 13.610801109262454)
(15, 14.683153027047366)
(16, 15.743581055557721)
(17, 16.793543199004244)
(18, 17.83450922885411)
(19, 18.86786478347474)
(20, 19.894862407822487)
(21, 20.91660212498721)
(22, 21.93402988488122)
(23, 22.947946204290005)
(24, 23.959020028529636) note: smallest nonzero change ~= 0.04h ~= 2m

Installation, Compatibility, and HowTo
install:
To install the mod, extract it to your KingdomComeDeliverance\Mods\ folder, so the folder structure looks like
KingdomComeDeliverance\Mods\EarlyBird_EarlierSchedules_v0-0-0\Data\EarlyBird.pak.
If installed on a current save, changes might not take effect immediately. Try waiting for 1 hour. If that doesn't work, try 24 hours. If that doesn't work, post a comment.

compatibility:
This mod affects the Data\Libs\Tables\rpg\soul.xml file.

how to tweak:
You can edit the AlarmClock.py to suit your scheduling preferences. I recommend checking the results for each hour before testing in-game (e.g., by typing "table (t,t - (t-2) * exp((2-t)/3.5)) for t = 2 to 24" into Wolfram|Alpha).

To use the code, put the Python code in the same directory as a soul.xml file and run it to generate a new file called soul_timechange.xml. If running on another mod's version of soul.xml, (e.g., soul_modname.xml), rename the mod's soul file to soul.xml before running the Python code. Put soul_timechange.xml in a NEW folder Libs\Tables\rpg\  and rename it to soul__modname.xml. Add the new Libs folder to a zip archive. Rename the zip so its extension is .pak instead of .zip. The new pak file goes in KingdomComeDeliverance\Mods\[MOD NAME HERE]\Data\. Create a mod manifest as described on the modding wiki: http://wiki.tesnexus.com/index.php/Modding_guide_for_KCD