This is Part 1 of a series of articles on Strand Games' IF authoring technology called Strand. Strand is a domain specific IF language and runtime.

With it, you can easily make parser IF, choice IF and anything in between with no programming. Deploy to mobile, desktop or the web with a GUI supporting pictures, animation and sound.

Strand Games Technology

Remasters & Sequels


Introduction

Strand does not claim to be more capable than other systems, nor does it claim to be better or have more features. Instead, Strand strives to be quick and easy to use while following simple ideas.

  • Write your game in your favourite editor as a text file.
  • Use a single "building block" in a variety of ways to make your game.
  • Don't let the 10% of complicated features poison the simplicity of the 90%.

Anyone can use Strand. Write your game in your favourite editor, then run it immediately! And it's open source!

Let's get started!

Generating Output

Terms and Flow are fundamental concepts. Flow is the way in which the event sequence of a story unfolds and terms are the initiators of flow.

Here is a story:

STORY
Once there were three bears, they all died!
The End.

OK, not a very exciting story (or even very original), but it illustrates a term and some flow.

Anything in capital letters is a term and the rest is flow.

STORY is a term and the text, "Once there were three bears, they all died! The End." is its flow. Let's run this story and see the output;

Once there were three bears, they all died! The End.

Let's add some more terms:

STORY
ONCE there were THREE bears, they all died!
The End.

ONCE
Once

THREE
three

This produces the exact same output as before, except now, ONCE and THREE are terms which emit their own flows (in this case just the words "Once" and "three" respectively).

Selectors

Now, we can give these terms branching flow using selectors. For example:

STORY
ONCE there were THREE bears, they all died!
The End.

ONCE
* Once
* Once upon a time
* A long time ago

THREE
* two
* three
* four
* five

The term ONCE has three selectors which give alternative flows. ONCE will choose one of the three selectors randomly. The same for THREE.

Now we get random stories, each time we run!

Once upon a time there were five bears, they all died! The End.

A long time ago there were four bears, they all died! The End.

So, just with these bear-bones (sic), we can already make stuff:

STORY
ONCE there were THREE bears, PART1. DIED. THEEND

ONCE
* Once
* Once upon a time
* A long time ago

THREE
* two
* three
* four
* five

PART1
* they were forced into lockdown in their HOUSE
* they all lived in a HOUSE

HOUSE
* small cottage
* tiny house
* woodland shack
* garden shed

DIED
Unfortunately they
* contracted VIRUS
* were poisoned by POISON

  and died

POISON
* tainted porridge
* a little blond girl
* dodgy mushrooms

VIRUS
* Covid19
* a nasty flu
* tuberculosis
* the plague

THEEND
* The End.
* It's all over.
* That's the end!

Some sample outputs;

A long time ago there were five bears, they were forced into lockdown in their garden shed. Unfortunately they were poisoned by a little blond girl and died. It's all over.

Once upon a time there were two bears, they all lived in a woodland shack. Unfortunately they were poisoned by tainted porridge and died. It's all over.

Once upon a time there were four bears, they were forced into lockdown in their woodland shack. Unfortunately they contracted tuberculosis and died. That's the end!

Sticky Selectors

A problem with random selectors is that sometimes you need to pick something at random and then stick with it. For example, a person's name.

Here's an example where we want to be random, but maintain consistency;

STORY
MARY had a little LAMB its FLEECE was WHITEASSNOW.
And everywhere that MARY went, the LAMB was sure to go.

MARY!
* Mary
* Larry
* Barry
* Harry
* Gary
* Sally

LAMB!
* lamb
* chicken
* puppy
* dog
* cat

FLEECE
* fleece
* coat
* fur
* tail

WHITEASSNOW
* white as snow
* red as blood
* green as grass
* pink as a fairy
* blue as sky

In this example, the terms MARY and LAMB have the indicator ! after their definition, but not their usage in the STORY.

The ! indicates the term is sticky.

A sticky term is one whose flow occurs just once and thereafter the flow output remains the same.

Here's some outputs;

Larry had a little puppy its fur was green as grass. And every where that Larry went the puppy was sure to go.

Harry had a little chicken its tail was red as blood. And every where that Harry went the chicken was sure to go.

Unfortunately, it doesn't always rhyme anymore!

There are other indicators you can apply to a term such as ones to control the ordering, the randomness and so on, We'll cover those later.


That's it for Part 1, in Part 2, we'll move on to Choices.

Next Post Previous Post