Skip to main content
Generate and print spawn scripts for quest levels, including creature spawns, timing, and allocation.

Usage

crimson quests <level> [OPTIONS]

Arguments

level
string
required
Quest level identifier (e.g., 1.1, 2.3, 5.10).Format: <tier>.<mission>Example levels:
  • 1.1 — First quest, tier 1
  • 2.5 — Fifth quest, tier 2
  • 5.10 — Final quest, tier 5

Options

--width
int
default:"1024"
Terrain width in pixels.
--height
int
default:"1024"
Terrain height in pixels.
--player-count
int
default:"1"
Player count for spawn calculation.Affects creature allocation in multiplayer quests.
--seed
int
Seed for randomized quests.Some quests use RNG for spawn positions/timing.
--sort
flag
Sort output by trigger time.Default: Unsorted (builder order)
--show-plan
flag
Include spawn-plan allocation summary.Shows creatures per spawn and slot allocation.

Output Format

crimson quests 1.1
Output:
Quest 1.1 Tutorial (12 entries)
Meta: time_limit_ms=120000; start_weapon_id=1; unlock_perk_id=0x05 (5); unlock_weapon_id=0x03 (3); builder_address=0x00401234; terrain_ids=[0x01 (1)]
01  t= 1000  id=0x08 ( 8)  creature=zombie      count= 3  x=  512.0  y=  100.0  heading=  1.571
02  t= 3000  id=0x12 (18)  creature=spider      count= 2  x=  256.0  y=  512.0  heading=  0.000
03  t= 5000  id=0x08 ( 8)  creature=zombie      count= 5  x=  768.0  y=  512.0  heading=  3.142
...

Columns

index
int
Entry number (1-based).
t
int
Trigger time in milliseconds.
id
hex
Spawn template ID (hex and decimal).
creature
string
Creature type name.
count
int
Number of spawns.
x, y
float
Spawn position.
heading
float
Spawn rotation in radians.

With Spawn Plan

crimson quests 1.1 --show-plan
Output:
Quest 1.1 Tutorial (12 entries)
Meta: ...
Plan: total_alloc=45 total_spawn_slots=8
01  t= 1000  id=0x08 ( 8)  creature=zombie      count= 3  x=  512.0  y=  100.0  heading=  1.571  alloc=  3 (x 1)  slots=0
02  t= 3000  id=0x12 (18)  creature=spider      count= 2  x=  256.0  y=  512.0  heading=  0.000  alloc=  4 (x 2)  slots=0
...
Additional columns:
alloc
int
Total creatures allocated (count × creatures_per_spawn).
slots
int
Spawn slots (for spawners that create additional waves).

Metadata Fields

time_limit_ms
int
Quest time limit in milliseconds.-1 = no limit
start_weapon_id
int
Starting weapon ID.
unlock_perk_id
int|none
Perk unlocked on completion.
unlock_weapon_id
int|none
Weapon unlocked on completion.
builder_address
hex
Original executable function address.Used for provenance tracking.
terrain_ids
list[int]
Valid terrain IDs for this quest.

Examples

Basic Quest Inspection

crimson quests 1.1

Sorted by Time

crimson quests 2.3 --sort

With Allocation Details

crimson quests 3.5 --show-plan

Randomized Quest

crimson quests 4.7 --seed 42
Some quests use RNG for variety. Same seed produces same result.

Multiplayer Quest

crimson quests 5.10 --player-count 4
Spawn counts may scale with player count.

Custom Terrain Size

crimson quests 1.1 --width 2048 --height 2048
Affects spawn positions near terrain edges.

Error Handling

Unknown Level

crimson quests 99.99
Output:
unknown level '99.99'. Available: 1.1, 1.2, 1.3, ..., 5.10
Exit code: 1

Available Quests

To see all available quests, use an invalid level:
crimson quests unknown
Output lists all valid quest levels.

Use Cases

Quest Development

Verify spawn scripts during quest design:
crimson quests 1.1

Difficulty Balancing

Analyze spawn density:
crimson quests 5.10 --show-plan
# Check total_alloc for difficulty estimate

Speedrun Planning

Plan optimal routes based on spawn timing:
crimson quests 3.7 --sort > quest-3.7-timeline.txt

Multiplayer Testing

Check spawn scaling:
crimson quests 2.5 --player-count 1 > solo.txt
crimson quests 2.5 --player-count 4 > coop.txt
diff solo.txt coop.txt

Parity Verification

Compare against original game spawns:
crimson quests 1.1 --seed 0 > reimpl.txt
# Compare with captured original game output

Spawn Plan Details

The --show-plan flag shows spawn plan allocation:
  • alloc — Total creatures created per spawn
  • slots — Ongoing spawn slots (for spawners)
Example:
id=0x12 count=3  alloc=6 (x2)  slots=0
Means:
  • 3 spawns of template 0x12
  • Each spawn creates 2 creatures
  • Total: 6 creatures
  • No ongoing spawn slots

Quest Builder Functions

Quest spawn scripts are generated by builder functions:
def build_quest_1_1(ctx: QuestContext) -> list[SpawnEntry]:
    return [
        SpawnEntry(
            trigger_ms=1000,
            spawn_id=SpawnId.ZOMBIE,
            count=3,
            pos=Vec2(512, 100),
            heading=1.571,
        ),
        ...
    ]
See crimson/quests/ for implementations.

See Also

Build docs developers (and LLMs) love