Game creation process: Your views on the relationship between coding and writing

Hey all,

I’ve read through a few threads about your writing process and they’ve been interesting, but they mostly focused on writing, story planning and what helps you concentrate, not particularly on the game side of the creation process, which is why I’m starting this as a new thread. (Sorry if there already is a thread like this, I couldn’t find it.)

I’m just curious about the difference between writing linear and interactive fiction, and how you weave the interactivity into your story. How much do the code and game mechanics influence your writing and story?

How thoroughly do you plan out your game and its branches? Do you have several major branches and endings in mind when you start off, or do they come as you write and develop the story?

Do you write and code at the same time? Do you create a code skeleton/outline and fill in the writing later, or do you write first and code it all later?

How conscious are you of stats before you start writing? Do you start out with all the stats you think you’ll need for the game and use those as guidelines when you write? Or do you just start writing and see which stats emerge from the story?

I think it’ll be helpful to hear your perspectives on which approaches you find most efficient, especially for new IF writers like myself. Thanks!


Coding is hard and writing is straining on the mind, coding and writing are a strain pain…a very happy marriage there. I plan to learn coding but me thinks it’s too hard so I shall stick to leaving stories in the dormitory thx :smile:

I have completed two novels and two books as a ghost writer, and my style has always been a panster. Coming into ChoiceScript was very hard as code without a plan is a nightmare. I have improved over the years but still very bad at planning so have to take it in short stage which still causes me many headaches lol. My thoughts on it are plan your stages and braches but do not get hung up on the details as a stroy will change as you write it. For me stats, I develope as I go, I might have a loose list but find that setting alll the stats at the get go can be very restrictive for me in the creative process.


I’ve yet to undertake writing in ChoiceScript, but I’ve written and coded using other engines for IF. Personally, I always write the code first. Always. A faulty code will break the game even if the writing is great. I try and ensure that I have functional code before I undertake any serious writing. I suppose it’s almost like creating an outline. I tend to leave placeholder text all over usually in caps so I make sure I don’t accidentally miss a segment. (I have a tendency to write vulgar placeholder text so I’d rather that not slip past. :stuck_out_tongue_winking_eye:)

It helps to have an idea of what you want to provide in terms of branching. I tend to create more conditional statements than I might need at the start just to try and cover all bases I might want to. Then, I can remove or add as I go or have the happy coincidence of being satisfied with what I’ve created. My thoughts come out in fragments a lot of times. Coding comes easier to me at first since it’s technically in fragments as well. Typically, I write as I go. I have a general idea for what I want, how I want to go about it, and how I want it to end. That’s enough for me to be able to create a solid foothold.


I usually have a broad idea of where I want a story to go, and then break it into acts. Like @Lithophene I code the outline act by act, with brief reminders of what’s supposed to go there. The Code is usually pretty simple, barebones stuff. Just “this goes here” or “if this than this”, nothing set in stone. When I actually go and write the scenes I usually add a little bit-- more choices, an extra scene, whatever.

It’s a plan, but it’s flexible, because I’m kind of capricious.

That said, it is vital for me. I actually lost my ‘outline code’ for Carhalow, which is why I stopped it. I’d done a lot of work on it, for one, and also I kind of… forgot what was supposed to happen at certain points lmao.

Me :smile_cat:


UuuUM. Hmm.

This is an intriguing topic. I’ve done bits of work for several CS games (none completed, though I’m focusing on just one now with that goal in mind) and my process has been different for each of them.

I’ll start out with stats. That’s probably easiest to answer. I decide on stats before I start writing. They are, to me, like the rules around which the game must revolve. It wouldn’t do very well, for example, to try to create a Magic:TG card without knowing the rules for Magic. So the stats come first- which goes in tandem with what the game is going to be about. Stats, including stat -checks-, can create exponential situations. If a hypothetical game only has one stat- ‘alignment’ let’s say, with only two possible ‘checks’… alignment > 50, and alignment < 51… that’s easy. The more you break it down, though- like, alignment < 25, alignment > 24 and alignment < 50, alignment > 49 and alignment < 75, and alignment > 74… well, the more instances of where the stat could check at, the more times the stat needs to be able to rise or fall, and the more instances where visible writing is changed because of stats. If you have fifteen different stats… even if all of them are only checked once, and only if they’re higher or lower than a certain number, that’s still 30 instances of separate writing needing to be done… and most of the time just checking a stat once is too bare-bones to have the stat there, and can instead be represented by choice. So make that 60 or more instances of separate writing. Monsters, incidentally, has fifteen stats- plus a number of flags (on or off variables). The number of times they’re used, though… is quite high, and faaaar more than just four possibilities. Having more stats would, before long, be simply too much. I might be able to take one or two more without going mad, but the workload just keeps going up vastly with each that’s added, because each requires a multitude of branching text dependant upon it.

In tandem with the stats is ‘the overall general idea of the story’. Like, prince/princess raising sim, realistic fiction psychological survival horror, high fantasy adventure, ect. Often this comes first thing, an idea inspired from who knows where. Like ‘Oooh! This seems like it would be an awesome idea for a game!’

Then, at least for me, main points for the story coalesce in my head. But not on paper. Like, ‘okay’, I want Monsters to be a story that shows the best and worst parts of humanity at the same time and really mixes up the two. It’ll be realistic- at least somewhat realistic, and true to life. How would actual people like the characters act in these situations? Sometimes it stretches reality a bit, but it also provides a fairly reasonable explanation in doing so. So, I’m going to set it on a road-trip around the US. How long will it be? Uhh… after putting some work in, it seems like ten chapters is a great aiming point. I knew what was going to happen in chapter 2 when I was working on chapter 1, though only in a ‘general sense’. I have in mind what’s going to happen in chapter 3, and most of chapter 4, while still working on chapter 2 as I am. Beyond that, I just have… ‘floating anchor points’. Things I know I want to have happen, though I’m not really sure ‘when’. Mostly, really important parts to the story.

None of it is written down, though. I force myself to write sequentially. The CScomp story I wrote for this year was a lot harder in this regard because there’s no clear cut sequential order- it’s more… roam-y. I was experimenting with *rand and it only partially worked how I hoped- it’s … not nearly as finished or fleshed out as I wanted to make it. Parts are, while other parts feel skeletal. So sticking with sequential writing probably helps me stay organized. With Reignmaker, I scripted out all the essential coding to make the game work- the skeleton around which the game can be built. A totally different approach. But still basically starting with the ‘rules around which the game is based’. Because it’s organized differently, that the -type- of game it’s meant to be is different, I believe that setting the foundation works for it, as a highly methodical and organized machine with many working parts.

Monsters, by comparison, which started as my first attempt at coding/scripting ever, is by comparison, a mess. Like some sort of outliner’s nightmare, choices within choices within choices, ifs and branches diverging and converging, huge chunks of script copied and pasted rather than creating a new label, simply by not knowing ahead of time when one would be prudent. And yet, somehow… other than the nightmare that is editing, the Frankenstein’s monster of a patchwork process somehow -works-.

And, the process itself. The beginning of a CS story is a lot easier than the rest. Stats haven’t really become a vastly divergent spectrum yet, and so the process of writing is less interrupted by divergent story. But with Monsters, I’ve simply as a natural process combined writing the scripting with the creative writing. Someone says something, and if your character has, say, Wrath > 55 they say one thing, while a Wrath < 56 results in a different response- well, I write this as I go, and both then have their own thread I fill in. One might end up in a choice selection and the other doesn’t. Okay, more division- fill in the various choices, any diversions within those… sometimes a portion somewhere is left hanging for a bit, like a choice without a thread under it, but I get around to it before pushing ahead with the next section of story. In long conversation threads, though, it can be very tedious and time consuming- and may well be entirely like writing twenty pages of ordinary novel to produce one page of visible conversation that can go any number of ways.

Which is suppose starts to get into the regard on branches. … I don’t plan out how this will go ahead of time. Doing so, I find, is like trying to force a story that doesn’t always go the way you expect it to go. I do have several endings in mind for Monsters- heh, actually, I have a LOT of possible endings for Monsters. :innocent: But not regarding bad endings, I want to have somewhere around about 21 or more different good endings. Seems like a lot of work to me, too. But there it is. But as far as the game itself goes… it’s a little harder to explain branches. Well, some are normal. Make a choice on who you want to stay with, and this section will happen, or that section will happen, but you won’t get both… and then later the story will converge again. Then there’s the smaller stuff. In this section, things can go a number of ways, which affect your stats, which affect everything in a butterfly-effect like way. You’ll end up with the same story if you make the exact same choices with the exact same character, BUT, if you change the order of choices in some cases, or do something differently, it could have a spill-on effect that affects more stat changes and leads to more divergent story content. So I have to be conscious of stats. At least in the ‘what they mean at the different points they can be’ level. Admittedly, I ended up changing around the whole meaning of what one stat essentially is, between chapter 1 and 2, and had to go back and retrofit changes… but editing is a never-ending process. Because I don’t plan things out precisely, there’s a lot of room for the story to grow and adapt, and to add in new branches where need-be. And there are many cases where differences are cosmetic- no ‘story-altering’ decision being made- although, in some instances, there are. Choosing your character from the very start, for example, or your character’s orientation… And a number of minor little things that often don’t seem important, but the game remembers and brings back later. Sometimes cosmetically, sometimes game-changingly. I just got done not long ago with an update that was almost entirely a side-branch most people playing the game won’t ever even reach unless they’re lucky or actively exploring the game. It just ballooned into this sprawl that kept going and going- and I let it, because it made sense within context for it to do what it does. But I was still thoroughly surprised that it took as long and ended up as long as it did. Like, oi. - It wasn’t developed ahead of time, I just had the idea for what was going to happen in my head.

Writing… when I’m actually writing, I don’t know what the next sentence I’m going to write is going to be until I’m writing it. I may know what I want to have happen… this character gets mad, or talks about something specific… but how it comes down isn’t set until I actually type each word. Heck, I don’t even really have the end of a sentence down, necessarily, when I begin writing one. It just forms as it goes, as I think it.

I think for Monsters, at least, it would be impossible- and I mean -impossible-, to strictly code first, or strictly write first. Reignmaker is a completely different approach, in which I’m attempting to set up -almost- all of the coding first, save choices and story-related stat changes. IE, the framework is being set before any story, and story can be written in nice little sections which are already ready for it, without needing to get bogged down by coding. That -can- sometimes get tedious on Monsters- having the writing interrupted by coding; ending up being more draining and feeling like what’s in the tank for creative juices gets used up faster, but it’s still a process I find works best for the type of story that it is. Where things can be altered on the fly and the story itself can surprise me. Where I can add all sorts of fun easter egg bits to reward players.

One thing, though- the story I’ve written doesn’t branch individually, into separate stories. I mean like… Choice of Robots, as an example, has different stories altogether depending on your vision of the future in the beginning, on what kind of ending you envision. That’s a cool game style, but I still can only manage one central trunk to the story. Even if that central trunk could play out in even more ways than four trunks combined, the story would follow the same plot and still converge in the same ways each time, being essentially ‘the same story’, just told different ways. I’d like to do a game sometime where that’s not the case- where the story splits completely… but I haven’t done so yet. I do have some things which cause the story to change in major ways, but parts are still going to be the same. In essence, I just bury shittons of content in *if statements. XD And more in choices, especially in conversations- in those ‘minor’ ways, well, a conversation may split into separate conversations. But the story isn’t really being changed by way of plot. Usually.

The process of writing both the story and the code as I go is what I think helps the most in weaving the interactivity into the story. It’s like… writing a regular novel, except with alternate realities. And no certainty which is the real reality. So in a sense, they all are. Continuity is -very- important. If someone for some reason apparently did something important at one point earlier in the story, except the version you played through this didn’t happen… that’s a real issue. Continuity errors happen, and can sometimes go unnoticed for a while- the more branching the story, the harder it can be to find 'em. Thank goodness for keen-eyed proofreaders and ravenous playtester story-fans. XD

So, I know that I mentioned starting with stats… that’s true… but flags… which are a little different, emerge from the story. Those are essentially true/false variables. Sometimes 1, 2, 3… but aren’t things that require a vast range of tracking. Did ‘this’ event happen? Yes? Okay, flag activated. Now, later in the story, the story can know if the event happened or not and react accordingly. I personally code my flags as *create blahname 0 - which has it set as off, and then *set blahname 1 if it needs to be true. Sometimes, *set blahname 2, like if it needs another state beyond true and false. Like ‘well, true, but -this- -also- happened, so that changes things’. Anywhoo… I’ve gone on a long ramble here, probably more than most people have an interest in reading. Thank you for your patience slogging through all this, but it’s also been fun for me to talk about my writing process. I hope maaaybe some of it helps… or that at least it’s been entertaining and insightful. Thanks. :slight_smile:


I come from a game background and have scripted in other engines before I came here.

My approach has been to build a “skeleton” structure of code and a muscle mass of story, then connect the two with “choices”.

Keep in mind, I am very much still a novice and non-published author; the jury is still deliberating on my efforts.

I learned a long time ago that what I code will become public knowledge - I avoid using plot notes or anything that might be trouble if j. public sees it. I know some people are shocked and upset that community members and purchasers of the game will look at their source code. This is something that every one of us should be prepared to accept; whether we like it or not.

1 Like

I generally just write… Coding and text happens at the same time, as I find it’s easier to just stick it together that way. If I know what I want to write, it’s not hard to make the code do what I want it to.

Planning was also something that happened as it went along; I didn’t even have an overall outline until I was about a third of the way through. :sweat_smile: What I basically started out with was a whole bunch of scene ideas (invasion of zombie-creatures; dream sequence with weird god-creature; etc), with a basic plot. The plot itself had begun life as a non-interactive story, and so there was originally only one actual ending, although more were added to it later. (And I’m still adding to them, even as I approach the finale, which in some cases involves going back and adding foreshadowing.)

As for stats, yes, my basic strength/charisma/intelligence trio was pretty much a definite from the beginning, as was the hidden stat (darkness), although I did have certain other, more battle-oriented stats (HP, power level), which were removed when I decided against the more RPGesque battle structure I initially posted (and replaced a few days later), and a few others (e.g. fame), that I never really worked out what I wanted to do with.

Guilty… :sweat_smile: I generally find it far more fun to look through the code than to replay the game ad nauseum, looking for things I’ve missed, especially with WIPs that might update far more incrementally than my own. If I am leaving a gap to fill in later, I’ll just write “WIP” there (and then make sure I’ve filled it in before I post the episode).


If it is were me, I’d use a tool like Chronicler to outline my story, choices, and conditions first, fill in the story text, then let the program write the code for me! :wink:

Shameless plugging aside, I definitely recommend writing the code first. (after you have the outline and character sheets done of course.) Then worry about filling in the story. My thought process is that if you have some mechanic that is critical to the story/gameplay, then it is best to get it done first. If you were to spend hours writing the text, only to find that a certain bit of code isn’t possible, (or extremely difficult to insert into all that text) then all that time spent writing was wasted.

Take Tin Star for example: one of it’s most endearing traits was the recurring town sequences wherein you could talk to the townsfolk and improve your character in various ways. If the author hadn’t taken the time to have that system in place first, it would have dramatically affected the rest of the game, in writing as well as mechanics.
(I recall reading this in some article awhile back. Can’t seem to find it now though :confused: )

Hope this helps!


I can’t mix and match, coding and writing are two very different parts of my brain, at least when it comes to the big coding decisions. I either see structure, or style, and rarely does the two meet. So I have the following process.

  1. Structure. I plot out the game/choices/chapters on paper so I can draw arrows between the scenes and figure out where everything goes. This I usually do at work, because I can spend a lot of time looking at structures and patterns when I tend to my machines. I have a rough plan for the entire game (usually in different acts), and then I do detailing in chunks of four or five chapters at a time.

  2. Coding. I write the main code the detailed chunk, one chapter at a time. Sometimes two if I can’t get into writing mood. I describe scenes with a single sentence or two, just so I know what is supposed to go where. This makes it easier for me to see stats, mods, choices and where everything should be and end up.

  3. Writing. This is the tough part. Now I go back and fill in the code, replacing all the once sentence structures with proper paragraphs. Dialog usually dictates new, smaller choices, and sometimes the code balloons in places where I discover that there might be alternatives I overlooked before. This is okay since I still have the skeleton to keep me on track.

  4. Connecting. Once I am done with a chapter, I go back and play it to see that everything flows. I often need to add page breaks to break up long passages and separate scenes, or add smaller choices to give more variation. I also need to rewrite a lot to make sure that words flow between the scenes, especially since I have rather complicated structures on where the text fits together. This is now ready for playtesting.

  5. Polish. Once I am done with the game (or when I feel the mood) I will go back and rewrite, polish the text, make sure clues and exposition is placed accordingly, and fill out the paragraphs with flavor text. This is where the bulk of the aesthetic editing will take place, and it will be put through my proofreaders to fix my swedified grammar.

In short, I can’t do proper coding and writing at the same time. Different mindsets.