How to import files into Thief.

Introduction
Getting the files from the Adventure Tool Kit Patch
Actually importing a .3ds file
Size Matters
Fixing the Palette
Objects Off-Centre?

This a question answer tutorial.


Thief Sub Menu

Introduction
There are two types of models in Thief, which I have divided into objects and creatures. Objects, are the stationary usable items in the game, eg, doors, torches, tables, etc. The other type is creatures, and this category contains all the humans, burricks, zombies that are in the game. As far as I know, the creatures were created using Alias (I think), and the objects were created using 3dstudio max. This document deals with the 'inanimate' objects, even though we might be able to get some degree of animation in there.

To import models in Thief you need a few things.

  • Either 3d studio max or access to the .3ds you want to import. You will probably be able to export from other 3d applications into that data type, but I am unsure whether that works. If anyone who tries it contacts me I will place the details.
  • Two files, one named 3ds2e, and the other bsp. These files are specific to Looking Glass Studios, so trying to search for them will probably not aid you. You might be able to get them from this link, 3dsimp.zip (150k), though if LGS request I will remove them.

The first one you cannot really do much about. you either have 3dsmax or a similar 3d package or you don't. To get the second you can simply use the same method I used for getting the files. First of all download the Flight Unlimited Adventure Builder Kit. It is quite a juicy download, at 4MB. Unfortunately, you need Flight Unlimited 2 to execute the patch. Tsk. To bypass this, you need a hexeditor, and some windows registry skills.

(Back to Top)

Getting the files from the Adventure Tool Kit Patch

IMPORTANT NOTE: This bit is actually irrelevant now a you can get the files from this link:-3dsimp.zip (150k)

Create a temporary directory on your hard drive somewhere and call it 'FLIGHT2', and then load up the registry editor. If you do not know how to do this, Start, Run, and then type in regedit. If you get it right, the registry should pop up. Again, in case you do not know, be careful. Deleting things in here willy-nilly will probably have some adverse side affects.

Now open up, HKEY_LOCAL_MACHINE, SOFTWARE, Microsoft, Windows, Current Version, App paths. Right click on the window on the left and create a key under App paths, and type in 'flight2.exe' as the key name. Then click on the default symbol, and modify it. Type in the directory path to the flight2 directory you created, and then add flight2.exe to the end. After the, create a new string named path, and in this type in the directory only. Running the patch should now say unable to determine version rather than program not installed.

Next, copy the thief executable from the thief directory to the flight2 directory, and rename it to flight2. Running the patch will now say, patch expects version f1.04 and you have version 1.33. Load up the fake flight2 executable in your hexeditor, scroll to the end of the file and then up again until you see some words about product version. Notice that it follows the pattern of letter then a dot, being careful to maintain the letter dot spacing, replace the 1..3.3 with f.1..0.4, with the first 1 being replaced by the F. Save this file, and if you have done it correctly the patch will now work correctly. If it doesn't work correctly, you have probably invalidated the info section, check this by right clicking on the file in windows and seeing if the version section displays correctly.

(Back to Top)

Actually importing a .3ds file

The documentation with the kit is a bit bewieldering, more so as it is meant for Flight Unlimited 2 users. I suggest first copying 3ds2e, and bsp to your thief work folder.

Now assuming that you have a 3ds model to import (or you could use this sample 3ds file, balloon, macdonalds, or teapot) I'll try to get some more suitable examples), launch a dos window, navigate to the work directory, and type in the following lines.

3ds2e <name of 3ds file + .3ds extension>
bsp <name of 3ds file + .e extension>

After doing this you will be left with a bin file, which is the native type that thief uses to import its files. To get your file into thief, create a sub directory under your installation directory called obj, and place the .bin file there. To get the file in dromed, create an object, and then edit its properties. Either add Shape, Model Name under the instance, or modify the Archetype (the one with the negative number).

I would suggest that you actually create your own archetypes rather than overwriting each objects settings locally as this will save time. This will involve saving your own gamesys, a 700kb or so file which you will then have to distribute with your level. To get this working, select File, Save gamesys, and then choose a suitable name. To get a level to use that gamesys, type 'set_gamesys name' without the game modifier, and then save your level normally. If done correctly, the dark.gam at the bottom should change to the name you selected. Remember to resave your gamesys every time you make a change otherwise it won't be there.

If all this goes to plan, you should have you first custom object in 3ds max. Unfortunately it is covered with Jorge. If when runing bsp you get a stack overflow error then you have a problem with the 3ds model. Usually, this is due to not assigning a uvmap modifier to the object

(Back to Top)

Size Matters

Both 3ds2e, and bsp have a number of command line options, which can be used to stop your object taking up the size of a city.. I shall attempt to give a brief description of what I think these commands do.
3ds2e only command line option is -v, and this lists a verbose listing of what the program does, though how useful this is I do not know.
BSP on the other hand has a lot more command line options, and the only ones I currently use are -s and -es. The first scales the object automatically, and the second shrink subobjects or something. I got this settings by canabalising a Flight Unlimited 2 helpfile, and the settings I use are -es.92 -s.0254 where the numbers seem to allow you to work in inches. It basically works out that a 100 units in max will give roughly 2.5 dromed units with this system on, and the defautly view initialisation is fairly intuitive. I recommend writing your own batch file, or you could use this one here. Simply type 'do filename' at the dosprompt.

To remove the Jorge texture from the objects, create a folder in the obj one named txt, and place your textures in there. Textures have to confirm to the usual standards. i.e.

The textures need to be 8 bit gifs, need to have the same palette as mappal.gif, and can only be rectangular or square with any combination of the following dimensions on a side: 1,2,4,8,16,32,64,128,256. So for instance, you can have a 32x256 texture map, but you can't have a 3x64, or a 128x5. If you want to have transparency in the texture, color zero will be transparent if you make the texture name begin with t_. So for instance "t_frank.gif" will show up in the model with color zero transparent. Color zero means the first entry in the color palette, which in mappal.gif is true black, (0,0,0) The 3ds model itself should be built in units of inches. We automatically scale it into the appropriate size for the game.

Once you have done this, your model should now have a texture once in dromed. Unfortunately, its palette has probably gone to high hell.

.(Back to Top)

Fixing the Palette

To fix the palette you need some of graphics editting package. I personally use paint shop pro. As the gifs in thief have an indexed colour system, you have to make sure that the indexes match up. I extracted a handy palette guide from one of the texture familys, and by using this, you can rectify the missing colours. (download the pcx file here, or the actual psp palette).

In paintshop pro, load up the each texture file, and then use load palette, and load the right one up. If you don't use psp, then you will have to save your palette manually from the pcx file.

.(Back to Top)

Objects Off-centre?

If when you import things into thief, they actual graphics seems to be off centre from the object box then this means that your 3ds model was not centred properly. I have just worked this out, and have gone through and re-addressed all my files.

To fix this, in 3d-studio, group the objects, and then right click on the move icon. This should pop up a dialogue box, in it, change the co-ordinates to 0,0,0. Then export, and bsp as normal. De-dah, no more off centre things.

.(Back to Top)