Too Cool for Internet Explorer

Menu:

Decoding Ultima IX

Created: 2005-12-29 19:24 - 0% Done
Last edited: January 11:th 2006
  • Edited anim.flx fileformat. That is now almost done
  • Edited sdinfo.flx fileformat.
  • Edited Ankh.pal description.
This is something I have been working on since my QB45 days. I have writen several apps that decode the flx files and found quite alot of stuff. This all started thanks to TumbleWeed Dragon (aka John Larcombe) and his Ultima 9 fileformat files. After I had a long break from my reasearch I returned to discover that those files where gone and where not to be found anywhere on the net. Luckily I had them tucked nicely away in some old folder on my computer. So I started anew and get really serious this time. So why decode the fileformats of Ultima 9. Why not, I say. First of all, I am very fond of the Ultima series and wanted to contribute to it. Ultima 9: Assention being somewhat of a black sheep almost noone has botherd to look at how it was made. And when I found that there was traces of the old engines and maps inside the game, my curiocity just grew. If there is something I love it is hidden stuff of old stuff in games. So I set out to give the comunity a view of how Ultima 9 might have looked like had they it not been given the deadline of horror and unforgettfull doom. Here is a guide to the different files that are in the directories of the game, what they are for and how they are structured. At every file I will give you the file that TubleWeed has composed of the format, and if I have found anything I will show my updated version of the fileformat. Hopefully TumbleWeed will not mind me puting his files out on the web, if that is not the case, I will remove them directly and write my one with his as a refference.

flx format

Before you read on tho, you might want to look at how the flx files are structured. Flx is a pak file format that Origin has used for the Series for some time now. So the basic structure is well known to the community.
Tumbleweed's file

runtime:

Contains all the starting data for all things that are movable in the game such as objects and NPC's. Infact that is the only things that are precent in that folder.

nonfixed.[nr]

This is where the object data for each map is stored. Data like X,Y and Z coordinates and direction. The [nr] value in the filename indicates what map it belongs to.
Tumbleweed's file

npc.flx

Contains information on all the npc's on the different maps.
Tumbleweed's file

savegame:

In here you have the different savefiles of the game, obviously. Here you will also find the current diary for the last loaded savegame. Conveniently named diary.txt.
Tumbleweed's file

sound:

Here you will find all the sound data for the game. These files are somewhat unknown as I have not found much info on them and I have'nt looked into them yet.
All the sound files follow this format:
Tumbleweed's file

music.flx

Contains the music in the game. Supprised, eh?
List of music files

sfx.flx

All the different sound filed used in the game. Stored in 3 different sound formats just to make life simpler for all of us. Might be due to the different rewrites U9 had.

sfxassoc.flx

There is no info on what this file is used for. However, one can guess by looking at the filename. IMO it contains associations to something of some kind. This will be looked into more in the future.

sfxcat.flx

Juding from the name, this contains the different categories of sound there are. I do not know for what purpose it serves, perhaps it was there to make the life easier for the developers.

sfxenv.flx

This seems to contain sound settings for the sound so you get cool stuff like echos in hallways and such. This will be fun to experiment with later on :D.

sfxtmpl.flx

Seems to contain data telling the engine what sounds to use at different events such as when a door is opend or closed.

Speech.flx

I am guessing that this is the sound files for the speech in the game... But I might be wrong... It has happend.

static:

Contains all the fixed data in the game such as unmovable objects, terrain and text. It also seems to be the scripts for the game that I am very interested in finding.

activity.flx

I am guessing by glancing inside the file and looking at the name that this are settings for when you enter a certain area, such as what script to use and what sounds/music to play.

anim.flx

This is where all the animations are stored. I spent a full day decoding this file and finally got some mighty fine fruit in the end! A very interesting piece of information contained in this file is that it showes where they stored the files in their origingal form. I have included a list of all the original locations of the animation files for your viewing pleasure. :D
Tumbleweed's file My file Animation list

ankh.pal

This is a palet containing 256 colors stored as DWORDS, probably used for the 8bit bitmaps. Due for testing.

areas.flx

The data in these seemes to be slightly random. But I have found occurences of some things a number of times. This a good indication of some sort of script file, YAY! So I guess it's a file containing the scriptfiles for different areas.

bitmap16.flx, bitmapC.flx, bitmapsh.flx

These are the files containing texture data for the game. This I have looked into quite alot and made a nice little script in PHP and GTK where you can look at them. These are stored in either 16-bit, 8-bit or compressed depending on the flx file. I have only looked inte the 16-bit file (bitmap16.flx) and have to my horror discoverd that the images are stored in two different ways and there is no way in the file that tells you which one of them it is. It is like this, you can store 16-bit color data in two different ways since you have 16 bits to work with that is not devidable by 3. So you can either skip one bit and use 15 bits, 5 for each color channel (Red, Green and Blue), or you can give one of the three channels one extra bit. This is normaly given to green since the eye sees green better than the outher colors. Now, U9 uses both of these ways. After much hair pulling and sleepless nights I finally found how the engine knew what colormode to use. It was stored in another file for some weird reason. Probably due to backwardscompatability with the older engine's textures. I will release a bitmap viewer as soon as I have learnt enough java to make one (PHP is way to slow. :D)
Tumbleweed's file

books-en.flx

Contains all the text for the books in the game. I think that there is one for each language in the cd that are installed depending on what language you choose. Nothing unordinary with this file. Just text with some font settings. It also contains the data for the shops. Things like shop inventory and prices. Very easy to edit. It even contains a file that describes how it works in one of the subfiles. Now that very nice of Origin to do that. :P
Tumbleweed's file

dimension.dat

Some sort of binary format. Hoping script file but you never know.

fixed.[nr]

Contains data for fixed objects in the game. The [nr] is the map nr.
Tumbleweed's file

highway.dat

Another binary file whith unknown purpose. And also with an od name for a fatasy RPG...

Mbrk.(br/fn/ns/vl)

Different language files for the misctext.flx file. So they are infact flx files in desguise.
(See misctext.flx for fileformat)

misctext.flx

Just what the name says. Misc text that is not speech or books. It is the text that is displayed when you try to open a locked door or stuff like that. Would be fun to play with.
(Uses same format as text.flx)
Tumbleweed's file

rgbccube.dat

Looks like an flx file in the hex editor. I guess it contains some color data or something. Perhaps palet data for the 8-bit textures. Will be checked.

sappear.flx

Yet another script-like file. And this is a big one. 75,4 MiB in total. Must be the main script file if that is the case. But I might have it all on the wrong foot. It can also be the illusive file containing the Model data. That would be just lovely!

sdInfo(16/C/).flx

Contains some of the header info from the bitmap files with the addition of what 16-bit color mode to use. I am guessing it is easier to just load this data into memory then the great big texture files.
Tumbleweed's file My file

shade.tbl, shadegry.tbl

Unknown format. Unknown usage. What more is there to say... at this point at least.

Tbrk.(br/fn/ns/vl)

The forreign versions of the text.flx file.

terrain.[nr]

Is contains the terrain data. This is very well documented by TubleWeed. And as before the [nr] stands for the map nr. Nice to note is that the old maps from the time when the deadline of doom was laid upon U9 are still there for our viewing pleasure. And you can also find the E3-demo map there! Thanks Origin! This will be great fun to play with once I make the right tools. ;D
Tumbleweed's file

text.dat

Somewhat related to the text in the game. How and why is still not known.
Tumbleweed's file

text.flx

Contains all the dialog text. Plain and simple!
Tumbleweed's file

Texture(8/16).(9/14)

This is very confusing. These are other files for storing textures. And the numbers 9 and 14 are the mapnrs for the Britain map and the map for Avatars house on earth. I dont know why but perhaps its the only texture files that are needed. Will be nice to test.
Tumbleweed's file

Tnbrk.(br/fn/ns/vl)

This is the forreign versions of the typename.flx file.

treedat.flx

Data for some tree structure I guess. For what and why is yet to be discoverd. Perhaps for the editor that Origin used.

triggers.flx

This file has to contain some script data. The name is just to perfect. Must be some sort of subrotines or something. Will be hard to find out but it has been done before with GTA3.

typename.flx

It contains all the names of the different objects and stuf that can have a name, like npc's. It also contains some additional data.
Tumbleweed's file

types.dat

The guess is that it contains data for each type of object or item in the game.
Tumbleweed's file

yiqccube.dat

Well this seems to be some other pallet type thing. Yet again I do not know exactly what its for. Hopefully all that will become apparent in due time.

Ultima XI root dir:

Well, I wont list all the files here since some of them are not important right now. But here are some nice files to play with.

00000409.(016/256)

A 16-bit and 256 color bmp file that is displayed when the game is loading. Makes for fun editing I bet. :D

Default.kmp

The default keymap used in the game. This is where you insert various cheats that you might find.

gamestate.ini

Now this is not here from the begining but it is a nice file to have if you want to explore the various maps that was left from olden times. There is a nice tool that TubleWeed has made that makes it a bit easier to configure it. It is a bit buggy ATM. But I will try to make one that is more stable sometime.

Options.ini

If you are one of those that are to l33t for your own good and dont want to configure the game at runtime, you can edit the values in this file. Alltho I think there are some options that the game does not let you set are in here to. So its worth a look.
That concludes the guide as of now. I will keep updating it as time permits and as new stuff is discoverd.
Hope you learnt something from this and if you would like to help me in my effort feel free to tell me so. It is a great task for only one man.
I would like to thank TumbleWeed Dragon for his efforts without wich this would not be possible.

Related Projects:
N/A
©2005 Martin Hultén Ashauer