Content packs: species, weapons, maps, prices and rules
The game keeps every species, weapon and map, and every price and hunt rule, in a content registry. Each entry has a string id. The game's own content comes first (the built-ins); then every enabled mod adds entries or changes them with small JSON files. Mods can:
- add new dinosaurs (with their own model / animations / sounds, or the game's files reused), new weapons and new maps; they appear in the hunt menu, with licences, prices, cards, calls and trophies; and new equipment for the hunt menu's option buttons;
- change any field of a built-in or of another mod's entry: stats, prices, names, files, icons, spawning;
- change the economy and the hunt rules: every price, the credits a trophy is worth, spawn counts, bonus species.
No code is needed: content packs are JSON files. Scripts can do the same at run time with the
content table. Examples using only files the game already has are in examples/mods/ (copy a
folder into mods/):
| Mod | Shows |
|---|---|
alpha-trex |
a new species in each game (content/dinohunter/, content/iceage/): a bigger, tougher T-Rex (the T-Rex's tirex.cat and AI) and an alpha sabertooth (Ice Age's smilo.cat and AI), each with its own name, card, price, score, tinted icon; a script gives it armour and a roar |
raptor-fjords |
a new map for both games: the Vengar Fjords as the Raptor Fjords, in Ice Age Dry Nodus Lake as the Wolf Fjords (shared fields in content/maps/, the rest in content/dinohunter/ and content/iceage/), dawn / night only, its own ambient creatures and licensable species; its populations.json gives raptor packs (wolf packs) dens beside the water and herds that graze along the shores (populations) |
elephant-gun |
a new weapon in the rifle's slot for both games, with its own .cat (each game's rifle model, the double-barrel shotgun's blast); the shared file holds the weapon, the game folders its price and card |
cheap-hunting |
rules for both games: a shared rules.json (half prices, better trophies, ten species per hunt) and each game's own (Dinosaur Hunter: a cheaper T-Rex, cheaper supplies, more dinosaurs; Ice Age: a cheaper bear and yeti, more animals) |
ice-age-lodge |
Ice Age: a new animal (the wolf's model, scaled up), a new piece of equipment, and a page of the menu API |
Both games
Each game has its own registry with its own built-ins (the ids below); a content pack names the game it is
for in mod.json ("games": ["iceage"], Games), since its species, maps and files are a game's own; a
pack for both games puts what differs in per-game folders (below).
In Carnivores: Ice Age the registry holds its 17 animals, its 8 weapons, its 5 maps and its 4 pieces of equipment,
and everything on this page works as in Dinosaur Hunter: new animals, weapons and maps get cells in its hunt menu (on
further pages when the grid is full) with their names, cards, pictures and prices; changes of built-ins (stats,
senses, scale, flags, calls, names, cards, icons, prices); rules.json (score fields, balance, priceScale,
ammoScale, maxSpecies, the hunt rules); a map's terrain and times; trophies and the side file of the save. One
difference is the game's own: Ice Age has no licences. A price there is what choosing the entry costs a hunt, against
the hunter's credits (its hunt menu shows "cost" and "Your Account"; an entry the credits do not cover cannot be
chosen), and nothing is bought. examples/mods/ice-age-lodge is an Ice Age content pack; alpha-trex, elephant-gun,
cheap-hunting and raptor-fjords are made for both games (below).
One mod for both games
A content pack for both games ("games": ["dinohunter", "iceage"]) keeps what the games share in content/ and what
differs in content/dinohunter/ and content/iceage/. These two folders have the same layout as content/ (species/,
weapons/, maps/, equipment/, rules.json), and each game reads only its own:
content/species/deinonychus.json shared: name, file, price, card ...
content/dinohunter/species/deinonychus.json {"ai": "velociraptor"}
content/iceage/species/deinonychus.json {"ai": "wolf", "score": 20}
content/iceage/maps/frozen_valley.json a map for Ice Age only
A game's file with the same name as a shared one is merged into it before it is read: its fields win, and objects
(card, balance ...) merge field by field. A game's file with a name of its own is one more file, for that game
only. Species, map and weapon ids are each game's own (the ids below), so an "ai", "copy" or "base"
that names a built-in belongs in the game's folder. A new species with its own "file" and a script brain
(Behaviour) needs no game folder at all.
Files
A mod is a folder (or zip) in mods/ (see the Mods screen; mods/modlist.txt is the load order). Its content JSON:
mods/<mod>/content/species/*.json
mods/<mod>/content/weapons/*.json
mods/<mod>/content/maps/*.json
mods/<mod>/content/equipment/*.json
mods/<mod>/content/rules.json
- A file holds one entry (an object with
"id") or a list of entries. Files are read in name order, mods in load order; a later mod wins.//and/* */comments and trailing commas are allowed. Texts are UTF-8. - Same id = change. Only the fields given change; everything else stays as the game (or an earlier mod) has it.
- New id = add. The new entry starts as a copy of a template and then takes its own fields:
species copy
"copy", else their"ai"species; weapons copy"copy", else their"base"weapon; maps copy"copy", else the built-in map of their"terrain". So a variant needs only the fields that differ. - A new entry needs its defining field (species
"ai","copy"or"file"; weapons"base","copy"or"file"; maps"terrain"or"copy"). Without one, the entry is taken as a change of an entry that is not there (its mod is off): the log says so and nothing happens. - Other files of the mod (
.cat,.3dn,.ani,.wav,.tga,.man,.rst, sprite.cfg...) are found by their bare name like any mod file, wherever they sit in the mod.content/**/*.jsonis not put into that file index. - The game's log prints a
content:line per entry: new / changed, its type slot, file and the mod (start the game from a terminal to see it, orprint(content.report())in the console).
Ids
Lowercase; spaces become _. Built-ins of Dinosaur Hunter:
- species:
moschops gallimimus dimorphodon pteranodon dimetrodon brachiosaurus(ambient),parasaurolophus ankylosaurus stegosaurus allosaurus chasmosaurus velociraptor spinosaurus ceratosaurus trex pachycephalosaurus amargasaurus oviraptor troodon utahraptor carnotaurus gigantoraptor coelophysis iguanodon(the 18 hunt dinosaurs, menu order),dilophosaurus(in the game's data but never used by it; the port's world API spawns it). Aliases:t-rex,tyrannosaurus,pachycephallosaurus,raptor. - weapons:
pistol shotgun dbshotgun xbow rifle sniper camera revolver(camera= the observer's photo camera, hidden in the menu). Aliases:crossbow,double_barrel. - maps:
area1(Delphaeus Hills)area2(Fort Ciskin)area3(Vengar Fjords)area4(Manya Jungle)area5(Mount Ravan)area6(Ravaren's Bridge)area7(Nibelungen Paradise).
Built-ins of Ice Age:
- species:
pig archaeopteryx(ambient; the Archaeopteryx flies),brontoteriy wildboar wolf rhinoceros diatryma deer smilodon mammoth bear indricothere hyaenodon bigfoot doedicurus andrewsarchus titanis(the 15 hunt animals, types 116-130, menu order). Aliases:yeti,megaloceros,boar,wild_boar,hog,rhino,woolly_rhinoceros,indricotherium,brontotherium,sabertooth. A new species without"ai"/"copy"copies thewolf. - weapons: the same ids as Dinosaur Hunter.
- maps:
area1(McRath Island)area2(Ravaren's Bridge)area3(Ring of Infernus)area4(Dry Nodus Lake)area5(The Giant's Boot); no residents. The rules' ambient species arepigandarchaeopteryx, the bonus pool the first seven hunt animals (brontoteriy..smilodon), as the game picks them.
Common fields
| Field | Type | Meaning |
|---|---|---|
id |
string | required |
copy |
id | template of a new entry (see above) |
name |
text | menu / HUD name |
info |
text | the menu card (species: %d = the score) |
price |
int | licence price in credits (0 = free, unlocked) |
hidden |
bool | not in the hunt menu (built-ins too) |
order |
int | sort key of the added entries on the extra menu pages |
icon |
sprite / .tga |
the menu cell picture (unlocked) |
iconLocked |
sprite / .tga |
the locked picture (silhouette); default: icon |
iconColor |
[r, g, b] or [r, g, b, a] |
tint of the menu cell (0-255) |
Texts are a string ("Alpha T-Rex"), an object by language ({"en": "...", "de": "...", "fr": "...", "es":
"..."}: the game's language, else English, else any), or a key of the game's strings.csv ("STR_T_REX"). The game's
fonts are Latin-1: other characters show as ?. \n breaks lines (the cards are right-aligned, about 45 characters
wide).
Icons: the name of a sprite the game has (button_dino_active_9 is the T-Rex's cell, button_weapon_active_5 the
rifle's, button_area_active_3 the third map; the _inactive_ ones are the locked pictures), a sprite from a sprite file
of the mod (list it in rules.json "sprites", the game's .cfg format: sprite name { texture = "file" tc_x = 0 tc_y =
0 tc_width = 90 tc_height = 100 }, textures are .tga), or a .tga file name (the whole picture fills the cell: 180 x 200
pixels like the game's own cell pictures, or 90 x 100).
Species (content/species/*.json)
| Field | Type | Meaning (CharacterInfo field) |
|---|---|---|
ai |
species id, or "scripted" |
whose AI drives it. It also decides the game's per-type rules (T-Rex shot / noise reactions, Brachiosaurus water places, the death camera of big predators, sound radii). The .cat must have the animations in that species' order (a copy of its .cat is the safe start) |
scripted |
bool | a script drives it (content.drive); the base AI runs while no script takes it |
file |
string | characters/<file>.cat: model, animations, sounds ("tirex" reuses the T-Rex's) |
health |
number | health (health0; T-Rex 1024: only a shot in the eye kills it) |
score |
number | trophy points (m_unk1640) |
mass |
number | tons (m_unk1634): trophy and binoculars weight x scale², world-API fight damage |
size |
number | metres (m_unk1638): trophy length x scale |
radius |
number | body radius the hunter collides with (m_unk163C) |
smell, hearing, sight |
number | senses (m_unk1644[0..2], about 0.3-1): higher notices the hunter from farther; the card's bars |
carryHeight |
number | drop ship carry height (m_unk1644[3]) |
scale |
[min, max] or number |
body scale range (scale0, scaleA); scaleMin / scaleRange set them apart |
flags |
int | 1 huntable (trophy), 2 dangerous (predator), 4 flying; or huntable / dangerous / flying booleans |
calls |
list of .wav names |
its decoy calls (up to 3); without: the game's call<N>_a/b/c of its AI species |
callVariants |
int | how many of the game's calls it has (1-3, m_unk1660) |
hunt |
bool | a hunt species: in the hunt menu, with licence, call and trophy (new species: true) |
card |
object | composes the card when there is no info: length, weight, diet, danger texts; score and the senses' bars are added |
maps |
list of map ids | the maps it lives on (empty = every map); on other maps it cannot be picked |
spawnWeight |
number | chance to be picked among the hunt's species (1) |
skipChance |
number | a pick is dropped with this chance (T-Rex, Spinosaurus, Ceratosaurus 0.5) |
group |
[min, max] |
group size (Coelophysis 3-5) |
groupChance |
number | a group spawns with this chance (Coelophysis 0.7) |
trophyPriority |
int | which trophy a new one replaces first when the trophy room is full (higher is kept; Parasaurolophus 0 .. T-Rex 17) |
A new species gets a free CharacterInfo slot (36 and up, not 41); the log names it. It is loaded when a hunt needs it (and unloaded after), or when the world API / a script spawns it.
Weapons (content/weapons/*.json)
The hunter has 8 weapon slots, one per built-in weapon. A new weapon takes the slot of its base weapon and its
behaviour: the sniper's scope, the crossbow's falling arrows, the revolver's muzzle flash, the reload pattern, the
recoil. In the menu it is an entry of its own (licence, ammo price, card); in a hunt it replaces its base weapon (the
menu lets you pick one weapon per slot).
| Field | Type | Meaning (CharacterInfo field) |
|---|---|---|
base |
weapon id | the slot and behaviour (new weapons) |
file |
string | <file>.cat: model, 4 animations (take, idle/fire, put away, reload), sounds per animation |
power |
number | damage per hit (m_unk1664; pistol 2, rifle 4, sniper 7, revolver 8) |
precision |
number | spread = 2 - precision (m_unk1668) |
pellets |
int | traces per shot (m_unk166C; shotguns 6) |
loudness |
number | how far shots are heard, x 14592 units (m_unk1670) |
rate |
number | shots per second (m_unk1674) |
ammo |
int | shots per hunt (m_unk1678) |
magazine |
int | shots before a reload (m_unk167C) |
aimFov |
number | field of view while aiming (m_unk1680) |
aimTime |
number | aiming zoom time (m_unk1684) |
ammoPrice |
int | credits per hunt for its ammunition |
Maps (content/maps/*.json)
| Field | Type | Meaning |
|---|---|---|
terrain |
string | the files: <terrain>.man, <terrain>.rst, <terrain>_dawn/_day/_night_shadowmap.tga, <terrain>_dawn/_day/_night_map.tga (map screen). "area3" reuses the Vengar Fjords |
difficulty |
text | a line after the card |
times |
list | "dawn", "day", "night" it can be played at (empty = all; another choice falls back to the first) |
species |
list | residents that live there in every hunt, whatever the hunter licensed: [{"id": "velociraptor", "count": [4, 7]}, ...] or {"velociraptor": [4, 7]}. Built-in maps: 5 Brachiosaurus |
huntable |
list of ids | only these species can be picked for this map (empty = any that lives there) |
hunt |
object | hunt rules for this map (as rules.json hunt) |
Rules (content/rules.json)
| Field | Type | Meaning |
|---|---|---|
priceScale |
object | multipliers: species, weapons, maps (licences), ammo |
prices |
object | per entry: {"species": {"trex": 500}, "weapons": {...}, "ammo": {"rifle": 10}, "maps": {...}} |
startCredits |
int | credits of a new profile (DEFAULT_CREDITS) |
resupplyPrice, relocatePrice |
int | the in-hunt supply drop / relocation (RESUPPLIES_COST, RELOCATIONS_COST) |
runSpeed |
number | PLAYER_FORWARD_SPEED_SCALE |
score.multiplier |
number | every trophy's credits (1) |
score.unlicensed |
number | multiplier for a species shot without its licence (0.5) |
score.combo |
number | + per trophy already taken in the hunt (0.1) |
score.flyer |
int | credits per shot flyer (1) |
score.bonus |
object | percent bonuses: tranquilizer 25, noRadar 30, coverScent -20, camouflage -15 |
maxSpecies |
int | species per hunt (the game: 9; at most 10) |
hunt |
object | hunt rules (below) |
balance |
object | any of the game's balance values by name, e.g. "DINO_T_REX_HEALTH": 2048, "WEAPON_RIFLE_POWER": 5, "WATCH_VIDEO_CREDITS": 25, "IAP_SMALL_PACK_CREDITS": 1000 (the full list: src/Sources/Game/BalanceManager.cpp) |
sprites |
list | sprite .cfg files of the mod, loaded with the game's |
Hunt rules (rules.json hunt, or a map's hunt, which wins for that map):
| Field | Type | Default (the game's) |
|---|---|---|
ambientCount |
[min, max] |
[370, 420] ambient creatures |
ambient |
{"id": weight} or list |
moschops, gallimimus, dimorphodon, pteranodon, dimetrodon, 1 each |
dinoCount |
[min, max] |
[16, 24] picks among the hunt's species (bonus spawns included) |
bonus.count |
int | 2 random bonus species per hunt (they need no licence; they give half score) |
bonus.spawns |
int | 2 of each |
bonus.pool |
list of ids | parasaurolophus ... spinosaurus (the first 7) |
nearPlayer |
bool | true: the first pick after the bonus spawns starts near the hunter |
Without any hunt rule, map species or species spawn fields in play, the game's own placement code runs unchanged.
Equipment (content/equipment/*.json)
The hunt menu's weapon page has four option buttons, the game's equipment: camouflage (animals see the hunter
1.5 times worse), cover_scent (they smell him 1.5 times worse), tranquilizer (shots put animals to sleep: no kills,
no blood trails) and radar (the hunt's species on the map). Each changes the credits of every trophy (the score.bonus
rules). A content pack changes them, hides them, or adds its own items: those get buttons of the same kind on further
pages of the four places (small arrows above them page through), with their own card. Aliases: coverscent,
scent, tranquiliser.
| Field | Type | Meaning |
|---|---|---|
id |
string | required; a new id adds an item |
copy |
id | a new item starts as a copy of this one |
name, info |
text | the card (as the weapon cards; info: %d = the score bonus) |
icon |
sprite | the picture on the button (icon_camouflage, icon_cover_scent, icon_tranquilizer, icon_radar or a mod's) |
price |
int | credits per hunt while it is on (the game's four: 0). Dinosaur Hunter adds it to what HUNT costs (paid with the ammunition), Ice Age to the hunt's cost against the credits |
scoreBonus |
number | percent on every trophy's credits while it is on (the game's four: their SCORE_BONUS_* balance values; the radar's bonus is for hunting without it) |
sight |
number | while it is on, animals see the hunter this many times worse (camouflage: 1.5) |
smell |
number | the same for smell (cover scent: 1.5) |
radar |
bool | added items: the hunt's species on the map (as the radar; no "no radar" bonus then) |
tranquilizer |
bool | added items: shots put animals to sleep (as the tranquilizer) |
default |
bool | switched on when the game starts (the game's: camouflage, cover scent and radar on) |
hidden |
bool | no button; a hidden item is off (the game's four too) |
order |
int | sort key of the added items |
[
{"id": "tranquilizer", "hidden": true},
{"id": "camouflage", "price": 10, "sight": 2.0},
{"id": "ghillie_suit", "name": "Ghillie suit", "info": "Dinosaurs see you half as well.\nScore %d% less.",
"icon": "icon_camouflage", "sight": 2.0, "scoreBonus": -20, "price": 25}
]
Other effects are a script's: content.equipped("night_goggles") tells whether an item is on in the hunt being played
(hunt_start), content.equipment() lists them, content.define("equipment", {...}) adds one at run time.
The hunt menu
The game's hexagon grid has 7 map cells, 18 dinosaur cells and 7 weapon cells (Ice Age: 5 maps, 15 animals, 7 weapons). Added entries go on extra pages of the same grid: two small hexagon buttons with arrows appear left of the dinosaur grid and above the map / weapon grids, with a lamp per page under them (red: the page shown). Selections stay across pages. Hidden built-ins leave an empty cell. Up to 128 entries per grid. Added equipment pages the four option buttons the same way. Scripts add their own buttons, pages and checks to the menus with the menu API.
Saves
The game's save (carnivores.st) keeps licences of the built-ins and a trophy's character type. For added content a side
file carnivores.content.json next to it keeps the licences (by id), the id of each trophy of an added species and
the mod weapon each new trophy was taken with. When a mod is removed, its trophies leave the trophy room into the side
file's orphans (the save still loads); when the species is back, they return to free places. Licences of removed
entries stay in the side file.
From scripts
The content table reads and changes the registry at run time, with the same fields as the
JSON: content.define("species", {id = "night_raptor", copy = "velociraptor", name = "Night Raptor", price = 300}),
content.setPrice("weapon", "rifle", 50), content.species("trex"), content.rules(). The price that
content.species(), content.weapons() and content.maps() give (and content.price) is what the menu shows: after
the rules' priceScale (ammoPrice after ammoScale); content.setPrice sets the entry's own price, before them. Entries defined while the
menus are open appear at once. content.drive(species, fn) replaces a species' AI with a script function (with
"ai": "scripted" in the JSON the species uses its base AI until a script drives it).
When changes apply: content packs are read at start and again when you press Apply in the Mods screen (outside
a hunt). print(content.report()) in the console lists every entry and which mod set it.
Limits
- A new species needs a
.catwhose animations follow its AI species' order; the AIs are the game's (or a script's, throughcontent.drive). - A
filethat cannot be used is an error in the log (content: error: weapon elephant_gun: elephant_gun.cat cannot be used (...)), and the entry loads its base's own file instead: a species its AI species'.cat, a weapon its base weapon's. That happens when the.cator its model is not found, it has no animations, one of its.anifiles is missing, or it has fewer animations than the base's file (the base's AI or weapon would play one that is not there). The entry keeps its other fields. If even the base's file does not load, the entry is left out of the hunt. - A new weapon shares a slot with its base weapon: one of them per hunt. Up to about 200 added species + weapons in all (CharacterInfo slots), 128 models loaded at once (a hunt uses about 50).
- A map's terrain files are the game's formats (
.man/.rst); the port reads them by name but does not make them. - Menu cards of added species compose English labels (Length / Weight / Diet / Score / Sight ...) unless
infogives the whole text. - Menu entries defined while the menu is open appear at once. Apply in the Mods screen re-reads the content packs
(outside a hunt), as does
content.reload(); buttons of entries that went away are then hidden. - Survive mode keeps the game's own species and weapons.