Data-Driven Config and Hot-Reload
Load game data from Lua files and reload scripts at runtime.
What Is Data-Driven Design?
Data-driven design separates what (data: stats, levels, layouts) from how (code: game logic). Data changes do not require recompilation.
Loading Config from a Lua File
A config file is a Lua script that returns a table. Load it with dofile or loadfile + pcall.
-- config.lua
return {
playerSpeed = 200,
gravity = 980,
maxEnemies = 10,
}All lessons in this course
- Event Systems in Lua
- Component-Based Scripting
- AI Behavior with State Machines
- Data-Driven Config and Hot-Reload