Godspeed, Mr. Spawn... Godspeed.
I've managed to write a parser for the .TIM files, on my way to finding a way to export them to another format.
It's complicated, but it doesn't look nearly as bad as the original Thief object formats. Each section is very well marked, and describes each internal data structure pretty well. I still don't know what's in each section, but they describe themselves well enough to take them apart.
It looks like the real important stuff is in the sections marked with the tags "TRMS", "DEMS" (Dimensions?), "PHMS" (Physics model?), and "0CRA" (that one is very complicated, but lots of stuff in there). The rest look like titles (object name, author) and materials / texture information, with some tags which don't seem to get used much, or have much data.
I've only run through about 20 files, from small to large, and so far I can parse them all. Need to do more extensive testing.
Now all I need to do is figure out what the stuff is and re-construct it into another 3D format.
Eventually, if I understand all the components in the .TIM file, I may be able to write a converter from something like 3DS to .TIM. This would allow all us folks who don't yet have 3DS Max 5.1 to make static meshes. Provided I can figure out the matlib part of this also.
I'll keep plugging away. Compared to the motion database in T2, this is easy!
Godspeed, Mr. Spawn... Godspeed.
Bonus points if you can guess why they are called .TIM files.
In honor of Tim Stellmach?
Was he the deranged genius who designed the binary formats for Thief? If so, I'd better watch out as I try this. There were a number of gotcha's in the old ones.
But I must admit, these don't SEEM as evil internally. That may just be my ignorance speaking.
Shadowspawn, if you can come up with a converter, I'll buy you a case of beer!
(If you can't get here to pick it up, I'll drink it for you, too! )
So are these TIM files for game objects and items?
The programmer who made the TIM file format was named Tim Perry. Guess where the name came from
Unfortunately no one consulted the designers for a name when the GMP format for the maps was created. If it were up to us they would be HOG files. Instead of hogs, we ended up with gimps
Yes, objects and static meshes (archways, doors, stairs, etc). Not the AI, however, they've got a different format (I'll eventually get to that).
If Tim is still hanging around somewhere, I'd be more than willing to accept any wisdom he could throw my way in deciphering these files. (Or code fragments, data structures, format docs, even a clue as to what the tags mean! )
After pouring over the output files, I'm still lost. (Yes, it's late and my brain hurts). I can't locate what I would normally expect to find for UV mapping coordinates, even vertices are hard to find. I'll keep at it, eventually I'll figure it out. (I hope!)
I've gotten the first hack at converting .TIM files into something else. I'm currently just converting them to the old .E format, and then converting them into 3DS.
It's not pretty, most of the normals are wrong, and I'm not quite handling all the materials properly, but the shapes are correct, and the UV mapping looks reasonable. So it's getting there. Depending on what is and isn't important, I think I can eventually create a something to .TIM converter. Although the designer will probably have to create a collision hull by hand, but I should be able to extract what they currently look like.
Anyway, back to work. I'll post some screenies when I get the first real conversion working. But this is going about 100 times faster than the Thief 1/2 BintoE program.
Indeed, this is very good thing to know. Keep on going.
If you (or somebody else using your discoveries) could write an export plugin for Blender, that would be fantastic. I would be more than happy to attempt this myself if you can get the format figured out.
Blender can export to .3ds (although I don't know how effective it is), so a .3ds to .tim converter ought to suffice, though.
Last edited by OrbWeaver; 13th Mar 2005 at 08:11.
More progress, at least I can reconstruct the objects now. This imagine is a 3DS file, rendered in Deep Exploration;
That's the lighthouse under buildings. There seem to be three materials I can't find in the textures directories; Material #7404, Material #7415, and Material #7821. They might be in the matlib, I don't know yet.
I cannot seem to find any "complex" items (things with moving parts, like axles or rotation axis). Don't they exist? Or is everything made up of individual pieces (which would make my life easier).
Haven't figured out transparency or illumination, yet. Getting there. I'll keep you posted. Time to look at some window objects (are there transparent ones?)
There is no transparency I'm pretty sure, and emissive is handled in the texture. As long there is a texture with emissive on the surface it should show up as emissive.Originally Posted by Shadowspawn
You mean objects with animation? There aren't any, at least in .TIM format. They are all static. Hardpoints should be the only thing besides the geometry and collision hull you should have to worry about.Originally Posted by Shadowspawn
Last edited by Krypt; 13th Mar 2005 at 22:33.
Krypt, thanks for the info!
It's so much easier if the materials have their properties and the objects don't directly affect that. I'm very much in the mind-set of Thief 2, where the object directly controlled the illumination and transparency of the materials. It's a relief not to have to worry about that.
Hmmm, why no transparency? I'm sure the engine (by running through Direct X) could manage it fine. I'll have to dig around and experiment some. Of course, it makes rendering that much harder. But it would be cool to have a dirty, obscured window which just lets the player get a glimpse of what's going on behind it.
Hardpoints?! Can you give me the name of a sample object which has 1 or more hardpoints? I've probably missed any of them. Suggestions as to where to look?
Wasn't there glass cases in the museum and a door with transparent windows in the seaside mansion? I could've sworn I saw those...
I just checked on the mansion. The highest entrance (bedroom balcony) has a door with glass in it. So the engine handles transparent objects fine (maybe not varying levels of transparency though?), and textures with transparent bits (alpha channels or whatever) are used for the grass and tree leaves. Am I missing something?
Any light or door mesh should have a hardpoint. You can see hardpoints in the mesh browser in the editor, they show up as a little red green and blue axis thing. The hardpoints can have names also, don't know if that makes any difference to you. I believe the hardpoint handles are attached to on door meshes is named hp_handle.Originally Posted by Shadowspawn
Oh yeah, forgot about those windows. I think Seaside is the only map that had windows so it was nothing I ever had to think about, hehe. Still, translucency and alpha channels are also handled by the material so Shadowspawn still won't have to worry about them for his TIM exporter.Originally Posted by Gestalt
Great, if the materials handle the transparency (and illumination, er.. emmisiveness?) I don't need to worry about it until I work on matlib tools.
OK, hardpoints! They're listed under the PHMS tags. For a regular door I found; Collision (which most every object seems to have), hp_handle, hp_lockA, and hp_lockB.
They look just like a translation matrix with a name. I guess they inform the engine how to position other objects that would link to make a working assembly of some sort, like a door with a lock.
Krypt, or another dev? How were those specified in the original 3DS Max files? Were the other objects placed in the correct spot, and marked or named specially, and then filtered out when making the object? Or was some kind of template used.
The reason for that question is so that we can specify this when making new objects. I imagine that if someone were to make a new door in 3DS Max, just producing a rectangular door object, that the engine wouldn't know where to attach the handle and locks with the hardpoint specified. And since it's a translation matrix, it would be alot easier to get it out of the raw 3DS (or whatever) than to have the designer specify it via parameters.
I didn't see any of this in any tutorials yet, on object making, so forgive me if this is covered somewhere and I haven't seen the tut yet.
Shadowspawn, Krypt, you guys rock. No other way to put it. To think, this will put static mesh creation (pretty much the basis for the look of all maps) into the hands of anyone who can download any of several free modelling tools supporting 3DS format output, is amazing. Kudos all around. I don't know how you're doing it, but it's great stuff. Almost time to get a T3 version amateur modelling thread going. Where is sluggs!?
Edit: What does this mean for the texturing? I don't know much about this at all, so I'm clueless here - is the texture info simply linked from the TIM to a DDS? IIRC there is a way to edit DDS files, but I know nothing about it. Will that all be handled somehow by the modelling package, or is there some third party tool needed to skin things? Hm.
Last edited by SneaksieDave; 14th Mar 2005 at 13:47.
If you're wondering where the locks and doorknobs you see in the game came from, those are actually seperate meshes. There are a series of meshes for different lock types and a generic doorhandle mesh that are connected via RigidAttachment link to the various hardpoints on the door mesh. As long as your exporter allows people to create a door mesh with the hp_handle and hp_lockA/B hardpoints, they will be able to set it up with a lock and handle themselves in the editor.Originally Posted by Shadowspawn
I think the question was more along the lines of "how do you specify the location of the hardpoints in 3DS Max?".Originally Posted by Krypt
If that was the question then I have no idea. The artists created all the meshes and the hardpoints, I just placed the meshes in maps Isn't hardpoint creation a standard function in max? I don't think our artists used any special methods to create them, I'm pretty sure it was something standard to max. I could be wrong though.Originally Posted by OrbWeaver
We'll need someone who knows 3DS Max to tell us about the hardpoints. If not, I can think of several easy ways to get it done. But I did see them in the Static Mesh Browser, so it all starts to make sense.
Are the different "skins" a standard in 3DS Max? It seems that a group of textures, using the same UV mapping, are defined in the .TIM file itself, which are then displayed in the Static Mesh Browser as possible ways to display the object. I don't think the simpler 3D modelling programs have this (TrueSpace, Animator, Milkshape). So I'll have to come up with a way to emulate this for those programs.
I'm thinking, as an intermediate format, I'll come up with something like .E2 (based on the old LGS .E file format). That way designers can add "skins" even if their 3d program doesn't support it.
I'll look at some of the standard ASCII formats before I jump into having to write two more programs.