A tool to generate Navp files for Hitman: World of Assassination Scenes in the Glacier 2 Engine
You can run NavKit by opening NavKit.exe
. To use the View Navp in game and Scene Extraction features, you will need ZHMModSdk installed, and you will need to copy the included Editor.dll
to your Hitman 3\Retail\mods
folder. For the Scene Extraction feature, you will also need to have Blender installed.
Functions available are loading and saving Navp and Navp.json, loading Airg and Airg.json, loading and saving Obj, scene extraction, building Navp, and viewing navp in game.
- Open Hitman and launch a mission.
- Open NavKit and load a Navp file for that mission.
- Click the
Send Navp
button in NavKit.
- Download the lastest release of NavKit (https://github.com/glacier-modding/NavKit/releases/latest) and extract it to any folder (e.g. C:\NavKit)
- Install ZHMModSDK (https://github.com/OrfeasZ/ZHMModSDK/releases/latest)
- Backup the "HITMAN 3\Retail\mods\Editor.dll" file
- Copy the included Editor.dll from the NavKit folder to the "HITMAN 3\Retail\mods" folder
- Install Blender (tested with 3.4 https://download.blender.org/release/Blender3.4/)
- Start Hitman and enter a mission
- Open NavKit
- On the "Extract menu" of NavKit, set your file paths:
- Hitman 3 directory (e.g. C:\Program Files (x86)\Steam\steamapps\common\HITMAN 3)
- Output directory (e.g. C:\NavKit\Output)
- Blender Executable (e.g. C:\Program Files\Blender Foundation\Blender 3.4\blender.exe)
- On the "Extract menu" of NavKit, click "Extract from game". It may take up to around 10 minutes depending on the complexity of the mission being extracted, and whether the alocs have already been extracted from the rpkg files.
- When the OBJ finishes generating, you can save it to an OBJ file so you can load it later if you'd like by clicking the "Save Obj" button on the "Obj menu"
- On the "Navp menu" click the "Build Navp from Obj" button
- On the "Navp menu" click the "Save Navp" button and choose where to save the navp file
- On the "Airg menu" click the "Build Airg from Navp" button
- On the "Airg menu" click the "Save Airg" button and choose where to save the airg file
- Include the .navp and .airg files in the chunk folder for your brick
- Choose an IOI string for it (for instance [assembly:/_pro/scenes/missions/trapped/scene_wolverine_modified.navp].pc_navp)
- In GlacierKit, search the original scene file for "navp" and it should take you to the Pathfinder Configuration (usually at Scene\Scenario_[scene name]\Global\Pathfinder\PathfinderConfiguration
- Copy the entity id (in this example screenshot it is 0f374e8c1e033807) and put it somewhere easily accessible
- Open your new brick file in GlacierKit in the Editor
- In the Property overrides for your new brick, add this to add the navp:
{
"entities": [
{
"ref": "[pathfinder entity id]",
"externalScene": "[original scene file]"
}
],
"properties": {
"m_NavpowerResourceID": {
"type": "ZRuntimeResourceID",
"value": {
"resource": "[new navp ioi string]",
"flag": "5F"
}
}
}
}
- Where [pathfinder entity id] is the id you copied earlier for the pathfinder, [original scene file] is the ioi string of the original scene (e.g. [assembly:/_pro/scenes/missions/snug/mission_vanilla.brick].pc_entitytype), and [new navp ioi string] is your new ioi string for the navp.
- In GlacierKit, search the original scene file for "airg" and it should take you to the Pathfinder Configuration (usually at Scene\Scenario_[scene name]\Global\Pathfinder\ReasoningGridConfig
- Copy the entity id (in the other example screenshot it is 6c6e6c3217bf058e) and put it somewhere easily accessible
- In the Property overrides for your new brick, add this to add the airg:
{
"entities": [
{
"ref": "[reasoning grid entity id]",
"externalScene": "[original scene file]"
}
],
"properties": {
"m_pGrid": {
"type": "ZRuntimeResourceID",
"value": {
"resource": "[new airg ioi string]",
"flag": "5F"
}
}
}
}
- Where [reasoning grid entity id] is the id you copied earlier for the pathfinder, [original scene file] is the ioi string of the original scene (e.g. [assembly:/_pro/scenes/missions/snug/mission_vanilla.brick].pc_entitytype), and [new airg ioi string] is your new ioi string for the navp.
- Save your brick file
- In GlacierKit, under the Text Tools, paste your navp ioi string into the Hash Calculator
- Copy the Hex value, and rename your navp to [hex value].navp Where [hex value] is the Hex value you calculated
- Paste your airg ioi string into the Hash Calculator
- Copy the Hex value, and rename your airg to [hex value].airg Where [hex value] is the Hex value you calculated
- Deploy the mod
NavKit performs the following series of steps to be able to generate Navp files.
- Run
glacier2obj.exe
to connect to the Editor server of the running Hitman game, and issue commands to: rebuild the entity tree, find the scene's brick tblu hashes, and send them back to NavKit. - Get the temp hashes for those bricks, and scan those bricks' dependencies to get the hashes for all Prim dependencies that are children of ALOCs and save them to
toFind.json
in the specified output folder. - Connect to the Editor server of the running Hitman game again, and issue a command with all of the ZGeomEntity / Prim hashes to get the transforms of all the ZGeomEntities and send them back to NavKit and save them to
prims.json
in the specified output folder. - Extract all of the needed Prim files from the rpkg files to the
prim
folder of the specified output folder. - Open the blender cli and run
glacier2obj.py
to generate an obj by importing all of the Prim files, copy them the number if times they are used in the scene, and transform each one according to what was sent by the game, and save it tooutput.obj
in the specified output folder. - Load
output.obj
from the specified output folder in NavKit. You can also save the obj file to another filename by pressing the Save obj button. - At this point, the build Navp section of the menu will be available and you can customize the parameters, then press build to call Recast to generate the Navmesh. Then you can save the Navmesh as a Navp or Navp.json file by pressing the Save Navp button.
NavKit is still a work in progress, and there may be glitches or issues with navp generation in the current version. If you encounter any problems while running NavKit please create an issue on this GitHub repo.
- Airg Generation
- Faster Scene generation
- Linux and MacOs support
You can also build NavKit yourself. To build NavKit:
- Clone this repository with the '--recurse-submodules' option
- Open in Visual Studio
- Cmake should load
- In the x64 command prompt make a build folder, cd into it, and run:
cmake -B . -S ..
- Then change back to the main directory and run
cmake --preset x64-debug
NoFate
Atampy25
Notex
Anthony Fuller
Recast team
rdil
2kpr
kercyx
Kevin Rudd
And everyone at the Glacier 2 discord!