So for the past few months, I've been coding a project I've dubbed the Kajar Engine. What this is is not a remake of Chrono Trigger itself, but its engine. If any of you know what GZDoom, Brutal Doom or OpenRCT2 are, that saves me an explanation. It's a free, from scratch, open source reimplementation of the Chrono Trigger engine. I wanted to wait til I had hit a few working milestones with it before I officially announced it. Last night I just got it to extract and import the Steam port's game data. My goals for this project is to make this the most optimal way to play Chrono Trigger, while making it easy to mod.
Project page:
https://github.com/Schala/KajarEngineLegal considerations:
- As stated, the engine will need the assets from a retail copy of the game to import and run.
- The Steam and mobile retail ports use Blowfish encryption for some files. While the "initialisation tables" are public domain and in the engine's importer, the encryption key is proprietary, and embedded within the Steam/mobile binary executable. The Dolphin project was denied on Steam because it had copied the Wii decryption key from the system, making it legally ambiguous. To avoid the same fate, the engine looks within the EXE at a hardcoded offset, reading 64 bytes from said offset. The downside is that this will likely need to be updated with any future patches to Chrono Trigger's Steam or mobile ports.
A list of details:
- Coded in
Rust to make this as bug free as possible and not make debugging a pain in the butt
- Has an importer that extracts the game data from a legally purchased copy of Chrono Trigger. Currently, only the Steam port as it is the easiest, but more ports are planned to support, thanks to the plethora of modding info the compendium has
- As this is open sourced under the
GPLv3 license, this will make Chrono Trigger 64-bit capable and allow the community to keep it up to date and add new stuff. As per the licensing terms, it allows you to modify the code as you wish, but if you plan to share your work, you must also make the code available for your entire project.
- Enemy AI and other functional code will be converted into
Lua scripts upon import. The modding capabilities themselves will use Lua for AI, story driven code, etc. Lua is the scripting language used by WoW addons and Roblox, to name a few examples, and as a coder, I love its embedding efficiency.
- For major modding, I want to look into developing a plugin API. This will be coded in Rust, but it can interop with C too, for those who find it easier.
- The game will use the
Bevy engine to run, as I find it the easiest, powerful, and most minimal to pick up.
- The Kajar Engine is being coded to surpass the hard-coded limits imposed by Chrono Trigger. With modding, putting in new character slots, for example, will be a breeze.
- As the game data is imported, special hash table files will be created. This will allow integrity checks between the vanilla game data and modded content. If two or more mods modify the same content, an error will occur.
What's done:
- resources.bin extraction
- TIM to PNG conversion (actually for possible Cross support, but I already coded something years ago, so this was easy)
- DRP import
- CPT import
- TBT import