Tomb Raider I-III Remastered Starring Lara Croft

Tomb Raider I-III Remastered Starring Lara Croft

Nicht genug Bewertungen
Launch Custom Levels
Von Лёв
My first attempts to run custom levels in this game.
2
   
Preis verleihen
Favorisieren
Favorisiert
Entfernen
Is this possible?
Yes! As it turns out, it is possible! But it was not without pitfalls.

For the test, I used the first part of the game and not all levels wanted to start. The game just closed without any errors.
How it works?
To get started, you should visit a site like this one: https://www.trle.net/

Here you will find many levels for different versions of Tomb Raider. Next, choose any map you like and download the archive. (I remind you that I conducted tests for TR1)

When you open the archive, you can see one of three file structure options (Or maybe there are more, I'm not sure):
First variant

Second variant

Third variant


I noticed that if the structure matches the first variant, then the levels will not run. At least this was the case for me, and besides, this is only the first test.

Next, go to the DATA folder. There you will probably see a bunch of different files. We are interested in the file called LEVEL1.phd, which is usually there. I'll demonstrate this in a level called Natla's Quest:

Copy this file to your desktop for example.
Before, I wrote that it should be renamed to GYM.PHD, but as I found out, if you run the level through Lara's House, then Lara will not have a weapon in the level.

Next, go to the folder:
Steam\steamapps\common\Tomb Raider I-III Remastered\1\DATA
DELETE files:
LEVEL1.MAP LEVEL1.PDP LEVEL1.TEX LEVEL1.TRG

If you do not remove them, the level will not start. At least that's how it was for me. Well, just in case, so that no errors arise.

And finally replace the LEVEL1.PHD file.
Results
Start a new game from the main menu.
As a reminder, we are now not running the level through Lara's House, as Lara will have no guns and can't fight off enemies.

If you're lucky and the level has loaded, the first thing you might see is some very strange textures:

To fix this, you need to switch to the old render (F1 key)

I have a suspicion that it is the file with the *.PDP extension that is responsible for the new look of the locations, but these are just my guesses.

In conclusion, I will say that I only tried to run the levels, but did not complete them to find out whether they would be completed normally.
Bonus: TEX format
Today I decided to deal with the .TEX format. By its extension, it is obvious that it is responsible for modern textures. I tried to use a .TEX file from other levels, but they ended up looking like this:

I don't have the skills for reverse engineering, but here is what I was able to find out about the structure of this file:

Bytes
Description
uint16 ᠌ ᠌ ᠌ ᠌ ᠌ ᠌ ᠌ ᠌ ᠌ ᠌ ᠌ ᠌ ᠌ ᠌ ᠌ ᠌ ᠌
Ammount of the modern textures used in level (N)
uint16 * N
Texture number that are stored in the TEX folder
uint16 * M
Object textures (M). I found out about this thanks to the trview program, which can open original levels and also show all the data in a log file.
In general, this number is stored directly in the .PHD level file

Ammount of modern textures used in level


Texture number that are stored in the TEX folder


Object textures


After a little understanding of object textures, I found out that only TileAndFlag is used from this structure.
Here's the structure (Taken from here[opentomb.github.io]):
struct tr_object_texture // 20 bytes { uint16_t Attribute; uint16_t TileAndFlag; tr_object_texture_vert Vertices[4]; // The four corners of the texture };

I even wrote a small program in Godot. (because I'm too lazy to use normal programming languages) To make sure exactly that this is the case.

In simple terms, the left column shows the number of the texture tile. The center column is where I display the texture tiles. (they don't have colors, because I have to write a program to read the palette from the .PHD file). And the third column shows the UV map. Ideally, it should be displayed on top of the atlas, but I'm too lazy to do it yet.

Well, as I understand, in the .TEX file itself, instead of the atlas number, the array index is already used, which contains the number of the modern texture.

After all the manipulation I did, I got this:


As it turns out, I also need to edit the UV coordinates of the textures in the .PHD level file itself! It doesn't matter what the coordinates were before, what matters is that now for each of the 4 vertexes we need to set the maximum possible value:
vertex1.x = 0; vertex1.y = 0; vertex2.x = 65535; vertex2.y = 0; vertex3.x = 65535; vertex3.y = 65535; vertex4.x = 0; vertex4.y = 65535;

And now we have the following result!

Modern textures


Classic textures

Yeah, in classic view, it's terrible now, but I'll stop there for now.

It's just a matter of doing the little things. Manually check the UV coordinates of each of the textures and replace them with modern ones. Unfortunately, I don't know how this can be automated.....

!!! This only works if you delete the file with the .TRG extension !!!
Bonus: TRG file
All I've learned is that this file is responsible for modern object meshes, new lighting sources, and new textures. Strangely, the new textures are also described in a file with a .TEX extension...

---upd---
This also contains updated level geometry! But only visually, without collisions.

---upd---
I thought for a long time, why this file has the extension TRG. So I present to you an unofficial transcript!

Tomb Raider Graphic
14 Kommentare
Лёв  [Autor] 23. Nov. 2024 um 4:29 
Hello! Unfortunately, there is no news :с

Some time ago I started to make a program with which you can quickly set up modern textures for old levels, but I never finished it. The problem on my way was transferring the code for reading the level to godot (because it was most convenient for me to work there). And the fact that godot does not support the dds (dx10) image format
Nightmare 23. Nov. 2024 um 3:47 
Hello,

Thanks for this interesting stuff.
Is there any news?

Could you need some help for anything?
I'm also really interested in this topic.

Cheers!
Лёв  [Autor] 20. März 2024 um 11:11 
Unfortunately no. But something tells me that this is somehow connected with the information about vertixes. The data is very similar to this. But unfortunately, I have not delved into this research yet. In addition, when deleting .pdp at standard levels, nothing happens :steamsad:
Dubai Trader 20. März 2024 um 11:06 
Die you found something about the .pdp? Like what is does? seems to be more a Problem than anything.
Лёв  [Autor] 13. März 2024 um 4:45 
Finally got the modern textures working. Checking the section with TEX format

Наконец-то заставил работать современные текстуры. Проверяем раздел с TEX форматом
Лёв  [Autor] 1. März 2024 um 6:05 
Updated the information about the TEX format a bit

Немного обновил информацию о формате TEX
JC Shpreng *N* 25. Feb. 2024 um 16:54 
👍🏻
Лёв  [Autor] 25. Feb. 2024 um 9:32 
Updated the information about the TEX format

Обновил информацию о формате TEX
Лёв  [Autor] 23. Feb. 2024 um 0:53 
At the moment I'm trying to figure out how the tex format works.
All I learned about unknown bytes is that their total number is divisible by 3 and 4. I still haven’t learned how to find out how many there should be...

But if I can figure this out, then we can run custom levels with new textures, but without new geometry and lighting.
Digital Dream-walker 22. Feb. 2024 um 13:49 
Great that you took the time to look into this. It's something I'm hoping will be supported properly in future, or that someone can at least figure something out.