Oh my. I've broken my own rule.
The rule is to prefer Viewers to Editors. There's this temptation that I have, I don't know about anyone else here but I have it, to go and build a Tool. In your head, the Tool will be Very Useful and will save you lots of work, and so it will be a Good Use of your Time.
[Danger: programmer talk ahead!]
It's a trap, because if you pick a sane data format, making a tool that's better than your IDE's text editor is a ton of effort, and if you're not careful when you build it, the tool will break every time you change your data format. Bad bad bad.
Better to make a viewer, and just update the view immediately as the data changes, so you get your instant feedback. That'll get you pretty damn far. So that's my rule. Prefer Viewers to Editors.
But then, there comes a time when your data format stops changing so much, and editing huge json files stops feeling like such a swell use of your time. In particular, looking up source code in order to figure out how to edit the huge json files starts to feel pretty crappy.
Maybe, you think, maybe it would be cool if someone else could edit this data, and I could go back to programming. And then before you know it you've gone and built an editor.
What have I done to myself. Anyway this monstrosity is the Content Editor. It can edit effects and aspects, which are the bulk of the data that goes into the game. It uses reflection with optional custom handling, which makes it moderately flexible. So it shouldn't break too badly when things change, and I can build custom workflows for particular use cases. I'm a bit proud of the inline editors with custom validation and dynamic suggestions:
It was honestly a lot of work. Maybe too much. But either way, this is the tool that we'll be using to write and edit the game data from here on in. It's already a lot nicer than a bunch of huge json files, so it's too late to turn back :-P
But not all the data in the game is covered by the editor yet, so I also made this validator. This is actually just a GUI wrapper for the command line validator that I've been using inside my IDE. But now people other than me can edit data files, and get instant feedback about their edits.
In my career, I've been a UI programmer more than I've been a game programmer, really, and I take a fair amount of pride in my ability to make a good UI. But good lord, that pride becomes a burden when you're building tools like this. It actually takes a prodigious amount of work to make a production-quality ui for a tool. Go figure. (This stuff here isn't what I'd call production quality, it's only as much as I could justify to myself.)
Anyway we have fun. And check out that perforce integration button, eh?
Maybe next time I'll talk about what happens when you press Ctrl+1. Oh oh OR, we can have another infrastructure post!



*low, drawn out whistle* Pretty nuts... and something I'd probably have made in your shoes.
ReplyDelete