Rise Of The Tomb Raider

File information

Last updated

Original upload

Created by

alphaZomega

Uploaded by

alphaZomega

Virus scan

Safe to use

Tags for this mod

About this mod

A file injector / mod manager for modding Rise of the Tomb Raider, including tools for model-modding

Requirements
Permissions and credits
Changelogs
Donations

Rise of the Tomb Raider Modding Tools v1.2



Banner by SilverEzredes

This is my collection of tools for installing and making mods for Rise of the Tomb Raider


Mod Injector
The ROTTR Mod Injector is a basic mod-manager and file injector for Rise of the Tomb Raider comprised of a .bat file and an injector application called ROTTRTigetadd.exe, which is fed commands by the bat file. It inserts modified files back into the game, forcing it to load them.
To install the injector, place the contents of the Mod Injector ZIP file into your Rise of the Tomb Raider game directory. It injects files into the "bigfile.update3.000.000.tiger", but mods can be made for older versions of the game using "bigfile.update2.000.000.tiger" as well.



You can install mods using InstallMod.bat by dragging and dropping a premade mod-folder onto it. The injector will keep a record of each file it replaces inside the Tools folder, which it can use to uninstall all mods and restore bigfile.update3.000.000.tiger back to default if you run InstallMod.bat by itself.


^^ Drag and drop a mod folder onto InstallMod.bat to install it, run InstallMod by itself to uninstall all mods.

InstallMod also supports "deep search" replacement of files, where all the hundreds of references to a single file are searched for and replaced with new references to your modded file. This kind of file installation is thorough and can take several minutes for one file, and results in less instances of the game ignoring the modded files. It can be uninstalled the same as any other file. In mods, files named "Replace" will be installed with deep-search

You can install files one at a time by copying the "DRM" archive file that the mod needs to install to as "drmfile.drm" next to InstallMod.bat, then dragging and dropping single-files onto InstallMod. Edit the batch file to change basic options of InstallMod.bat, such as installing single-files with deep search or changing the locations of certain files.

UPDATE v1.3: You can now use the uninstall "tiger_patch.log" files created after files with deep-search to make those files install 1000% faster next time. Place the log file next to the Section [XXXX] file it was created for, named [XXXX].log to enable this feature.

You can test out the mod injector using my mod "Lara Bikini", also available on Nexus

^^ Lara Bikini, a model mod I made with these tools

Model and Texture Editing Tools for Modders
Noesis Plugin
This Python Plugin for Noesis [Download Noesis here] can preview and extract tr2pcd textures and tr2mesh models from Rise of the Tomb Raider, and also exports FBX models back into Rise's tr2mesh format. From FBX, you can edit models using programs such as 3ds Max or Blender, then export back as FBX again and export the FBX from Noesis into a working tr2mesh, ready to be used in the game.
For exporting FBX back to tr2mesh, mesh names and bone names are important, and objects will be ignored if their names do NOT match the names of those objects in the original model. You must find the file with extension "skl" in your extracted drm and put it next to your tr2mesh as "skeleton.skl" for Noesis to give your model bones. Thanks to Gh0stblade for creating the original tr2mesh importer.


Exporting FBX --> tr2mesh while preserving facial blend-shapes

Blend shapes are the facial animations for ROTTR, but unfortunately their format in the game is not well understood and they can only be copied and imported. Therefore, they will only work with original unchanged geometry. You can export with the " -bs" argument after the name of the tr2mesh file to export over, and the plugin will copy lara's head mesh from the other tr2mesh file, with its blendshapes intact (if it has them still, as exporting without the " -bs" parameter will delete all blendshapes).
You can now also import facial blend shapes as meshes using the Noesis plugin, thanks to aman's research. Increase the number of blend shapes by increasing gNumDisplayShapes in the global options at the top of the py file. Lara's head has 107 blendshapes, and you can change which one of them it starts on by changing the "gFirstShape" option.
Keep in mind while editing that the Bone affect limit / vertex weight limit is 4. Also, make sure your scaling is correct and not 2.54x bigger or 0.39x smaller (inches vs cm units)


MaxScript Model Tool

This "rottr_mesh_tool" Maxscript was originally created for editing Lara's head model, but you can use it to edit any mesh on the model now. It is the main thing I used to make the Bikini mod, at the end. It injects one mesh at a time, for tweaking the model after it has been created by the Noesis tr2mesh exporter. You can use it to change what material (texture set) is used by a mesh, by editing the User Properties in the object properties of the mesh and setting "Write Material ID = True". 
If you have prepared a mod with a copied version of Lara's original head mesh by using the Noesis plugin with the " -bs" argument, you can use the MaxScript tool to change things about it without disturbing the vertex order required to keep facial animations.

Editing the head mesh:
You can edit the geometry, UVs, skin weights and normals of the default head mesh inside 3ds Max without disturbing the facial blendshapes by importing Lara's original head mesh with rottr_mesh_tool.ms, editing it, then clicking "Inject Model Data" and injecting the 3ds Max head over your mod that you made with the " -bs" parameter. After that, you can transfer the modded head around by exporting over your NewMesh with Noesis and the " -bs" parameter. You cannot add or delete any verts or re-import the model, or the blend-shapes will be ruined. The order of the vertices on the model must always remain exactly the same in order to keep facial animation.
rottr_mesh_tool can also save the vertex and face data for other meshes besides the head mesh, as long as the amount of verts and faces are the same in the file you are injecting over. 


^^ Using rottr_mesh_tool.ms MaxScript to modify the head mesh to match it to the body without changing the vertex order

010 Templates
I have included my binary templates for ROTTR's tr2mesh format, tr2mesh skeletons, as well as for DRM. Also included is he 1sc script that will convert all references in the DRM file to the endurance tiger file, for extracting.
The ROTTR_mesh.bt template is invaluable for modding, as it lets you change texture sets for meshes (inside SubmeshInfo, change the "material") as well as swap around vertex buffers and faces lists.

^^ ROTTR_mesh.bt template showing vertices of a tr2mesh

A tr2pcd template is included for looking at texture headers, and a SKL template is available for adjusting bone positions
There is also a TIGER file template, though it can be a huge memory hog so it is limited to only searching the first 1408 DRMs. You can edit the template to make it parse all entries.


Extracting Game Files
Use Ekey's TIGGERUnpacker to extract the DRM files from the game's bigfile.update3.000.000.tiger file. Then, find a DRM file named for an asset you want to modify, and extract it from the game files using the DRM dumper.
How to extract DRMs from bigfile.update3: 
https://forum.xentax.com/viewtopic.php?f=10&t=13501&start=270#p166554


^^ Ekey's DRMDumper extracting the contents of a Lara costume "DRM" file, tricked into extracting bigfile.update3.tiger

Creating & Distributing Mods
To create a mod package, create a mod folder and create another folder inside it for each DRM file you wish to modify, putting the DRM file inside each with the same name as its containing folder. All Section XXXX files to be installed to this DRM go inside this folder, and you can have multiple DRM folders in one mod. Files named "Replace XXXX" will be forcibly installed over all references to that asset; their installations can take a long time but are more likely to work. 
Drag and drop the main mod folder onto InstallMod.bat, and it will install each DRM folder inside the mod folder to the game one by one. Files named "Section XXXX" will be injected quickly in the normal fashion, while files named "Replace XXXX" will be injected with deep-search


^^ Example of a mod folder, using old uninstall logs to improve installation time, and using txt files to redirect textures to other textures

You can re-use the "tiger_patchXX.log" uninstall logs to make the files in your mod install much faster, just rename them to the section number of the asset they were produced for + .log
If you are going to re-use textures, you can have one asset redirect to another one by creating a txt document in its place, with a , like Section 0104 would just be a copy of Section 0101.tr2pcd, so inside "Section 0104.txt" it would say Section 0101.tr2pcd , making Section 0101.tr2pcd be loaded in its place

How to Mod Textures
To load up textures from Rise of the Tomb Raider, open them in Noesis with the Noesis plugin. You can say File -> Export and save them as a TGA file, then open that file with Photoshop. After you edit them, you can use the Intel Texture Works plugin for Photoshop to save the textures as DDS format. You can find the name of an original texture by opening it up in a hex editior such as HXD or 010 Editor. The name and type of the texture will be at the beginning of the file, and will say something like "assets\mesh\objects\characters\lara\textures\lara_tanktop_d" (the "d" means "diffuse", in this case).
For each material, there is usually one light map, one effects map, and then three sets of normal, diffuse, and roughness maps (one regular set, one muddy set and one bloody set):

Diffuse Map
The regular color textures

Normal Map
The normal maps, simulating depth and light. To make your normal map yellow like the game's normals, invert the blue channel.
The green channel should be in DirectX format

Roughness Map
This texture represents skin shine and sweat, I am still not fully sure exactly what each channel does. The original roughness textures for skin are very dark yellow. I know that darkness in the green channel prevents Lara from getting wet when rolling in mud.

Diffuse maps, normal maps and roughness maps are saved with very-lossy BC1 compression, using these settings:

All ROTTR textures are saved as Texture Type: Color, with no alpha channel

Light Map
A black and white texture representing shadows on the model. Save this with BC4-Grayscale compression

Effects Mask
The channels RGB are each masks used with the roughness texture for wetness, sweat, blood shine -- I'm not fully sure which. Compare to the original textures and try to imitate them. Save this with BC7 compression

Once you have saved your texture as DDS, you can turn it back into a TR2PCD texture that you can use in a mod by opening your DDS file in Noesis, saying File > Export and exporting it as tr2pcd over the original tr2pcd texture that it was extracted from. Preview the new TR2PCD file in Noesis to make sure it works before injecting it back into the game


CREDITS

Thanks very much to everyone who supported me in making this, but especially to:
  • Gh0stblade - Thanks for his research into reverse engineering Tomb Raider, and for making vital tools such as the original Noesis importers and CDRM.exe (used to quickly compress assets before injecting them into the game)
  • aman - For creating the source code to TR9tigetadd, which was adapted into ROTTRTigetAdd.exe, used for this injector. Also thanks for his helpful insight into fixing exported models
  • Raq / LuckyEdge - Thanks for testing, general help and feedback

Spoiler:  
Show