World systems

Spawn System

Every creature in Beleghost - from the humblest rat to a named area boss - comes out of the same encounter-table engine, nicknamed Sparky after its core include file.

How a table entry works

Each area loads its spawn tables off a placeable tagged sparky_variables, which carries up to 10 local slots (enc01 through enc10) - each one a case number into the module-wide sparky_enc.nss switch. That's a hard cap: an area can never host more than 10 distinct encounter tables without a second placeable.

FieldMeaning
timealways, day, night, or an hour range like 20-4
chance%Rolled fresh each time - a straight d100() ≤ chance check
countA flat number, or a range like 1-2
creature / groupA single resref, or a named group pulling several possible spawns at once

A group's own entries stop at the first missing number in its sequence - the loop that reads group_<name>_01, _02, and so on gives up the moment one is blank. Removing a group member from the middle of that sequence silently truncates everyone after it, which is why a retired entry gets its resref swapped out for something else instead of being deleted outright.

Boss encounters

A named area boss is just a Sparky entry like any other - a dedicated case number, wired into a free encNN slot, with a fixed count (almost always exactly 1) and a real BOSS local variable set on its blueprint. That flag is what tells the loot system to bypass the normal drop-rate roll and run two full generation passes instead of the usual one. See the Bestiary for the full roster of named bosses this way, area by area.