Havok Behavior Serialization/Deserialization Library
Features
- [x] 32bit to 64bit (reverse) conversion of hkx.
- [x] XML to 32bit/64bit hkx (reverse) conversion.
- [x] Display of hkx/XML reference dependency tree.
- [x] Output logs that make it possible to determine the binary data location of hkx.
- [x] Hexdump the binary data of hkx.
- [x] Display data differences between two hkx/XML.
Download CLI(For behavior creator)
./hkxc --help
Build CLI(For contributor)
git clone https://github.com/SARDONYX-sard/serde-hkx.git;
cd ./serde-hkx && cargo build --release-lto;
When used as a library(For developer)
NOTE: Currently there is a stack overflow problem of unknown cause.
This occurs with debug build (cargo build) but not with release (cargo build --release).
According to this CAO issue report, it was found that passing through a function (fn) can prevent stack overflow without requiring Classes to be wrapped in Box. Thank you. (I made the changes using a macro and have verified that they actually work.)
# in Cargo.toml
tokio = { version = "1.41.0", features = ["full"] } # Async runtime
serde_hkx_features = { git = "https://github.com/SARDONYX-sard/serde-hkx", tag = "2.0.0" }
use serde_hkx_features::{convert, Format, Result};
use std::path::PathBuf;
#[tokio::main]
async fn main() -> Result<()> {
let input = "./defaultmale.hkx"; // file or dir path
let out_fmt = Format::Xml; // Format::Xml, Format::Amd64, Format::Win32
let output: Option = None; // `None` is same as input. Or `Some("./output/defaultmale.xml".into())`
convert(input, output, out_fmt).await
}
# in Cargo.toml
havok_classes = { git = "https://github.com/SARDONYX-sard/serde-hkx", tag = "2.0.0" }
serde_hkx = { git = "https://github.com/SARDONYX-sard/serde-hkx", tag = "2.0.0" }
-
When using C or other languages (FFI)
1.First build serde_hkx_ffi.
cargo build -p serde_hkx_ffi --release # output: /target/release/serde_hkx_ffi.lib2.See C Example
Documentation
Implementation progress
The only way to find out if it is possible or not is to try it out.
- [x] XML Serializer
- [x] XML Deserializer
- [x] Bytes Serializer
- [x] Bytes Deserializer
- [x] Generate Havok Classes
- [x] Testing the API & CI.
- [x] Modify the code based on the test data.
cli/gui
└── serde_hkx_features
├── havok_classes <- (generated by class_generator)
│ ├── havok_serde
│ │ └── havok_types
│ ├── havok_types
│ └── havok_types_derive
│ └── havok_types_derive_proc_macros
└─ serde_hkx
├── havok_serde
└── havok_types
Install
Unzip it into its own folder anywhere (not inside the game's Data folder) and run it. If you use MO2, add it as an executable so it sees your load order.





















































