Browse/Crafting & Building/Portal Construction
Crafting & Building

Portal Construction

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

Medium complexity
2 examples
1 patterns

Overview

Portal Construction is a fundamental game mechanic that defines how players interact with this aspect of the game world. The implementation varies significantly across genres, with each game adapting the core concept to fit its specific design goals and target audience. Modern implementations often combine this mechanic with procedural elements to increase variety and replayability.

Game Examples

Party Games

Party Games use this mechanic where players customize their experience to outperform other players. Player choice meaningfully affects outcomes, resulting in memorable moments.

Point-and-Click Adventures

Point-and-Click Adventures use this mechanic where players navigate branching paths to achieve mastery over the system. Each decision has cascading consequences, resulting in build diversity.

Pros & Cons

Advantages

  • Enables strategic player expression
  • Creates natural cooperation between players
  • Scales well from beginner to advanced play
  • Creates natural competition between players

Disadvantages

  • May overwhelm accessibility-focused players with too many options
  • May overwhelm younger audiences with too many options
  • Risk of analysis paralysis in competitive environments
  • Can create unfair when RNG is unfavorable
  • Can become obsolete in the late game

Implementation Patterns

Crafting Queue

A modular approach to portal construction that separates concerns and enables easy testing.

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