Linear vs Sandbox thoughts

I note that choicescript favors a generally linear approach to scenes. A follows B follows C. As a long time RPG game master I favor a more sandbox approach, however I understand that that is much harder to code, at least conceptually.

To illustrate what I mean by sandbox, my first serious game, currently under alpha development, is a player trying to save a rural town from invasion by inter dimensional aliens.

There are 18 major locations, interconnected in a square grid, and a number of major locations have one to three minor sub locations, like Charlie’s Junk Shop (minor location) in the South Precinct (major location).

In the town I have about 9 significant NPCs. They have behaviors of their own, react to the growing situation and to the player character. I have had to do some bashing on the game flow structure but its coming together nicely. This lets me have an organic behavior for people, including NPC arcs like a mother and her child, the town chief of police and a lover, a grumpy know it all that doesn’t know who to trust, and the need for the player to find ways to get NPCs on side and coordinated to help. NPCs can also be shortcuts to important player knowledge and help me with the Three Clue Rule.

There are also about 6 alien actors (I might include more) that go about their business building up the invasion and trying to fend off interference. There are also some artifacts that can be acquired and used to good effect against their makers.

I have no preset path through this model. I have two accelerating systems, the alien progress and the PC progress, that interact in somewhat predictable ways. The hardest part is ensuring that the player neither has defeat nor success accidentally thrown in their face. Instead at each turn they have some awareness of how close to either they are and can make meaningful choices to push away from defeat and toward success.

The skeletal framework I have put together is working fairly well. I can play an abbreviated version of the game through and normally achieve success, with a few social dilemmas on the way.

To achieve this one thing I have had to do is allow a “scene” to actually be an NPC or an alien. I go to labels in those scenes to find out how that character deals with a moment of time passing, the player interacting with them in some way, or some sort of event occurring, such as a citizen being kidnapped, the player upsetting someone who then calls the police, and so on.

This has given me a bit over 30 scene files.

I’m kind of pleased with performance just the same. 1,000 random test runs takes about 2 seconds which strikes me as pretty awesome given the number of choice functions that get called, and scene jumps that are taken.

Getting it to run that many times and catalog line counts helped me twice to find instances where I had made some choices impossible to ever take. I’m now adding a set of true / false debug flags in my start up. Turning them on gets the script to throw diagnostics into the scene that can show up when I do test runs. Its a cool system.

Anyway, that’s my journey so far with choice script. I have taken the harder path but I did linear adventures to death back in the 70s, so its time for a challenge. I’m pleased with it so far and hope to have something more robust in a month or so as a beta system to show you.

Open to questions and comments



I don’t think a sandbox would be harder to implement than a linear story from a technical point of view. As long as it is not a time-cave. But, of course, that also depends on other features you may want to implement.

If you want to publish through CoG, you’ll have an interesting challenge in how to provide a demo for the game. Usually, CoG releases the first three chapters for free as a demo, but in a sandbox environment where everything can happen non-linearly, you’d have to come up with a different measure. Maybe a number of big choices the player can make before the game locks down, or perhaps a number of areas the player can visit.


I don’t think sandbox being hard to code is the main problem. It’s hard to write.

Sandbox games would require much, much more writing than a linear game, because you have to account for a lot more situations - and since the game still has to follow a script, you’ll still have to limit the player choice in a way a tabletop sandbox game won’t, because it’s absolutely impossible to account for every situation and there’s no GM to do some quick-thinking when one of their players throw a curveball at them this time.

When it comes to CoG products, it comes with a second cavehats: so far, most of the attempts at sandbox games are bland as hell. Characters are barebone, battles are just a string of numbers, emotional beats are non-existant, and payoffs are rarely worth it. There’s so much time and energy invested in building a coherent system with a wide diversity of options that none of the options really stand out, writing-wise.

Don’t get me wrong, there’s not a lot of things more satisfying than a good tabletop sandbox game. But I do not believe CoG is the best format for them - or at the very least, the attempts I’ve seen haven’t really convinced me.


I have been toying with sandbox thoughts, and the issue I ran into was not coding. It was while the game might be a sandbox, the players’ progress is inherently linear for them, and unique for every player. This means that I would have two choices:

  • Have a disconnected sandbox, where scenes can come in any order, but the connective tissue between them is shallow. For example, I might track clue variables and plot knowledge, but no deeper NPC or world reactions.
  • OR have a big impact on the world and much connectivity, but don’t reflect it very much in the text of the actual scene.
  • (of course the third choice is to be prepared to write a massive amount of text for a very short scene for the player.

Because believe me, this escalates fast.

If we just take three scenes 1, 2 and 3, with NPC’s A, B and C, and important game knowledge X, Y and Z that can be done in and I might end up with something like this in a linear game:

Scene 1: Made NPC A angry/suspicious/friendly, and learned of X that might affect other scenes.
Scene 2: NPC B knows A, so the dialog will differ depending on if you have Af, As or Aa. It will also vary if you know X, which will open up new dialog pathways. You can also learn Y which can be useful in the future. NPC B can be helpful or obstinate.
Scene 3: NPC C doesn’t care about the other two. However, if you know X or Y you can get more info and learn Z.

Now, imagine being able to do these scene in any order. In each scene you need variables for Aa, As, Af, Bh, Bo and if you know X, Y or Z, or XY, XZ, YZ, XYZ. And as the sandbox spreads, so do the alternate path info.

And, if you have the ability to go back to scenes once you have more info, the web gets complicated fast, and while the code might be workable, it also has to be filled with text to give the player a nice experience. A lot of text…

That, for me, is the biggest challenge with a sandbox.


You can check out War for the West if you haven’t, it can give you an idea/example of how what you’re planning can be executed


I agree there is a lot more writing. The combination of options is large. However I am finding it not to difficult to collapse sets of options to single situations in conceptual terms. The emotional beat thing I’m regulating by the use of minor NPC arcs that can get triggered, and artificially controlling their activation to ovoid collision complexity. The active behavior model changes the timing and circumstance.
Anyway, as I plow through this the framework is seeming to deliver on my intent. I’m hampered a little by technical experience with choice script. I just had to do a core engine strip and replace to fix some issues with scene segue and in story time flow (tactical vs dramatic).
I’ll keep you up to date with how that’s going and hopefully have something that surprises by the time I get to beta test.

That’s a cool point to bring up. I actually have a mechanism for measuring progress, and level of tension in the game. I could create a signal that says sorry, peak tension and progress, to go further you must purchase. That will probably also have to come with a save option so after purchase the player can come back to where they left off rather than start over.

Agree about the combinatorial text options and exploding.
I have created the game first with a bare bones model just displaying data about things, including relations between NPCs and Player, knowledge base, actions of antagonists and so on. That’s coming together nicely.
The random test option for showing line usage after, say 1000 runs, shows me where rich distinguishing text is going to be important. If a set of combinations come up rarely its not to hard to write a single text set that encompasses several of those options together. Where something is repetitive but narratively uninteresting its possible to collapse some repetitions into a single piece, up to the point of meaningful choice.
The nice thing about a text adventure as opposed to say a 3d adventure is the ability to quickly switch to dramatic time and skate over stuff without jarring the player.
Anyway, as I said in some replies earlier this is all good as hypothetical, but the actual implementation is tentatively bearing fruit, so we will see.

1 Like

That is awesome. A bit more grand view than I have in mind but certainly an example of the structure I’m working on. And for a very cheap price that’s a no brainer for me to buy. :slight_smile:

Also just saw the release notice for Life of a Space Force Captain. Looks great.