While the game client is the biggest single piece of Miranda, by sheer numbers, tools are definitely winning. There's a tool for importing Collada 3D models, one for putting assets into container files (sort of like a ZIP tool) (thanks music industry), a tool for creating Secret Lair Codes, a tool for converting the string database into a quick to load, quick to search format, a tool for analyzing memory reports for when things go horribly, horribly wrong, a tool to run the servers and restart them in case they crash, a tool for doing evil things to PNG files that shaders like, a tool for processing and procedurally generating all the terrain data, about 50 tiny automation tools (also known as batch files,) a tool for loading TOS documents into the database and last but not least, a unit testing program that makes sure that I don't accidentally break anything important. Whew.
Since I wanted to add a bunch of new units to Miranda, and since those units are built out of Components, I needed a tool that would help me analyze and balance all those new components. I initially thought of building a GUI tool that would do cool tables and graphs, but after a day of working on it I realized there was a huge shortcut.
Yes, the shortcut is in fact a spreadsheet. LibreOffice Calc
to be specific. A spreadsheet has the power to slice and dice my component data and generate tons of fancy graphs and some nice people have already written all that for me.
The components that go into a unit fit together like pieces of a puzzle. A unit Chassis can only carry so much weight and each component (gun, shield reactor etc.) has a weight assigned to it. Every component also uses power and an onboard reactor needs to generate enough power to run all of them. If either of those (and some other) criteria are not met, the unit design is invalid and the unit can't be built. To test out that the pieces (components) I add are working in that puzzle, I needed a way to see all the completed puzzles. The new tool can write a CSV (comma separated values) file which any spreadsheet can read. That file contains a list of every possible legal unit in the game along with a bunch of balancing statistics like damage per second, cost, and more. Add to that one last report that says how many puzzles each piece fits into, and I have some powerful tools to make sure the components I add to Miranda are working as desired.
Once I go over the list of units, the tool takes all the component data from the XML source (I originally specified the game components in XML because it is quite easy to work with) calculates more statistics and writes it all out as another CSV. Then it launches the spreadsheet then waits for it to exit. (It is cool in Windows that you can just use ShellExecuteEx to have Windows open a file with the program associated with it.) I can then modify the components or add new ones. Once the spreadsheet exits, the tool wakes up and reads back the CSV file and updates all the source files with any changes. I even added indices to first row and column so that I can rearrange the columns or rows and the tool can still read back the modified CSV correctly. So much faster than writing a GUI tool!
Since loot is such an important part of the game, I have another CSV of all the loot items along with stats like the probability of obtaining them. Like components, the spreadsheet can be edited and the data read back.
One last nice little addition is a report that lists missing strings, icons and models (which let me knock off a whole lot of little bugs really quick) as well as a list of components which are impossible for the player to get. Whoops.
I could have reworked the original XML data to be spreadsheet friendly, but all the extra statistical and informational data the tool adds to the CSV is well worth the extra effort.