Skip to main content

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.

SystemPurposeKey Components
Core Character SystemsBase character functionalityCharacter utilities, player deaths
CustomizationCharacter appearance and clothingBeefalo clothing, player clothing
EmotesCharacter expressionsEmote items, emoji items
ProgressionCharacter advancementSkill trees, progression constants
SpeechCharacter dialogueCharacter-specific speech patterns, Rift 5 updates

Data Management

Handles all data persistence, assets, and file operations.

SystemPurposeKey Components
AssetsAsset loading and managementJSON handling, KLUMP files
SavesSave file operationsSave file upgrades, save indexing
UtilitiesData processing utilitiesPlatform post-load, scheduler

Development Tools

Provides debugging, profiling, and development utilities.

SystemPurposeKey Components
ConsoleConsole commands and reloadConsole commands, hot reload
DebuggingDebug utilities and helpersDebug commands, debug keys
ProfilingPerformance analysisProfiler, memory analysis
UtilitiesDevelopment utilitiesDumper, string fixes

Fundamentals

Core building blocks that other systems depend on.

SystemPurposeKey Components
ActionsPlayer and entity actionsAction system, buffered actions
AI SystemsArtificial intelligenceBehavior trees, brains
CoreBase classes and entitiesEntity script, class system
UtilitiesShared utility functionsCommon utilities

Game Configuration

System configuration and game mode management.

SystemPurposeKey Components
ModesGame mode definitionsMode settings, configurations
SettingsGame settings and optionsWorld settings, player preferences
StatsStatistics trackingPerformance stats, gameplay metrics

Game Mechanics

Implements specific gameplay features and systems.

SystemPurposeKey Components
AchievementsAchievement systemAchievement tracking
ContainersContainer functionalityContainer widgets
CookingCooking and recipesRecipe system
CraftingCrafting systemRecipe management
Special EventsTime-limited eventsEvent systems

Localization Content

Multi-language support and content localization.

SystemPurposeKey Components
ContentLocalized game contentText content, dialogue
StringsString managementString resources, formatting
TranslationTranslation systemsLanguage switching, locale handling

Mod Support

Modding framework and integration systems.

SystemPurposeKey Components
CoreBase modding functionalityMod loader, API hooks
DLCDLC integrationDLC content, compatibility

Networking Communication

Multiplayer networking and communication systems.

SystemPurposeKey Components
Chat CommandsIn-game chat systemChat processing, commands
MultiplayerMultiplayer coordinationPlayer synchronization
NetworkingNetwork protocolsData transmission, connection handling

System Core

Low-level engine integration and core functionality.

SystemPurposeKey Components
Engine IntegrationCore engine bindingsEngine interface, system calls
Performance CorePerformance optimizationMemory management, optimization

User Interface

User interface systems and widgets.

SystemPurposeKey Components
WidgetsUI component libraryInteractive elements, displays
ScreensScreen managementMenu systems, overlays
LayoutsUI layout systemsPositioning, responsive design
ControlsInput handlingUser input, control mapping

World Systems

World generation and environmental systems.

SystemPurposeKey Components
GenerationWorld creationTerrain, biomes, structures
EnvironmentEnvironmental effectsWeather, seasons, time
PhysicsWorld physicsCollision, movement, interactions
PersistenceWorld state managementWorld 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

BuildDateCategoryChange TypeDescription
6763122025-06-25Game ConfigurationmodifiedEnhanced error recovery in console settings and cookbook data
6763122025-06-25User InterfacemodifiedAdded validation line numbers in frontend and input systems
6763122025-06-25Game ConfigurationmodifiedSimplified tile conversion logic in game logic
6763122025-06-25Game ConfigurationmodifiedAdded waxed berrybush variants to item blacklist
6763122025-06-25Character SystemsmodifiedAdded Rift 5 speech lines across multiple characters
6760422025-01-21MultiplestabilityGeneral 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

IssueAffected SystemsSolution
Initialization orderFundamentals, AllEnsure core systems load first
Memory leaksData ManagementFollow proper cleanup procedures
Performance dropsAllCheck profiling tools
Function conflictsCross-systemUse namespace isolation

Debugging Workflow

  1. Identify which system category contains the issue
  2. Use development tools to isolate the problem
  3. Check system-specific documentation for solutions
  4. 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

  1. Determine appropriate category placement
  2. Follow established architectural patterns
  3. Document integration points clearly
  4. 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

  1. Understand current dependencies
  2. Maintain backward compatibility
  3. Update related documentation
  4. Test integration impacts