File Formats
Gamestudio and lite-C support numerous file formats for importing and exporting
artwork and data.
!! All file names that you're using should be kept short (texture and skin names in WAD and MDL files are limited to 15 characters) and must not
contain any special characters except "_" or "+".
Never, ever, use spaces in your file or path names! Many import
filters will not find texture files when they have spaces or exotic characters
in their name.
In the following
you'll find specific information about the
formats supported:
Image files
Image files are used for importing
textures
,
model or terrain skins, terrain heightmaps, sprites, bitmaps and fonts,
and for exporting screenshots.
Supported image formats are PCX, BMP, TGA, DDS, PNG, JPG,
and WAD. All formats
have their specific advantages and disadvantages.
- BMP and PCX 256 color (8-bit palettized)
images for low quality textures are supported for compatibility reasons.
All 256 color images must share the same color palette per level, given in
WED Map Properties. The first color of the palette (color #0) must always
be black, the last color (color #255) must always be white.
Due to the many
restrictions and requirements, we do not recommend to use 256 color images
- especially for beginners who don't know about handling color palettes.
- BMP and PCX true
color
(24-bit
RGB) images are used for medium quality textures. They are internally
stored in either 16-bit high color or 4-bit compressed
format, depending on d3d_texdepth. PCX is
preferable as it's a compressed format and files sizes are much smaller than
for BMP images.
- TGA true color (24-bit RGB) and true
color
alpha
(32-bit
ARGB) images are used for high quality textures. They are internally stored
in 16-bit high color or 32-bit true color, depending on the setting of d3d_alphadepth.
32-bit ARGB images contain an alpha channel which gives a transparency value
for every single
pixel.
For
creating
an alpha channel in Photoshop, open the channels window, and click
onto the small "new channel" button below. Now an alpha channel
is created, and you can paint onto it. When saving the picture, use the 32
bit TGA format.
- DDS images are used for medium/low quality textures when
video memory must be economized. They are supported in the DXT1..DXT5 sub-formats
with included mipmaps. DDS uses a compressed 4-bit texture
format for saving memory at the expense of image quality. DXT2..DXT5 textures
contain an alpha channel and are treated as translucent by the engine.
Due
to their compressed content, DDS bitmaps
can not be altered by image manipulation
functions (like pixel_to_bmap), can not be used for textures
that contain several separate images (like animated sprites or sky
cubes),
and are not displayed by the older GXL libraries in the WED and MED editors.
They can be created with the DirectX Texture Tool, with a Photoshop Plugin,
or with ATI's Compressonator.
- JPG images are supported for bitmaps, but are
not recommended
for realtime games due to their slow loading, high
video memory consumption, and bad quality compared to other
formats.
- WAD files are image collections containing several
BMP, PCX, TGA, or DDS images,
with names and included mipmaps. They are imported in WED and used for level
textures. As DDS images are not displayed by WED, they appear
as blue squares in the
WAD preview.
Some considerations about transparency:
-
All image formats that contain an alpha channel - 32 bit TGA, or
DXT2..DXT5 - are treated as transparent by the engine, even if the alpha
channel is totally opaque and even if you don't know what an alpha channel
is. Transparency has consequences for sorting and rendering, so never use
an alpha channel texture for an object that you don't want to be transparent.
- Images without alpha channel can
be used for overlays with
transparent parts.
Overlays are sorted like opaque textures. In overlay images, black parts
(RGB == 000) are totally transparent, the rest is totally opaque. For nontransparent
black
use a RGB color value of 8 or above. If d3d_autotransparency is
enabled, the transparency color is taken from the upper
left pixel of the
image. This way an arbitrary color can be used for transparency, avoiding
the dark seams around intransparent parts that are otherwise caused by
black pixel antialiasing.
Restrictions apply to image sizes:
- 3D cards have a texture size limit
-
mostly 4096, 2048, or 1024 pixels in every
direction. For supporting all 3D cards,
don't use bigger bitmaps than 1024x1024, except for images
containing several frames (for animation or sky cubes), or images with
mipmaps. The
next-lower mipmap is then automatically used when a 3D card does not
support the
image size.
- 3D cards can not render arbitrary texture sizes. Often they require power-of-2 texture sizes (32, 64, 128, 256, 512, 1024...), like 64x128 or 128x512.
All other sizes
are
automatically
'padded'
by the engine to the
next power of 2, at cost of video memory, performance,
and image quality.
In some cases, f.i. for tiled textures, invalid sizes
are not possible at all. So always use power-of-2 sizes for level textures
and terrain or model skins.
Only for sprites and panels it might make sense to use different sized
textures.
Video files
Video files are used with the media_play functions
and can be played on the screen or on a texture. There are specific video formats
like MPG, DIVX or QTW, and
meta-formats like AVI. MPG files, or AVI files
with
MPEG coding can normally be played on every computer. Special
format like DIVX or Quicktime require their
filters to be installed, so they have to be included in the distribution. Check
the required license conditions
before
including such filters in your game.
Sound files
Sound files are used by the media_play and snd_play functions,
as well as for sound sources in the level. WAV, MID, OGG,
and MP3 files are
supported.
- OGG is the recommended format for snd_play and
sound
sources.
It uses Gamestudio's internal OGG player. OGG can also be used with media_play, however an media player OGG filter
(installer included in Gamestudio) must then be distributed with the game
and installed on the target machines.
- WAV and MID work
everywhere, but WAV is large in
size and MID low in quality.
- MP3 requires a license
fee and thus is not recommended
for low budget games.
Script and Effect files
Script and effect files are plain text files with the extension WDL for
scripts, and FX for shader and effect definitions.
FX files contain a standardized language (HLSL),
so external FX files can be used by
just adapting variable names. Shaders and effects can also be contained in
script material definitions, or in models.
3D files
MED
and WED
can import models in many 3D formats:
FX,
3DS, X, ASE,
OBJ, MDL, MD2, ASC,
and Milkshape.
Additionally, terrain can be imported from heightmap images.
Further formats are supported through MEDs own import/export filters and through
Milkshape import/export
filters that can be directly plugged in MED.
- 3DS, ASE, and
OBJ files contain nonanimated
models with multiple meshes and materials, and are supported by almost all
3D packages. Some 3D editors do not use
transparency
and
set the alpha value at zero, so after importing check the material alpha
setting. Using a list of 3DS files, vertex animation can
be imported. 3DS models can also be exported for using
them in external editors.
-
FX and X files are models with multiple meshes and materials
plus bones or vertex animation.
The recommended format for importing complex models and levels is the FX format that is exported by all major editors. Unfortunately, FX as well as X bones animation suffers from inconsistencies, resulting from different versions of coordinate transformation systems (even within the same file). The importer tries to resolve the problems. For reasons that are the secret of the FX developers, the FX format exists in a 2005 and 2006 version that are incompatible and can not be detected automatically. So you have to try both if you don't know which format version your editor exports.
- Milkshape is a popular model editor that supports many
formats through external filters. Milkshape filters can be used by MED,
and models in Milkshape
ASCII format can be directly imported, including bones animation.
- MDL and MD2 files are vertex animated models with a single texture, used
for the Quake game series by id software.
- ASC is a nontextured mesh format for importing raw 3D
data.
Gamestudio files
Gamestudio's editors produce several internal files for images, levels, models,
and terrains (see also Entities
and Internal File Formats):
- WMP files are created by WED and contain the level lighting, textures and
geometry, plus references to additional files for models, terrain, sprites,
and sound
source.
Once
they
are compiled they become WMB files that can be read by the engine.
- WAD files are created by WED and contain texture collections.
External WAD files from Quake and Halflife can be imported.
- MDL files are created by MED and used for animated models.
They support bones and vertex animation, multiple meshes and textures, materials
and shaders. They are not identical with Quake MDL files,
although the engine also accepts models in the Quake
MDL format.
- HMP files are created by MED and used for terrain. They contain the height
values and the terrain textures.
► latest
version online