Skip to main content

What is KV Format?

KeyValues (KV) is Valve’s lightweight key–value text format used throughout Dota 2 for data-driven configuration. A KV file consists of nested blocks delimited by braces, where each entry is either a "key" "value" pair or a named sub-block.
In Lua, KV files are loaded with the built-in LoadKeyValues function:
KV files live under scripts/kv/ inside the game addon directory. They are loaded once at game start and cached for the lifetime of the match.

File Reference


Loading Pattern

Most KV files follow the same load-and-cache pattern in Lua:
Values are plain strings in KV; cast them when needed: