Commit graph

92 commits

Author SHA1 Message Date
ff6fd948c8
sdk: Remove unused function 2025-02-19 11:14:11 +01:00
572778f210
dtmt: Fix file injection
I ended up wrapping the raw data in a `BundleFile` twice.
I also made '--compile' the default, as it should be much less often
that raw data needs to be inserted. Even files that are essentially raw
binary blobs, like `.wwise_event`, still have some custom fields that
need to be accounted for.
2025-02-19 11:14:09 +01:00
6f6df14bfc
Refactor code for file injection 2025-02-19 11:14:05 +01:00
bcbc005df7
Implement more texture formats
The second compression method found in the game's code seems to be Zlib,
but it doesn't seem to be used in the game files. What does get used is
a compression type of `0`, which appears to be uncompressed data.

For DDS formats, all the ones that are currently used by in the game
files can be emitted as is. Though for some of them, other tools might
not be able to display them.
2025-02-19 11:14:04 +01:00
233389ebb1
sdk: Implement decompiling streamed mipmaps
For now, we only extract the largest mipmap.
2025-02-19 11:13:59 +01:00
30b9a93fa3
Reverse DDSImage::load
Decompiling the game binary shows a rather elaborate algorithm to load
DDS images from binary. Though comparing it to Microsoft's documentation
on DDS, most of it seems to be pretty standard handling.

However, we don't actually need all of it. The part about calculating
pitch and reading blocks only accesses a subset of the `ImageFormat`
struct, so we can strip our implementation to just that.
2025-02-19 11:12:11 +01:00
84cb6ff985
sdk: Add decompiled SJSON texture file
In addition to the actual image file, also write a `.texture` engine
file.
2025-02-19 11:12:09 +01:00
0e2f0d4409
sdk: Add dictionary group for texture categories 2025-02-19 11:12:08 +01:00
ea7886b08f
feat(sdk): Implement partial texture decompilation 2025-02-19 11:12:05 +01:00
a2bbab1398
Update dependencies
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
2024-08-21 14:33:39 +02:00
d7fa80f471
Merge pull request 'Add tests for hash inversion' (#185) from feat/murmur-tests into master
All checks were successful
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
Reviewed-on: https://git.sclu1034.dev///bitsquid_dt/dtmt/pulls/185
2024-08-14 12:07:31 +00:00
2a1d8d815f
Add tests for hash inversion
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
Just a quick round trip test, and an additional assert to demonstrate
that byte order does matter.
2024-08-14 09:22:24 +02:00
7fa08c2efd
dtmt: Implement listing bundle database contents 2024-07-28 22:03:43 +02:00
dbf060032b
sdk: Implement bundle database resource hashes
Algorithm reverse engineered by WhiteGoat.
2024-07-28 14:46:10 +02:00
3a6e954f9a
sdk: Refactor murmur modules and add IdString32
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
2024-07-19 11:30:09 +02:00
f1f9a818cc
sdk: Allow any byte stream for hashing dictionary entries
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
2024-07-19 09:48:25 +02:00
c997489e18
Add some doc comments 2024-07-19 09:48:23 +02:00
08219f05ba
sdk: Fix reading strings
Fatshark has a few weird string fields, where they provide a length
field, but then sometimes write a shorter, NUL-terminated string into
that same field and adding padding up to the "advertised" length.
To properly read those strings, we can't rely on just the length field
anymore, but need to check for a NUL, too.
2024-07-19 09:48:21 +02:00
95fc6c160b
dtmt: Implement name overrides
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
For most of the game files, we don't know the actual name, only the hash
of that name. To still allow building bundles that contain files with
that name (e.g. to override a game file with a custom one), there needs
to be a way to tell DTMT to name a file such that its hash is the same
as the one in the game.
The initial idea was to just expect the file name on disk to be the
hash, but that wouldn't allow for arbitrary folder structures anymore.

So instead, there is now a new, optional setting in `dtmt.cfg`, where
the modder can map a file path to an override name.
2024-07-18 09:50:48 +02:00
b7e26eee57
refactor(sdk): Split BundleFileType into its own file 2024-07-17 11:14:22 +02:00
a47167b735
Fix printing hashes with leading zeroes
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
Closes #179
2024-07-12 15:58:39 +02:00
96a7eeb1e0
Implement faster hex string parsing 2024-07-09 16:16:48 +02:00
189c3199a0
Update bitflags 2024-07-09 16:16:42 +02:00
ae30499a49
Remove unused dependency 2024-05-15 19:19:54 +02:00
647cb1b8bd
Update fastrand 2024-05-15 19:16:34 +02:00
e633a571b5 Apply clippy lints 2023-11-24 11:52:47 +01:00
4ec44720b0
sdk: Don't fail decompilation on LJD error
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
2023-11-17 15:10:20 +01:00
46a61a7473
Use exit status to determine LJD failure
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/msvc Build for the target platform: msvc
build/linux Build for the target platform: linux
2023-11-17 09:58:53 +01:00
7080dcb8de
sdk: Use common ljd flags
Some checks failed
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
2023-10-30 14:07:00 +01:00
57224622d9
sdk: Don't wait for cleanup
Some checks failed
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
2023-10-30 09:28:15 +01:00
93db78d58f
sdk: Implement decompiling Lua
Closes #48.
2023-10-30 09:28:07 +01:00
690098d7c7
feat(dtmm): Improve debug logging
This re-enables stdout/stderr logging for release binaries for DTMM.
As a GUI application, it usually won't be started from a CLI, and there
should be no negative impact from that.
But since stdout logging is synchronous and much faster than the async
action that writes to the log file, it might get to log more when the
application panics.
2023-04-09 14:33:55 +02:00
1887cdf2ef
fix(sdk): Fix creating invalid bytecode
An update to LuaJIT made an option enabled by default that changed the
bytecode output.

Fixes #99.
2023-04-06 12:17:16 +02:00
e2a285a739
feat: Add Docker images for CI compilation 2023-03-23 13:42:03 +01:00
ba753cf6bb
feat: Implement static linking, second attempt
This is mostly just the code from the previous attempt. All that was
missing were the `.lib` files to link to on Windows.
2023-03-16 18:09:40 +01:00
308613d5fc
feat(dtmt): Improve error messages when compiling Lua
Fixes #58.
2023-03-08 21:27:29 +01:00
a8db19cf9f
refactor: Capitalize error messages 2023-03-08 20:40:30 +01:00
4a1e88987c
fix: Force unix path separators for engine values
The engine, and therefore the SDK, too, use unix path separators.
However, on Windows, `PathBuf` automatically produces backslashes.

Fix #46.
2023-03-03 17:36:53 +01:00
ed4a22c97a
Revert "feat(sdk): Switch to statically linked Oodle"
This reverts commit d08321a645.

Closes #42.
2023-03-02 13:51:44 +01:00
638b081cb7
version: dtmt v0.3.0, dtmm v0.1.0 2023-03-01 22:29:27 +01:00
d08321a645
feat(sdk): Switch to statically linked Oodle
This removes another runtime dependency.
2023-03-01 22:14:31 +01:00
1d26a5c113
fix(sdk): Fix generating Lua file names during compilation 2023-02-25 16:28:21 +01:00
cd9554fbe3
fix(dtmm): Fix deploying mod bundles
Two different functions were each reading the bundle database
from the backup, so their changes would overwrite each other.
Additionally, mod bundles were missing from the database.

Ref: #28.
2023-02-25 16:09:09 +01:00
0b17e8edf5
fix(sdk): Fix generating bundle name from file path 2023-02-25 16:07:16 +01:00
93c8f4fe9c
fix(sdk): Add missing value in Package binary format
After digging through the VT2 SDK `.exe`, I found that `.package` files
(`stingray::ResourcePackageResource`) actually have more data than I
originally knew about. Most notably, there is a 1 byte `flags` value
that is written at the end of every package file.

Depending on what value those flags have, more data could come after it,
but in most cases, it's just that one byte, which I must have missed in
the binary.

Ref: #28.
Ref: #36.
2023-02-25 13:57:37 +01:00
b9cd9ed5de
chore(sdk): Add debugging for unknown value in bundle database
Ref #28.
2023-02-25 12:58:21 +01:00
09f357d72d
fix(sdk): Prevent duplicates in bundle database bundles
Ref #28.
2023-02-25 11:42:16 +01:00
45e0d79fa7
refactor: Add crate for shared functionality
Adds an additional crate for shared functionality between dtmt and dtmm
that doesn't fit in the sdk.
2023-02-23 21:38:35 +01:00
701516aa7c
feat: Make mod resource scripts optional
With splitting DMF and DML, there is now more than one case where this
is needed, so it may well be made proper now.
The template still defines them, and, as with VT2 most creators will
probably stick with it, but they do have the option to make a non-DMF
mod now.
2023-02-22 16:40:02 +01:00
0cf2908904
fix(sdk): Fix resolving package wildcards
Directories were ignored as invalid extension type. Now they are
recursed into.
2023-02-22 16:37:07 +01:00