Important information: this site is currently scheduled to go offline indefinitely by end of the year.

LithTech Models (.abc, .ltb, .dat)

Post questions about game models here, or help out others!
Post Reply
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

LithTech Models (.abc, .ltb, .dat)

Post by finale00 »

LTB script: http://db.tt/WhaVroBD
ABC script: http://db.tt/N8KeCn5o
DAT script: http://db.tt/ogpsoZNY (maps and stuff, only for files with idstring 85 for now)
DTX script: http://db.tt/jVR8Q8kr (does not work for many files. For me anyways)

Overview

Models are in .abc, .lta, or .ltb format.
lta probably stands for "lithtech ascii" while ltb stands for "lithtech binary"

I am not interested in the lta files. It is a text file and is a pain to parse. Good for reference, but that's it.

Info

Some info from Tron: http://www.ldso.net/tronwiki/doku.php?i ... htechfiles

I'm looking for any specs or tools that are already out there.

I know they have plenty of modding tools already for particular lithtech games (I think monolith even provided a set of tools themselves awhile ago).

Dtx format specs would be nice.
If not, a standalone dtx exporter would also be nice. I don't like how existing tools just rely on milkshape, photoshop, or dedit.

Samples and games

Aside from info, I'm also looking for samples from various games using LithTech engine (all versions)
So far the samples I have are from

Might and Magic 9: abc
Combat arms (LithTech jupiter)
Sudden Attack (LithTech jupiter)
Zu Online: ltb
Atlantis: Search for the Journal: abc
Crossfire Online: abc
Last edited by finale00 on Mon Apr 02, 2012 8:18 pm, edited 20 times in total.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Might and Magic IX

Post by finale00 »

Revisiting this format.
LithTech engine seems to be used for a lot of 3D games. At least, old ones anyways.

Someone sent me supposed specifications, but they were only for a specific game.
It is still useful, because the structure of each node should be similar.

I am looking for abc samples from a variety of games. The generic structure looks like it's a bunch of nodes with pointers to the next node. So pretty much a linked list.

One can parse the entire format by simply doing something like

Code: Select all

node = self.read_name()
nextNode = self.inFile.readInt()
while nextNode != -1:
	print(node)            

	#go to the next node
	self.inFile.seek(nextNode)
	node = self.read_name()
	nextNode = self.inFile.readInt()            
And then just read the node name and determine which function to call.
Some people might notice a logical flaw in this code: it doesn't parse the last node.

Lol, which is true. I guess I'll probably just build a list of nodes and go back to parse each one individually.
All information is welcome and encouraged. If there are already tools for this format that would be great as well.
napoleon321
advanced
Posts: 60
Joined: Tue Nov 16, 2010 12:11 pm
Has thanked: 9 times
Been thanked: 4 times

Re: LithTech Models

Post by napoleon321 »

The contents of this post was deleted because of possible forum rules violation.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: LithTech Models

Post by finale00 »

Ltb format I have a couple from Zu Online.
Would be interesting to see if there is a general data structure.

I've read that there are two dtx format (generic one from lithtech, and some version used by nexon which is basically the same thing except they just switched the first 12 bytes of the header??)

There seems to be some pascal source code for LTB format but it was only for a specific game and it hardcodes a bunch of offsets.

the ABC format was pretty easy to figure out its general structure, but the LTB not so much.

I don't know the format for the dtx files.

Here's something I quickly threw together from the zu online ltb's

I'm still stuck on which value indicates which mesh type I'm looking at, considering how there are 4 different vertex types already.

It's basically

Code: Select all

Header
numMesh Mesh
   numSubmesh Submeshes
Bones
Animation

Code: Select all

Struct Header {
	word
	word
	dword[4]
	dword[3]
	dword numBones
	dword[10]
	word[2]
	dword
	word len #may be 0
	len "Shadow Enable"
	float
	dword
	dword numMesh
}

Struct Vertex {

	if type == 
		32 bytes
	elif type ==
		36 bytes
	elif type ==
		40 bytes
	elif type == 
		44 bytes
}

Struct Face {
	word[3] v1, v2, v3
}

struct unk_struct {
	dword count
	count {
		12 bytes
	}
	byte

Struct submesh {
	dword 1
	dword 2 
	dword 1
	dword 2 
	dword 3
	dword (0, 1, 2, 3)
	byte ?
	dword
	dword sectionSize (from now until the end of unk_struct)
	dword numVerts
	dword numFaces
	dword[2]
	dword 0x13
	if type == ?
		byte[13]
	else if type == ?
		byte[12]
		dword
	endif
	numVerts Vertex
	numFaces Face
	
	unk_struct

Struct Mesh {
	word len
	char[len] meshName
	dword numSubmesh
	if numSubmesh == 1
		dword[1]
	elif numSubmesh == 3
		dword[3]
	dword
	dword
	numSubmesh Submesh
}

Struct Bone {
	word len
	len Name
	word boneIndex
	byte ?
	float[16] matrix
	dword
}

Struct Animation {
	?
}
	
Last edited by finale00 on Tue Feb 21, 2012 11:47 pm, edited 2 times in total.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: LithTech Models

Post by finale00 »

Got some LTB models out for Zu Online.
Freezes on some models though. Assumes textures are located in a folder called "texture"

I'm hardcoding material names and skipping a whole section in the submesh because I don't know which flag to check.
This works for Zu Online because they name their textures like "name", "name_a", "name_b", but this won't work in general.

For the dtx files, I'm also just doing some hardcoding here and there.

Model import: http://db.tt/WhaVroBD
Textures: http://db.tt/g8MZyIBy

Image Image
User avatar
CriticalError
double-veteran
double-veteran
Posts: 678
Joined: Sun Jul 05, 2009 2:03 am
Has thanked: 104 times
Been thanked: 41 times

Re: LithTech Models (.abc, .ltb)

Post by CriticalError »

very good job, the truth that is at work all, congratulations for your skills.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: LithTech Models (.abc, .ltb)

Post by finale00 »

Image

Here's another ltb model from a different game.
Someone sent it to me but I'm not sure which game it is.

I'm guessing lta is the ascii version while ltb is the binary version.
Neither of them seem to store the material information, or at least I don't see it (the model file is called "model67" but the textures are called "zom", which is not obvious).

The good thing about that is it becomes easier to figure out what's what. Trying to parse the lta directly is kindof annoying because text-parsing is pretty annoying in general (compared to binary anyways)
User avatar
CriticalError
double-veteran
double-veteran
Posts: 678
Joined: Sun Jul 05, 2009 2:03 am
Has thanked: 104 times
Been thanked: 41 times

Re: LithTech Models (.abc, .ltb)

Post by CriticalError »

finale00 wrote:Image

Here's another ltb model from a different game.
Someone sent it to me but I'm not sure which game it is.

I'm guessing lta is the ascii version while ltb is the binary version.
Neither of them seem to store the material information, or at least I don't see it (the model file is called "model67" but the textures are called "zom", which is not obvious).

The good thing about that is it becomes easier to figure out what's what. Trying to parse the lta directly is kindof annoying because text-parsing is pretty annoying in general (compared to binary anyways)
well freaky model xD, about game maybe is one of same companies of LithTech or too can ask guy who send you file :D
napoleon321
advanced
Posts: 60
Joined: Tue Nov 16, 2010 12:11 pm
Has thanked: 9 times
Been thanked: 4 times

Re: LithTech Models (.abc, .ltb)

Post by napoleon321 »

That's from crossfire online. (a mutant character called smoke, or something like that)
Trishty
advanced
Posts: 63
Joined: Mon Jul 05, 2010 2:37 pm
Has thanked: 7 times
Been thanked: 15 times
Contact:

Re: LithTech Models (.abc, .ltb)

Post by Trishty »

finale00 wrote:http://i.imgur.com/K3KLg.jpg

Here's another ltb model from a different game.
Someone sent it to me but I'm not sure which game it is.

I'm guessing lta is the ascii version while ltb is the binary version.
Neither of them seem to store the material information, or at least I don't see it (the model file is called "model67" but the textures are called "zom", which is not obvious).

The good thing about that is it becomes easier to figure out what's what. Trying to parse the lta directly is kindof annoying because text-parsing is pretty annoying in general (compared to binary anyways)
Whoa! Nice to see this. Is it can load animations yet?
textures name is "zom" for zombie. I have extracted it via Hex a long time ago. Model name is "model67" because i use ltb extractor on MPGH

.LTA lost UV because of ltb2lta tool. And .abc convert from .lta via ModelEdit Talon so it lost UV too.
I can rip all .LTB model by the way import it to "No one lives forever 2" :keke:
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: LithTech Models (.abc, .ltb)

Post by finale00 »

No unfortunately I don't really understand animations all that much aside from the fact that they use keyframes...
Seyiji
n00b
Posts: 10
Joined: Tue Sep 20, 2011 4:37 pm
Location: USA
Has thanked: 31 times
Been thanked: 2 times

Post by Seyiji »

finale00 wrote:I am looking for abc samples from a variety of games. The generic structure looks like it's a bunch of nodes with pointers to the next node. So pretty much a linked list.
Here is a sample character file from Atlantis: Search for the Journal a game I got in a cereal box years ago :P

http://db.tt/qO1wkLcU

Your plugin imports the model but its all pointy polygons and jumbled together.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: LithTech Models (.abc, .ltb)

Post by finale00 »

Ok cool I figured out the geometry. Previously I got it all wrong lol
It now parses the atlantis model, and all the might and magic models correctly as well.

I don't know which version these abc files are, but I haven't seen any other versions either to figure out how to check.

Now the next step is to get the dtx out. I think they have tools for that already though.

Image

Code: Select all


struct Face {
	float[2] UV1
	word v1
	float[2] UV2
	word v2
	float[2] UV3
	word v3
}

struct Vertex {
	word bone count?
	word ?
	count {
		dword bone index?
		float[4] weights?
	}
	float[3] vx, vy, vz
        float[3] nx, ny, nz
}

struct Submesh {
	dword numFaces
	numFaces Face
	dword numVerts
	numVerts Vertex
}

struct Mesh {
	word
	float[3]
	word
	word len
	char[len] meshName
	numSubmesh Submesh
}
Seyiji
n00b
Posts: 10
Joined: Tue Sep 20, 2011 4:37 pm
Location: USA
Has thanked: 31 times
Been thanked: 2 times

Re: LithTech Models (.abc, .ltb)

Post by Seyiji »

finale00 wrote:Ok cool I figured out the geometry. Previously I got it all wrong lol
It now parses the atlantis model, and all the might and magic models correctly as well.

I don't know which version these abc files are, but I haven't seen any other versions either to figure out how to check.

Now the next step is to get the dtx out. I think they have tools for that already though.
Milkshape says that Atlantis file is version 13.
Antonkf
n00b
Posts: 15
Joined: Sat Feb 18, 2012 6:47 pm
Has thanked: 3 times

Re: LithTech Models (.abc, .ltb)

Post by Antonkf »

Hi!
finale00, you say it opens .abc files with Noesis, but I only found .ltb there. Could you please tell me how to
open those .abc files (Might and Magic 9).
May be I did something wrong: I put in Noesis\plugins\python these files:
fmt_ZuOnline_ltb.py
fmt_LithTech_dtx.py
rapi_model_template.py
__init__.py
Sanae.py
I don't remember what version of python I installed - probably 2.6.
Post Reply