Legionaries is my upcoming defense-strategy mod for Dota 2. You can read more about it here if you’re interested, since this post is about the data behind Legionaries and how it’s translated into Dota 2’s format.
So in Legionaries, each legion has six basic units that be spawned, which can each upgrade into a more powerful unit, and each unit may or may not have an ability or two. There are also other thirty waves of enemies, and twenty mercenary units that can be spawned. That’s at least 98 different units that have to be made if I want to start with four legions. Which is a lot of units to begin with, and when all unit definitions in Dota 2 (below is a single unit definition) have to be in a single file, thats a lot of scrolling in the one file. It also makes comparing units impossible, and makes it a pain to modify lots of units data in a relatively short time.
This type of data is normally handled via spreadsheets, and Legionaries is no different. All the units, abilities, and localization data is stored on spreadsheets in Google Docs. Getting this data from Google Docs to Dota is the tricky part, which is why I developed the Legion Data Tool alongside Legionaires.
The spreadsheets contain all the information I need on each unit, like health, damage, abilities, upgrades, etc. so that I can easily change and compare units and keep everything nice and simple. Similarly, heroes and abilities are also defined with their information via the spreadsheets so that data can be shared and we can reduce duplicated code. Localizations are even handled by the spreadsheets, and using Google Translate, I can automatically have my localization keys translated so that I can see a rough outline of how long strings will be for other languages when designing the UI.
The Legion Data Tool made lets you input spreadsheet IDs and tab IDs to allow the tool to connect, download the data, and process it. Processing the data involves converting all the columns from each spreadsheet to the appropriate unit, ability, or hero; and link abilities to units, upgrade units to their base counterparts, and units to their legion Commanders (heroes).
Once everything has been processed, the Data Tool runs through and generates the Dota compatible data based on template files which are built with the tool. The resulting files are ready to be dropped into the Dota folder and are usable with no extra changes. The tool also generates the appropriate Lua files for legion Commander’s spawning units, which can also be dropped into the right folder and be used immediately.
Using this tool allows me to mass update units and abilities far faster than editing one large file, or multiple files and then combining them. This faster iteration time allows me to design new units and abilities faster as I can compare them to existing units, and balancing existing units gains the same benefits.