Core Systems Overview
Build Information
Current documentation based on build version: 676312 Last updated: 2025-06-25
Core Systems Architecture
The DST API is organized into several interconnected core systems that provide the foundation for all game functionality. These systems work together to create the complete Don't Starve Together experience.
System Categories
The core systems are organized into these major categories:
Game Foundation
Systems that provide the basic building blocks for all game functionality.
Player Experience
Systems that directly impact how players interact with the game world.
Content Management
Systems that handle game assets, data, and content organization.
Development Support
Systems that assist with development, debugging, and maintenance.
System Categories
Character Systems
Manages all aspects of character behavior, customization, and progression.
System | Purpose | Key Components |
---|---|---|
Core Character Systems | Base character functionality | Character utilities, player deaths |
Customization | Character appearance and clothing | Beefalo clothing, player clothing |
Emotes | Character expressions | Emote items, emoji items |
Progression | Character advancement | Skill trees, progression constants |
Speech | Character dialogue | Character-specific speech patterns, Rift 5 updates |
Data Management
Handles all data persistence, assets, and file operations.
System | Purpose | Key Components |
---|---|---|
Assets | Asset loading and management | JSON handling, KLUMP files |
Saves | Save file operations | Save file upgrades, save indexing |
Utilities | Data processing utilities | Platform post-load, scheduler |
Development Tools
Provides debugging, profiling, and development utilities.
System | Purpose | Key Components |
---|---|---|
Console | Console commands and reload | Console commands, hot reload |
Debugging | Debug utilities and helpers | Debug commands, debug keys |
Profiling | Performance analysis | Profiler, memory analysis |
Utilities | Development utilities | Dumper, string fixes |
Fundamentals
Core building blocks that other systems depend on.
System | Purpose | Key Components |
---|---|---|
Actions | Player and entity actions | Action system, buffered actions |
AI Systems | Artificial intelligence | Behavior trees, brains |
Core | Base classes and entities | Entity script, class system |
Utilities | Shared utility functions | Common utilities |
Game Configuration
System configuration and game mode management.
System | Purpose | Key Components |
---|---|---|
Modes | Game mode definitions | Mode settings, configurations |
Settings | Game settings and options | World settings, player preferences |
Stats | Statistics tracking | Performance stats, gameplay metrics |
Game Mechanics
Implements specific gameplay features and systems.
System | Purpose | Key Components |
---|---|---|
Achievements | Achievement system | Achievement tracking |
Containers | Container functionality | Container widgets |
Cooking | Cooking and recipes | Recipe system |
Crafting | Crafting system | Recipe management |
Special Events | Time-limited events | Event systems |
Localization Content
Multi-language support and content localization.
System | Purpose | Key Components |
---|---|---|
Content | Localized game content | Text content, dialogue |
Strings | String management | String resources, formatting |
Translation | Translation systems | Language switching, locale handling |
Mod Support
Modding framework and integration systems.
System | Purpose | Key Components |
---|---|---|
Core | Base modding functionality | Mod loader, API hooks |
DLC | DLC integration | DLC content, compatibility |
Networking Communication
Multiplayer networking and communication systems.
System | Purpose | Key Components |
---|---|---|
Chat Commands | In-game chat system | Chat processing, commands |
Multiplayer | Multiplayer coordination | Player synchronization |
Networking | Network protocols | Data transmission, connection handling |
System Core
Low-level engine integration and core functionality.
System | Purpose | Key Components |
---|---|---|
Engine Integration | Core engine bindings | Engine interface, system calls |
Performance Core | Performance optimization | Memory management, optimization |
User Interface
User interface systems and widgets.
System | Purpose | Key Components |
---|---|---|
Widgets | UI component library | Interactive elements, displays |
Screens | Screen management | Menu systems, overlays |
Layouts | UI layout systems | Positioning, responsive design |
Controls | Input handling | User input, control mapping |
World Systems
World generation and environmental systems.
System | Purpose | Key Components |
---|---|---|
Generation | World creation | Terrain, biomes, structures |
Environment | Environmental effects | Weather, seasons, time |
Physics | World physics | Collision, movement, interactions |
Persistence | World state management | World saving, loading |
System Integration Patterns
Data Flow Architecture
User Input → Actions → Core Systems → Game State → World Updates
↓ ↓ ↓ ↓ ↓
Networking → Character → Fundamentals → Data Mgmt → UI Updates
Common Integration Points
- Entity System: All systems interact through the core entity framework
- Event System: Systems communicate via global and local events
- Component System: Modular functionality through component attachment
- Save System: State persistence across all game systems
Recent Global Changes
Build | Date | Category | Change Type | Description |
---|---|---|---|---|
676312 | 2025-06-25 | Game Configuration | modified | Enhanced error recovery in console settings and cookbook data |
676312 | 2025-06-25 | User Interface | modified | Added validation line numbers in frontend and input systems |
676312 | 2025-06-25 | Game Configuration | modified | Simplified tile conversion logic in game logic |
676312 | 2025-06-25 | Game Configuration | modified | Added waxed berrybush variants to item blacklist |
676312 | 2025-06-25 | Character Systems | modified | Added Rift 5 speech lines across multiple characters |
676042 | 2025-01-21 | Multiple | stability | General stability improvements |
Development Guidelines
System Dependencies
- Core Dependencies: Fundamentals must be initialized first
- Layer Dependencies: Higher-level systems depend on lower-level infrastructure
- Optional Dependencies: Some systems provide enhanced functionality when available
Performance Considerations
- Memory Management: Each system has specific memory usage patterns
- Update Frequency: Systems update at different frequencies based on need
- Resource Sharing: Systems share common resources efficiently
Best Practices
- Always initialize fundamentals before other systems
- Use the event system for loose coupling between systems
- Follow the component pattern for modular functionality
- Maintain clear separation of concerns between system categories
Function Integration Patterns
Core Function Categories
System Initialization Functions
-- System startup pattern
function InitializeCoreSystem(systemName, config)
local system = CreateSystem(systemName)
system:LoadConfiguration(config)
system:InitializeComponents()
system:RegisterEventHandlers()
return system
end
Cross-System Communication Functions
-- Event-based communication
function BroadcastSystemEvent(eventName, data)
for _, system in pairs(GetActiveSystems()) do
if system:HandlesEvent(eventName) then
system:ProcessEvent(eventName, data)
end
end
end
Component Management Functions
-- Component lifecycle management
function AttachSystemComponent(entity, componentType, data)
local component = CreateComponent(componentType, data)
entity:AddComponent(component)
RegisterComponentWithSystem(component, componentType)
return component
end
Function Integration Guidelines
Dependency Management
- Function Registration: All core functions must be registered with dependency system
- Initialization Order: Functions dependent on other systems initialize after dependencies
- Error Handling: Functions implement consistent error handling patterns
- Performance Monitoring: Critical functions include performance tracking
Cross-System Function Calls
-- Safe cross-system function invocation
function CallSystemFunction(systemName, functionName, ...)
local system = GetSystem(systemName)
if system and system[functionName] then
return system[functionName](system, ...)
else
LogError("Function not available: " .. systemName .. "." .. functionName)
return nil
end
end
Troubleshooting
Common System Issues
Issue | Affected Systems | Solution |
---|---|---|
Initialization order | Fundamentals, All | Ensure core systems load first |
Memory leaks | Data Management | Follow proper cleanup procedures |
Performance drops | All | Check profiling tools |
Function conflicts | Cross-system | Use namespace isolation |
Debugging Workflow
- Identify which system category contains the issue
- Use development tools to isolate the problem
- Check system-specific documentation for solutions
- Follow integration guidelines for cross-system issues
Function Debugging
-- Debug function execution
function DebugFunctionCall(systemName, functionName, ...)
local startTime = GetTime()
local result = CallSystemFunction(systemName, functionName, ...)
local endTime = GetTime()
LogDebug(string.format("Function %s.%s executed in %.2fms",
systemName, functionName, (endTime - startTime) * 1000))
return result
end
Contributing to Core Systems
Adding New Systems
- Determine appropriate category placement
- Follow established architectural patterns
- Document integration points clearly
- Provide comprehensive testing
Function Development Standards
- Naming Conventions: Use clear, descriptive function names
- Parameter Validation: Validate all input parameters
- Return Values: Provide consistent return value patterns
- Documentation: Include comprehensive function documentation
Modifying Existing Systems
- Understand current dependencies
- Maintain backward compatibility
- Update related documentation
- Test integration impacts