Data file formats

This is the reference for every file format the game reads: what each file is, when the game loads it, its exact layout, its limits and what happens when it is missing or broken, for the PC port of Carnivores: Dinosaur Hunter HD. Everything was checked against the files of the Android release 2.0.1 (the data the PC port extracts from your APK). Where the meaning of a value is not known, this page says unknown.

The catalog of the actual files (which dinosaur uses which files, which files are safe to replace) is The game's files. How mods are installed and ordered is in Mod folders, load order, file mods; adding new species, weapons and maps (instead of replacing the game's) is done with content packs.

Contents

  1. How the game finds files
  2. Units and coordinates
  3. Text files: the common syntax
  4. Characters (.cat)
  5. Models (.3dn)
  6. Animations (.ani)
  7. Textures (.tga, .pkm, .crt)
  8. Sounds (.wav)
  9. Maps (.man)
  10. Map resources (.rst)
  11. Map textures, sky, water and fog
  12. Weapons and the hunter's hands
  13. Other 3D assets: hunter, ships, compass, particles
  14. Fonts (.fnt, .fnthd)
  15. Localisation (strings.csv)
  16. Menu and HUD art (sprite .cfg)
  17. Shaders (.vsh, .fsh)
  18. Other files
  19. Limits
  20. Missing and broken files
  21. Compared with the 1998/1999 PC games
  22. How to: checklists

Conventions on this page: all binary numbers are little-endian (except inside the PKM header, which is big-endian); int32 / int16 are signed, uint8 / uint16 / uint32 unsigned, float32 is an IEEE single. Offsets are in bytes from the start of the file or record.


How the game finds files

Asked for Tried in this order
a texture name.tga (every texture request) name.pkm, name.tga, name.crthd, name.tga, name.crt, name.tga - so effectively .pkm, then .tga, then .crthd, then .crt
a font name name.fnthd, then name.fnt
an image name read as pixels (grass mask) name.png: if it exists the load fails (PNG is not decoded); else name.tga

The first rule matters for texture mods: a .tga never replaces a game texture that ships as .pkm (see Textures).

When files are read. Files are read when the game needs them; most are kept in memory afterwards. Changing a mod takes effect the next time the game loads the file:

When What is loaded
Game start (engine) the shaders, strings.csv, user_privacy_config.json, the .tag check files
Game start (once, after the engine) fonts; the sprite .cfg files and the textures they name (menu and HUD art); vignette_screen, binoculars, photoframe, particle, white, compas textures; the hunter's dead body hunter1.cat, the ships ship2a.cat / sship1.cat, the supply bag bag1.cat, the ambient creatures mosh, gall, dimor2, ptera, dimet, brachi1 (.cat with their models, textures, animations, sounds); the decoy calls call<N>_a/b/c.wav; the muzzle flash; the hunter's step, water, bush and death sounds; the photo camera sounds; the menu music
Each hunt (loading screen) the map (.man, .rst and everything the .rst names), the hunted species' .cat files, the chosen weapons' .cat files; they are unloaded when the hunt ends
Trophy room trophy.man / trophy.rst and the .cat of every trophy's species

So: menu art, fonts, texts and the always-loaded creatures change after a restart; maps, hunted dinosaurs and weapons change at the next hunt. Textures and models are shared by name while loaded (a second request for allo.3dn reuses the loaded one).

Text encoding. All text files are single-byte Windows-1252 (Latin-1 plus the 0x80-0x9F punctuation); line ends may be CRLF or LF.


Units and coordinates

These conventions hold for every format below (and for the Lua API, which uses the same world units).

Quantity Value Where it comes from
World unit 1/128 metre (128 units = 1 m) the binoculars show distance / 128 as metres; the hunt statistics count the path / 128 as metres
Terrain cell 256 units = 2 m .man layers are per cell
Map size 1024 x 1024 cells = 262144 units = 2048 m per side
Height step 64 units = 0.5 m ground height = heightmap byte x 64; 0..255 gives 0..16320 units (127.5 m)
Water level, fog altitude x 64 units (same steps as the heightmap) .rst [water] level, [fog] altitude
Hunter's eye 256 units above the ground (2 m); 180 under water the camera height while walking
View distance 76 cells = 19456 units (152 m) fog distances in the .rst are fractions of it
Time seconds animations: frames per second (kps)

Axes. +Y is up. The map lies in +X and -Z:

cell x = X / 256          (0..1023, X from 0 to 262144)
cell z = -Z / 256         (0..1023, Z from 0 to -262144)
ground vertex (x, z) = (x * 256,  height[x][z] * 64,  -z * 256)

Map layers are stored [x][z]: byte offset x * 1024 + z (low-resolution layers x/2 * 512 + z/2). Viewed as an image with the first byte at the top left and rows going down, a layer lines up with the in-game area map picture: rows = cell x (top = 0), columns = cell z (left = 0).

Compass. On the area map picture and in the .rst bound keys: north = top = -X, south = +X, west = left = +Z, east = right = -Z.

Angles.

Who Unit Direction it faces / walks
The hunter (rot.x), .rst birthplace alpha degrees forward = (sin h, -cos h) in (X, Z): 0 = east (-Z), 90 = south (+X), 180 = west, 270 (or -90) = north
The hunter's pitch (rot.y), birthplace beta degrees look up / down
Creatures (heading alpha) radians forward = (cos a, sin a) in (X, Z): 0 = south (+X), pi/2 = west (+Z), pi = north, 3pi/2 = east. Creature alpha = hunter heading - 90 degrees
Map objects 90-degree steps 2 bits per cell in the flags layer

Model space (what is inside a .3dn / .ani): the files use the 1998 games' left-handed axes and the loader negates X when it reads them.

Model In the file Scale at load / draw
Creature +Y up, feet at Y = 0, the creature faces -Z, file +X is the creature's left side x 1; drawn x (scale0 + random x scaleA) x 64/55 (scale0, scaleA: per-species values built into the game)
Map object +Y up, base at Y = 0 x 2 at load (1 model unit = 2 world units)
Weapon (with hands) camera space: origin at the eye, +X right, +Y up (negative = below the eye), +Z forward x 1
Supply bag as a creature drawn x 2

Faces are counter-clockwise seen from outside in file coordinates read as right-handed (the normal (b - a) x (c - a) points out; checked on the shipped models). The loader mirrors X and reverses the order, which keeps them facing out. Back faces are culled unless the face is double-sided (flag 1).


Text files: the common syntax

.cat, .rst, the sprite .cfg files and the .fnt fonts are read by the same simple word splitter:

The last two rules are the usual cause of broken mods: an unknown key with two values (foo = 1, 2) or a value with a space shifts every following key by one. The shipped .rst files contain keys the game does not read (shadow_circle_radius, [fog] color, distance, density ...); they parse correctly only because each has an odd number of tokens (a three-number colour is one skipped value plus a skipped "key, value" pair).


Characters (.cat)

What: a creature, weapon or vehicle: which model, which animations, which sounds, and which sound plays with which animation. Text file, characters/<name>.cat. The .cat holds no behaviour: health, speed, size, senses and the AI are built into the game (and can be changed with content packs).

Who loads it: the game, by fixed names: at game start for the always-loaded characters, when a hunt loads for the hunted species and the weapons (table).

Layout

carnivores_character            <- header word (skipped)

[general]
title = MyDino                  <- not used by the game
model = mydino.3dn              <- model file, with extension

[animations]
count = 3
animation_id 0
    file = mydino_walk          <- mydino_walk.ani (no extension here)
    sound_index = 0             <- optional: sound slot played with this animation
animation_id 1
    file = mydino_run
animation_id 2
    file = mydino_die
    sound_index = 1

[sounds]
count = 2
sound_id 0
    file = mydino_step          <- mydino_step.wav (no extension here)
sound_id 1
    file = mydino_die
Section Key Value Notes
[general] model file name with extension must end in .3dn; max 31 characters
other keys one token skipped (title is one of them)
[animations] count 0..64 number of animation slots used
animation_id 0..63 selects the slot the next keys fill
file base name <file>.ani; max 31 characters
sound_index 0..63 sound slot played when the animation starts; slots without it play nothing
[sounds] count 0..64 number of sound slots used
sound_id 0..63 selects the slot the next file fills
file base name <file>.wav; max 27 characters (".wav" is appended in a 32-byte buffer)

Ids and counts are not range-checked: an id of 64 or more writes outside the tables (memory corruption). Slots are loaded 0 .. count-1; a slot without a file has an empty name and fails to load (logged).

How sounds attach to animations. When the AI switches a creature to animation n, it plays sound slot sound_index[n] from the creature's position, if the hunter is within the sound's range. Weapons play the sound of their animation when the weapon changes state (draw, fire, holster, reload). The range of a creature sound is set by the game per species and sound slot, not by the file: max distance 7680 units (60 m) by default, up to 30720 for roars and calls; the min distance (full volume) is 0.2 x max. Sounds of the ships and the supply bag are played by slot number. So keep the slot order of the game's .cat when you replace a character's sounds.

Animation slots are chosen by the game: each species' AI uses fixed slot numbers for walk, run, idle, eat, die, sleep ... A replacement .cat must keep the same number and order of animations as the game's file. The slots of every species are listed in The game's files.


Models (.3dn)

What: a static mesh: points, triangles with texture coordinates, and the name of its texture. Used for creatures, weapons (with the hunter's hands), map objects, vehicles, the compass, the muzzle flash and the sky sphere.

Who loads it: the game, when a .cat names it (model), for the map's [objects] (scale 2), and by fixed name for sky_sphere.3dn, compas.3dn, muzzle_flash.3dn. A model already loaded under the same name is reused. The texture is loaded at the same time.

Layout

Offset Type Field Notes
0x00 int32 pointCount (V)
0x04 int32 faceCount (F) at most 21845 (see limits)
0x08 int32 boneCount (B) skipped by the game; B bone records follow the faces
0x0C char[32] texture base name, NUL-terminated, max 27 characters; ".tga" is appended and the texture rules apply; empty = no texture
0x2C int32 hasSprite not 0: a char[32] sprite name follows; skipped by the game (shipped objects name <model>_sprite)
0x30 (0x50 if hasSprite) point[V] points 16 bytes each
... face[F] faces 52 bytes each
... bone[B] bones 48 bytes each; ignored

Nothing after the faces is read; the shipped files end exactly after the bone records.

Point (16 bytes)

Offset Type Field Notes
0 float32 x model units; negated at load
4 float32 y up
8 float32 z
12 int16 owner ignored (a group or bone number of the modelling tool)
14 int16 hide ignored

Face (52 bytes)

Offset Type Field Notes
0 int32 x 3 a, b, c point indices (counter-clockwise from outside, see axes)
12 int16 x 6 ua, va, ub, vb, uc, vc texture coordinates, interleaved per corner. 0..255 spans the whole texture whatever its size (the shader multiplies by 1/255); v = 0 is the top row of the image; values outside 0..255 repeat
24 uint32 flags see below
28 24 bytes - skipped; mostly zero in the shipped files, meaning unknown

Face flags used by the game:

Bit Value Effect
0 1 double-sided (drawn from both sides)
2, 3 4, 8 the face is ignored by shots and collision traces (leaves, glass, see-through parts)
4 16 instant kill: a shot that hits this face kills the creature at once (the T-Rex's eyes, the Pachycephalosaurus' head ...)

Other bits occur in the shipped files (32, 64, 128 ...) and have no effect in this game. Transparency is not a face flag: world models cut out texels whose alpha is below 0.6.

Bone (48 bytes, ignored by the game): char[32] name, float32 x, y, z, int16 parent (-1 = none), int16 unknown.

Notes


Animations (.ani)

What: one vertex animation: every point of the model, for every frame. One file per animation slot of a .cat (and muzzle_flash_fire.ani for the revolver's flash).

Layout

Offset Type Field Notes
0x00 int32 kps frames per second
0x04 int32 frameCount (N)
0x08 int32 pointCount (P) must equal the model's V
0x0C int16[N][P][3] frames x, y, z of each point, in 1/8 model units (value / 8), x negated like the model's

File size = 12 + N x P x 6 bytes (true for every shipped file).

Timing

Errors


Textures (.tga, .pkm, .crt)

Who loads them: the game, by name. Every request names a .tga (models append ".tga" to their texture name, sprite files and .rst keys too); the fallback order then picks the first existing file of <base>.pkm, <base>.tga, <base>.crthd, <base>.crt. The format is chosen by the extension of the file found.

Consequences for mods:

All textures: linear filtering, no mipmaps, repeat wrap. Sizes: use powers of two (64 ... 2048; the shipped ones are all powers of two). The GL ES 2 rules allow repeat only on power-of-two textures, so other sizes can render black on some drivers.

Logical size. The game treats every texture as half its pixel size (width / 2, height / 2): an HD texture stands in for a 1998-size one. Sprite coordinates and atlas tiles are given in these logical units (see sprites).

TGA (.tga)

Standard Truevision TGA, read field by field from the 18-byte header:

Supported Not supported
image type 2 (true colour) or 3 (greyscale), uncompressed RLE (types 9, 10, 11), colour maps (type 1)
8 bits (greyscale, uploaded as luminance), 24 bits (BGR), 32 bits (BGRA) 16 bits (rejected)
bottom-up (descriptor bit 5 = 0) or top-down (bit 5 = 1) right-to-left (bit 4 is ignored)
a TGA 2.0 footer (ignored) an image ID field: idLength must be 0 (the ID is not skipped; pixels would be read from the wrong place)

8-bit images are uploaded in file row order (not flipped); 24/32-bit images are put top row first. Alpha of 32-bit textures: world models cut out texels with alpha < 0.6; sprites and fonts blend.

PKM (.pkm): ETC1

Compressed RGB, no alpha. The 16-byte header:

Offset Type Field Notes
0 char[4] magic 50 4B 4D 20 ("PKM "); anything else is rejected
4 char[2] version skipped (shipped: "10")
6 uint16 BE type skipped (shipped: 0 = ETC1 RGB without mipmaps)
8 uint16 BE width padded width (multiple of 4); used
10 uint16 BE height padded height; used
12 uint16 BE original width skipped
14 uint16 BE original height skipped
16 ETC1 blocks (width / 4) x (height / 4) x 8 bytes, block rows top first

Tools that write ETC1 .pkm files (for example etc1tool from the Android SDK) produce this layout. On PC the blocks go to the driver as ETC1 (OpenGL ES context) or as ETC2 (desktop OpenGL fallback: OpenGL 4.3 or ARB_ES3_compatibility).

CRT (.crt, .crthd, .crtlm)

Tatem's own raw format (.crthd and .crtlm are read the same way; only .crt is shipped):

Offset Type Field Notes
0 uint16 width pixels
2 uint16 height
4 uint8 bpp 8, 24 or 32; with bit 7 set (0x98, 0xA0): PVRTC 4 bpp
5 pixels top row first, R G B (A) byte order, no padding: width x height x bpp/8 bytes

PVRTC variant: after the bpp byte an uint32 data size, then the PVRTC data (RGB if bpp & 0x7F = 24, else RGBA). PC drivers do not decode PVRTC; the one shipped PVRTC file (trophy_sprites.crt) is not used. Other bpp values create an empty texture without an error.

A CRT is the easiest format to write from a script: 5 header bytes and raw RGBA. Example header of a 256 x 256 RGBA file: 00 01 00 01 20.

PNG, JPG

Not decoded by the game. (Help/*.png and Help/hud_control.jpg belong to the Android help pages, which the PC version does not show.)


Sounds (.wav)

What: every sound and the menu music. RIFF WAVE files.

Who loads them: the game, by name: the .cat [sounds], the .rst [sounds] and [ambients], and fixed names (list). Each request reads the file again (sounds are not shared by name).

Shipped formats IMA ADPCM 4-bit (466 files), 16-bit PCM (40), mono, 22050 Hz (some 44100 / 48000)
Read by the PC port its SDL3 sound decoder: PCM 8/16/24/32-bit, float, IMA ADPCM, MS ADPCM, A-law, mu-law; any sample rate (resampled to 48 kHz); stereo is mixed down to mono
Recommended mono 16-bit PCM or IMA ADPCM, 22050 or 44100 Hz
Looping decided by the game (ambients and the menu music loop), not by the file
3D creature, weapon, call and map random sounds are positional with linear roll-off between min and max distance (set by the game); ambients, the menu music and the hunter's own sounds are not

Limit: 512 sounds loaded at once (the game uses far fewer). A missing or undecodable sound is logged ("Failed to open sound file", "Cannot add sound") and stays silent.


Maps (.man)

What: the terrain of one area: heights, three light maps, flags, tiles, objects, object heights, water, fog and ambient zones. Binary, areas/<area>.man. Read when a hunt loads (first loading steps). The .man file is opened twice: the height map at its start is read last.

Layout

Uncompressed part (always at these offsets):

Offset Size Layer Values
0x000000 1024 x 1024 heights 0..255, x 64 units, at the cell corners (vertex x, z)
0x100000 1024 x 1024 light map, dawn 0..255 brightness (1/255) for creatures and objects
0x200000 1024 x 1024 light map, day
0x300000 1024 x 1024 light map, night only the one for the chosen time of day is kept
0x400000 1024 x 1024 flags bits below
0x500000 512 x 512 low-resolution flags low nibble: rotation 0..3 of the low-resolution tile (keep the high nibble 0)

Then seven RLE-compressed layers, one after the other (from 0x540000):

# Decompressed size Layer Values
1 1024 x 1024 tiles tile index into the tiles atlas
2 512 x 512 low-resolution tiles tile index, used for ground farther than 5888 units (23 cells) or everywhere with use_second_lod
3 1024 x 1024 objects 0..253 = index into [objects]; 0xFE = a hunter start place; 0xFF = none
4 1024 x 1024 object heights base height of the object on that cell, x 64 units
5 1024 x 1024 water low nibble = index into [water]; only cells with even x and even z are read
6 512 x 512 fog 0 = none, 1..15 = [fog] entry 0..14
7 512 x 512 ambient zones 0..15 = index into [ambients]

The file ends after layer 7 (no trailing data in the shipped files).

RLE layer: an int32 size, then size bytes of (value, count) byte pairs; each pair writes value count times. size counts the compressed bytes (it must be even and greater than 0) and the pairs must expand to exactly the layer size: more writes past the buffer (memory corruption), fewer leaves stale data from the previous map. Counts are 1..255 (0 writes nothing). Example: 06 00 00 00 | 05 03 FF 02 00 01 expands to 05 05 05 FF FF 00.

Flags layer bits:

Bit Value Meaning
0-1 0x03 ground tile rotation, 0..3 x 90 degrees
2-3 0x0C object rotation, 0..3 x 90 degrees
4 0x10 the cell's two triangles are split along the other diagonal (corner (x+1, z) to (x, z+1) instead of (x, z) to (x+1, z+1))
5 0x20 creatures may not be placed on or around this cell (the Brachiosaurus instead needs water: 0x80)
6 0x40 unknown (set in a few shipped maps; no code reads it)
7 0x80 water on this cell

Hunter start places come from three sources, in this order: every 0xFE cell of the objects layer becomes one (at the cell centre, heading -90 degrees = north; the cell is then empty); a [birthplaces] section in the .rst replaces that list (its count resizes it, its entries overwrite it); in the trophy room the game sets 24 fixed places. A hunt starts at a random place (never the same twice in a row); with no place at all the hunter starts at (65536, -65536).

Objects: an object on cell (x, z) stands at ((x + 0.5) x 256, objectHeight x 64 - 18, -(z + 0.5) x 256), rotated by flag bits 2-3. additional_rise of the object type and additional_objects_rise of the map are added to the object height byte at load (byte arithmetic, it wraps). Objects whose index is not below the [objects] count, or whose type is disabled, are removed at load.

Missing .man: the hunt still starts, with the map data that was in memory (flat or the previous map). No error screen.


Map resources (.rst)

What: the text part of a map: sky, light colours, fog distances, the tile atlases, the object types, sounds, water and fog levels. areas/<area>.rst, read at hunt start step 2 (before the atlases, objects and sounds load). Common syntax applies; header word carnivores_area_resources.

Missing .rst: logged ("File '...rst' not found!"); the defaults below apply, with no objects, sounds or water.

[general]

Key Value Default Effect
detailmap_texture texture base name detailmap_default (also used when the named one is missing) detail texture repeated once per cell over the ground near the camera
bound_north cells 36 the hunter cannot go below X = value x 256
bound_south cells 988 ... above X = value x 256
bound_west cells 36 ... above Z = -value x 256
bound_east cells 988 ... below Z = -value x 256
use_second_lod 0 / 1 0 1 = draw all ground with the low-resolution tiles (and use them for the grass mask)
additional_objects_rise int 0 added to every object height byte

[sky]

Most keys exist three times, prefixed dawn_, day_ and night_; only the one for the hunt's time of day is used.

Key Value Effect
use_sky_sphere 0 / 1 1 = draw sky_sphere.3dn with the sky sphere texture plus a cloud plane; 0 = a flat sky fan with the sky texture (every shipped map uses 1)
*_sky_sphere_texture texture gradient on the sky sphere (mapped by the sphere model's UVs)
*_sky_plane_texture texture cloud layer over the camera; repeats, scrolls
*_sky_plane_color R, G, B (0..255) cloud layer tint
*_sky_plane_opacity 0..255 cloud layer alpha at the zenith (fades to 0 at the horizon)
*_sky_texture texture the sky without sphere (use_sky_sphere = 0)
*_sky_color R, G, B distance fog colour
*_sun_color R, G, B light colour (ground and the light-level colour table of creatures / objects)
*_shadows_color R, G, B ambient colour added in shadow
*_fog_start, *_fog_end fraction of 19456 units distance fog; defaults 38 and 76 cells (0.5, 1.0)
*_clouds_shadows_texture base name cloud shadows: <name>.raw (128 x 128 bytes, darkens creatures / objects) and <name>.tga (darkens the ground); both tile every 128 cells and drift; at night the shadows are halved
*_clouds_speed_scale number drift speed of clouds and cloud shadows (default 1)
snow_density number stored, but no code reads it in this version

[tiles]

Key Value Effect
atlas_texture texture the ground tiles atlas: tiles of 64 x 64 pixels, of which the inner 60 x 60 are sampled (2-pixel border)
atlas_tiles_in_row power of two tiles per row (8 or 16 in the shipped maps)
atlas_tiles_in_column int tiles per column
sprites_atlas_texture texture far-away objects: 128 x 128-pixel sprites, picked by lod_sprite_index
grass_atlas_texture texture grass blades: 128 x 128-pixel cells
grass_mask_texture image base name where grass grows (TGA only; see grass)

Tile index t is at column t % tilesInRow, row t / tilesInRow (top row 0). The tile count per row must be a power of two (the game uses bit masks).

[birthplaces]

[birthplaces]
count = 2
birthplace_id 0
    position = 128000, 0, -96000     <- X, (ignored), Z in world units
    alpha = 270                      <- heading in degrees (270 = north)
    beta = 0                         <- pitch in degrees
birthplace_id 1
    position = 64000, 0, -64000
    alpha = 0
    beta = 0

count resizes the start list (and so replaces the 0xFE places of the .man). An id outside 0..count-1 is ignored with a warning.

[objects]

count (max 256; more are cut with a warning), then per type object_id <n> and its keys:

Key Value Effect
model base name <model>.3dn, loaded with scale 2
disabled 0 / 1 1 = the type is not loaded and its cells are emptied
use_lod 0 / 1 0 = never replaced by a sprite; also gives the model per-vertex shading
lod_sprite_index int sprite in the sprites atlas used far away
lod_dist_factor number larger = the model is drawn farther before the sprite takes over; compared with the squared distance x a quality factor from the settings
wind_waving 0 / 1 the model sways (offset grows with height)
make_noise 0 / 1 a bush: a rustling sound (bush1..3.wav) when the hunter comes within 64 units of its cell centre
radial_collision_detection 0 / 1 1 = the hunter collides with a cylinder of radius bound_radius; 0 = with a square of half-size bound_radius
face_collision_detection 0 / 1 1 = the hunter collides with the model's faces instead (faces with flag 4 / 8 excepted)
bound_radius world units collision radius (0 = no collision); creatures are not placed within it when it is 8 or more and walk around it when it is 10 or more
bound_bottom, bound_top world units, above the object's base vertical extent of the collision volume; the hunter can stand on bound_top
additional_rise height steps added to this type's object height bytes
use_custom_light 0 / 1 1 = ignore the light map
custom_light_intensity 0..255 the light level used then
transparent 0 / 1 stored; no code reads it

Other keys of the shipped files (shadow_line_length, shadow_line_intensity, shadow_circle_radius, shadow_circle_intensity, static_light) are skipped. Object models share the 128 model slots with everything else (see limits).

[sounds]

count, then sound_id <n> with file = <base name> (.wav). These are the random sounds of the ambients: positional, min distance 1536, max 7680 units. Max 64; an id of 64 or more is replaced by 0 with a warning.

[ambients]

count, then ambient_id <n> (max 32; only 0..15 can be addressed by the ambient zone layer):

Key Value Effect
file base name looping background sound of the zone (2D)
volume 0..1 its volume
random_sounds_count 0..16 random sounds of the zone
random_sound_id 0..15 selects the random sound the next keys fill (not range-checked)
random_sound_index int index into [sounds]
random_sound_volume 0..1
random_sound_frequency seconds time between random sounds = frequency x 1.5; only the first random sound's value is used for the zone
random_sound_daytime_only 0 / 1 not played at night

A random sound plays at a random point up to 4096 units around the hunter. Under water the ambient is replaced by a_underw.wav.

[water]

count, then water_id <n> (max 16):

Key Value Effect
level height steps water surface at level x 64 units
color R, G, B water colour (dawn and day); default 0, 26, 13
night_color R, G, B water colour at night; default 0, 13, 26
tile_index, opacity stored; no code reads them

[fog]

count, then fog_id <n> (max 16; zones address 1..15):

Key Value Effect
altitude height steps fog top at altitude x 64 units
poisonous 0 / 1 1 = the hunter loses health below the fog top (and dies in it)

color, distance and density in the shipped files are skipped: this version draws no fog volumes.


Map textures, sky, water and fog

Besides the textures named in the .rst, each map loads files whose names are built from the map name:

File Format, size in the shipped maps Use
<area>_<dawn/day/night>_shadowmap.tga 1024 x 1024 (one texel per cell), shipped as .pkm brightness of the ground (red channel), times the cloud shadow. If missing: <area>_shadowmap.tga, then white.tga
<area>_<dawn/day/night>_map.tga 256 x 256, shipped as .crt or .tga the picture on the in-game map screen; not used in the trophy room
<clouds>.raw / <clouds>.tga 128 x 128 bytes / 128 x 128 8-bit TGA cloud shadows (see [sky])
sky_sphere.3dn model, radius about 1015 the sky dome when use_sky_sphere = 1
a_underw.wav sound ambient under water

Area map picture. Drawn at 256 x 256 screen units over the whole map: one picture pixel = 4 x 4 cells, row = cell x / 4 from the top, column = cell z / 4 from the left (the same orientation as the .man layers seen as images). The hunter, creature and supply bag markers are placed with that mapping, so the picture must be exactly 256 x 256 pixels.

Shadow map orientation. The terrain shaders sample the shadow map at u = cell z / 1024 and v = -(cell x) / 1024 (wrapped). The shipped shadow maps are stored in the same row order as the .man layers (row = cell x from the top of the file): to stay consistent with the game, store yours the same way.

Grass. Drawn on cells near the camera when the graphics settings allow, the map has a sprites atlas, and the grass mask loaded. The mask is an image laid over the tiles atlas (same proportions; the shipped masks are 512 x 512 or 1024 x 512, like their atlases): for each grass position the game takes the ground texel's atlas coordinates and reads the mask's first channel there (red for 24/32-bit, grey for 8-bit). Values below 64 grow nothing; above, the blade size grows with the value. So grass grows on tiles, not on cells: paint the mask over the tile pictures. Not on water. The blade picture is one of the grass atlas cells.

Water. A cell is water when flag 0x80 is set; its level and colour come from [water] entry waterLayer[x & ~1][z & ~1] & 0x0F. The hunter counts as under water when the surface is above his eyes (about 2 m deep); he then loses health and can drown.

Light. Creatures and objects take their colour from the chosen light map (x the cloud shadow map, x 0.85 + 0.15), converted through a colour table built from *_sun_color and *_shadows_color. The ground uses the shadow map texture instead.


Weapons and the hunter's hands

Each weapon is a .cat whose model contains the weapon and the hunter's hands and arms (one texture with both; there is no separate hands file). The model is drawn in camera space (see model space).

Slot Weapon Character type Files
1 Pistol 0 pistol.cat
2 Shotgun 1 shotgun.cat
3 Double-barrel shotgun 2 dbsgun.cat
4 Crossbow 3 x_bow.cat
5 Rifle 4 rifle.cat
6 Sniper rifle 5 sniper.cat (the model is not drawn: the scope overlay is shown instead)
7 Photo camera 34 loads pistol.cat again for its timing and sounds; the model is not drawn
8 Revolver 41 revolver.cat, plus muzzle_flash.3dn + muzzle_flash_fire.ani while firing

Naming in the shipped files: <weapon>.3dn, texture <weapon> (.pkm or .crt), animations <weapon>_animation_0..3 (revolver: revolver_up, _fire, _down, _reload), sounds <weapon>_sound_0..3.

Animation slots of a weapon (fixed by the game):

Slot Played when Sound
0 taking the weapon out its sound_index, at the start
1 firing (also the idle pose: frame 0 while not firing) at each shot
2 putting the weapon away at the start
3 reloading (not used by the crossbow and the sniper rifle; x_bow.cat has 3 slots) at the start

Firing rate, damage, ammunition and magazine size are code / balance values (changeable with content packs), not part of the files.


Other 3D assets: hunter, ships, compass, particles

Asset Files Notes
Hunter's dead body hunter1.cat (+ hunter1.3dn, texture hunter1) shown when the hunter dies. Slot 0: killed on land (loops); slot 1: drowning, then slot 2 (held). Slot 3: unknown
Drop ship ship2a.cat 1 animation (the flight); 6 sound slots played by number
Supply ship sship1.cat no animation; 2 sound slots
Supply bag bag1.cat drawn at scale 2; 2 sound slots
Compass compas.3dn, texture compas drawn in screen space
Muzzle flash muzzle_flash.3dn, muzzle_flash.tga, muzzle_flash_fire.ani revolver only
Particles particle.tga (shipped .crt, 64 x 64 RGBA) every particle (blood, splashes); colours are set by the game; up to 2048 particles
Screen overlays vignette_screen, binoculars, viewfinder, photoframe textures sprites / full-screen images

Fonts (.fnt, .fnthd)

What: bitmap fonts in the AngelCode BMFont text format, one page. The game loads four by name at start: ccra14, lith18, ofs13, ofs15 (tries <name>.fnthd, then <name>.fnt). A .fnthd is an HD font: its metrics are in pixels of a double-size texture and the game draws it at half scale; a .fnt is drawn 1:1.

The file must start with the info line (its first word is skipped like a header). Lines and keys read (other keys skip one token, see syntax; here " and , are not delimiters):

Line Keys used Rules
info unicode must be 0 (else the font is rejected)
common lineHeight, scaleW, scaleH, pages pages must be 1
page file the texture, in quotes (the first and last character are cut off), no spaces; loaded through the texture rules
chars -
char id, x, y, width, height, xoffset, yoffset, xadvance id 0..255 (a higher id writes outside the glyph table)
kernings count below 2048
kerning first, second, amount only pairs of characters below 128 work

Localisation (strings.csv)

What: every text of the game in four languages: localizations/strings.csv. Read once at start strings_ia.csv (Ice Age texts) is never read.

Format

key,en,de,fr,es
STR_EXAMPLE,"Text","Text","Texte","Texto"
STR_WITH_COMMA,"Up, then down","...","...","..."

Limits: file size 256 KiB (262144 bytes), at most 8192 cells (lines x columns). The shipped file has 335 keys x 5 columns.

Languages

The language is chosen at start: de, fr, es (and es-MX) select their column, anything else selects en. On PC the language comes from the environment variable CARNIVORES_LANG, then LC_ALL, LC_MESSAGES, LANG (the part before _, ., @ or -), else the system's preferred language. A new language cannot be added as a column (only these four names are looked up), but a mod can put any language into one of the four columns.

If the language's column is missing, column 1 is used. A missing key shows the key itself (and logs an error).

Notes


What: every picture of the menus and the HUD is a sprite: a named rectangle of a texture atlas. The rectangles are defined in ui/*.cfg; the game draws sprites by name. Loaded at start from sprites_backgrounds.cfg, sprites_buttons.cfg, sprites_game_gui.cfg, sprites_menu.cfg, sprites_free_to_play_shop.cfg, sprites_menu_dinhunter.cfg, in this order.

sprite my_button {
    texture = "gui"            <- atlas texture base name (".tga" appended; max 27 characters)
    tc_x = 128                 <- left, in logical pixels (texture pixels / 2)
    tc_y = 0                   <- top, logical pixels, top-left origin
    tc_width = 90              <- 0 = the whole texture width
    tc_height = 160

    tablet_texture = "gui"     <- optional: used instead in the tablet layout
    tablet_tc_x = 884          <- in texture pixels (the game halves them)
    tablet_tc_y = 480
    tablet_tc_width = 140
    tablet_tc_height = 240
}

To change menu art, either paint over the atlas with the same layout (keeping the texture rules: menu_01 ships as .pkm, most others as .tga / .crt), or ship a changed .cfg that points sprites at your own texture. New sprite names are only drawn if code or a script asks for them (content packs can list extra .cfg files). The sprite names the game uses are listed in The game's files.


Shaders (.vsh, .fsh)

shaders/*.vsh / *.fsh: GLSL ES 1.00 sources (each starts with #ifndef GL_ES defines so desktop GL compiles them too), loaded at start by name (sh_world_terrain, sh_world_model, sh_gui_sprite ...). They can be replaced, but the attribute and uniform names (input_position, input_texCoord, input_tex_scale, input_mvp ...) must stay. A shader that does not compile ends the game at once; a missing shader file leaves the effect empty and the game crashes when it draws with it. sh_gui_postscreen, sh_world_clip_plane and the lone .vsh/.fsh halves not listed in The game's files are not used.


Other files

File What Notes
common.tag, common_android.tag, dinhunter.tag, dinhunter_android.tag presence check must exist (any content, shipped: 3 bytes), else the game stops at start with "Failed to find TAG file"
user_privacy/user_privacy_config.json, PrivacyPolicy.txt, TermsOfUse.txt the first-start privacy consent JSON listing the documents; leave alone
Help/*.html, *.png, *.jpg, style.css Android help pages not used on PC
lut/lut.tga, lut_normal.tga colour look-up tables not read by the game
Save folder: carnivores.st (+ .bak, .tmp) the player profile binary, encrypted and checksummed; not for modding
Save folder: config_settings.json settings written by the game
Save folder: carnivores.content.json, moddata/ content pack and script mod data see content, mods

The game reads no balance file: balance values (health, prices, weapon power ...) are built in; content packs change them (rules.json balance).


Limits

What Limit What happens beyond
Models loaded at once 128 (characters, weapons, map objects, sky, compass, flash together; a hunt uses about 50) "too many models", the model is not loaded
Faces per model 21845 (3 x faces must fit 16-bit indices) broken drawing
Points per model no fixed limit
Model / texture name in a .3dn 27 characters (texture), 31 (model) memory corruption / cut off
Animations per .cat 64 memory corruption
Sounds per .cat 64, names 27 characters memory corruption
Animation coordinates int16 / 8: -4096 .. +4095.875 model units wraps
Draws per frame 1024 model instances, 256 per model the rest is not drawn
Sounds loaded at once 512 not loaded
Character types 256 (content packs use 36 and up)
Creatures alive 1024
Map object types 256 in the .rst; 254 addressable (0xFE, 0xFF reserved); in practice bounded by the 128 model slots cut with a warning
Map sounds / ambients / waters / fogs 64 / 32 (16 addressable) / 16 / 16 (15 addressable) warning, id set to 0 (no check on count)
Random sounds per ambient 16 memory corruption
Tiles in an atlas 256 (tile index is a byte), tiles per row a power of two
Sprites 1024 "Too many sprites"
Glyphs per text 3072 the rest is not drawn
Kerning pairs per font 2047 font rejected
strings.csv 256 KiB; 8192 cells larger file: not loaded, every text shows its key; more cells: the cells are not stored and the game crashes at the first text
Texture size no limit in the game; the driver's maximum (2048 is safe)

Missing and broken files

File Missing Broken
.tag files the game does not start ("Failed to find TAG file") (content not checked)
shader crash when it is used compile error: the game ends at once
strings.csv every text shows its key wrong cell count: texts shift to other keys; over 8192 cells: crash
font "font not found", texts in that font are not drawn rejected (unicode, pages, kernings): same
sprite .cfg logged; its sprites are not drawn parsing shifts: wrong pictures
texture logged ("Texture '...' not found!"); the model is drawn with whatever texture was bound before "Unsupported format" / "Failed to read": the same
.cat logged ("Character file '...' not found!"); the type has no model and no animations. Hunt species: the PC port leaves the species out of the hunt. Always-loaded characters and weapons: invisible, and the game can hang when their animation runs (length 0) as for its model, animations and sounds
.3dn logged ("model '...' not found!"); invisible wrong counts: reads past the end, garbage
.ani logged ("Animation file '...' not found!"); the game can hang when that animation plays too short: static pose, logged; wrong point count: scrambled
.wav silent, logged silent, logged
.man the hunt starts with stale / empty map data RLE size wrong: memory corruption or stale layers
.rst defaults, no objects / sounds / water key misalignment (see syntax)
shadow map falls back to <area>_shadowmap, then white
area map picture logged; the map screen shows a wrong or empty picture
grass mask no grass a .png of the same name blocks it

The log is the game's standard output; error lines name the file.


Compared with the 1998/1999 PC games

The HD game's data is derived from the PC games of Action Forms (Carnivores, Carnivores 2, Ice Age), but none of the old formats is read, and no tool made for the old formats reads the HD ones directly.

1998/1999 HD (this game) Differences
.car (character: model, texture, animations and sounds in one binary) .cat text file + .3dn + one .ani per animation + .wav + a texture file split into separate files; behaviour stays built into the game
.3df (static model) .3dn texture name in the header instead of embedded 16-bit pixels; points come before the faces; texture coordinates are 16-bit, interleaved per corner, and span 0..255 whatever the texture size; 52-byte face record; the same kind of point record (x, y, z, owner, hide), face flags (1 double-sided, 4/8, 16 "mortal") and bone table
animation frames inside .car .ani: kps, frame count, point count, int16 x 8 coordinates the vertex data is the same kind (fixed point, x 8)
.map + .rsc .man (binary layers) + .rst (text) + separate textures, models and sounds the .man has the same kinds of layers (heights, three light maps, flags, tiles, low-resolution tiles, objects, object heights, water, fog, ambient zones) but RLE-compressed and in its own order; the .rsc's embedded tiles, objects, sky and sounds became separate files named in the .rst
16-bit textures embedded in the files TGA / ETC1 PKM / CRT files at twice the old resolution "logical size" = half the pixel size

The descriptions of the 1998 formats in this table are those commonly used in the Carnivores modding community; they were not checked here. Community editors for the old formats (for example C3Dit for .car / .3df) can still be part of a workflow through a small converter: the model content (points, faces with flags, texture coordinates, bones) maps one to one, but the byte layout does not.


How to: checklists

The file names below are in The game's files. Put every file into your mod folder (mods/<your mod>/, any sub-folder) with exactly the game's name.

Retexture a dinosaur

  1. Look up the species in the character table: its .3dn and the texture it names, with the shipped format. Example: Allosaurus, allo.3dn, texture allo, shipped as allo.pkm 256 x 256.
  2. Get the shipped layout: decode the shipped texture (a TGA or CRT is direct; a PKM needs an ETC1 decoder) and paint over it. The model's texture coordinates span the whole image (0..255), so keep the layout.
  3. Save it in one of two ways: - Same name, same format family: shipped .pkm → write an ETC1 .pkm (power of two, multiple of 4; no alpha). Shipped .tga / .crt → write <name>.tga (24 or 32-bit, uncompressed, idLength 0) or a .crt. - New name, any format: copy the .3dn, change the 32-byte texture name at offset 0x0C (max 27 characters, pad with zero bytes), ship the changed .3dn and <newname>.tga. This also lets two mods retexture different species without touching each other's files.
  4. Start a hunt with that species (or restart, for the always-loaded Moschops, Gallimimus, Dimorphodon, Pteranodon, Dimetrodon, Brachiosaurus). If it looks wrong, search the log for the texture name.

Replace a sound

  1. Find the file: creature and weapon sounds in their .cat [sounds] section, map sounds in the .rst, fixed names in the sound list.
  2. Make a RIFF WAV, mono, 16-bit PCM (or IMA ADPCM), 22050 or 44100 Hz. Stereo works but is mixed down.
  3. Name it exactly like the game's file (allo_sound_4.wav), put it into the mod.
  4. Range and looping are set by the game, not the file: a quieter sound needs a quieter recording.
  5. Test: next hunt for map, hunted-species and weapon sounds; restart for the rest.

New map from an existing one

Replacing an area (file mod) or adding a new one with its own name (a content pack map with a new terrain) needs the same files:

  1. Start from a copy of areaN.man and areaN.rst (new name: <terrain>.man / .rst).
  2. Edit the .man with a script: read the 0x540000-byte uncompressed part, expand the seven RLE layers, change them, compress them again (exact layer sizes!). Edit layers as 1024 x 1024 greyscale images: row = cell x, column = cell z. - Heights 0..255 (0.5 m steps). Keep the outer cells low or blocked: the hunter stays inside bound_*. - Tiles: indices below the atlas tile count; rotation in flags bits 0-1. Low-resolution tiles (512 x 512) for the distance. - Water: flag 0x80 on the cells, the water index in the water layer at even (x, z), levels and colours in [water]. - Objects: type index per cell; the object height layer = the ground height under it (the shipped maps mostly hold the rounded average of the cell's four corner heights); rotation in flags bits 2-3; 0xFE for start places (or a [birthplaces] section). - No-go cells for creatures: flag 0x20. Ambient zones and fog zones: the 512 x 512 layers. - Recompute the three light maps if you changed the terrain shape (creatures and objects use them).
  3. Edit the .rst: atlas names, [objects] (models you ship or the game's), sounds, waters, fogs, sky.
  4. Ship the pictures: <terrain>_<dawn/day/night>_map.tga (256 x 256) and the shadow maps (1024 x 1024). When you keep a shipped name, remember that a shipped .pkm shadow map can only be replaced by a .pkm.
  5. Name and description: STR_AREAn / STR_AREAn_INFO in strings.csv for a replaced area (keep the name below 32 bytes), or name / info in the content pack.
  6. Test each time of day; watch the log for missing files.

Change menu text in all languages

  1. Copy the game's strings.csv into your mod (the whole file: a mod cannot change single lines).
  2. Edit the en, de, fr and es cells of the keys you want. Keep the quotes, the commas, the number of cells per line, the final line break, and Windows-1252 encoding (save as "ANSI" / "Western (Windows-1252)", not UTF-8).
  3. Keep species, weapon and area names below 32 bytes. Use \n for line breaks inside a text.
  4. Test every language: start the game with CARNIVORES_LANG=de (fr, es, en). Texts are read at start, so restart after each change.

New character model

Replace a species' model (file mod), or give a content pack species your own .cat ("file") while it uses the AI of a shipped species ("ai"). Either way the AI decides which animation slot plays when:

  1. Pick the species whose AI you want and open its .cat: you need the same number of animations in the same order (slot table) and the same sound slots (ranges come from the slot number).
  2. Build the mesh: up to 21845 triangles, +Y up, feet at Y = 0, facing -Z, file +X on the creature's left (mirror X when you export from a right-handed tool), counter-clockwise faces seen from outside, 128 units per metre. Remember the game scales creatures by about 1.16 x the species' random scale.
  3. Mark the instant-kill faces (flag 16) and the faces shots go through (flag 4 or 8); double-sided faces flag 1.
  4. Texture coordinates 0..255 over the texture, interleaved per corner; texture name in the header (27 characters).
  5. Export every animation as an .ani with exactly the model's point count, coordinates x 8 as int16 (same X mirroring), kps >= 1, at least 2 frames; for loops make the last frame equal the first.
  6. Write the .cat (model, one file per slot, sound_index where a sound should play, [sounds]), keeping all names within the length limits and without spaces.
  7. Ship .cat, .3dn, .ani files, the texture and the .wav files. Test in a hunt (or spawn it with a script) and check the log for "overflow" and "not found" lines.