r/decomps • u/reprehenderit • 11d ago
Preview I decompiled Bloodlines' game code: all 23,934 functions of vampire.dll now rebuild byte-for-byte from C++
Hi all,
I've been working on a matching decompilation of vampire.dll, the DLL that holds most of Bloodlines' own game logic: the player, NPC AI, combat, weapons, disciplines, frenzy, inventory and more.
Repo: https://github.com/otonomy/vampire-decomp
WHAT "MATCHING" MEANS
Each function is C++ that, compiled with the same compiler Troika used (Visual C++ 6.0, /O2), produces exactly the same machine code as the original DLL. So it isn't a guess at what the code does: every function is checked against the real game, byte for byte.
WHERE IT STANDS (PATCH 1.2)
• All 23,934 game functions match: 23,799 as plain C++ (97% of the code), 135 still with inline assembly.
• The DLL's data, globals and static initializers are in the sources too.
• A hybrid build (the original DLL with the recompiled functions linked in) loads and plays in game.
• A fully standalone vampire.dll already links with zero errors. A few vtable slots, the exports and an in-game test are left before it can replace the original.
• client.dll is in progress; the engine DLLs and Vampire.exe are not started yet.
WHAT IT COULD BE GOOD FOR
• Reading how the game really works: the exact rules and numbers instead of guesswork.
• Fixing bugs in source code instead of patching bytes in the DLL.
• Later on: bigger mods that change game logic, and maybe ports.
ABOUT AI, UP FRONT
Most of the C++ was written by AI coding agents working through my own matching tool, which compiles each function with the original compiler and only accepts it when the bytes are identical. The hard cases were done by hand. Because everything is checked against the original, the result is verifiable, but many names and functions still need cleanup to be nice to read.
WHAT'S NOT INCLUDED
No game files, assets or binaries. To build anything you need your own copy of the game (patch 1.2) and Visual C++ 6.0. My own work in the repo is CC0 (public domain); the game itself belongs to its owners. This is an unofficial fan project, not affiliated with Paradox or Activision.
14
u/BardielEight 11d ago
I’m curious how people are going about these decomps. Are they just hooking up Claude and say IDA Pro or Ghidra and having it go do its thing?
11
u/DaedalusRaistlin 11d ago
Man I wish I had this stuff back when I was doing the Bloodlines Revival / Resurgence mod. Trying to reimplement everything by hand killed the project at least twice.
8
u/Wooden-Tomatillo9281 11d ago
daammmmnnn 🤯🤯
2
u/JohnMarston17 11d ago
Playing it on the Switch would be amazing.
2
u/kawaiibakanekodomo 10d ago
AI is fine for doing the work but can’t you at least write your own post?
4
u/BlueThunderFlik 11d ago
I just opened one of the source files at random. Is this considered finished?
1
u/Demonchaser27 10d ago
If I may ask. When you decompile for accuracy (byte for byte), what does that entail exactly? What's the process? Are you reading the assembly (coverted to C or otherwise) and then trial and erroring various solutions to recreating the original function until one compiles to exactly the byte code in the original source?
1
u/StellarBull 11d ago
I had gamebreaking bugs even with the latest community patch on the Steam Deck, I hope this is the beginning of finally squashing them all for good.
Also native gamepad support would be dope :D
0
u/One-Speed4271 11d ago
A full first / third person you can switch rather than what we have in game + true controller system + the asset being remade for the RTX Remix mod would make this the perfect remastered PC port
0
u/thehiddensign 10d ago
Amazing work! This will fix all the long standing bugs.