Back to Index
III./Worldbuilding · Game Engine · Systems Architecture

Aldryn (The Alderlands)

An original Discord-native idle RPG built to bring my fantasy world to other players while learning how to architect a systems-driven text game from scratch.

The Basics

I started Aldryn for two reasons: to give other people a taste of the fantasy world I have long invested my time and writing into, and to learn how to architect a full systems-based text game from the ground up.

The game rules live in an 80-module TypeScript package with zero Discord imports, tested by 33 unit test suites. Running an extended live alpha with real players also drove a full V2 cohesion audit covering XP pacing, item tags, crafting sinks, and community projects.

Specs & Scope
Role
Creator, Lead Systems Designer & Architect
Status
Live Alpha moving toward 1.0
Workspace
Turborepo + pnpm (5 Packages)
Engine Size
80 Pure TS Modules · 33 Vitest Suites
Bot Surface
43 Slash Commands · Design Tokens · Copy CLI
Backend
Prisma, PostgreSQL, Background Worker
Engine Separation

80 Rules Modules With Zero Discord Dependencies

Keeping game rules out of Discord command handlers allows fast deterministic unit tests, standalone simulation scripts, and the option to attach other frontends later without rewriting game logic.

Turborepo Architecture
apps/bot
Discord UI Layer

43 command files, interactive caravan and trade menus, inventory exports, and shared color tokens.

apps/worker
World Timers & Checks

Resolves scheduled expeditions, enforces trip durations, and runs background anti-abuse scans.

packages/engine · Pure TS33 Test Suites
80 Simulation Files
· 13 Skill Trees & XP· Seeded Affix Loot· Paperdoll & Autoequip· Crafting & Gems· Legacy & Ascension· Realm Epochs· Guilds & Dungeons· Seasonal Festivals
Includes gameplay-loop-demo.ts to simulate a full region outside Discord.
packages/database
Prisma + Postgres

Migrations, the migrate:xp sync script, and trophy repair scripts.

packages/shared-types
Shared Types & Text CLI

Domain interfaces plus a CSV/JSON export and diff tool for auditing player-facing copy.

One-way dependency flow: apps/bot (UI) and apps/worker (timers and anti-abuse) call into packages/engine and persist through packages/database.
02Procedural Loot Forge
generateItem.ts + affixes.ts + calculateItemPower.ts

Deterministic Seeded Item & Affix Forge

Item generation runs through a seeded PRNG, weighted rarity tiers (Common 1000 down to Exceptional 1), item tag filtering, and exclusion groups so items never stack conflicting traits like Sturdy and Reinforced.

Deterministic Seeded Item & Affix Forge

Same seed always generates the exact same item (used in Aldryn’s 33 Vitest suites for reproducible balance tests), with tag filtering and exclusion-group pruning.

uncommon · ×1.25 power multPower 189 · Grade B
Swift Runite Greatsword of Fortune
damage+34
accuracy+22
gatherSpeed+4
gold_bonus+9
Roll & Exclusion Audit
Base tags: weapon, melee, slashing
Prefixes rolled: Swift
Suffixes rolled: of Fortune
03Zero-Wipe XP Rebalance
Live Alpha Migration

Re-Anchoring the XP Curve Without Resetting Players

Auditing xp.ts showed that lvl / 10.0 put Level 99 at ~1.1M XP instead of ~13M, pushing alpha players to Level 133 Mining ahead of schedule. Tightening the curve directly would have demoted existing characters.

Before
Veteran at Lv 133 Mining

The flat curve moved players past Level 100 Legacy Retirement too quickly, and a direct formula swap would lower earned levels.

Elevation Script
xp = max(oldXP, xpForLevel(lvl))

A non-destructive Prisma migration raises stored XP to match each player’s existing level on the normalized curve.

Result
Zero Lost Levels

Alpha testers retain Level 133 Mining while subsequent levels and new characters follow the corrected 1.0 curve.

04Realm Epoch Scaling
Community Projects

Scaling Realm Contributions by Total Level

Community building projects break down when endgame stockpiles complete the entire goal in minutes. Aldryn scales gold and material costs per Support Point by the contributor's Total Level and material tier weight.

Democratic Epoch Contribution Calculator

Running the live math from packages/engine/src/projects/contributionScaling.ts. Drag Total Level to see how newcomer and veteran effort stay proportional.

TL 500
Gold / 1 Support Pt
952g
100 · (TL/100)^1.4
Units / 1 Support Pt
37 units
ceil(10·(TL/100)^0.8 / 1)

At TL 1,400, donating Tier 1 Birch takes 83 logs per Support Point while Tier 5 Elderwood takes only 3, preventing veterans from trivially dumping starter stockpiles while keeping newcomers genuinely helpful.

054-Tier Expeditions
Risk, Prep & Consumable Sinks

Replacing Binary Trip Failures With Graduated Outcomes

Binary failure penalties punished longer idle trips and left cooked food and potions unused. Moving to four yield tiers tied food buffs, potions, tool tiers, Endurance, and Survival into expedition outcomes.

4-Tier Expedition Hazard vs. Resistance Resolver

Adjust region danger, tools, Endurance, Survival, and packed consumables to see why food and potions became real gameplay levers instead of dead bank clutter.

Region TierTier 4 (Hazard 65)
Tool TierTier 4 (+32 R)
EnduranceLv 45
SurvivalLv 40
OUTCOME TIERR 93 vs H 65 (+28)
Triumph
115% – 125% Yield

+25% bonus rare drop chance

MajorMinorStandardTriumph
Audit Finding · Missing High-Tier Tool Tags
While auditing filterEquippedStats.ts, I found that Tier 6 to 8 pickaxes and hatchets were tagged mining and pickaxe without the _tool suffix checked by the stat aggregator. Equipping top-tier tools dropped gather yield and speed bonuses to zero until the tags were fixed across ITEM_BASES.
06Skills & UI Tokens
Systems Cohesion & Discord UI

Distinct Roles for All 13 Skills & Standardized Embeds

Endurance

Reduces expedition duration (-1% per 5 levels, up to -20%), adds hazard resistance, and extends fatigue thresholds.

Survival

Extends food buff durations (+1% per level), improves camp yield, and converts Major Setbacks into Minor Setbacks.

Scavenging

Raises relic and blueprint discovery (+0.5% per level), recovers socketed gems when salvaging, and multiplies scrap yield.

Tracking

Supplies 20+ beast pelts and scales directly into Leatherworking recipes and increases roaming beast encounters.

apps/bot/src/lib/designTokens.ts · Shared Visual Tokens

Centralized embed colors, 11 category headers, feedback icons, and trip duration labels in designTokens.ts across all 43 commands, paired with player-text-manager.mjs to export and diff player-facing copy in CSV or JSON.

Warm Oak
Primary
Treasury Gold
Epoch / Loot
Frontier Sky
Info / Guide
Verdant Green
Triumph
Amber Lantern
Minor Setback
Crimson Hazard
Major Hazard
Deep Timber
Secondary
Stone Gray
Meta