|
CTB, TEX and TXB files are used to define briefings and
credits screens, plus most of the text Descent uses (such as the menus and the cockpit
texts) are stored here.
- TXB files contain briefings, standard credits and text resources and are encoded.
- TEX files are the same as TXB files, but not encoded.
- CTB files contain custom briefings in Descent 2 Commercial V1.2 and are encoded.
Quick Index over the TXB specs:
Tools for briefing files:
Credits for this specs page:
- Everything written by Heiko Herrmann, except:
- En/Decoding CTB/TXB files section, written by Bryan Aamot.
- Macros for Descent 1 TXB files section, written by Timothy S. Singer.
- Macros for Descent 2 V1.2 TXB files section, written by ??? (I forgot this, I will research for the author of this).
- Exit sequnces in Descent 1 section, written by Lars Christensen.
- Page compiled to one document by Heiko Herrmann.
|
En-/Decoding CTB/TXB files (Descent 1/2)
|
Encode TEX files (which are normal ASCII files) to the TXB
files using the following algorithm (this means the same as rotating the value to the
right by 2 bits):
if (decchar!=0x0d)
{
if (decchar==0x0a)
{
encchar=0x0a;
} else {
encchar=((decchar&0xfc)>>2)+((decchar&0x03)<<6))^0xe9;
}
}
|
Decode TXB files back to TEX files using the following
algorithm (this means the same as rotating the value to the left by 2 bits):
if (encchar==0x0a)
{
decchar=0x0a;
} else {
encchar=((encchar&0x3f)<<<2)+((encchar&0xc0)>>6))^0xa7;
}
|
Here are some alternative algorithms that do exactly the
same:
TXB -> TEX (decode)
ch = (((code and 127) shl 2) + ((code and 192)
shr 6)) xor 167
code = (ch ror 2) xor 167
code = (ch xor 233) ror 2
CTB files are encoded using the same algorithm.
|
List of TXB files packaged with Descent 1/2
|
TXB files included in the DESCENT.HOG of Descent 1 Full Version:
| DESCENT.TXB |
Text resources |
| CREDITS.TXB |
Main D1 Credits |
| BRIEFING.TXB |
D1 briefings |
| ENDING.TXB |
End briefings of D1 Shareware
after Level 7 (not used in the Commercial version, but still packaged there) |
| ENDREG.TXB |
End briefings of D1
Commercial after Level 27 |
| LEVELxx.TXB |
As it seems only the bitmap
and the coordinate definition of the briefing screens for each level |
| END.TXB |
The subtitle for the end
movie (displayed when running with "-Subtitles") |
TXB files included in the DESCENT2.HOG of Descent 2 Full Version:
| DESCENT.TXB |
Text resources |
| CREDITS.TXB |
Main D2 Credits |
| MCREDITS.TXB |
Main D2 Credits for Mac
version (not used of course in the PC version, but also packaged there) |
| HELP.TXB |
Text displayed when running
with the "/?" command-line switch |
| ROBOT.TXB |
Robot descriptions (for the
briefings) |
| INTRO.TXB |
The subtitle for the intro
movie (displayed when running with "-Subtitles") |
| END.TXB |
The subtitle for the end
movie (displayed when running with "-Subtitles") |
|
How to make custom briefings in your missions
|
Descent 1 Commercial (any version) any Descent 2 Commercial
(V1.2 only) support the use of custom briefings screens in your levels. To create them you
can use any text editor to make TEX files and use all macros listed below. Then convert
them to TXB files using e.g. Bryan's TXT2TXB program, which can be found here (17 kB). You can also use HAMM, Yahoma
or BriefEd for a special TXB editor.
You should look at other TXB files first as a reference, e.g.
the original ones of Descent 1/2 and the ones from the Single-Player-Collections. Just extract
them using any HOG-editor (like Descent Manager).
To let Descent 1/2 use the TXB file do the following:
Descent 1
Name the TXB file as you want and put it into your HOG. Then add a line
"briefing=<name>" to your MSN file with <name> being the name you
chose for your TXB file without the extension.
Descent 2
Just name the TXB file like the HOG file, put it into the HOG file and it will be
automatically used.
In both games the whole briefing (of all levels) is included
in one file, you divide the levels using "$Sn" macros (see below).
|
Macros for Descent 1 Full Version TXB
|
In this document:
- <num> refers to a number.
- <name> refers to a file or texture name, without the
extension.
- <cr> refers to the Carriage Return character (0x0A in
TXB files)
- <tab> refers to a tab character (0x09)
When D1 encounters a '$', it looks at the next character and
decides what to do based on it (whenever I include <cr> at the end of the command,
Descent skips over any part of that line before the <cr> that is not a parameter of
the control code):
| $B<name><cr> |
Display <name>.BBM |
| $C<num><cr> |
Change color. Stable
colors are 0 (gray), 1 (green), and 2 (white). |
| $F<cr> |
Toggle the cursor-flash flag. |
| $N<name><cr> |
Display the texture
<name> as non-animating. If <name> is the exit door, then animate it. |
| $O<name><cr> |
Display the texture
<name> and animate it if possible. |
| $P<cr> |
Start a new page. |
| $R<num><cr> |
Display Robot #<num> |
| $S<num> |
Section #<num> |
| $T<num> |
Set tab stop at pixel
<num> from left edge of text window. |
In addition, a '\' just before a <cr> means
line-continuation. Descent will not start a new line for the text that follows.
This means you can switch colors on the same line!
Also, a ';' right after a <cr> means a comment.
Descent will not display the line.
If the characters overflow the right edge of the window,
Descent will start a new line. If the characters overflow the bottom edge of the
window, Descent will start a new page without waiting for a keypress. Finally, <tab>
advances to the tab stop when it is not past it, but the <tab> character does not
count as a character in Descent's eyes. In other words,
"\<tab><cr>" is the same as "\<cr>", and
"<cr><tab>;" is the same as "<cr>;". In either
case, the control code still works when the tab is inserted between the characters.
See main\titles.c in the D1 source code for the window coordinates,
levelnums and default backgrounds for each section.
Thanks to Timothy S. Singer for this
information.
|
Macros for Descent 2 V1.2 TXB files
|
Here is the macro list so far known for usage with Descent 2
TXB files. Note that you need V1.2 to view missions (V1.0 and V1.1 will just ignore
them...)
The TXB file has to be called like the MN2 name and stored
into the HOG file of the mission.
| $Sn |
Sequence number. This is just
the level number in D2! $S3 would link the following briefing text to be shown before
level 3! If you want a post-briefing after the last level, just add a $Sn, with n as the
number of levels +1. |
$D1 xxx.pcx
0 3 20 22 257 177
$Z xxx.pcx |
Defining the background
picture. The name of the picture shall not exceed 7 characters and needs to be saved in
320x200! Also be sure to add a 640x480 version with a "b" at the end of the
filename (e.g. END01.PCX and END01B.PCX!) |
| $F |
unknown (Toggling the
cursor-flash?) |
| $T 70 |
unknown (Setting tab stop
pixel?) |
| $P |
End of the page. Waits for a
user key and then clears the screen + stops the animations before continuing... |
| $Cn |
Color value (1-8). If you use
an animation on the current page be sure to set this BEFORE writing any briefing text. |
| $Rx |
Robot animation. x is one of
the following characters:
B Smelter
D Ice Spindle Defense Robot
E Bulk Destroyer
F TRN Racer
G Fox Attack Bot
H Sidearm
I Lou Guard
J Guide-Bot
K Internal Tactical Security Control Robot
L Omega Defense Spawn
M Internal Tactical Droid
N PEST
O Sidearm Modula
P PIG
Q Spawn
R Diamond Claw
S Seeker
T Bandit
U E-Bandit
W Boarshead
X Spider
Y Red Hornet |
|
Credit files for Descent 2 V1.2
|
In Descent 2 V1.2 you can also add a credits scroller at the
end of your mission. Just create a CTT file with the same name as your HOG, use any
text-editor to write the credits down and encode it to a CTB file using TXT2TXB. CTB files are of other structure
than TXB files. The first character of each line defines the look of this single line:
| * |
Blue color line |
| $ |
Big char size font. (Note:
don't write anything in the next line, it will be overlapped by this one otherwise). |
Everything else will be displayed in normal yellow colors.
Be sure to synchronize the text with the music, if
possible (e.g. make the text longer or shorter until it fits).
Good examples of CTB files are in all single-player-missions
listed on our DLN pages. Use them as a
reference... Also the Vertigo Series have a CTB file...
To use a custom background picture:
Add custom STARS.PCX (for 320x200) and STARSB.PCX (for 640x480) files to your HOG file.
Warning: This also affects the picture used when displaying the "level
destroyed" (the scoring screen) info.
To use your custom MIDI while
displaying the credits:
Add custom CREDITS.HMP (wavetable-soundcards), CREDITS.HMQ (FM-soundcards) and CREDITS.MID
(Win95-native-version of D2) to your HOG file.
To use another custom MIDI for the
"level destroyed" (scoring) screen, after the mission is solved AND a credits
file is available:
Add custom DESCENT.HMP (wavetable-soundcards), DESCENT.HMQ (FM-soundcards) and DESCENT.MID
(Win95-native-version of D2) to your HOG file.
There are two methods, one which use the original exit
tunnels from Descent and one where you make your own exit tunnel.
Method 1 - Using an orginial Descent tunnel:
In this method you use a exit tunnel from a original Descent level.
- Find a level in the original Descent I hog which has a exit
corridor that suits you. Extract the level (for example using the Descent Manager) and the TXB file which has the same
name as the level, i.e. "level4.rdl" and "level4.txb".
- Start Devil or DMB, select all the cubes in the exit
corridor, from the first cube after the exit door (the one that has the exit door as a
wall) till the last one containing the exit side (the last cube, the one that has the
little brown cross on one wall). Make sure that current side is the side in which the exit
door is, then make a macro or block of this corridor and save it.
- Load your own level and insert the Descent corridor where
you want your exit corridor. Place the exit door in the corridor, where the original exit
door was. Change the textures of the corridor according to your level. Save and exit.
- Now, rename the TXB file, so it has the exact name of your
level file. So if your level is called "mylevel.rdl", you should rename the TXB
file to "mylevel.txb". Mark the end of the corridor with 'Set connected
side/exit' in Devil or 'End of exit tunnel' in DMB.
- Place both files in your HOG file.
- Play, shoot down the reactor, escape and enjoy.
Method 2 - Making your own exit tunnel
You can alter more than the texture of the tunnels you use.
You can actually make you own exit tunnel. You can change the geometry of the tunnel, make
it wider, have rooms and have tunnels with other cross sections than the normal
square tunnel. All you have to do is to follow these simple rules.
- The escape path must always move from one side of a cube to
the opposite side. That is, you can't leave a cube in the up, down, left or right
direction, you can only pass strait through. If you violate this rule you will get no exit
sequence. You can twist the cube if you want to change direction.
- The last 4 cubes in your tunnel should be standard 20x20x20
cubes placed in a strait line. If you violate this rule, the ship might leave the tunnel
on the surface in a funny angle.
- You must enter at side 5 and exit at side 4 in the last cube
of the tunnel. If you violate this rule, the ship will emerge through the back, top,
bottom or side of the surface exit.
- You must include a TXB file in your HOG file with the exact
name of your RDL file. That is, to 'mylevel.rdl' you must include 'mylevel.txb'. You can
use one of the original TXB files from 'descent.hog' (level01.txb, level02.txb, ...). If
you do not include the TXB file you will get no exit sequence. If you have a bad format in
the TXB file, a assertion is generated. The contents of the TXB files as TXT is (my
comment does not belong in the file):
| moon01.bbm |
The texture that is to be
put on the surface. |
| lev01ter.bbm |
The elevation map. A
grayscale bmp. |
| 5,10 |
don't know |
| 1 |
don't know |
| earth.bbm |
The sky texture |
| 205,0 |
don't know |
| 200 |
don't know |
| 90,40 |
don't know |
- Remember to mark the side 4 of the last cube as 'end of exit
tunnel' or 'connected side or exit'.
- Place your RDL and the TXB file in your HOG file.
- Play, shoot down the reactor, escape and enjoy you own
homemade exit sequence.
Thanks to Lars Christensen for this
information.
|
FAQ - Frequently asked questions about briefings
|
Can the texts of DESCENT.TXB be
customized by just putting a new one into my HOG, so that I can assign new names and texts
e.g. for the weapons?
Unfortunately not. Adding the DESCENT.TXB to your HOG won't do anything. The only way to
change texts is to overwrite the TXB file in the DESCENT2.HOG (DESCENT.HOG for D1), but
then the change would be applied to ALL missions :(. Also just copying a new DESCENT.TXB
to the main dir (like some did with the DESCENT.SNG file for custom soundtracks) of D1/D2
does not seem to work with the DESCENT.TXB file. Only the one in the HOG is used...
Do I need to encode the briefings to
TXB? Can I also use decoded TEX files?
Yes, you can also add your briefing file as a TEX file. TEX files even have a
higher priority when you add both - TXB and TEX- to your HOG. The only reason why most
people are using TXB files, is that their briefings are not that easy editable or viewable
from outside. To hide what's happening in the later levels etc. Of course these still can
be easily hacked using any briefing editor or by just switching to the later levels using
the cheat codes ;-), but it still is a bit harder to do and it maybe also looks a bit more
professional...
Why are briefings not supported in
Descent 2 V1.0 and V1.1? How does the internal mission then call the briefings?
The reason for the first question is unknown. It just was forgotten, I think. To the
second question: well the internal mission is special handled by Descent 2. E.g. the intro
movies before level 1, 5, 9, 13, 17, 21 and 24 are also only called when using the
original Descent 2: Counterstrike mission. This is just hard-coded into the program, you
can't call these functions when using your own HOG...
Descent 1 used the software renderer
for displaying robots in the briefings, Descent 2 pre-calculated movies. Now I want to
display my own robot, created e.g. with Polytron. Can I somehow switch on the
software-renderer in D2 for briefings again?
Unfortunately no. To display your robot anyway, you can make a screenshot of it (e.g.
using PMView) and integrate it into your
briefing pictures. That was the way Razor Blade has used for his Phobos Encounter. Of course it is not animated (e.g.
rotating) then...
Can I display an exit sequence in
Descent 2 as in Descent 1? Can I use a custom MIDI when displaying the briefings in
Descent 2? Can a secret level have briefings in Descent 2?
Same as above: no, unfortunately these functions were removed out of some
(unknown) reason in Descent 2...
How can I display the exit sequence in
Descent 1 in my custom mission?
Look at the section "Exit Sequnces in Descent 1".
How can I use a custom MIDI in the
briefings in Descent 1?
Convert your MIDI to a HMP (HMQ for FM-soundcards) using DTX, then name the file
"BRIEFING.HMP" (BRIEFING.HMQ for FM-soundcards) and add that file to your HOG.
You can only define one briefing music, it is the same in every level of your mission
then.
How can I do end briefings (briefings
that are displayed after the mission has ended)?
Descent 1: The ending briefings are to stored in a different TXB
file and to be defined in the MSN file with the keyword
"ENDING=<filename_without_extension>".
Descent 2: The section "$Sn", where n is the number of levels in
that mission +1 (secret missions not counted) defines what happens after the end of the
mission. You can even attach custom credits using a CTB file; if available, they are
displayed AFTER the end briefings.
How do I use custom background
graphics in my briefings?
Descent 1: Add the graphics as PCX files in 320x200x256 and use the names
and use the names Descent 1 has used in that order (brief01-03.pcx etc.). AFAIK there is
no way to use own orderings or e.g. more than 4 briefing graphics before level 1.
Descent 2: Descent 2 is more friendly here. You can use whatever and how
many PCX files you want before every level (except secret ones). Use the commands
"$D" and "$Z" to define what graphic to be displayed. The name of the
PCX file has to be maximal 7 chars long (instead of the normal 8 of DOS). Add your graphic
twice: once as <name>.PCX in 320x200x256 and once as <name>B.PCX in
640x480x256 (that's the reason for the 7 chars limit). E.g. add MYGRAPH.PCX and
MYGRAPHB.PCX to the HOG to support both VGA and SVGA modes in the briefings. If you forget
to e.g. add the VGA graphics, Descent 2 will crash when trying to run the mission in that
mode. Parallax actually forgot to put in the VGA-versions in their Vertigo Series, so
people using the VGA-menu-interface get a crash (back to DOS!) when trying to open the
Vertigo levels.
How can I find out which number in
"$Cn" does mean which color?
Actually this is very tricky to find out. Just try-and-error. However -to make it
worse- D2Voodoo/D2_3Dfx use other colors as standard Descent 2. If you have both versions,
be sure to test your settings in both...
|