The Ultimate Guide To RE_Kenshi / ReKenshi

Kenshi642 views13 favorites15 min readby BFrizFoShizUpdated Jul 19View on Steam ↗

What is RE_Kenshi?

RE_Kenshi, or commonly spelled ReKenshi is a Plugin Loader that offers a host of features but more simply acts as a translation layer between C++ Mods and Kenshi allowing for the plugins to inject code into the game. This allows non-traditional modding for additions like new survival mechanics, direct character control, full graphical pipeline overhauls and other such things.

Support BFrizz (The Mod Author)
https://ko-fi.com/bfrizzlefoshizzle

RE_Kenshi Features (For Players)

For A Full Complete List, including modder specific features see the link here[github.com]

Save On Crash
RE_Kenshi's crash handler can attempt to force the game to save when a crash is detected.
It is possible for this to fail in some cases, but it should usually generate working save files, allowing you to keep your progress when a crash occurs.
RNG bug fix
Fixes a bug in Kenshi's random number generation code.
Enabling this causes the following side-effects:

Randomized recruits will actually be random
Randomized item spawns will actually be random

Custom game speed controls
Set the game to any speed (up to 1000x, also supports slow-motion/speeds under 1x)
Increase max camera height
Doubles the maximum camera height.
Note: zooming the camera out too far can cause visual bugs (most notably with shadows)
Shader cache
Cache precompiled shaders.
This reduces load time to get into the game, and may occasionally reduce stuttering when moving around the map.
Change mod-controlled values in-game
Supported values:
  • Attack slots (1-5)
  • Max. squad size (1-1000)
  • Max. faction size (1-1000)
  • Max. squads (1-1000)
If you drag the slider to 0, these will default back to the value set by mods.
You also need to check the tick box next to the slider in order to enable the setting override. Leaving this unchecked will default back to the value set by mods.

There is unofficial support for setting these to out-of-range values by manually editing RE_Kenshi's config file RE_Kenshi.ini
Some visual bugs occur in the UI if the player has over 256 characters in a squad, but gameplay seems to work correctly. (This can be fixed for another mod later in this guide)

Heightmap optimization
Kenshi reads the heightmap in an inefficient way that causes measurable performance issues, particularly on HDDs.
There are two options for optimizing the heightmap loader:
  • Compressed heightmap
Generally recommended for all users
Enabling this setting can often halve load time on HDDs, but usually causes little to no difference on SSDs.
The "compress heightmap" option must be enabled when installing RE_Kenshi in order to use this setting. The install option is enabled by default when installing to an HDD, and disabled by default when installing to an SSD.
The current implementation caches decoded heightmap values in RAM, which can use up to 500MB of extra RAM.
  • Fast uncompressed heightmap (recommended for Most modern SSDs)
This uses a different method of reading the vanilla .TIF heightmap file designed to outperform the vanilla implementation on SSDs. For HDDs, it will still outperform vanilla but won't be as fast as the compressed heightmap.
Because the fast uncompressed heightmap uses the vanilla .TIF file, it should work regardless of what setting you installed RE_Kenshi with.

The first time RE_Kenshi is run, it will attempt to automatically select the "highest performance" option based on the type of drive you're loading the game from.

Fix mod list scroll
Stops Kenshi from scrolling to the top of the mod list every time you enable/disable/rearrange mods.
Skip splash screens
Skips the intro splash screens on the load to the main menu. Enabling this reduces the load time to the main menu by 8 seconds on my machine.
Skip unused mipmap reads
Stops Kenshi from reading parts of texture files that aren't used. This improves load times when texture quality is below maximum. The setting for this also includes bugfixes for some BC7 texures.
PhysX collider cache
Improves load times by stopping Kenshi from loading the same collider multiple times. This setting reduces both file loads and CPU usage as loading colliders is quite CPU-intensive.

How To Install

RE_Kenshi can be found at the link Here: https://www.nexusmods.com/kenshi/mods/847?tab=description

Install instruction:
  • Go to the “Files” tab on the Nexus page linked above, download “RE_Kenshi installer (latest)
  • Extract The folder anywhere
  • Run the installer and follow it's instructions.
  • Dont forget to select the correct file path and language!
  • Once installed, running the game normally either through the desktop icon, if allowed, or through the Steam shortcut should load RE_Kenshi. Also if you launch the game via the RE_Kenshi shortcut in your start menu/desktop the game will open about a second faster (it skips some initialization).
  • If the mod has installed correctly, the version text in Kenshi's main menu should read: RE_Kenshi vx.x.x - Kenshi 1.0.x - x64 (Newland)

Settings can be changed through the mod's in-game UI.
Game speeds don't have to be integers, e.g. you can have a speed of 0.5 or 0.1 for slow motion, or 3.5, etc. Negative values crash the game.
To reopen the mod menu:
  • (at main menu) OPTIONS -> MODS -> RE_KENSHI SETTINGS
  • (in-game) esc -> OPTIONS -> MODS -> RE_KENSHI SETTINGS
For Reshade Users
If you want to use ReShade (third-party software that adds filters such as color adjustments to the game) with RE_Kenshi version 0.3.1 or later, you should place it in the RE_Kenshi folder.
This is located in the Kenshi installation folder: \Steam\steamapps\common\Kenshi\RE_Kenshi
It is however advised to use the DUST plugin instead which has direct access to the rekenshi systems and settings for better control: https://steamcommunity.com/sharedfiles/filedetails/?id=3703458265

Common Issues

"DLL not found" during installation
The most common cause of this is not having the VC++ redistributable installed (download here[aka.ms] or find the latest version on this page[learn.microsoft.com])
The game starts in 1.0.65
RE_Kenshi is technically incompatible with 1.0.68, during installation the game is partially downgraded to 1.0.65.
By default, the game starts in 1.0.65. To run 1.0.68, add the flag --norekenshi to your Kenshi launch arguments on steam. This will also disable RE_Kenshi as it is not compatible with that version of the game.
Unable to talk to recruits
In the RE_Kenshi settings menu, double-check the max. squad size/faction size/factions sliders are set to an appropriate value. If you drag the slider all the way down to 0, it should default back to the game's default, or whichever value your mods have set it to.
RE_Kenshi: Could not initialize UI.
Set the Game to Borderless full screen

Reporting Bugs & Suggesting Ideas

Reporting Bugs
Reporting bugs can be done one of four ways with three methods being more preferable:
  • Discord
    The preferred method of reporting bugs is to directly message BFrizz on Discord (his Discord ID is in RE_Kenshi's readme). Discord is preferred because it's easy to send people debug builds when necessary.
    You can also report bugs on the Genesis Modding discord here: https://discord.gg/g7F6aHw

  • Github
    Ironically given the support network for modders and the mod author himself github reporting is actually not the preferred method as other options exist. https://github.com/BFrizzleFoShizzle/RE_Kenshi/issues

  • Nexus Mods
    The third preferred method to report bugs can be found on the nexusmods site: https://www.nexusmods.com/kenshi/mods/847?tab=bugs

  • RE_Kenshi in-game bug report
    RE_Kenshi has a built in crash detection mechanism & bug report feature. All reports are sent directly to the mod author (BFrizz) anonymously. The in-game bug reporter is the least-preferred method as it does not allow for two-way communication.
Feature Suggestions, Plugin Requests, & Plugin Suggestions

Disadvantages of RE_Kenshi

As of RE_Kenshi version 0.3.3, there are no particular disadvantages.

Starting with RE_Kenshi version 0.3.0, Kenshi launches using version 1.0.65—the version prior to the latest Kenshi release, 1.0.68—rather than the latest version.
As a result, free camera mode is unavailable without a plugin.
The free camera feature was restored in RE_Kenshi version 0.3.2.
Furthermore, it appears that the only difference between Kenshi versions 1.0.65 and 1.0.68 is the presence or absence of the free camera feature.

A plugin for RE_Kenshi has also been posted that nicely expands the capabilities of the free camera.
Even if you are using RE_Kenshi versions 0.3.0 or 0.3.1, which do not include the free camera, you can use the free camera with this plugin.

https://steamcommunity.com/sharedfiles/filedetails/?id=3697462928

We’ll explain what RE_Kenshi plugins are and how to install them in the following chapters.

ReKenshi Plugins

RE_Kenshi version 0.3.0 and later support plugins for RE_Kenshi. This is a suggestive list and not an exhaustive one. When searching for RE_Kenshi plugins in the Workshop, using “rekenshi” (without the underscore “_”) as a keyword will usually bring up the results you’re looking for.

What exactly is an RE_Kenshi plugin? Can you eat it?
Simply put, it’s something that allows RE_Kenshi to load it and add new features to Kenshi.

Regular mods use the Forgotten Construction Set (FCS) to modify or add elements within a predetermined scope.
FCS is the tool you launch by selecting “Launch Modding Tool” from the options when starting Kenshi.

Unlike standard FCS-based mods, RE_Kenshi plugins involve RE_Kenshi loading code written through rigorous programming to perform various functions.

While FCS-based mods alone have limited the scope of what can be modified or added, RE_Kenshi plugins allow for a much wider range of possibilities.

In the next chapter, I’ll introduce some of the RE_Kenshi plugins that have been posted.
I think you’ll get a sense that “these are fundamentally different from other mods” and that “they’re changing the very foundation of Kenshi.”

For Japanese Players/日本のプレイヤーの皆様へ
モマヨさんの「レケンシ」ガイドはこちらをご覧ください: https://steamcommunity.com/sharedfiles/filedetails/?id=3657041735
Japanese IME Input Support Plugin
https://www.nexusmods.com/kenshi/mods/1930
Kenshi Extension Plugin
https://steamcommunity.com/sharedfiles/filedetails/?id=3638161797
ReDev
https://steamcommunity.com/sharedfiles/filedetails/?id=3740289989
Extra Inventory Sections
https://www.nexusmods.com/kenshi/mods/1838
Go Prone
https://www.nexusmods.com/kenshi/mods/1830
Freecam Rebuilt
https://steamcommunity.com/sharedfiles/filedetails/?id=3697462928
Dust - A Graphical Rendering Overhaul
https://steamcommunity.com/sharedfiles/filedetails/?id=3703458265
Direct Control - WASD Mod
https://steamcommunity.com/sharedfiles/filedetails/?id=3737240806
Hide Your Helmet
https://steamcommunity.com/sharedfiles/filedetails/?id=3731943408
Atachment Optimization
https://steamcommunity.com/sharedfiles/filedetails/?id=3731036037
Wall-b-gone
https://steamcommunity.com/sharedfiles/filedetails/?id=3665666467
Thirst Mod
https://steamcommunity.com/sharedfiles/filedetails/?id=3766154146
Better banking
https://steamcommunity.com/sharedfiles/filedetails/?id=3651996394
Needsleep
https://steamcommunity.com/sharedfiles/filedetails/?id=3763358143
Character Highlight
https://steamcommunity.com/sharedfiles/filedetails/?id=3688641949
LimbRegen
https://steamcommunity.com/sharedfiles/filedetails/?id=3689978178
Rotate Items
https://steamcommunity.com/sharedfiles/filedetails/?id=3691158692

How to Install Plugins for RE_Kenshi

Simply enable the mod with that plugin’s name on the mod list screen when you launch the game.

For plugins available on the Steam Workshop, such as the Kenshi Extension Plugin, you just need to subscribe to them.
It’s best not to perform what’s known as “localization” (copying and pasting into the Kenshi/mods folder and renaming the folder) unless you’re doing so for backup purposes.
This is because there’s generally no need to view or edit the contents using FCS, and if the same mod exists in both the Workshop and the Kenshi/mods folder, the one in Kenshi/mods takes precedence and is loaded into the game.
If you leave it subscribed, the plugin will update automatically when new versions are released, so it’s best to keep it that way.

For plugins found on Nexus and similar sites, place them in the Kenshi/mods folder just like regular mods.

Plugin Best Practices
For RE_Kenshi plugins, in most cases, it doesn’t matter where you place them in the load order.
This is because they generally won’t conflict with other mods.
It’s a good idea to group them together at the very top or bottom of the mod load order.
If a plugin that interacts with the UI panel seems to conflict with other standard UI-modifying mods and causes something to look or behave strangely, check to see if the plugin is up to date, or try rearranging the load order as needed.

RE_Kenshi For Modders

All Relevant Links and Features can be found at the following link: https://github.com/BFrizzleFoShizzle/RE_Kenshi/wiki/RE_Kenshi-Features#modder-features

A JSON schema for RE_Kenshi.json mod config files can be found here: https://github.com/BFrizzleFoShizzle/RE_Kenshi/blob/0.2.12_fork/mod-config.schema.json

File rebinding/mod hard-coded files
The file rebinding system can be used to redirect file paths from one location to another. This can be used, for example, to redirect a hard-coded file path in Kenshi's install directory to a path in a mod's directory.

Tutorials and documentation for this feature can be found on the following pages:


Sound modding
The soundbank loading system allows mods to load new sound banks, allowing you to add new sounds and replace existing sounds.
The documentation for this is still a work-in-progress as the community is still figuring out the best way to use this.
More information can be found here[github.com]
Undocumented settings/features
  • Performance notes
The following settings negatively impact performance and should be left off unless you are actively using them:
  • Log file I/O
Log audio IDs/events/switches/states
Viewing the Debug Log tab (I recommend staying on "Settings" or closing the window)
On some high-end SSDs, the compressed heightmap can hurt performance vs vanilla, but this is largely fixed in 0.2.9 onwards

  • Preload heightmap
[/b][/u]
[/list]
If heightmap compression is enabled, this forces the entire heightmap to be loaded + decompressed into RAM when the game starts. This isn't well-tested and it is recommended to keep this disabled.
If you want to enable this, set "PreloadHeightmap" to true in RE_Kenshi.ini
  • Game speeds above 1000x
Speeds above 1000x can be added by manually typing them into the UI, but this isn't officially supported
  • Disable save on crash
To disable the save on crash system, set "EnableEmergencySaves" to false in RE_Kenshi.ini
  • Disable hash check
If you are using a modified version of Kenshi's executable, you can disable RE_Kenshi's hash check to stop it from disabling itself. This makes RE_Kenshi compatible with hard-coded mods such as the "LVL 200 Max" mod on Nexus.
Note: disabling the hash check WILL NOT allow RE_Kenshi to work on unsupported versions, it will only fix modified copies of SUPPORTED versions.
To disable the hash check, set "IgnoreHash" to true in RE_Kenshi.ini
EXTRA WARNING: Enabling this may cause crashes after updating Kenshi from a supported version to an unsupported version. If this occurs, set "IgnoreHash" back to false.
  • Disable update checker
To disable the version/update checker, set "CheckUpdates" to false in RE_Kenshi.ini
  • Disable mod list scroll fix
To revert Kenshi's mod list behaviour back to vanilla, set "FixModListScroll" to false in RE_Kenshi.ini
  • Disable skip reading unused mipmaps
To disable skipping the reading of unused mipmaps, set "SkipUnusedMipReads" to false in RE_Kenshi.ini
  • Disable PhysX collider cache
To disable caching of PhysX colliders, set "CachePhysXColliders" to false in RE_Kenshi.ini

KenshiLib (For Modders)

KenshiLib Page: https://github.com/BFrizzleFoShizzle/KenshiLib
KenshiLib Examples: https://github.com/BFrizzleFoShizzle/KenshiLib_Examples/

KenshiLib Description
KenshiLib is a C++ library that reconstructs Kenshi's structures, exporting a version-independent API for accessing variables and calling and hooking methods.

The best way to get started with writing RE_Kenshi/KenshiLib plugins is to download and compile the KenshiLib Examples repo[github.com] which also contains links with information on how to set up KenshiLib's dependencies.

KenshiLib is released under the GPLv3, please be aware that this generally means KenshiLib plugins must also be released under the GPLv3. KenshiLib also contains 3rd-party components with additional licenses.

Plugin Best Practices For Modders
  • DO use KenshiLib's built-in function hooking system, it is designed to handle multiple plugins hooking the same function.
  • DON'T use 3rd-party function hooking/detouring libraries as these can cause issues when multiple plugins hook the same function using different libraries.
  • DON'T access the UI from non-UI threads. Most MyGUI functions are NOT thread-safe, this will cause race conditions that will intermittently crash the game. If you are exporting functions for other plugins to use, it is wise to make your plugin a Preload Plugin (doccumentation coming) so that it is loaded before other plugins.

RE_Kenshi Plugins (For Modders)

FCS Extended
https://www.nexusmods.com/kenshi/mods/1825
Automatically loads custom fcs.def configurations
Adds new features to FCS and RE_Kenshi via the FCS Extended plugin

Bfrizz Extra Extensions
https://steamcommunity.com/sharedfiles/filedetails/?id=3625832102

  • DC_IS_SLEEPING - checks if the target character is sleeping.
  • DC_HAS_SHORT_TERM_TAG - checks if the speaker has a short term tag (CharacterPerceptionTags_ShortTerm) for the target character.
  • DC_IS_ALLY_BECAUSE_OF_DISGUISE - checks if the target is considered an ally because of a disguise, i.e. the target is disguised, is an ally, and would not be an ally if not disguised.
  • DC_STAT_LEVEL_UNMODIFIED - checks the unmodified stat level of the target.
  • DC_STAT_LEVEL_MODIFIED - checks the stat level of the target taking into account stat modifiers.
  • DC_WEAPON_LEVEL - checks the weapon level of the character's currently equipped weapon, taken from the weapon manufacturer model info defined in the FCS.
  • DC_ARMOUR_LEVEL - checks whether the character has at least one piece of armour with a level satisfying the comparison operator. E.g. armour level > 20 means at least one equipped armour item with a level above 20, armour level < 20 means at least one equipped armour item with a level below 20.
  • "take item" - takes a specified number of items from the target character (if they have them) and gives it to the speaker. Items will be placed in the spearker's inventory if there's room, or dropped on the ground if their inventory has insufficient space.
  • "destroy item" - destroys a specified number of items from the target character (if they have them).
  • "variable equals" - checks if a referenced variable is equal to some value
  • "variable greater than" - checks if a referenced variable is greater than some value
  • "variable less than" - checks if a referenced variable is less than some value
  • "set variable" - sets a referenced variable to a specified value
  • "add to variable" - adds a specified value to a referenced variable. Subtraction can be done by adding a negative value

RE_kenshi License

RE_Kenshi for modders is a lot more robust than many people realize and that's what makes it so great BUT it is worth noting that RE_kenshi is licensed under the GPLv3 License.
which can be found In the following places along with this guide:
GNU License: https://www.gnu.org/licenses/gpl-3.0.html#license-text
Github License: https://github.com/BFrizzleFoShizzle/RE_Kenshi/blob/master/LICENSE

This also means that all subsequent Plugins and mods based off RE_Kenshi are also GPLv3. This is a mandatory Legal Requirement to ensure open collaboration between all community members


GPLv3 License
[github.com]

Videos Covering Rekenshi & Plugins

Guide & Plugin Highlight Video

Dust, The Graphical Overhaul

Direct Control (WASD Mod) + Perfect Parry Plugin

ReDev - A Developer Testing & Control Mod

MiniMap Mod

KEP - A Modders Resource & Vanilla Bug fix plugin mod

Need Sleep Mod

Kenshi Co-op Mod

This guide was created by its original author on the Steam Community. Are you the author and want it removed? Request removal.