clan system

Guide for clan system

Clan (Sangha) System Design

Concept: In Legends of Hastinapur, a Clan is known as a Sangha (Community) or Sampradaya (Tradition). It is not just a chat channel, but a spiritual and economic cooperative centered around a growing Clan Temple.

1. Creation Process: The Sankalpa (Vow)

Creating a Sangha is a significant commitment, requiring a group effort, not just one wealthy player.

Requirements

  1. The Four Acharyas (Founders):
    • A Sangha CANNOT be created by a single player.
    • Requires 4 Founding Players to be present at the "Temple of Origins" in Kashi.
    • Each Founder must contribute:
      • 100,000 Gold (Total 400k).
      • 1 Unique Item: E.g., a "Vedic Scroll" obtained from a difficult quest or drop.
  2. The Ritual:
    • The 4 Founders perform a Sankalpa (Solemn Vow).
    • They must choose a Deity for their Clan Temple (Agni, Indra, Varuna, etc.) which influences cosmetic themes.
  3. Naming:
    • Name limited to Sanskrit/Vedic themes is encouraged but not enforced strictly (Standard filters apply).

2. Structure & Hierarchy

RankTitleRole / Power
LeaderMahant (Abbot)Only 1 (or rotating). Full control. Can disband (with voting).
Co-LeadersAcharya (Teacher)The 4 Founders start here. Can initiate Yajnas, kick members, upgrade Temple.
ElderGuruCan recruit, mute chat, start Resource Phases.
MemberShishya (Student)Standard member. Can contribute resources and vote.
ProbationSadhaka (Aspirant)New recruit. Cannot vote or withdraw from Clan Bank.

3. Recruitment & Onboarding Plan

Recruitment Mechanisms

  1. Ashram Notice Boards:
    • Physical boards in major cities (Kashi, Dwaraka).
    • Clans can post a "Dharma Patra" (Flyer) listing their focus (PvE, Skilling, PvP) and requirements.
    • Players can "Apply" directly via the board.
  2. Invite Scrolls:
    • Leaders can craft/buy "Invite Scrolls" to hand to players. Using the scroll sends a formal invite UI.

Onboarding Flow: The Initiation

  1. The Welcome:
    • When a player joins, they spawn in the Clan Temple.
    • They are greeted by a system message (customizable by Leaders) explaining the Clan's rules.
  2. The Sadhaka Phase (Probation):
    • New members start as Sadhaka.
    • Restriction:
      • Cannot withdraw from Clan Bank.
      • Cannot vote on Weekly Yajna.
    • Promotion Criteria:
      • Manual promotion by Acharya/Guru.
      • OR Automatic after contributing X value of resources to the Clan Stockpile.
  3. Mentorship System:
    • A Guru can be assigned as a mentor to a Sadhaka.
    • If the Sadhaka reaches certain milestones (Total Level, Quest Pts), the Guru gets a small "Karma" reward (Boon Points).

4. Clan Progression

Clans level up by successfully completing Weekly Yajnas.

Levels & Unlocks

  • Level 1: Basic Temple Instance, 50 Members.
  • Level 5: Clan Bank (Shared storage).
  • Level 10: Temple Garden (Instanced Skilling Plots - see Group Activities).
  • Level 20: Clan Teleport (Teleport to Temple).
  • Level 50: Member Cap Increase (up to 200).

5. Clan Bank & Economy

  • Tax System: Leaders can set a generic "Tax" on gold drops (e.g., 5%) that goes to the Clan Coffer.
  • Stockpile: Separate from the Bank. Accepts only Yajna resources (Wood, Ghee, etc.).
    • Instanced Auto-Add: Resources gathered inside the Temple Garden go straight here.

Summary of User Feedback Integration

  • 4 Leaders: Enforced via "Four Acharyas" requirement.
  • Instanced Gathering: Integrated as "Temple Garden" unlock.
  • Onboarding: Defined "Sadhaka" role and mentorship incentives.

6. Technical Implementation Status (As of Jan 2026)

Backend (logic-core)

  • Resource Stockpile: Implemented via clan_resources table (clan_id, item_id, amount) and ClanManager::deposit_resource (idempotent).
  • Homa Voting: Implemented via clan_homa_votes (aggregates) and clan_member_votes (individual tracking to prevent double voting).
  • Vote Logic: Transactional voting ensures consistency between member record and aggregate count.
  • Creation: currently uses ClanManager::create_clan (single owner). 4-Founder requirement is a high-level orchestration task pending implementation.

Frontend (loh-game)

  • SDK Overlay: "Sangha Dashboard" implemented in systems/sdk/clan.rs.
  • Tabs:
    • Dashboard: View Clan Stats.
    • Stockpile: View/Deposit Resources.
    • Voting: Vote for weekly Homa bonuses.
    • Admin: Clan creation interface.

Database Schema

-- Resources
TABLE clan_resources (clan_id, item_id, amount)
-- Voting
TABLE clan_homa_votes (clan_id, week_number, vote_option, count)
TABLE clan_member_votes (clan_id, player_id, week_number, vote_option)