Heating / Cooling System
Design pattern addressing heating / cooling system, defining how this system creates engagement and supports the overall game experience.
Overview
This mechanic, commonly known as heating / cooling system, establishes rules governing player behavior and system responses. When well-implemented, this mechanic creates a satisfying feedback loop that keeps players engaged and motivated to continue playing. Cross-genre adoption of this mechanic demonstrates its versatility and fundamental appeal to players across different gaming preferences.
Game Examples
Grand Strategy Games
Grand Strategy Games use this mechanic where players customize their experience to outperform other players. Multiple valid strategies exist for different playstyles, resulting in long-term engagement.
First-Person Shooters
First-Person Shooters use this mechanic where players weigh competing priorities to support their team effectively. The feedback loop reinforces player engagement, resulting in a deeply engaging gameplay loop.
Stealth Games
Stealth Games use this mechanic where players allocate limited resources to tell their own story. The learning curve is steep but rewarding, resulting in a sense of mastery.
Farming Simulators
Farming Simulators use this mechanic where players learn through failure to achieve mastery over the system. The system rewards both skill and knowledge, resulting in emergent storytelling.
Pros & Cons
Advantages
- Scales well from beginner to advanced play
- Reduces tedium while maintaining challenge
- Encourages stealthy playstyles and experimentation
Disadvantages
- May overwhelm competitive players with too many options
- Requires extensive balance testing to avoid edge cases
- May overwhelm accessibility-focused players with too many options
Implementation Patterns
Crafting Queue
Data-driven implementation that loads heating / cooling system configuration from external definitions.
class HeatingCoolingSystemSystem {
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.05);
return { ...recipe.output, quality };
}
rollQuality(baseChance: number) {
const roll = Math.random();
if (roll < baseChance * 0.01) return "legendary";
if (roll < baseChance * 0.15) return "rare";
if (roll < baseChance) return "uncommon";
return "common";
}
}Material Dispatcher
A modular approach to heating / cooling system that separates concerns and enables easy testing.
class HeatingCoolingSystemProcessor {
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.15);
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";
}
}