Skip to main content

Game Configuration Settings Overview

Build Information

Current documentation based on build version: 676042 Last updated: 2025-06-21

System Purpose

The Game Configuration Settings category provides the foundational infrastructure for managing all configuration aspects of Don't Starve Together. These systems establish global constants, handle platform-specific configurations, manage game balance parameters, and provide override mechanisms for testing and customization. They form the technical backbone that enables consistent game behavior across different platforms and deployment scenarios.

Key Responsibilities

  • Define and manage global game constants and configuration values
  • Provide platform-specific configuration management and overrides
  • Handle game balance parameters through the central tuning system
  • Support testing and debugging through configuration override mechanisms
  • Manage console settings and user preference persistence
  • Control fire mechanics and environmental systems configuration

System Scope

This category includes all configuration infrastructure but excludes high-level game mode management (handled by Game Configuration Modes) and runtime gameplay mechanics (handled by Game Mechanics).

Architecture Overview

System Components

Game Configuration Settings are implemented as low-level infrastructure services that provide the foundation for all other game systems. The configuration architecture supports layered overrides, platform-specific customization, and runtime modification capabilities.

Data Flow

Platform Detection → Base Configuration → Override Application → Global Constants → System Initialization
↓ ↓ ↓ ↓ ↓
Config Selection → Default Values → Platform Specific → Tuning Values → Game Systems Ready

Integration Points

  • All Game Systems: Every system depends on configuration values and constants
  • Platform Layer: Platform-specific overrides affect configuration behavior
  • Testing Framework: Override systems enable isolated testing environments
  • Game Balance: Tuning systems control all gameplay parameters
  • User Preferences: Settings persistence affects user experience

Recent Changes

BuildDateComponentChange TypeDescription
6760422025-06-21ConfigstablePlatform configuration management system
6760422025-06-21ConstantsstableGlobal constants and configuration values
6760422025-06-21TuningstableCentral game balance and configuration system

Core Infrastructure Modules

Platform Configuration

Platform-aware configuration management with automatic override application.

ModuleStatusDescriptionKey Features
ConfigstablePlatform configuration managementPlatform detection, override application, configuration persistence

Global Constants

Comprehensive system defining all global constants and enumerations.

ModuleStatusDescriptionKey Features
ConstantsstableGlobal constants and configuration valuesMathematical constants, input mappings, character data, rendering layers

Game Balance

Central system controlling all gameplay balance parameters.

ModuleStatusDescriptionKey Features
TuningstableGame balance and configuration systemNumeric balance values, modifier functions, multiplayer adjustments

Override Systems

Testing and debugging configuration override mechanisms.

ModuleStatusDescriptionKey Features
Tuning OverridestableSystem for overriding game mechanicsFunction replacement, mechanic disabling, testing support

User Settings

Persistent user preference and console history management.

ModuleStatusDescriptionKey Features
Console Screen SettingsstableConsole history and settings persistenceCommand history, UI state, automatic save/load

Environmental Configuration

Specialized configuration for environmental systems.

ModuleStatusDescriptionKey Features
Fire LevelstableFire intensity and behavior configurationFire progression, visual effects, heat distribution

Global Variable Overrides

System for global variable configuration and environment-specific overrides.

ModuleStatusDescriptionKey Features
Base OverridesstableBase configuration templateClean foundation, documentation
Clean OverridesstableEmpty configuration for testingZero modifications, baseline environment
Monkey OverridesstableMod testing configurationMod support, warning suppression
PAX Server OverridesstableEvent server configurationTimed sessions, public demonstrations

Common Infrastructure Patterns

Platform Configuration Access

-- Check platform-specific configuration
if TheConfig:IsEnabled("hide_vignette") then
-- Mobile optimization: remove performance-heavy vignette
HideVignetteEffects()
end

if TheConfig:IsEnabled("force_netbookmode") then
-- Use compact layout for smaller screens
SetCompactUIMode()
end

Tuning System Usage

-- Access game balance values
local player_health = TUNING.WILSON_HEALTH -- 150
local spear_damage = TUNING.SPEAR_DAMAGE -- 34
local day_length = TUNING.TOTAL_DAY_TIME -- 480 seconds

-- Use tuning values in component setup
inst.components.health:SetMaxHealth(TUNING.WILSON_HEALTH)
inst.components.weapon:SetDamage(TUNING.SPEAR_DAMAGE)

Constants System Integration

-- Use global constants for consistency
if entity.Transform:GetFacing() == FACING_RIGHT then
-- Entity is facing right
end

-- Check for specific input
if TheInput:IsControlPressed(CONTROL_ATTACK) then
-- Player is trying to attack
end

Override System Application

-- Disable specific mechanics for testing
local overrides = require("tuning_override")
HoundAttackManager.StartAttack = overrides.hounds -- Disable hound attacks
EarthquakeManager.StartQuake = overrides.earthquakes -- Disable earthquakes

Infrastructure Dependencies

Required Systems

Optional Systems

Performance Considerations

System Performance

  • Configuration values are resolved at startup for optimal runtime performance
  • Platform detection occurs once during initialization
  • Tuning values use direct table access for O(1) lookup performance
  • Override functions have minimal call overhead

Resource Usage

  • Configuration data is cached in memory for fast access
  • Constants are stored as immutable values requiring minimal memory
  • Override systems share common dummy functions to reduce memory usage
  • Settings persistence uses efficient JSON serialization

Scaling Characteristics

  • Configuration systems handle unlimited custom values through extensible design
  • Platform-specific overrides scale efficiently with new platform additions
  • Tuning modifiers support complex calculations without performance degradation
  • Settings systems accommodate growing user preference requirements

Development Guidelines

Best Practices

  • Always use existing constants instead of hard-coding values
  • Apply platform-specific configuration through the Config system
  • Use tuning values for all gameplay balance parameters
  • Test configuration changes across all supported platforms
  • Document all custom configuration additions and their purposes

Common Pitfalls

  • Hard-coding values instead of using constants or tuning parameters
  • Not considering platform differences when implementing features
  • Modifying configuration values without understanding their system-wide impact
  • Bypassing the configuration system for direct global variable access
  • Not testing configuration changes in multiplayer environments

Testing Strategies

  • Use clean override configurations for baseline testing
  • Test platform-specific configurations on target platforms
  • Verify tuning value changes don't break game balance
  • Test override systems for proper mechanic disabling
  • Validate settings persistence across save/load cycles

System Integration Patterns

With Core Game Systems

Configuration settings provide the foundation for all game functionality:

  • Constants define the behavioral parameters for all systems
  • Tuning values control the balance and feel of gameplay mechanics
  • Platform configuration ensures consistent behavior across deployment targets
  • Override systems enable isolated testing of individual components

With Development Workflow

Settings infrastructure supports efficient development processes:

  • Override systems allow selective feature disabling for focused testing
  • Platform configuration enables cross-platform development and testing
  • Tuning system supports rapid balance iteration and experimentation
  • Settings persistence maintains developer preferences across sessions

With User Experience

Configuration systems directly impact player experience:

  • Platform-specific optimizations ensure optimal performance on each target
  • Tuning values create consistent and balanced gameplay
  • Settings persistence maintains user preferences and customizations
  • Configuration flexibility supports modding and customization

Performance Monitoring

Key Metrics

  • Configuration lookup time and frequency
  • Platform detection and override application duration
  • Tuning value access patterns and performance
  • Settings persistence operation performance
  • Memory usage of configuration data structures

Optimization Strategies

  • Cache frequently accessed configuration values
  • Minimize runtime configuration lookups through startup resolution
  • Use efficient data structures for configuration storage
  • Optimize settings persistence for minimal I/O operations
  • Monitor and limit configuration-related memory usage

Troubleshooting Infrastructure Issues

Common Configuration Problems

IssueSymptomsSolution
Platform overrides not applyingFeatures behave incorrectly on specific platformsCheck platform detection and override logic
Tuning values not taking effectGameplay balance feels wrongVerify tuning value loading and application
Settings not persistingUser preferences reset on restartCheck settings save/load operations
Constants not availableCompilation or runtime errorsVerify constants loading order and dependencies

Debugging Infrastructure

  • Use configuration debug commands to inspect current settings
  • Monitor platform detection and override application
  • Check tuning value resolution and modifier application
  • Validate settings persistence operations and file integrity
  • Review configuration loading order and dependency resolution

Advanced Infrastructure Features

Custom Configuration Development

  • Framework for creating custom configuration categories
  • Extension points for platform-specific configuration needs
  • Integration patterns for configuration UI development
  • Best practices for configuration validation and error handling

Configuration Migration

  • Support for configuration format upgrades across game versions
  • Migration strategies for settings compatibility
  • Backward compatibility considerations for configuration changes
  • Version-aware configuration loading and fallback mechanisms

Testing and Development Support

  • Comprehensive override system for feature isolation
  • Configuration validation tools for development workflows
  • Testing frameworks that leverage configuration flexibility
  • Performance measurement tools for configuration impact assessment

Future Development Considerations

Extensibility Design

  • Configuration systems support unlimited custom additions
  • Platform configuration framework accommodates new deployment targets
  • Tuning system designed for complex balance calculations and modifiers
  • Override mechanisms support advanced testing and debugging scenarios

Integration Planning

  • New features should leverage existing configuration infrastructure
  • Consider platform implications for all configuration changes
  • Design for backward compatibility with existing configuration data
  • Plan for configuration UI and user experience implications
SystemRelationshipIntegration Points
Game Configuration ModesUses settings infrastructureMode-specific configuration application
Character SystemsDepends on tuning valuesCharacter stat and behavior configuration
Game MechanicsUses balance parametersRecipe costs, damage values, timing
World SystemsUses generation parametersWorld creation and environmental settings
Development ToolsUses override systemsTesting and debugging configuration

Contributing to Infrastructure

Adding New Configuration Categories

  1. Follow established patterns for configuration organization
  2. Implement proper validation and error handling
  3. Consider platform-specific requirements and overrides
  4. Document configuration impact and usage guidelines

Extending Platform Support

  1. Understand current platform detection mechanisms
  2. Implement appropriate configuration overrides for new platforms
  3. Test configuration behavior across all supported platforms
  4. Update documentation for platform-specific considerations

Modifying Core Constants

  1. Understand system-wide impact of constant changes
  2. Maintain backward compatibility where possible
  3. Test changes across all game systems and features
  4. Document changes and their implications for dependent systems