www.tombraiderforums.com  

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Modding

Reply
 
Thread Tools
Old 21-10-16, 15:46   #1
aman11
Hobbyist
 
Join Date: Oct 2015
Posts: 25
Default Tutorial: Tomb Raider 2013 character modding

This tutorial describes how to replace v2_lara's long pants with stephanie's short pants.

Credits:
Gh0stBlade: Mod tool is based on his Noesis importer plugin. tiger file patcher is based on his tiger and drm file format info and his cdcEngine tools

maliwei777: Blender mod tool is based on the mesh replacement framework he developed for his 3DS maxscript mod tool.
Gibbed Tiger unpacker
Ekey's TR9 DRM dumper

You need following tools:
Gibbed Tiger unpacker and Ekey's TR9 DRM dumper: http://forum.xentax.com/viewtopic.php?f=10&t=10174
Gh0stBlade's TR8 CDRM.exe cdrm compress/decompressor (part of his cdcEnigneTools https://github.com/Gh0stblade/cdcEngineTools/releases)
My TR9 character mod tools: http://www.mediafire.com/file/gybol9...r9modtools.zip
Update:
v0.4 Blender addon: Added scene object mesh support. http://www.mediafire.com/file/c5sytp...d_tool_v0_4.py

1. Tool installation:
download Tiger unpacker and TR9DRMdummper and unzip and copy contents to your Tomb Raider installation direcotry
download cdcEngineTools-09-08-2016-RELEASE.zip ,unzip it and copy "Release TR8 PC-W\CDRM.exe" to Tomb Raider directoy
Download TR9 mod tools package, unzip and put all files under Tomb Raider directory.
2. Unpack patch.000.tiger
in Window Explorer drag and drop patch.000.tiger to Gibbed.TombRaider9.Unpack.exe. You will get a new folder called patch.000_unpack.
3. Dump all assets from v2_lara.drm and stephanie_mp.drm
Find v2_lara.drm and stephanie_mp.drm under patch.000_unpack\default\pc-w\, copy both of them to Tomb Raider installation directory.
run TR9DRMDumper.exe click on text entry box near title bar and entry the full path of your TR directory(typically C:\Program files (x86)\Steam\steamapps\common\Tomb Raider). Select File menu/open and select v2_lara.drm(within tomb raider directory) Let tool extract all content. You will find a new v2_lara folder in you TR directory. do the same to stephanie_mp.drm.
4. First we will take care of texture replacement:
look under v2_lara\Texture\ and find lara's pants textures. It will help a lot if your windows explorer has DDS thumbnail preview support.

Section 432.dds : Lara's pants diffuse texture res 2048x2048
Section 433.dds : Lara's pants normal texture res 2048x2048
Section 434.dds : Lara's pants specular texture res 1024x1024

Look under stephanie_mp\Texture\ and locate stephanie's body texture

Section 2556.dds : Steph's body diffuse texture res 2048x2048
Section 2557.dds : Steph's body normal texture res 2048x2048
Section 2558.dds : Steph's body specular texture res 1024x1024
5. Copy Steph's texture content over Lara's :
load Lara and Stephanie textures in paint program ( I use free Paint.Net) and copy Steph's texture over Lara texture of the same kind (diffuse over diffuse, normal over normal , specular over specular) Save Lara's textures back as DDS format with a new name. I like to append a 'x' to new file name. Make sure you have mipmap enables and retain same resolution and DXT(DXT1/DXT5) format as the original.

You now should have 3 new textures ( Section 432x.DDS Section 433x.DDS Section 434x.DDS) , move all 3 files to your tomb raider directory where all the tools are installed.

6. Make a backup copy of your patch.000.tiger file. Launch a Windows command console ("cmd.exe") and type the following commands:

cd <Tomb Raider directory> (i.e. cd "C:\Program Fiels (x86)\Steam\steamapps\common\Tomb Raider")

tr9texpatch.cmd . v2_lara.drm 432 "Section 432x.dds"
(do not forget the double quotes "", this will inject new diffuse texture, take about 10 seconds )
tr9texpatch.cmd . v2_lara.drm 433 "Section 433x.dds"
tr9texpatch.cmd . v2_lara.drm 434 "Section 434x.dds"
(for more detail of tr9texpatch.cmd, see this post http://www.tombraiderforums.com/showthread.php?t=213392)

7. launch Tomb Raider game and load a save game that was saved between mountain village and radio tower stage.



8. Once you confirm Stephanie's texture has replaced Lara's pants texture, you can move on to replace the pants meshes.
If you have problem with the texture patches and want to start over , just copy your back up patch.000.tiger file over the one in game directory.

9. Install latest Blender 3D from https://www.blender.org/download/ (i am still runbing 2.76)

10. Install mod tool python addon script.

Launch Blender.exe in the menu bar select File menu->User Preferences,

A user preferences dialog show up. select "Add-ons" button on top bar, then "Import/Export" botton on the left menu. After that click on "Install from file" button at the bottom.

In file selection dialog Locate io_TR9_mod_tool_0.3.py (should be under tomb raider directory),select it and click install from file button.

Scroll up and find "Tomb raider addon" and click check box on right to enable it. click "save user settings" button near bottom of window. close windows by click on "X" button.

If you have an older version of mod tool installed before. you can click on triangle to expand and click on delete button to delete old verion. Click on check box of new mod tool to enable new version.


11. back to Blender main windows.

by default you should see 3 areas. Tool shelf on left with multiple tabs. 3d view in middle, and Outliner with a tree view on right. You can resize areas by mouse left-clicking and drag the divider between areas. Also areas may have scroll bar that you can click and drag to see more contents.

This tutorial will be using lots of blender hot-keys, please make sure you have mouse cursor inside 3d view before pressing any hot-key. hot-key will not work if mouse cursor is not in 3d view. Also remember ctrl-z key (undo), most mistake can be undo, always press ctrl-z if you make any mistake in editing mesh.
First delete all objects in 3d view. with mouse cursor in 3d view, press 'a' key twice, you will see all object turn orange. hit 'x' key and select 'Delete'

You should left with a empty 3d view.
12. Prepare Stephanie's mesh for modding:

Stephanie's body contain several meshes. we are going first merge them into one mesh and then delete the unwanted parts (upper body and feet).
click on the bottom "Misc" tab in tool shelf. You should see the TR9 mod tool panel, click "import TR9 mesh" button

use the file selection dialog to locate "<tomb raider dir>\stephanie_mp\RenderMesh\Section 4122.mesh", click "import TR9 mesh" button to start import


13. you should see Stephanie mesh show up in 3d view.


make sure you have mouse cursor inside 3d view, press shift-c (zoom centre). view will zoom out and show whole body.

Here are some basic Blender controls (mouse cursor must be inside 3d view):
press 'z' key to toggle wireframe/solid view
press numpad-5 key to toggle orthogonal /prospective view.
use mouse wheel to zoom in and out.
hold down middle mouse button and drag to rotate 3d view.
numpad-1 for front view, numpad-3 for right view, numpad-7 for top view.
shift-c to zoom out and put all object in center of screen. handy when you are lost and cannot see objects.

press shift-b (box zoom), a cross hair will show up, click near steph's waist and drag a box enclose her lower body, let go mouse button. this will zoom and give close up view of lower body.

14. Select all Stephanie's high detail body meshes:

press 'a' key twice. it will clear all mesh selections("all meshes should be in black not yellow/orange color) mouse right click selects mesh. First right click on the foot mesh. if it give you low detail mesh like this:


press ctrl-z (undo). and right click on foot again, when you get high detail mesh look like this:

hold down shift key and right click on the upper thigh mesh to add more mesh to selection. If you get a low detail mesh again, ctrl-z and hold down shift key and right click again. after some tries I got all high detail meshes selected like this:

15. Combine all body meshes into one and move it to a new layer.

While all body meshes are selected , press ctrl-j (join) , you will be left with one body mesh in yellow color (still selected). press 'm' (move to layer). a button grid will show up, click second button from left to move body mesh to layer 2.

switch 3d view to layer 2 by click on the button grid on bottom of 3d view.

16. edit body mesh in layer 2. delete unwanted vertices

we are looking at layer 2. make sure mouse cursor is in 3d view. hit numpad-3 key for right side view. hit shift-c to see whole body.

if body mesh is not in yellow color, right-click it first to select it.
hit <tab> key to enter edit mode. hit 'a' key twice to un-select all vertices

press 'b' key (box select) , click and drag a box encloses all upper body vertices

press 'b' key again and click and drag a box encloses the feet.

press 'x' key , and select "Vertices" in the popup menu to delete selected vertex


17. export body mesh as collada file.

hit <tab> key exit edit mode and back to object selection mode.

Click file menu->export -> Collada (Default) (.dae)

check "Selection only" checkbox in export options, give a file name like "stephanie_shorts.dae" and click "Export COLLADA" button

remember where you save the collada file.

We will inject stephanie_shorts.dae to v2_lara.mesh next,
14. Time to edit Lara's mesh file. Start a new blender project with blank 3d view.

You can exit blender and launch it again. or go to File menu->New and choose "Reload Start-Up file"

to delete everything in 3d view, move mouse cursor to 3d view, press 'a' key twice to select all objects, press 'x' and choose "delete"
15. Import v2_lara.drm

Once again. click on "Misc" tab in tool shelf area. In TR9 Mod tool panel click "Import TR9 Mesh" Button.

In file selection dialog locate "<tomb radier direcotry>\v2_lara\RenderMes\Section 567.mesh" and click "import TR9 mesh" button

16. Once v2_lara.mesh is loaded, move mouse cursor to 3d view.


press numpad-5 (ortho-view),
press shift-c (zoom-center),
press 'z' (wireframe toggle)
press shift-b , click and drag a box encloses lara waist and thigh, your screen should look like this.

17 . import stephanie_short.dae:

file menu->Import->Collada (Defalt).dae

in File chooser dialog locate stephanie_shorts.dae and click "Import COLLADA" button

Steph's short will be loaded and overlay on Lara's meshes. It should also be already selected (yellow colour). if not right click on mesh to select it.
18. Make Lara's pants invisble in game, copy Lara's pants mesh name to Steph;s shotts mesh.

While Steph;s short is selected you should see Steph's mesh name on bottom of 3d view. in Outliner window you see the same name in tree view with a yellow highlighted icon
You may need to click and drag the Outliner scroll bar to find Steph's mesh in tree view.

Take notes of Steph mesh name and where it is in the tree view. we will come back and give it a new mesh name in a moment.
Right click on Lara's pants mesh in 3d view to select it. It stick out a bit in the thigh area , should be easy to pick out.

Once Lara pants is selected. press <tab> key to enter edit mode.
press 'a' key a few times until all vertices are selected.
press 'x' key, in the pop-up menu select 'Only Faces'. this delete all faces in pants mesh. it will not be visible in game.
( For tomb raider, I don;t know how to hide mesh by simply settng a flag. We cannot just delete the whole mesh, that will confuse the game)
( My mod tool cannot import mesh with no faces, once this project is exported to mesh file, it cannot be import and edit again)

press <tab> key to return to object mode
Optional: press 'z' key to toggle wireframe/solid view, you will notice Lara pant only contains lines and no faces.

In Outliner tree view, scroll down and locate lara pants mesh name ,it should have a yellow highlighted icon, right click on name text area and select 'rename'.

The text turn into a text entry box with all text selected. press 'ctrl-c' to copy name text to clipboard.

right click Stephs shorts mesh in 3d view to select it.
In Outliner tree view, scroll and find Steph's mesh name, right click on name text and select 'rename'
press ctrl-v to paste Lara's pants name to Steph's mesh. Don't press enter to confirm yet.
use left arrow key or 'home' key to put input cursor at beginning of text input and add a 'x' as first character of mesh name, press enter to confirm.
Final mesh name should be 'xMesh_3_2_Flag0x...'

(the 'x' tell mod tool this is a new mesh, new mesh will use the shaders/textures from mesh id _3_2, Mesh_3_2 is Lara's Pants)
(We have replace Lara's pants textures earlier. new mesh will be using Lara;s pants new texture because it has xMesh_3_2 as its name)
19. Transfer Lara pants bone weights to Steph's shorts (mesh skinning).

You should know how to select multiple meshes in Blender by now.
Right click on Lara's pants mesh first. hold down shift key, right click on Stephanie's shorts. (press ctrl-z to undo if you make wrong selection)
Stephanie's shorts will be in yellow, indicates it is selected and currently in focus.
Lara's pants will be in dark orange, indicates it is part of a multi-object selection.
Find the 'Object Mode' button on bottom of 3d view and click on the double arrow to its right to bring up a menu.

select Weight Paint, Steph's mesh will turn blue.


On Left tools shelf click on 'Tools' tab , scroll down and find the 'transfer weight' button and click on it.
A option panel shows up right below transfer weight button, use scroll bar and find Source Option
click on the double arrow to the right of Source Option and select 'By name'
Click on 'weight transfer' button one more time to make sure it is enabled.

Optional: press 'z' key to switch to solid view. click on the 'Vertex' button (upside-down triangle) below Outliner area, use scrool bar to find 'Vertex Groups' List. Click on one of the 'b_xxx_xxx' name to select a bone, use up and down arrow keys to browse through all bone(vertex groups). you can see a heat map of each bone group. Red mean 100% influence by that bone, blue mean no influence. I marked a blue area in right thigh to show vertices that did not get correct weight. You will see these vertices stick out of thigh when Lara walk in game.


Click on the double arrow to right of Weight Paint button and select 'Object Mode' to exit Weight Paint mode.
20. Export changed meshes to a new Tomb raider mesh file.

We have two modified meshes we need to export. Lara pants which have no faces and the new xMesh_3_2_Flag0x.. mesh that contain skinned shorts
If you just finish weight transfer, blender should be in object mode with both Lara pants and Steps shorts selected. if not use shift-right click to select both Lara pants and Steph's shorts meshes.
In tools shelf click on 'Misc' tab and find TR9 Mod tool panel, click Export TR9 mesh button.


In file chooser dialog , locate and click on v2_lara's mesh (Section 567.mesh) and click 'Export TR9 Mesh' button.


A new file named 'Section 567_new.mesh' will be created in the same directory as Section 567.mesh.

Save your Blender project with some name, this blender project allow us to add more changes to v3_lara in the future since we cannot re-import the exported mesh file again.
21. Final Step. inject Secton 567_new.mesh to patch.000.tiger.

move Section 567_new.mesh to your tomb raider directory where all the tools are installed
Launch a Window command console "cmd.exe", type the following commands
cd <Tomb raider direcotry>
dir "Section 567_new.mesh" (check and mark the file size, Mine has 1650520 bytes in size)
cdrm "Section 567_new.mesh" (compress mesh file)
tr9tigetadd.exe . v2_lara.drm 567 "Section 567_new.mesh=1650520"

Launch game and load a save game between mountian village and radio tower stage.


Limitations and advance mesh editing.

- You will notice v2_lara right arm bandage and watch take on Steph's body texture. It is because these object use the same texture as lara pants. To solve this problem , we need to copy the watch/bandage texture to a unused corner of stephanie;s texture and modify UV coordinates of both objects to point to new texture locations. I may write up a guide in the future.

- Steph's waist do not aligned with Lara's body perfectly. to fix this one need to enter edit mode and rotate Steph's vertices pivot around the ankle to make the waist aligns with Lara's upper body. Also step's figure is "fuller" than Lara's , her bottom and thighs need to scale down a little to match Lara's physique.

- Blender weight transfer only take one mesh as source. Suppose someone want to transfer Lara's body bone weights(scatter in many meshes) to another body mesh. One solution is to shift-right click all high detail Lara body meshes. Press shift-D (copy mesh) and press enter to confirm. immediately press ctrl-j (join). This give you a single copy of body mesh you can use as source for bone weight transfer.

- TR9 mesh can not uses more than 42 bones. The mesh we injected will mess up or crash game if it draws weights from more than 42 bones. My mod tool will not export a mesh if it counts more than 42 bones is in used. A workaround is to divide your mesh into several meshes, i.e a full body mesh can be divide into 3 meshes , lower body, upper body and a third mesh contain both arms. All new mesh will have similar name i.e. xMesh_3_2_Flag..001 , xMesh_3_2_Flag...002 , xMesh_3_2_Flag..003.

- At step 18. we copy Lara's pants mesh name to Stephanie's shorts mesh and added an 'x' to the name. This allow new mesh to be appended to character and not share bone map with existing meshes. That reduce the chance of creating a bone map with more than 42 bones. If you are modding scene object meshes, they only have one bone. you can just copy mesh name to new mesh, after that delete the old mesh. Basically completely replace an existing mesh, there is no need to add 'x' to new mesh name.

Last edited by aman11; 29-10-16 at 03:23.
aman11 is offline   Reply With Quote
Old 21-10-16, 18:38   #2
VictorXD
Relic Hunter
 
VictorXD's Avatar
 
Join Date: Jan 2009
Location: ♓︎ Venus ♓︎
Posts: 9,126
Default

Awesome! Looking forward to the rest of it. And mods please sticky this! It deserves it!
__________________
Persecution to all non Luds Gate believers may God's wrath fall upon you sinners
VictorXD is offline   Reply With Quote
Old 25-10-16, 21:56   #3
Gh0stBlade
Archaeologist
 
Gh0stBlade's Avatar
 
Join Date: Dec 2010
Posts: 2,284
Default

Very good work, do you think you'll be able to add Scene mesh support?

Cheers.
__________________
No longer accepting PMs due to abuse of the system.
Gh0stBlade is offline   Reply With Quote
Old 25-10-16, 23:30   #4
VictorXD
Relic Hunter
 
VictorXD's Avatar
 
Join Date: Jan 2009
Location: ♓︎ Venus ♓︎
Posts: 9,126
Default

Wait, if this uses Blender, it would it be possible to import other models as well using the same texture data etc? And would it be possible for example, double the number of vertices for more detailed models?
__________________
Persecution to all non Luds Gate believers may God's wrath fall upon you sinners
VictorXD is offline   Reply With Quote
Old 27-10-16, 04:02   #5
aman11
Hobbyist
 
Join Date: Oct 2015
Posts: 25
Default

@ VictorXD: you can import a high detail mesh and replace any body part. Picking a texture to replace and not interfere with texture of other meshes is the hard part.

@ Gh0stBlade : Thanks, I make a change to my blender script , it can import/export scene objects, scene objects still contain one single bone it seems. I should change a mesh and test it in game first before release this version. However, I can think of two issues:

- Currently my tiger patcher will only patch.000 ( it can also patch title.000 and patch2.000 after some modification) I can only replace scene object included in one of these patch files. That limits the usefulness of modding scene objects. Well, actually the same limitation apply to character drm file.

- Is there a scene object in patch.000 that is big and easy to spot in game? The drm names are not very specific (i. e. barrier_side_debis.drm ). let say I replace a debis mesh. How do I know where to look to verify the change?
[edit]
Found a barrel_hobo_heater_ignitable.drm inside patch.000.tiger. it contains the mesh of blue barrel fire pit at radio tower. I widen it a bit and inject it back to game. It seems working. I posted new scene object support mod tool in first post.
Here are the sample commands for injecting barrel mesh to patch.000.tiger:

cd <tomb raider directory>
copy patch.000_unpack\default\pc-w\barrel_hobo_heater_ignitable.drm .
copy "barrel_hobo_heater_ignitable\RenderMesh\Secti on 629_new.mesh" .
dir "Section 629_new.mesh" ( got file size 120396 bytes)
cdrm "Section 629_new.mesh"
tr9tigetadd.exe . barrel_hobo_heater_ignitable.drm 629 "Section 629_new.mesh=120396"



Regards

Last edited by aman11; 29-10-16 at 02:18.
aman11 is offline   Reply With Quote
Old 27-10-16, 20:05   #6
VictorXD
Relic Hunter
 
VictorXD's Avatar
 
Join Date: Jan 2009
Location: ♓︎ Venus ♓︎
Posts: 9,126
Default

Amazing! This means that we could finally have Lara looking like she was supposed to (turning point trailer) and we can make a decent non dead squirrel tail hair too.

Even if TR runs like complete **** on lowest settings on my laptop, I might just install it again to start making mods.
__________________
Persecution to all non Luds Gate believers may God's wrath fall upon you sinners
VictorXD is offline   Reply With Quote
Old 04-11-16, 20:20   #7
GRiannisRaider
Explorer
 
GRiannisRaider's Avatar
 
Join Date: May 2016
Location: Greece , Athens
Posts: 639
Default

Quote:
Originally Posted by VictorXD View Post
Amazing! This means that we could finally have Lara looking like she was supposed to (turning point trailer) and we can make a decent non dead squirrel tail hair too.

Even if TR runs like complete **** on lowest settings on my laptop, I might just install it again to start making mods.
Yes please !
__________________
'' D'you know,it's gonna be a real pleasure to shut you up ''
GRiannisRaider is offline   Reply With Quote
Old 08-11-16, 13:35   #8
GRiannisRaider
Explorer
 
GRiannisRaider's Avatar
 
Join Date: May 2016
Location: Greece , Athens
Posts: 639
Default

Quote:
Originally Posted by GRiannisRaider View Post
Yes please !
Can anyone made Lara Croft From The Aplha build Of the game?
__________________
'' D'you know,it's gonna be a real pleasure to shut you up ''
GRiannisRaider is offline   Reply With Quote
Old 10-11-16, 08:02   #9
dylan_croft
Historian
 
dylan_croft's Avatar
 
Join Date: Aug 2013
Location: My laptop
Posts: 357
Default

About the texture .
Did you try to change the UV map , I mod dead or alive 5 last round all the time with blender and i change the UV map in blender to get the desired texture .
__________________
Team Classic: We want our classic Lara Croft back!
dylan_croft is offline   Reply With Quote
Old 11-11-16, 14:07   #10
aman11
Hobbyist
 
Join Date: Oct 2015
Posts: 25
Default

Quote:
Originally Posted by dylan_croft View Post
About the texture .
Did you try to change the UV map , I mod dead or alive 5 last round all the time with blender and i change the UV map in blender to get the desired texture .
You can change UV map of a mesh. Remember put this mesh in selection before exporting otherwise changes will not be exported. My exporter only export one UV channel.
aman11 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 09:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.