RPG Event Generator - v5.0.0
    Preparing search index...

    World Building

    Generate seeded world lore: continents, kingdoms, factions, landmarks, and historical events. Tier 3 — use for lore JSON, not as a live game backbone unless you wire it yourself.

    const { RPGEventGenerator } = require('rpg-event-generator');
    const generator = new RPGEventGenerator();

    // Seeded, reproducible world
    const world = generator.generateWorld(42);

    console.log(world.regions.length); // continents + kingdoms
    console.log(world.factions.length); // one faction per kingdom (varied types)
    console.log(world.events.length); // initial historical events

    // Events are stored on the instance
    const history = generator.getHistoricalEvents();

    // Advance time
    generator.simulateWorldYears(50);
    const extended = generator.getHistoricalEvents();
    generator.generateWorld({
    seed: 42, // reproducible output
    continentCount: 3, // 2–8 continents (default: 5)
    historyStartYear: 800, // first year for initial history
    currentYear: 1000 // present year at generation
    });

    // Legacy: numeric seed still works
    generator.generateWorld(42);
    • Continents — name, culture, climate, population, stability
    • Kingdoms — 2–4 per continent, landmarks, climate-appropriate resources
    • Landmarks — castles, temples, ruins, etc. with unique names

    One faction per kingdom, rotated types: kingdom, guild, cult, tribe, merchants, nobles. Each has:

    • Named leader (culture-appropriate title)
    • Influence, reputation, gold
    • Relationships with all other factions (neighbors biased toward ally/rival)
    • 2+ goals

    Types: war, alliance, discovery, disaster, ascension, fall, plague, famine, revolution, invasion, treaty, betrayal.

    Descriptions reference actual region names, factions, and landmarks — not generic filler.

    Events apply consequences (population, stability, relationships).

    generator.getAllWorldRegions();
    generator.getAllWorldFactions();
    generator.getHistoricalEvents();
    generator.getWorldStats();

    generator.getFactionAllies(factionId);
    generator.getFactionEnemies(factionId);
    generator.getFactionDiplomacyStatus(id1, id2);
    generator.getFactionPowerRanking();
    generator.getFactionTradeRoutes(factionId);
    const world = generator.generateWorld(42);
    const kingdom = world.regions.find(r => r.type === 'kingdom');

    const lore = generator.getWorldLore(kingdom.name);
    // e.g. "In 920, war of northern marches — Armies of ..."

    // Use in your game UI or prepend to event text yourself
    const event = generator.generateEvent({ location: kingdom.name.split(' ')[0] });

    getWorldLore() matches partial location strings against region names.

    World sim is not connected to generateEvent() automatically. Typical workflow:

    1. generateWorld(seed) at game start or in a tooling pipeline
    2. Export JSON for your game engine
    3. Optionally call getWorldLore(location) when showing events in known regions
    4. Optionally run simulateWorldYears() between game sessions
    • No cities/provinces below kingdom level
    • Player actions don't feed back into world state
    • generateEvent() ignores faction politics unless you add that logic