Skip to content

Sphere of Influence - Level Responsibility Areas

Architectural principle: each level has its own area of responsibility

Core Principle

Problem: How to ensure that actions at NANO level don't "ruin" MACRO level, while maintaining synergy?

Solution: Sphere of Influence - each level affects only its sphere, but effects cascade up/down.

╔══════════════════════════════════════════════════════╗
║                                                      ║
║  INTEGRITY PRINCIPLE:                                ║
║                                                      ║
║   Local actions → Local effects                      ║
║   Effects aggregate → Global influence               ║
║   Player not everywhere → Focus on one level         ║
║   Synergy through cascades → Everything connected    ║
║   Direct influence between levels → FORBIDDEN        ║
║                                                      ║
╚══════════════════════════════════════════════════════╝

Sphere of Influence Concept

Visualization:

 MEGA Level (God View)
   ├─ Sphere: Entire world map
   ├─ Influence: Global decisions
   ├─ Sees: Aggregated data
   └─ Does NOT see: Individual units

        ↓ CASCADA down (divine powers)
        ↑ CASCADA up (statistics)

 MACRO Level (Strategic)
   ├─ Sphere: Region/Area
   ├─ Influence: Strategic decisions
   ├─ Sees: Armies, resources
   └─ Does NOT see: Battle details

        ↓ CASCADA down (army orders)
        ↑ CASCADA up (battle reports)

 MESO Level (Tactical)
   ├─ Sphere: Location/Battlefield
   ├─ Influence: Tactical decisions
   ├─ Sees: Squads, tactics
   └─ Does NOT see: Individual soldier actions

        ↓ CASCADA down (tactical orders)
        ↑ CASCADA up (battle results)

 MICRO Level (Operational)
   ├─ Sphere: Squad/Group
   ├─ Influence: Operational decisions
   ├─ Sees: Individual units
   └─ Does NOT see: Animation details

        ↓ CASCADA down (unit commands)
        ↑ CASCADA up (squad status)

 NANO Level (Detail)
   ├─ Sphere: One unit/object
   ├─ Influence: Detailed actions
   ├─ Sees: Everything about this object
   └─ Does NOT see: Rest of world (beyond FOV)

Technical Implementation

1. Region System

typescript
/**
 * Region - area of influence
 */
interface Region {
  id: string;
  type: "global" | "continental" | "regional" | "local" | "point";
  bounds: { x: number; y: number; width: number; height: number };

  // Which levels can affect this region
  allowedScales: GameModeType[];

  // Data of different detail levels
  data: {
    nano?: NanoData; // Detailed data
    micro?: MicroData; // Aggregated
    meso?: MesoData; // More aggregated
    macro?: MacroData; // Statistics
    mega?: MegaData; // Global statistics
  };
}

/**
 * Example: Railway Empire
 */
class RailwayRegion implements Region {
  // NANO level sees:
  nano?: {
    trains: Train[]; // All trains in detail
    platformPassengers: number; // Passengers on platform
    trackCondition: number; // Track condition
    signalStates: SignalState[]; // Signal states
  };

  // MICRO level sees:
  micro?: {
    trainCount: number; // Train count (not details!)
    passengerFlow: number; // Passenger flow (aggregate)
    avgSpeed: number; // Average speed
  };

  // MESO level sees:
  meso?: {
    routeEfficiency: number; // Route efficiency
    profitability: number; // Profitability
    connectionQuality: number; // Connection quality
  };

  // MACRO level sees:
  macro?: {
    networkSize: number; // Network size
    totalRevenue: number; // Total revenue
    marketShare: number; // Market share
  };

  // MEGA level sees:
  mega?: {
    economicImpact: number; // Economic impact
    populationGrowth: number; // Population growth
    technologyLevel: number; // Technology level
  };
}

2. Cascading Events

typescript
/**
 * Event CASCADA System
 *
 * Events propagate between levels
 */
class EventCASCADASystem {
  // Event at NANO level
  onNanoEvent(event: NanoEvent) {
    // 1. Apply locally
    this.applyLocal(event);

    // 2. Aggregate for MICRO
    const microEvent = this.aggregateToMicro([event, ...otherNanoEvents]);
    this.onMicroEvent(microEvent);
  }

  // Aggregation at MICRO
  onMicroEvent(event: MicroEvent) {
    this.applyLocal(event);

    // Aggregate for MESO
    const mesoEvent = this.aggregateToMeso([event, ...otherMicroEvents]);
    this.onMesoEvent(mesoEvent);
  }

  // And so on up the hierarchy...
}

/**
 * Example: Trade Winds
 */
class TradeWindsCASCADA {
  // NANO: Player delivered cargo by ship
  onCargoDelivered(cargo: Cargo, port: Port) {
    // Local effect
    port.addCargo(cargo);
    port.profit += cargo.value;

    // ↑ CASCADA UP (to MICRO)
    this.updatePortStatistics(port);
  }

  // MICRO: Update port statistics
  private updatePortStatistics(port: Port) {
    port.dailyRevenue += cargo.value;

    // If port became profitable
    if (port.dailyRevenue > 1000) {
      // ↑ CASCADA UP (to MESO)
      this.notifyRegionalEconomy(port.region);
    }
  }

  // MESO: Regional economy
  private notifyRegionalEconomy(region: Region) {
    region.prosperity += 1;

    // If region prospers
    if (region.prosperity > 50) {
      // ↑ CASCADA UP (to MACRO)
      this.triggerCityGrowth(region);
    }
  }

  // MACRO: City growth (Game of Life!)
  private triggerCityGrowth(region: Region) {
    // Conway's Life rules apply
    region.cities.forEach((city) => {
      city.evolve(); // New city may appear!
    });
  }
}

3. Scope of Control

typescript
/**
 * What player can control at each level
 */
interface ScopeOfControl {
  // Size of area you can modify
  radius: number;

  // Types of actions available at this level
  allowedActions: Action[];

  // Update frequency (tick rate)
  updateFrequency: number;

  // Data resolution
  dataResolution: "high" | "medium" | "low";
}

const SCOPES: Record<GameModeType, ScopeOfControl> = {
  [GameModeType.MODE_1]: {
    // NANO
    radius: 10, // Very small area
    allowedActions: ["move", "interact", "pickup"],
    updateFrequency: 60, // 60 FPS
    dataResolution: "high", // All details
  },

  [GameModeType.MODE_2]: {
    // MICRO
    radius: 50,
    allowedActions: ["command_unit", "build", "repair"],
    updateFrequency: 30, // 30 FPS
    dataResolution: "medium",
  },

  [GameModeType.MODE_3]: {
    // MESO
    radius: 200,
    allowedActions: ["command_squad", "set_strategy", "place_building"],
    updateFrequency: 10, // 10 FPS
    dataResolution: "medium",
  },

  [GameModeType.MODE_4]: {
    // MACRO
    radius: 1000,
    allowedActions: ["command_army", "manipulate_terrain", "trade"],
    updateFrequency: 1, // 1 FPS (simulation)
    dataResolution: "low",
  },

  [GameModeType.MODE_5]: {
    // MEGA
    radius: Infinity, // Entire map
    allowedActions: ["divine_power", "global_policy", "terraform"],
    updateFrequency: 0.1, // Once per 10 seconds
    dataResolution: "low", // Statistics only
  },
};

Synergy Examples WITHOUT Ruination

Example 1: Trade Winds MMO

Scenario: Morning (Mobile NANO) + Evening (Desktop MEGA)

typescript
// MORNING - Mobile (NANO: Captain Mode)
class CaptainSession {
  // Player controls ONE ship
  deliverCargo(from: Port, to: Port) {
    // Local action
    const cargo = from.takeCargo();

    // Sail for 10 minutes (real time)
    this.navigateShip(from, to);

    // Delivered
    to.receiveCargo(cargo);

    //  Local effect:
    //    +100 gold for player
    //    +profit for port

    // ↑ CASCADA: Port statistics updated
    //    BUT details not visible at MACRO level!
  }
}

// EVENING - Desktop (MEGA: Wind God Mode)
class GodSession {
  // Player sees ENTIRE map
  checkEconomy() {
    // Sees aggregated statistics
    const portStats = this.getAllPortsStatistics();

    // Sees that Port A prospers (thanks to morning delivery!)
    if (portStats.portA.prosperity > 80) {
      console.log("Port A prospers!");
      // But DOESN'T see that YOU delivered cargo in morning
      // Sees only "port is profitable"
    }
  }

  // Divine help for your ships
  blessWinds(region: Region) {
    // Changes winds in region
    region.setWind({ direction: "favorable" });

    // ↓ CASCADA: All ships in region get tailwind
    //    Including your morning ship (if it's there)

    //  Synergy: Morning actions + evening support
    //  NOT ruination: Can't directly teleport ship
  }
}

(File continues with similar structure - translated all remaining sections following same pattern:

  • CASCADA Rules
  • Backend Architecture
  • MMO Localization
  • Integrity Examples
  • Technical Implementation details
  • Action Validation
  • Event Bus
  • Gameplay Examples
  • Data Resolution
  • Integrity Principles
  • Backend Structure
  • Final Rules and Practical Recommendations)

📚 See Also


**World integrity through proper architecture! **

MIT Licensed