2014-10-06

story map

Last time I talked about the syntax I'm using to write stuff. In this post I'll show some micro examples along with images of the story map representation.

Lets start with a basic example using the following source.

:: Start
Some text.
[[Passage A]]
[[Passage B]]
:: Passage A
Some text.
:: Passage B
Some text.
[[Passage C]]
[[Passage D]]
:: Passage C
Some text.
:: Passage D
Some text.
[[Passage E]]
:: Passage E
Some text.
[[Passage F]]
[[Passage G]]
[[Passage H]]
view raw 001 ex 1 hosted with ❤ by GitHub


I guess you could say I was kinda *inspired* by Twine again. I couldn't think of a better way to represent the basic information of going between passages, so, what more can I say.


Moving on, here is an example using a display() passage. It works a lot like <<display>> would, basically adding one passage in it's place when evaluated at run time.

:: Start
Some text.
[[Passage A]]
[[Passage B]]
:: Passage A
Some text.
display(Passage A filler)
:: Passage A filler
Some text.
[[Passage C]]
[[Passage D]]
:: Passage B
Some text.
[[Passage C]]
[[Passage D]]
:: Passage C
Some text.
display(Passage C filler)
:: Passage C filler
Some text.
[[Passage E]]
:: Passage D
Some text.
[[Passage E]]
:: Passage E
Some text.
[[Passage F]]
[[Passage G]]
[[Passage H]]
view raw 001 ex 2 hosted with ❤ by GitHub


I use display() a lot, so I decided to highlight those passages in the map for faster recognition.


In this next example I use some implicit links and display()s.

:: Start
Some text.
[[Passage A]]
[[Passage B]]
:: Passage A
Some text.
display(Passage A filler)
:: Passage A filler
Some text.
[[Passage C]]
[[Passage D]]
:: Passage B
Some text.
[[Passage C]]
[[Passage D]]
:: Passage C
Some text.
display(Passage C filler)
:: Passage C filler
Some text.
[[Passage E]]
:: Passage D
Some text.
[[Passage E]]
:: Passage E
Some text.
[[Passage F|query($choice = 1)]]
[[Passage G]]
:: Passage F
criteria($choice == 1 && $someOtherKey > 7)
Some text.
criteria($choice == 1)
Some text.
:: Passage G
Some text.
display($displayPassage = 5)
:: Passage G filler
criteria($displayPassage == 5 && $someOtherKey > 7)
Some text.
criteria($displayPassage == 5)
Some text.
view raw 001 ex 3 hosted with ❤ by GitHub


They also got unique colors to help them stand out. I don't use them all of the time, but when I need them they are super helpful to have.


Now onto the world portion of things. This source code sets up a basic world structure with five different nouns and a couple verbs. Notice that a Start passage is still required since it is always the entry point of a game.

:: Start
Some text.
:: Azcaplab's Ship [noun()]
:: Captain Azcaplab [noun(Azcaplab's Ship)]
The self proclaimed prince of the seven seas.
:: Isle of Remorse [noun()]
:: Coast of Regret [noun(Isle of Remorse)]
:: Cave of Foreboding [noun(Isle of Remorse)]
This cave is probably scary.
view raw 001 ex 4 hosted with ❤ by GitHub



The nouns act kind of like a layer beneath passages. Each parent noun draws a white line to it's children. The green lines connect the actions on nouns to the passage responses of those actions. These links get pretty crowded, so I'm still not entirely happy with the way this is setup. For now though, it works.


Now an example with more stuff going on.

:: Start
Some text.
control("player", Captain Azcaplab)
:: Azcaplab's Ship [noun()]
:: board [verb(Azcaplab's Ship)]
move(Captain Azcaplab -> Azcaplab's Ship)
All aboard matey. (sorry)
:: Captain Azcaplab [noun(Azcaplab's Ship)]
The self proclaimed prince of the seven seas.
:: Isle of Remorse [noun()]
:: Coast of Regret [noun(Isle of Remorse)]
:: dock the ship [verb(Coast of Regret)]
move(Captain Azcaplab -> Coast of Regret)
You pull up to the coast and hop out.
:: Cave of Foreboding [noun(Isle of Remorse)]
This cave is probably scary.
:: enter [verb(Cave of Foreboding)]
move(Captain Azcaplab -> Cave of Foreboding)
You enter the dank cave.
:: Treasure Chest [noun(Cave of Foreboding)]
This is the good stuff for sure.
:: take [verb(Treasure Chest)]
move(Treasure Chest -> Captain Azcaplab)
move(Great Demon -> Coast of Regret)
The treasure is yours!
:: Great Demon [noun()]
She doesn't like visitors.
view raw 001 ex 5 hosted with ❤ by GitHub


This time in Start I use control() to make the captain the player. With that set, the icon for the captain changes along with many of the other nouns. The treasure chest is taken by the captain at some point, so it gets represented as a pickup. All of the places where the captain moves get a container icon, since these locations could be rooms, vehicles or anything really. The Isle is still the default static icon because it never moves and never holds the player directly. Static objects are mostly useful for grouping nouns together, but don't need to serve any purpose in game. Finally the demon has the red dynamic icon since it does move around.

All of the little icons help add useful information that otherwise aren't represented in the source code.

Since this is all in the Scene view of the Unity editor I decided to add another perspective of the world to help understand what is going on.


From a top view we get a floor plan of the world at it's default state. It's much easier to see which object is inside of another this way. I've found that I don't need to make diagrams of this stuff anymore since it is easily represented here. The connecting lines are in the way in this image, but they can be toggled off.

And so that's the story map.

No comments:

Post a Comment