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
Build | Date | Component | Change Type | Description |
---|---|---|---|---|
676042 | 2025-06-21 | Config | stable | Platform configuration management system |
676042 | 2025-06-21 | Constants | stable | Global constants and configuration values |
676042 | 2025-06-21 | Tuning | stable | Central game balance and configuration system |
Core Infrastructure Modules
Platform Configuration
Platform-aware configuration management with automatic override application.
Module | Status | Description | Key Features |
---|---|---|---|
Config | stable | Platform configuration management | Platform detection, override application, configuration persistence |
Global Constants
Comprehensive system defining all global constants and enumerations.
Module | Status | Description | Key Features |
---|---|---|---|
Constants | stable | Global constants and configuration values | Mathematical constants, input mappings, character data, rendering layers |
Game Balance
Central system controlling all gameplay balance parameters.
Module | Status | Description | Key Features |
---|---|---|---|
Tuning | stable | Game balance and configuration system | Numeric balance values, modifier functions, multiplayer adjustments |
Override Systems
Testing and debugging configuration override mechanisms.
Module | Status | Description | Key Features |
---|---|---|---|
Tuning Override | stable | System for overriding game mechanics | Function replacement, mechanic disabling, testing support |
User Settings
Persistent user preference and console history management.
Module | Status | Description | Key Features |
---|---|---|---|
Console Screen Settings | stable | Console history and settings persistence | Command history, UI state, automatic save/load |
Environmental Configuration
Specialized configuration for environmental systems.
Module | Status | Description | Key Features |
---|---|---|---|
Fire Level | stable | Fire intensity and behavior configuration | Fire progression, visual effects, heat distribution |
Global Variable Overrides
System for global variable configuration and environment-specific overrides.
Module | Status | Description | Key Features |
---|---|---|---|
Base Overrides | stable | Base configuration template | Clean foundation, documentation |
Clean Overrides | stable | Empty configuration for testing | Zero modifications, baseline environment |
Monkey Overrides | stable | Mod testing configuration | Mod support, warning suppression |
PAX Server Overrides | stable | Event server configuration | Timed 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
- System Core: Engine integration and platform detection services
- Data Management: Configuration persistence and file operations
- Fundamentals: Basic class and utility frameworks
Optional Systems
- Development Tools: Debug configuration and override tools
- User Interface: Configuration UI and settings screens
- Networking: Network-specific configuration handling
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
Issue | Symptoms | Solution |
---|---|---|
Platform overrides not applying | Features behave incorrectly on specific platforms | Check platform detection and override logic |
Tuning values not taking effect | Gameplay balance feels wrong | Verify tuning value loading and application |
Settings not persisting | User preferences reset on restart | Check settings save/load operations |
Constants not available | Compilation or runtime errors | Verify 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
Related Systems
System | Relationship | Integration Points |
---|---|---|
Game Configuration Modes | Uses settings infrastructure | Mode-specific configuration application |
Character Systems | Depends on tuning values | Character stat and behavior configuration |
Game Mechanics | Uses balance parameters | Recipe costs, damage values, timing |
World Systems | Uses generation parameters | World creation and environmental settings |
Development Tools | Uses override systems | Testing and debugging configuration |
Contributing to Infrastructure
Adding New Configuration Categories
- Follow established patterns for configuration organization
- Implement proper validation and error handling
- Consider platform-specific requirements and overrides
- Document configuration impact and usage guidelines
Extending Platform Support
- Understand current platform detection mechanisms
- Implement appropriate configuration overrides for new platforms
- Test configuration behavior across all supported platforms
- Update documentation for platform-specific considerations
Modifying Core Constants
- Understand system-wide impact of constant changes
- Maintain backward compatibility where possible
- Test changes across all game systems and features
- Document changes and their implications for dependent systems