Browse/Crafting & Building/Electrical Wiring
Crafting & Building

Electrical Wiring

A system that manages electrical wiring mechanics, providing structured rules for how this feature operates within the game.

Low complexity
3 examples
2 patterns

Overview

Electrical Wiring represents a design pattern that balances complexity with accessibility to engage diverse audiences. Designers must carefully balance the system's depth against its learning curve, ensuring that new players can engage while experienced players find room for mastery. Modern implementations often combine this mechanic with procedural elements to increase variety and replayability.

Game Examples

Fighting Games

Fighting Games use this mechanic where players track multiple variables to complete objectives efficiently. Failure states are informative rather than punishing, resulting in risk-reward tension.

Sandbox Games

Sandbox Games use this mechanic where players interact with NPCs to unlock new abilities and options. The system tracks multiple variables simultaneously, resulting in skill differentiation.

Tycoon Games

Tycoon Games use this mechanic where players make strategic decisions to achieve mastery over the system. Accessibility options allow different skill levels to participate, resulting in social interaction.

Pros & Cons

Advantages

  • Creates satisfying delayed loops
  • Enhances temporal without disrupting core gameplay
  • Provides long-term collection objectives for dedicated players
  • Supports numerous viable strategies and approaches
  • Enables mechanical player expression

Disadvantages

  • Can lead to frustration if overused
  • May create a knowledge wall for new players
  • May create a skill gap for new players
  • May reduce pacing if implemented poorly

Implementation Patterns

Crafting Queue

Data-driven implementation that loads electrical wiring configuration from external definitions.

class ElectricalWiringController {
  recipes: Recipe[] = [];

  craft(recipeId: string, inventory: Inventory) {
    const recipe = this.recipes.find(r => r.id === recipeId);
    if (!recipe) return null;

    for (const ingredient of recipe.ingredients) {
      if (!inventory.has(ingredient.id, ingredient.amount)) {
        return null; // Missing materials
      }
    }

    for (const ingredient of recipe.ingredients) {
      inventory.remove(ingredient.id, ingredient.amount);
    }

    const quality = this.rollQuality(0.2);
    return { ...recipe.output, quality };
  }

  rollQuality(baseChance: number) {
    const roll = Math.random();
    if (roll < baseChance * 0.05) return "legendary";
    if (roll < baseChance * 0.1) return "rare";
    if (roll < baseChance) return "uncommon";
    return "common";
  }
}

Assembly Pipeline

Event-driven pattern that reacts to electrical wiring changes and updates dependent systems.

class ElectricalWiringHandler {
  recipes: Recipe[] = [];

  craft(recipeId: string, inventory: Inventory) {
    const recipe = this.recipes.find(r => r.id === recipeId);
    if (!recipe) return null;

    for (const ingredient of recipe.ingredients) {
      if (!inventory.has(ingredient.id, ingredient.amount)) {
        return null; // Missing materials
      }
    }

    for (const ingredient of recipe.ingredients) {
      inventory.remove(ingredient.id, ingredient.amount);
    }

    const quality = this.rollQuality(0.1);
    return { ...recipe.output, quality };
  }

  rollQuality(baseChance: number) {
    const roll = Math.random();
    if (roll < baseChance * 0.02) return "legendary";
    if (roll < baseChance * 0.1) return "rare";
    if (roll < baseChance) return "uncommon";
    return "common";
  }
}