Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:4thfever Cultivation world simulator generate dynasty emperor

From Leeroopedia
Knowledge Sources
Domains Procedural_Generation, Game_Initialization
Last Updated 2026-10-22 14:00 GMT

Overview

Concrete tool for procedurally generating a dynasty template with a royal surname and an emperor, provided by the Cultivation World Simulator dynasty generator system.

Description

The generate_dynasty and generate_emperor functions create the political backdrop of the game world. generate_dynasty picks a dynasty template from config, selects a random royal surname, and creates a runtime `Dynasty` instance. generate_emperor generates an `Emperor` with a randomized age (18-90) and a given name from the name pool, using the dynasty's royal surname.

Usage

Import these functions when:

  • Game initialization: called during `perform_game_initialization` to create the dynasty and first emperor
  • Dynasty succession: called when the current emperor dies and a new one must be generated

Code Reference

Source Location

Signature

def generate_dynasty() -> Dynasty:
    """Pick a dynasty template and create a runtime instance with a random royal surname."""

def generate_emperor(dynasty: Dynasty, current_month_stamp: int) -> Emperor:
    """Generate an emperor with random age and given name."""

Import

from src.systems.dynasty_generator import generate_dynasty, generate_emperor

I/O Contract

Inputs

Name Type Required Description
dynasty (for generate_emperor) Dynasty Yes Dynasty template with royal_surname
current_month_stamp int Yes Current time as integer month stamp

Outputs

Name Type Description
generate_dynasty return Dynasty Dynasty instance with title, royal_surname
generate_emperor return Emperor Emperor with surname, given_name, birth_month_stamp, max_age

Usage Examples

Generate Dynasty and Emperor

from src.systems.dynasty_generator import generate_dynasty, generate_emperor

dynasty = generate_dynasty()
emperor = generate_emperor(dynasty, current_month_stamp=int(world.month_stamp))
dynasty.current_emperor = emperor

Related Pages

Implements Principle

Required Environments

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment