StoryDev is really starting to show it's true form. Our conversation system involves much discussing, and in this article, we will prove that the last week has been worth the time taken (taking into account that I have returned to work).
This is the introduction to the video game, hence the name of the "Branch" we have selected. Choices are automatically created when we add branches to the currently selected. We can add branches by right-clicking the branch, as well as rename them. There will also be an option to add more than one link to an existing branch, but this has not been implemented yet.
By selecting a different branch, we see different highlighting. A green highlight indicates the parent branch of the selected, while dashed blue indicates children. This can help with more complicated branching as a visual aid later as the game grows.
Currently, there is a hard limit of 50 branches. This was a design choice primarily to help with performance as all the GDI+ code underneath operates on fixed-sized arrays. Dynamic arrays are slower when combined with 2D graphics, where elements are needed every time the Control is painted.
Going back to our Introduction branch, we can see at the bottom of the screen choices that we can edit.
- Priority - This is useful for simulation. When the game grows, we will want to be able to track best and worst outcomes, and determine based on these variables what conditions are appropriate to apply in any conversation.
- Edit Condition/Script - This will bring up our handy Code Construction where we can edit either the condition (whether or not this choice appears for the player) or the script (executed when the choice is made).
The StoryDev Script
Up to this point, most of our discussion has been on data management and implementing features into the editor. Now it is time to begin understanding how we actually write the story.
As you may have noticed in the above screenshots, most of the story is fairly straight-forward.
: It is quiet in the children's bedroom, where two young girls sleep. Johiah : Saniyah! Caroline! Caroline : Huh? Saniyah : <waking> What's going on?
Here, if a character's FIRST name is omitted, it is considered narration, otherwise dialogue.
In our game, this translates to:
As described above, choices are automatically created in our editor. Although we don't see it, these choices appear like this in the saved
> Do not comply -> goto("Do not comply"); > Ready for a fight -> goto("Ready for a fight");
goto is internal code executed via
hscript, which is a scripting library for Haxe. StoryDev will be taking full advantage of this. In our game, the above choices become:
This is where our decisions start having an effect – yes, right at the very start of the game. It is not possible to lose if you choose to fight, but continued negative outcomes will make the game harder for you as a player.
There are other parts of the script that have not been mentioned.
The exclamation mark indicates you wish to execute code. It is not expected to execute anything complicated, and it is not recommended to use
while loops or anything of the sorts. Instead, the mark-up
=! is used as a conditional applying to the entire conversation.
Take the following example:
=! HasFrequency(3.9); Saniyah : I'm feeling okay today. =! Saniyah : Honestly, I'm not feeling good. Saniyah : In fact, I'd rather you not talk to me.
This would happen, say, if you choose to ask Saniyah how she is feeling. If your frequency value is equal to or greater than 3.9Hz, then Saniyah responds by saying she's fine. An empty condition is considered an
else like in a traditional if statement.
There is a use for the
= sign, of course.
= EXCLUSIVE = NO_CLEAR Caroline : What is happening?
These are options that can be used for many things.
Exclusive means that returning to this conversation later after a choice was chosen means that choice is no longer available.
No clear means not to clear the current conversation on-screen and to continue as if it is part of the same conversation.
You could add any option of any description and perform any kind of logic before the conversation starts.
~ 57AD, Temple
One other prefix, which we are not taking advantage of as yet, is the tilde which indicates overlay text. This is likely to be used as a form of extra title text in cutscenes or cinematics, perhaps.
There are many other features that yet need implementing, and we will discuss this in more detail later. These include:
- Linking branches manually to more than one.
- Managing story order in preparation for the simulation engine.
- Create simulations to track variables depending on which conversation we happen to be at.
There will be more options later as well, but expect the above to appear in the next article. Until next time.