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:

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

Ids

Lowercase; spaces become _. Built-ins of Dinosaur Hunter:

Built-ins of Ice Age:

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