You Merely Adopted Rules.csv, I Was Born Into It
This post is about the process of implementing scripted dialog content into Starsector. It’ll get technical toward the end and I’ll do a tutorial on how to implement a new piece of character interaction.
So! I’ve been given to understand that rules.csv is notorious among modders of the game – how unfortunate!
In response, allow me to present a spirited defense of this data file and its attendant content pipeline. I’ll talk a bit about what it is, why Alex made it the way it is, how I came to use it, and how it can be used in general.
(It’s probably important to explain what the heck a rules.csv is in the first place, isn’t it.)
The rules.csv file is the primary, but not only, means of creating dialog interactions within the game Starsector. This includes almost all situations where the player engages with an entity – a planet, fleet, or character – where a textbox pops up and allows the player to choose from a set of responses. After choosing a response, stuff happens, more text is displayed, and a new set of possible responses is presented. This interaction loop proceeds until the dialog is closed.
This system is the basis for conversations with NPCs, for most interactions with campaign objects (planets, derelicts, sensor arrays, jump-points), and nearly all of the missions and story events.
In short, rules.csv contains the data used by what amounts to a custom scripting language that hooks into the game code to drive almost all content which doesn’t involve the combat map or the campaign map.
It’s a big deal!
Though some may find it hard to believe, I do enjoy using rules.csv because, above all, it’s lightweight. Every step is fast, simple, and responsive. I’ll walk through how this looks in practice in the tutorial section of this post.