• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

How to Import and Read .tcm Files in Python

Experienced Elementalist
Joined
Aug 6, 2021
Messages
220
Reaction score
55
You can probably find a module online to read the file, otherwise you will need to understand how the .tcm file is structured and what data needs to be read.
 
Joined
Oct 8, 2006
Messages
740
Reaction score
289
That's correct. If there's no existing .tcm file reader made in any programming language, you will need to understand the .tcm file's data structure.
I recommend 010 Editor for such things. You can do binary templates and structure the data by data types. And you also need a lot of patience.
 
Skilled Illusionist
Joined
Mar 7, 2013
Messages
330
Reaction score
2
I'm no expert on making that kind of tool, I will do some research about 010 editor so I can read the file that contains the data of terrain. and replicate it to unity
 
Joined
Jun 10, 2009
Messages
659
Reaction score
141
That's correct. If there's no existing .tcm file reader made in any programming language, you will need to understand the .tcm file's data structure.
I recommend 010 Editor for such things. You can do binary templates and structure the data by data types. And you also need a lot of patience.

By any chance is there a logic for packing and unpacking TDB (texture database) files?
 
Joined
Oct 8, 2006
Messages
740
Reaction score
289
By any chance is there a logic for packing and unpacking TDB (texture database) files?

By "logic", if you mean "Why they did this?", I think it's a common practice to pack or encrypt these files. Probably the developer's logic is to not let the end-users use them or access them.
Sometimes a texture database could contain more information than needed but vital for the texture alignment, such as vectors/polygons used in the map terrain, so my opinion would be, for security reasons, to encrypt such a database to prevent users altering them because not every game server is actually having the geodata of the terrain loaded into the memory.
 
Joined
Jun 10, 2009
Messages
659
Reaction score
141
By "logic", if you mean "Why they did this?", I think it's a common practice to pack or encrypt these files. Probably the developer's logic is to not let the end-users use them or access them.
Sometimes a texture database could contain more information than needed but vital for the texture alignment, such as vectors/polygons used in the map terrain, so my opinion would be, for security reasons, to encrypt such a database to prevent users altering them because not every game server is actually having the geodata of the terrain loaded into the memory.

I was asking about "logic" as in a standard algorithm to unpack TDB. So the answer is no, as it is up to the game developers to decide how TDB is made. Am I correct?
 
Joined
Oct 8, 2006
Messages
740
Reaction score
289
I was asking about "logic" as in a standard algorithm to unpack TDB. So the answer is no, as it is up to the game developers to decide how TDB is made. Am I correct?

Absolutely. You're correct.

The algorithm should be in the game dlls/executables, most likely called when the TDB is loaded into the memory in some initialization methods at the start up.
What game is this actually?
 
Joined
Jun 10, 2009
Messages
659
Reaction score
141
Absolutely. You're correct.

The algorithm should be in the game dlls/executables, most likely called when the TDB is loaded into the memory in some initialization methods at the start up.
What game is this actually?

An old MMO from 2003 named A3 Online (https://forum.ragezone.com/f98/). There was a TDB tool released built using C++ but source was never shared and hence was wondering if there was some standard way. The only downside of the tool was that, in order to repack the extracted DDS files, the files had to be of same size which is sometimes hard to retain after it was updated.
 
Joined
Oct 8, 2006
Messages
740
Reaction score
289
An old MMO from 2003 named A3 Online (https://forum.ragezone.com/f98/). There was a TDB tool released built using C++ but source was never shared and hence was wondering if there was some standard way. The only downside of the tool was that, in order to repack the extracted DDS files, the files had to be of same size which is sometimes hard to retain after it was updated.

I found the encrypt keys for TDBs.

Seems like TDBs are containing only .DDS(Textures) files?


GMDeveloper1 - How to Import and Read .tcm Files in Python - RaGEZONE Forums

And also the C# source code for decoding/encoding:



Code:
private static void DecodeULL(ref byte[] buffer, int size)
{           

for (int i = 1, j = size - 1; i < size; i++, j--)
    buffer[j] = (byte)(i ^ (size ^ (cryptTable[buffer[j - 1]] ^ buffer[j])));

}

private static void EncodeULL(ref byte[] buffer, int size) // It's not used in the source
{           

  for (int i = 1, j = size - 1 ; i < size; i++, j--)
  {                               
      buffer[i] = (byte)((((j & 0xff) ^ buffer[i]) ^ (size & 0xff)) ^ cryptTable[buffer[i - 1]]);
  }

}
 
Last edited:
Newbie Spellweaver
Joined
Jun 10, 2022
Messages
12
Reaction score
1
Try to re-make tantra online in UNITY , as what master_unknown said.
 
Back
Top