Click here to Skip to main content
15,890,557 members
Articles / Programming Languages / C++
Tip/Trick

Sci-Fi Plot Compiler

Rate me:
Please Sign up or sign in to vote.
4.81/5 (8 votes)
19 Feb 2019MIT2 min read 6.7K   151   3   2
A simple Sci-Fi plot compiler

Introduction

If you ever wanted to create a Sci-Fi plot for a:

  • Book
  • Role playing game
  • First person shooter game
  • Strategy game

but found yourself at the wits end, this simple program is for you. This little plot compiler can generate more story plots than there are in existence today.

Background

This algorithm was published in the 1980s in a magazine, which one I cannot remember unfortunately. It was attributed to the Stanislaw Lem, famous Polish sci-fi writer. The algorithm was simple enough and it stuck in my head so I decided to recreate and share it. Also, I did some improvisations on the algorithm sections.

I myself am not a story writer but every plot has a very strict structure. Typically, it looks like this:

  • Prologue
  • Rising Action
  • Climax
  • Falling Action
  • Epilogue

This plot compiler does not follow this structure. It is one level above it. Once a plot is compiled, it can be subdivided into the appropriate plot structure as described. I think I should be able to expand this algorithm to include the above mentioned plot structure. Also, any good story contains a:

  • Protagonist (our hero or heroes)
  • Antagonist (enemy or enemies)

The story also can have more than one climax. It would be the type of a story where at a certain point, seemingly things cannot get any worse or better but the remaining thickness of a book or length of a motion picture gives it away that there is yet more to come. This is referred to as a “Dramatic Structure”. Google it up, if it sparks your interest, but for the purposes of this article, I’ll leave it as an exercise for the esteemed reader.

Using the Code

Compile and run the SciFiPlotCreator.exe. It is a fun program and it should give you many LOLs and OMGs.

Image 1

Plot 2:

Image 2

Choices 1-3-2-4-4-2-2-3-9 will give you the following plot summary which is very similar to the “Independence Day” movie:

Plot summary:
Choices: 1, 3, 2,4,4,2,2,3,9,
**********************
Earth
Invaded
By
Huge
Alien life forms
Who
Do not understand us
And who are
Nonradioactive
And
Can be defeated
By
Nuclear weapon
And they
Killed
The End
...

You can run a random generator at the start if you select ‘Y’ or ‘y’.

Image 3

To do list:

  • Incorporate dramatic structure into the algorithm

Points of Interest

  • This program uses of STL std::map, std::string

Credits

  • Stanislaw Lem
  • Wikipedia dramatic structure article

History

  • 02/17/2019: Initial version

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Architect Robotz Software
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionContent Generator Pin
Stid20-Feb-19 23:23
Stid20-Feb-19 23:23 
AnswerRe: Content Generator Pin
steveb21-Feb-19 12:26
mvesteveb21-Feb-19 12:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.