The RPG Scrollbars: Notes On Writing A Universe

Hello, God talking. At least, within a certain small sphere. Like a few of Team RPS, I’ve been writing for games as well as writing about them recently, most prominently as the writer of Daedalic Studio West’s The Long Journey Home [official site] – a space exploration RPG with roguelike elements (but not the crap ones). You know. A SERPGWRENCO. We’re now at the stage where my job is basically done, the universe is designed, the dialogue is all written, and I’m asking tramps on the street if I can borrow their whisky just so I can breathe heavily into the bag. There’s not much more fun than working on a game inspired by some of your favourites, notably Star Control 2. At the same time, well… oh dear, here comes that pesky hyperventilation again…

But I’m not here to market, but to talk tools. I know I’m always interested in seeing behind the scenes, so this week, I thought I’d pull back the curtain a little to talk not so much about what I’ve been working on, but what I’ve been working in.

Just as a quick intro though. The Long Journey Home is the story of a ragtag crew (four out of ten characters – your choice) shot to the other side of the galaxy as part of humanity’s first jump drive test. Your job is to get them home, through a procedurally generated universe full of hostile worlds and amusing aliens. There are stories and mysteries to uncover, but mostly the focus is on freedom, and giving you the kind of power that you’d have if you were actually in that situation. For instance, if you take on a FedEx quest, there’s nothing stopping you opening the box and stealing what was in it. Or agreeing to escort someone home, only to turn around and sell them to slavers instead. Each time you play, we want you to find different things and learn more about the races and how the universe ticks. On the flip-side though, much of what works in other RPGs had to be rethought and reworked around our specific ‘get home’ goal. Interesting quests? Yes, but respecting that forward momentum has to be key.

This actually proved pretty challenging, as every quest had to feel like something that a) was worth the crew’s time, despite their desperation to get back to Earth above all else and so not necessarily giving a shit if some planet comes down with Shivering Rot or whatever, b) something that the aliens would actually entrust these random visitors with, and c) something that was worth the player’s time to do. And of course, d) something that fit one of our core goals of bringing a bit more personality to space than players are used to. We really wanted this to feel like a living universe where you were experiencing an at once terrible and breathtaking situation along with your crew, and one you can believe is ticking along around you. For example, most of the time when you finish or fail an important quest, the original quest-giver will show up again in person to handle everything, rather than using some kind of galaxy-wide internet or just flashing up a FISSION MAILED message and moving on.

Spoiler alert. This means a lot of writing.

As Alec covered last week in his Supporter post, games are basically spreadsheets with controller support. If you want to write games, you have to be prepared to Excel. If it’s not Excel or Google Docs, then you’re probably going to be working with some proprietary tool that… well, imagine a car, only without luxuries like doors, a roof or seats. Luckily, this isn’t quite a universal rule, but… yeah. There’s a reason why most teams don’t release their internal tools to the public, and those that do wrap them in more warnings than a thin cardboard box containing fresh plutonium rods.

While bits of The Long Journey Home have meant spending a lot of time with Unreal tables (the worst of all things) and Google Docs, most of the hardcore writing has been in a surprisingly good, though initially slightly difficult to parse proprietary tool called LINCOS – a dialogue editor that we also use for locations and and encounters. The core file is a CSV spreadsheet, but LINCOS parses it and puts that information into a much more readable, easy to edit style, complete with built in flag-testing and other niceties. The result is that conversations look a little something like this:

This is just a tiny snippet of one of our races – the ‘charming’ Ilitza. Our conversation system is built on a few different key interactions, with the main one being assembling questions in bits based on objects and information that you’ve found. In this case, you’ll fly up to an Ilitza ship, they’ll probably insult you for having a terrible ship, and then you take over the conversation. ASK GOSSIP. PRAISE ILITZA. SHOW VALCORGRUE. That kind of thing. LINCOS was built around these non-linear conversations. If you know your programming, think of it as a glorified ‘switch’ command. With every line and interaction, it begins at the top and keeps going until it reaches the first appropriate response. And here’s where things get cool. With pre and post-conditions, we have a lot of power over what it finds and produces and how aliens react to, say, being asked about something they’ve already told you not to.

Pre-conditions are the instructions above each block. To use the top one as an example, it means “If we haven’t encountered this Race, and this member isn’t Fighting or Fleeing and the player isn’t Hostile, give this Greeting.” This triggers the Ilitza ship to introduce itself by name, making sure the player knows it. Underneath is the shorter Greeting you get if you’ve met, and are neutral (Wary). Later, there are other versions for Friend and Enemy. Obviously, there can be more than one thing in each pre-condition block, effectively hijacking a conversation. The bottom one is an example of this. It says “If the player has never heard of Jassikan’s Teeth (an extremely easy to understand gambling game), then when they ask for GOSSIP, tell them about it, and add it to their knowledge.” Once you’ve done that, ASK GOSSIP will then fall through to the next possibility, which might be another opportunity, like suggesting getting into Bounty Hunting, some galactic information, or just another rude comment.

Each NPC you meet is built with several of these files, chained together – typically PERSONALITY > CLASS > ROLE > RACE. As awesome as it would be for everyone to respond differently to literally everything, that’s how you get murdered in your sleep by translators and accountants. The compromise is that most members of a Race share a basic dictionary that handles the standard questions, like what they think of, say, the Glukkt – our trader race. However, each distinct Personality and Class get their own set of basics, with hopefully enough bolted on that it doesn’t feel like the universe is just five guys without so much as an over-rated burger to call their own.

More importantly, LINCOS is where we script enemy AI as well as raw dialogue – what happens if, for instance, you raise weapons on a character. Most races therefore have their Civil and Military script, which handles the basics of how fights play out, but with scope to bolt extra stuff on. For example, if you’re losing a fight with an Ilitza Slaver, they’ll often call to say that they’ll let you go… in exchange for one of your crew.

The really cool part of having a proprietary tool though is how it can be upgraded, and how every upgrade opens up new possibilities. At the start of development for instance, there were only pre- and post- conditions for controlling dialogue. Aliens would have to give you a mission by asking, and then it would be added to your Mission Log without any real say. Since that didn’t work, we added basic transactions. Now the alien can say something and you can reply YES or NO. Cool. But… couldn’t we have a bit more fun? Yep. And so once again the system was updated with ‘Transaction Labels’, which effectively reskin those Yes and No options for specifics. A few of my favourites, for which I’m not going to give any context, include FLUSH KING?, REMOVE MY SKIN? and RIDE THE WORM? In general, ‘yes’ is a good idea. Promise.

Of course, the LINCOS side of things is only part of it – albeit the part that I know best. The quest implementers on the team spend as much time in the Unreal editor, working on ferociously complicated Blueprints that handle the game logic of things. Here’s a quick snapshot of just part of a relatively simple treasure hunting quest…

Now, of course on top of all this there are plenty of other tools. Crew dialogue for instance is all in a monster Google Docs spreadsheet, with Notifications and Mission Briefings, the Artifacts you can find and crew comments on them held somewhere else entirely, all in one great big swirling maelstrom of words and lore. Personality in particular requires not just a lot of words, but lots of vectors and care and consideration.

One of the small touches I doubt anyone will notice, but which I’m proud of at least, is that you will never get a mission briefing that tells you to do something. Instead, it’s always phrased in some form like “We’ve been asked to-” or “We’ve heard about-” to reinforce that you’re in command and not just following orders. You’re not failing anything by not doing something. You’re just choosing not to do it. Big difference, even if the alien you’ve promised to help to might not see it that way.

Of course, whether it all works, I guess we’ll see in a couple of months. Until then… pass the brown paper bag. Much hyperventilating left to do before release.

From this site


  1. ynamite says:

    Always interesting to read about how things like this are developed and which tools are used in the process.

    Looking forward to this game by the way, very intriguing concept.

  2. KylHu says:

    Great writeup! It’s rare that game writers go into the technical aspects of their jobs during these kinds of articles. Thanks Richard – looking forward to checking out the game. Hang in there!

    • Richard Cobbett says:

      Thanks! That was the hope. I try to avoid crossing the streams outside of disclosure purposes, but occasionally it’s nice to talk about something that I know more intimately. Where relevant, of course!

  3. aldo_14 says:

    Pre-conditions are the instructions above each block

    Are these preconditions applicable in an automated planning (i.e. STRIPS) style sense? Because I always thought that offered an interesting way to build dialog or story, provided you can define some ultimate goal.

    • Richard Cobbett says:

      Everything’s hard-coded and scripted and just uses Boolean logic. When you roll a die in LINCOS for instance, you don’t roll a 6, but roll for success with a 0.X chance (q.rand?success=0.4) which gives you the pre-condition P.Q.rand.success for true and !P.Q.rand.success for false. But really you’d need integer and math support to do anything approaching that, and for this project that just wasn’t necessary.

      The team’s built in some additional features during development like a dedicated picker and interfacing with the inventory, but more complicated stuff is handled in Unreal blueprints rather than the LINCOS file. (For instance, checking whether a mission is finished, or a particular character is currently on board the ship, or flagging ‘bored’ after asking too many questions) You wouldn’t be able to use it for conversational AI, but it’s very effective for adding detail and handling all of the key alien and location scripting in one easily updatable place.

  4. milligna says:

    Fascinating stuff, thanks for the look over your shoulder — looking forward to trying this game!

  5. Premium User Badge

    Drib says:

    Weird aliens and a small crew with possibly interesting character interaction?

    Sign me up.

    Neat look behind the curtain so to speak. Look forward to seeing the thing play out.

    • Richard Cobbett says:

      Me too! (reaches for bag) The high concept of character interaction is that if you have a team that likes each other, it should be a bit like Star Trek, if they hate each other, then more like Red Dwarf, and if it’s somewhere in the middle, then Farscape. But it’s tricky, when the player could have any line-up of characters :-)

  6. geldonyetich says:

    Sounds like a fun game. And I see you left the “boring” flag toggled to off. Good move! That is a common crucial mistake.

    • Richard Cobbett says:

      Hehe. That’s important while writing! (What it actually means is that some lines add to a countdown, after which the alien won’t talk to you any more).

  7. Sardonic says:

    Thanks for this, I’ve always been curious what the professional and proper way to do this kind of thing was. What I’m doing in the unity prototype I have going on right now is a system of generated dialog based on what part of the mission you’re on, where random phrases are said by a random friendly mook (An array of mooks, a bunch of arrays of phrases in an IRC-like interface), and some other actual scripted dialog by the main characters at the appropriate times.

    Thank god I’m not trying to make a roguelike is all I’ll say, wow, I can’t even imagine all the permutation cases to write for. Even my limited prototype feels challenging at times.

    Will definitely check out the game when it drops.

    • Richard Cobbett says:

      It’s difficult! Especially as writing too many variants for who’s around and what’s happening in the galaxy leads to an exponentially increasing amount of words. A lot of the time the trick is working around that so that you don’t have to. For example, in our crew dialogue, a character’s line on an item doesn’t know who else is on the ship, so we can’t do something like “Zoe, can I borrow your laptop.” HOWEVER, once that line has been spoken, the response system inherently DOES know that character exists, so they can reply “Just use your own, Siobhan.”

      There’s a lot of that kind of stuff. Hopefully it’s not too noticeable! But it is one of the things that I think separates ‘writing’ as people often think of it from ‘narrative design’, which tends to involve a lot of mechanical experimentation and consideration.

  8. davorable says:

    Very interesting, thank you. Good luck!

  9. Premium User Badge

    Captain Narol says:

    Game has been on my wishlist for a while, sounds really like a cool concept. I wonder if some members of the crew will be inspired by famous people of the RPS team…

  10. davi817 says:

    Thanks for peeling back the top layer to show us the guts. Been playing a lot of Steve Jackson’s Sorcery lately and I am wondering what a lot of their flow charts look like for dialogue and events.

    • Richard Cobbett says:

      80 Days too! Wow, that thing must be complex. I know that Sorcery does a lot of stuff under the hood that you don’t see, like keeping track of what kind of player you are, and in the third game, a lot of random elements and loot tables rather than everything necessarily being baked into specific places and encounters. Crazy complicated stuff. Can’t wait to see Inkle’s next thing.

  11. damnsalvation says:

    Games need more CSV. One fine day, maybe even only CSV.

    A guy can dream.

  12. syndrome says:

    SERPGWRENCO = Space Exploration Role Playing Game With Roguelike Elements Non-commissioned Officer?

  13. Premium User Badge

    Harlander says:

    There’s something about Unity blueprint scripts that makes me feel faintly nauseous.