Encounter generation
Encounter generation creates target requests for camps, monster sites and hunting grounds, filters candidate tiles and writes map markers during world generation. When candidates are scarce, the generator relaxes some conditions in stages; template selection and map discovery follow separately. This article separates what the generator tries from what a save actually receives.
Contents
What this generation article covers
World generation first makes a target request for a class of location, then chooses positions from eligible tiles and writes map markers. Once a scene is entered, room templates, initial objects, dynamic summons and loot are handled by their own rules; this page covers the placement and discovery chain.
“Request 3” is the target the generator tries to satisfy. It does not guarantee three sites in every save or a fixed enemy count when a site is entered. Use the relevant event article for creatures, resources and respawn.
Requested targets and actual results
The same-release world initialization requests camps, monster sites and hunting grounds separately. Camps use a total target, while monsters and hunting grounds request each concept separately; empty candidates, failed creation or a room restart can change the final result.
| Category | Generator target | How to read it |
|---|---|---|
| Camps | 35 requested positions | Point of Interest; template and variant are selected separately |
| Monster sites | 3 requested for each of 6 concepts | The target is not a guaranteed created count; candidates can run short |
| Hunting grounds | 3 requested for each of 7 concepts | Map-event concepts share the placement flow with monster sites |
How candidate tiles are filtered
Initial filtering checks biome, forest weight, Wilderness, distance from existing encounters and whether a tile is usable. Some locations pass a starting-zone argument, but the current candidate-array function copies the global encounter-zone list; that argument must not be read as an active regional lock.
| Stage | Source behaviour | How to read it |
|---|---|---|
| Initial candidates | Filter by biome, forest weight, Wilderness, encounter safe zone and occupancy | A tile enters the pool only after these checks |
| Relaxation stage 1 | Wilderness > 40, with the main other restrictions retained | A lower threshold does not ignore terrain |
| Relaxation stage 2 | Wilderness > 30 | This is still candidate selection, not a forced coordinate |
| Relaxation stage 3 | Stop comparing Wilderness while retaining the encounter safe zone | The pool grows but can still be empty |
| Relaxation stage 4 | Retain biome, allow same-class reuse in a zone and adjust the forest constraint | The final fallback can still fail to reach the target |
How candidate pools are consumed
The generator takes a position from the candidate tiles and continues with the next request. If no position can be selected, remaining requests stop; when a source kind creates nothing, the room restarts. Once at least one has been created, the target can still remain short.
Template pools have a separate without-replacement rule: a selected template is removed from the current pool and the pool is refilled only after it is empty. Pool size describes available layouts, not enemy counts, loot counts or an encounter rate for each run.
| Camp variant | Template pool | Reuse |
|---|---|---|
| Common bandit camp | 15 templates | Draw without replacement, then refill when empty |
| River and steppe bandit camp | 4 templates | Reuse by river frame or without replacement |
| Crawler-overrun camp | 3 templates | Draw without replacement |
| Deathstinger-overrun camp | 3 templates | Draw without replacement |
Monster-site template coverage
The table lists monster-site concepts whose room templates are verified in the same release. It shows how many scene layouts the generator can choose from; the event articles explain pre-placed creatures, resources, loot and respawn after entry.
| Site concept | Placement target | Template pool |
|---|---|---|
| Crawler Burrow | 3 requested per concept | 3 scene templates |
| Deathstinger Hive | 3 requested per concept | 6 scene templates |
| Ghoul Den | 3 requested per concept | 3 scene templates |
| Gulon Den | 3 requested per concept | 1 scene templates |
| Harpies Nest | 3 requested per concept | 3 scene templates |
| Troll Domain | 3 requested per concept | 3 scene templates |
When the player sees a marker
A world-map fog update calls the point-of-interest marker flow. It checks a one-tile neighborhood around the current position for undiscovered Point of Interest, Dungeon and Random Encounter tiles, then writes a discoverable point-of-interest rumor. This is the discovery radius, not a fixed spawn coordinate.
- Map discovery · In development
- Open interactive map
What these rules do not establish
Coordinates in the example map, displayed marker counts and template-pool sizes are not fixed results for every save. Failed creation, scarce candidates and relaxation stages can change the result; placement rules alone cannot predict an enemy's next move, loot or quest reward after entering a marker.
- Wilderness event index
- Enemy behaviour · In development