Browse/Crafting & Building/Base Construction
Crafting & Building

Base Construction

Framework for implementing base construction in games, covering the core loop, edge cases, and integration points.

Low complexity
4 examples
2 patterns

Overview

The base construction mechanic provides a framework that balances complexity with accessibility to engage diverse audiences. The mechanic interacts with multiple other game systems, creating emergent gameplay that extends beyond its individual components. The key to successful implementation lies in clear communication of rules, fair outcomes, and satisfying feedback for player actions.

Game Examples

Fishing Games

Fishing Games use this mechanic where players master complex timing to reach the highest tier. Accessibility options allow different skill levels to participate, resulting in competitive depth.

Racing Games

Racing Games use this mechanic where players master complex timing to survive increasingly difficult challenges. The mechanic respects player time and investment, resulting in memorable moments.

Colony Simulators

Colony Simulators use this mechanic where players respond to dynamic events to optimize their strategy. The system tracks multiple variables simultaneously, resulting in a sense of mastery.

Party Games

Party Games use this mechanic where players track multiple variables to support their team effectively. The mechanic integrates seamlessly with other systems, resulting in long-term engagement.

Pros & Cons

Advantages

  • Integrates naturally with progression systems
  • Easy to understand but difficult to master
  • Enhances social without disrupting core gameplay
  • Creates satisfying immediate loops

Disadvantages

  • Increases CPU requirements significantly
  • Risk of power creep in multiplayer contexts
  • Creates potential for abuse by experienced players

Implementation Patterns

Blueprint System

Core implementation pattern for handling base construction logic with clean state management.

class BaseConstructionProcessor {
  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.01) return "legendary";
    if (roll < baseChance * 0.2) return "rare";
    if (roll < baseChance) return "uncommon";
    return "common";
  }
}

Assembly Pipeline

Data-driven implementation that loads base construction configuration from external definitions.

class BaseConstructionManager {
  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";
  }
}