RES.TXT

_RES.TXT is the main configuration file for Carnivores 2 and Carnivores Ice Age, located in the "HUNTDAT" folder. It is a text file divided into three main blocks, delineated by curly braces : "weapons", "characters", and "prices". The "weapons" and "characters" blocks are further divided into separate sub-blocks for each weapon and animal.

History and technical details
_RES.TXT was first introduced during the development of Carnivores 2. At this time, the existing animal and weapon definitions in Game.cpp were left intact, simply being commented out.

This code shows that _RES.TXT was created after Dimetrodon and Brachiosaurus (at that time misspelled as "Brahiosaurus") had been added and Triceratops had been changed to Chasmosaurus, and before Pachycephalosaurus had been removed (no weapons had been added or changed yet). Furthermore, looking at the array index numbers on the line  for the Brachiosaurus (especially in comparison to the same line for other animals) shows that it had originally been added as a pointable animal, probably with a higher price than Tyrannosaurus, but was changed to an ambient animal at some point before the introduction of _RES.TXT.

This comment block is part of the function, the rest of which shows that, if not defined in _RES.TXT, scale0, scaleA, and shipdelta default to 800, 600, and 0, respectively:

LoadResourcesScript
_RES.TXT is initially read by the function  in Resources.cpp:

This code shows a few things: each line in _RES.TXT is expected to be 255 or fewer characters in length, any line beginning with a "." (period) is treated as the end of the file (EOF), and lines containing the strings "weapons" or "characters" cause the functions  and , respectively, to be called.

ReadWeapons
, defined in Resources.cpp, is responsible for loading the information for each weapon from _RES.TXT:

ReadCharacters
, defined in Resources.cpp, is responsible for loading the information for each animal from _RES.TXT:

This code suggests that  and   don't have any effect from within _RES.TXT, and are in fact left over from when _RES.TXT was created and the information moved out of the source.

Examination of the source code has revealed that there are certain configuration options that can be included in the beginning of _RES.TXT.

Weapons
This block contains a sub-block for each weapon available in the game. Each of these sub-blocks uses several variables. All variable names are lowercase.

name
The name of the weapon, displayed in-game.

file
The filename of the weapon's .CAR file, relative to \HUNTDAT\WEAPONS. The filename specified here is case-insensitive.

pic
The filename of the weapon's TGA bullet icon, again relative to \HUNTDAT\WEAPONS and case-insensitive.

power
The weapon's power, with 0 being the lowest meaningful value (a weapon with 0 power does no damage). Power translates one-to-one with health, so that a weapon with a power of 2 must hit an animal with a health of 4 twice to kill it.

prec
The weapon's accuracy, on a scale from 0.0 to 2.0.

loud
How much noise a shot makes, on a scale from 0.0 to 2.0.

rate
How fast a weapon can fire, on a scale from 0.0 to 2.0. This value usually doesn't actually do anything; a weapon's base fire rate is instead controlled by the length of the reload animation and the shot sound.

shots
How many shots a weapon has; by default, weapons have between 6 and 8 shots, though the number can be anywhere from 0 up.

trace
Short for "tracer" or "tracers"; how many individual bullets are shot when the weapon is fired once. This is only used on the shotgun and DB Shotgun, both of which have 6 tracers to a shot. The default is 1.

fall
How fast a shot curves downward after being shot. The DB Shotgun is the only weapon to use this, where it is set to 1.

reload
How many shots are fired before a weapon must be reloaded. The only weapon which uses this is the DB Shotgun, which has 2 shots to each reload; the default value is 1.

optic
The zoom factor of the weapon, either 0 or 1. The sniper rifle is the only weapon to use this; the default value is 0.

It is worth noting that, unlike the sniper rifle, the binoculars can be zoomed in and out via the + and - keys, respectively, on the keypad.

Characters
This block contains a sub-block for each character (the hunter and all animals) in the game. Each of these sub-blocks uses several variables. All variable names are lowercase unless otherwise noted.

name
The name of the character, displayed in-game.

file
The filename of the character's .CAR file, relative to \HUNTDAT and case-insensitive.

ai
The AI number of the character. The hunter is 0, ambient animals are between 1 and 9, and pointable animals are from 10 to 18. Because the animations and sounds, and their order, in the .CAR files differ from animal to animal, changing AI values can have very interesting results and some combinations will cause the game to crash.

health
How much health the character has, from 0 (dies as soon as the hunt begins) to 1024 (invincible, or so). Even though the hunter's health is set to 1, changing it will not make him less vulnerable to damage or attack. Both the Brachiosaurus and the T-Rex have health of 1024, but they can both be killed if they are shot enough. The Brachiosaurus, however, does not have a death noise or animation, so the only visible indication it has died is that its information no longer displays in the binoculars (some users have also reported that killing the Brachiosaurus causes the game to crash, but this hasn't been confirmed by anyone else).

mass
The animal's weight. scaleA and scale0 are used to calculate the animal's weight in the following code from RenderSoft.cpp (the code is almost identical in Renderd3d.cpp and Render3DFX.cpp):

In this code,  is true if measurements are set to "Imperial", and false if they are set to "Metric". The animal's Metric weight is determined by taking its mass value from _RES.TXT and multiplying it by scale (as calculated with scale0 and scaleA), then multiplying it by scale again:

For imperial measurements, the same algorithm is followed, but the result is then divided by 0.907:

length
The animal's length. Similar to mass above, scale0 and scaleA are used to calculate it in the following code from RenderSoft.cpp (again, the code is almost identical in Renderd3d.cpp and Render3DFX.cpp):

again determines what the measurement system is, and the metric length of the animal is determined by taking its length value from _RES.TXT and multiplying it by scale:

For imperial measurements, this is then divided by 0.3:

This variable is only set on pointable animals and the Brachiosaurus; if not set, it displays as 0.

radius
The bounding radius used on animals in the trophy room to determine how close the player can get to the animal. This variable is only used on pointable animals and the Brachiosaurus; if not set, the player can walk through the animal.

basescore
The base number of points earned for killing the animal. This score is affected by a number of factors, including the equipped equipment, whether the tranquilizer is equipped, and how many pointable animals have already been killed or tranquilized during that hunt. If a pointable animal which was not selected for hunting is shot, this also affects the points awarded. This variable is only used on pointable animals and the Brachiosaurus.

smell
The acuity of the animal's sense of smell, ranging from 0.0 to 1.0. This variable is only used on pointable animals and the Brachiosaurus.

hear
The acuity of the animal's hearing, ranging from 0.0 to 1.0. This variable is only used on pointable animals and the Brachiosaurus.

look
The acuity of the animal's sight, ranging from 0.0 to 1.0. This variable is only used on pointable animals and the Brachiosaurus.

shipdelta
The height above ground level that the "hook" on the dropship stops when picking up a trophy. This variable is only used on pointable animals and the Brachiosaurus, and defaults to 0.

scale0 and scaleA
scale0 and scaleA together are used to calculate "scale", which is used to determine each animal's weight and length, in the following code from Characters.cpp: A floating-point number is calculated by getting a random number between 0 and scaleA, adding it to scale0, and dividing the result by 1000:

If scale0 or scaleA are not set for a given animal in _RES.TXT, they default to "800" and "600" respectively (as seen above), making the default minimum and maximum scale values 0.8 and 1.4, respectively.

scale0
One of the size modifiers used for length and weight, scale0 is the base scale. It's important to note that this uses the numeral, not the capital letter  , in its name. This variable is only used on Ankylosaurus and Allosaurus. The name "scale0" is probably short for "scale original".

scaleA
One of the size modifiers used for length and weight, scaleA is the amount of possible variation. This variable is only used on Ankylosaurus, Allosaurus, Velociraptor, Spinosaurus, and Ceratosaurus. The name "scaleA" is probably short for "scale additional".

danger
This variable determines whether ambient animals and herbivores run away when the animal's call is used, and is only used when it is set to "TRUE".

One user has reported that setting this to "FALSE" on carnivores, or adding it with "TRUE" to herbivores, will change their behavior appropriately, but examination of the source code has confirmed that the only effect this has is on ambient animals and herbivores, as noted above.

hearK and lookK
Used only on Velociraptor, Spinosaurus, and Ceratosaurus, these variables are not actually read, and are left over from when the information was first moved from the source to _RES.TXT - the programmers overlooked them when they should have changed them to hear and look.

Prices
This section contains variables which set the number of points a player starts with ("start"; defaults to 100) and the price of each area ("area"), animal ("dino"), and weapon ("weapon"). There is also one entry for each accessory ("acces"), but these are all set to 0 and changing them doesn't appear to have an effect in-game.