Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411507 Posts in 69374 Topics- by 58429 Members - Latest Member: Alternalo

April 26, 2024, 04:07:55 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsPezna Story Engine - A tool for creating non-linear, complex stories for games.
Pages: [1]
Print
Author Topic: Pezna Story Engine - A tool for creating non-linear, complex stories for games.  (Read 2050 times)
Pezna
Level 0
**


View Profile WWW
« on: June 29, 2015, 10:12:17 AM »


A PSE story called "The Concise Tragedy of Romeo and Juliet

When creating a game with a story, creating and implementing the dialogue into the game can be very tedious. This was a problem I faced when I wanted to make a game with branching dialogues that could alter the course of the story depending on the player's choices.

I searched for tools that could do what I needed, but they always fell into these categories:
  • Crappy - Did not have as many features as I needed.
  • Overkill- Was too expensive and had many features, but not the features I needed.
  • Tedious- Repetitive dragging and dropping and clicking, constantly moving the mouse to click buttons and menus, etc.

There was no program that fell into just one category; each met at least two categories. The only reasonable thing to do was to build my own. Thus, Pezna Story Engine was born.


A portion of a story file that was used to rigorously test PSE.

I needed a program that would let me create characters, variables, choices for the player, and dialogue branching. I needed the program to be like a text editor that I could simply start writing in, and not have to painstakingly drag, and drop, and click, and arrange. In some of the programs that I found, by the time you finish clicking, dragging, and arranging, you've forgotten important details about the story you want to write. If your mind is anything like mine, you can get a dozen different ideas a day, and when trying to flesh out an idea, a bad user experience is not ideal. For the amount of flexibility and customisability that I needed, I had to create my own scripting language.

That is essentially what Pezna Story Engine is, a tool that interprets a simple scripting language designed for creating non-linear, complex stories for games.

Created with non-programmers in mind, it is extremely straightforward and easy to learn.

For the list of current and planned features, please visit the features page. PSE is still under development, and has not been released yet because there are many features that still need to be added.

I will talk more on the syntax and structure of a story file in later blog posts. Hopefully, I'll be able to release a demo within a month. Please follow me on twitter @pezna_official


Typing out an example story.


Test running the example story within PSE.

Website: http://pezna.com
Twitter: http://twitter.com/pezna_official
« Last Edit: June 29, 2015, 10:21:34 AM by Pezna » Logged

Sgt. Pepper
Level 1
*


View Profile
« Reply #1 on: June 29, 2015, 11:16:57 AM »

This honestly looks really, really cool.
Logged
Pezna
Level 0
**


View Profile WWW
« Reply #2 on: June 29, 2015, 12:35:09 PM »

This honestly looks really, really cool.

Thank you. My goal is to make sure every game developer has this program in their arsenal.
With the ability to easily and quickly create stories, the indie gamedev scene can greatly expand.
I've always enjoyed games with non-linear stories, and part of my motivation for creating such a flexible tool was to give game developers the ability to easily create and implement stories into their games.
Logged

Pezna
Level 0
**


View Profile WWW
« Reply #3 on: July 02, 2015, 08:34:49 PM »

Update 1 - (Website blog post)

Stack Overflow Error in Loops

Update 2 fixed this problem by implemented while-loops.
Currently, in PSE, there are no while-loops. To imitate a while loop, you would need to use an if-statement with goto and label statements. For example:
Code:
label start
if (num < 50):
    num += 1
    goto start
end if
I thought that something like this would be sufficient for everyone's needs, but while running some tests yesterday I discovered a problem with this code:



After creating and exporting a story, you load the story file into your game using a runtime library. It reads the exported file, and let's you navigate through the story. Because of the way I created the Java library, with recursive function calls, a stack overflow error was produced after about 2000 loops. This was because it never had a chance to "return". I then replaced the recursive function calls with a loop, but a stack overflow error now occurred after about 4000 loops. This happens because of the way "goto" statements are implemented. Explaining everything in text is going to be difficult, so I'll just leave it at that.

To solve this problem, I'm going to have to create while-loops in PSE, so that users do not have to use gotos to make loops. I'll still look for a way to solve the problem with if-statement loops, but if there is no practical solution, I'll simply discourage people from making loops with ifs, labels, and gotos (at least, loops with over 4000 iterations).

New GUI

I've worked on the GUI a lot in the last 2 days. When compiling and running a story within PSE, a new window would appear with the Run Console. Not anymore. Now, the Run Console is below the text editor.


The current look of PSE's GUI.

The panel on the left is the variable panel. It shows all the variables within the game, and their history (what values they previously held).

The panel to the right of the text editor will be the auto-generated flowchart that will help you visualize the flow of your story.
« Last Edit: October 20, 2015, 09:44:48 AM by Pezna » Logged

Mr. Levich
Level 0
**



View Profile
« Reply #4 on: July 02, 2015, 10:37:23 PM »

Looks really interesting, and I would really like to hear more about your runtime API and how I can use it in games.
« Last Edit: July 02, 2015, 10:51:47 PM by Mr. Levich » Logged

Pezna
Level 0
**


View Profile WWW
« Reply #5 on: July 03, 2015, 07:33:20 AM »

Looks really interesting, and I would really like to hear more about your runtime API and how I can use it in games.

I'll be sure to create a detailed blog post on how to use it in games.
Logged

Pezna
Level 0
**


View Profile WWW
« Reply #6 on: July 03, 2015, 03:22:45 PM »

Update 2 - (Website blog post)

Events

This is something I've been putting on the back burner for a while, but today I decided I would finally implement this into PSE. You can use events to alert your game if an important action needs to occur. For example, if you want a transition after a line is displayed, you could do something like this:

Code:
line: person "Hello, World!"
event "transition 1"
# or, if a variable (string, number, boolean) has been initialized
# you can send its value with the event
event variableName

While-loops

The problem  I had in the previous update with a stack overflow error has been fixed with the introduction of while-loops.

Code:
line: person "I will count to 10!"
while (var <= 10):
    var += 1
    line: person var+"!"
end while


Using events and a while-loop in PSE.

What are your thoughts?

Be sure to follow me on twitter: @pezna_official
Logged

oahda
Level 10
*****



View Profile
« Reply #7 on: July 04, 2015, 12:42:35 PM »

Looks really useful and kool!
Logged

Pezna
Level 0
**


View Profile WWW
« Reply #8 on: July 04, 2015, 12:56:08 PM »

Looks really useful and kool!

I'm glad you like it. Are there any features you'd like to see?
Logged

Pezna
Level 0
**


View Profile WWW
« Reply #9 on: August 05, 2015, 04:22:21 PM »

A Tragedy Occurred

I lost everything in a hard drive crash about a month ago.
Luckily, I made backups in June 8.
However, those backups do not contain major progress that I made in the months of June and July. I have just gotten a new, crappy laptop and I'm just beginning the process of recreating what was lost. Pray for me.
« Last Edit: October 20, 2015, 09:41:35 AM by Pezna » Logged

jctwood
Level 10
*****



View Profile WWW
« Reply #10 on: August 06, 2015, 04:42:00 AM »

That is brutal... I'm sorry you are having to rebuild everything but hopefully it is faster the second time around. I would love to see an html5 based editor but I guess that is out of scope for a game tool as opposed to a standalone application.
Logged

Pezna
Level 0
**


View Profile WWW
« Reply #11 on: August 06, 2015, 09:51:07 AM »

That is brutal... I'm sorry you are having to rebuild everything but hopefully it is faster the second time around. I would love to see an html5 based editor but I guess that is out of scope for a game tool as opposed to a standalone application.

I'm now using an online repository backup. The html5 editor would probably be a bit too much for me, but you never know, I may create that later on.
Logged

Pezna
Level 0
**


View Profile WWW
« Reply #12 on: October 20, 2015, 09:41:58 AM »

Update 3 - Flowchart, Events, and Internal Variables - site blog post

It's been a while since I made an update. PSE is still alive and kicking, and I've made some awesome additions.

Flowchart

The flowchart is a visual representation of your story. Every node represents a statement in your story. The first node is the story object, the next level of nodes are acts, the next are scenes, and each scene has its statements below it. It is still in its beginning stages, and is nowhere near finished. The aim of having a flowchart in PSE is to allow the you to visually see how your story flows. It allows you to see which places have more "substance" than others.


Flowchart prototype of a story.

The edges (connecting lines) are currently not organized, and therefore it looks very ugly in its current state.

Events

Previously, event statements could only take a single value/variable. Now, they can take multiple values separated by commas.


An event that sends multiple values when it is triggered.

Internal Variables

Internal variables are variables that are initialized automatically by PSE, not the user. They contain information about the story, and the current position with blocks. Currently, the only internal variables available are:

  • story.name - This variable contains the name of the story
  • act.name - This variable contains the name of the current act.
  • act.label - This variable contains the label of the current act, if it has a label.
  • scene.name - This variable contains the name of the current scene.
  • scene.label - This variable contains the label of the current scene, if it has a label.
  • choice.text - This variable contains the display text of a selected choice. Note that if this is used outside of a choice-block, it will contain the display text of the last selected choice. If no choice has been selected in the entire run of a story, it will be blank.

Only story.name can be used outside of a scene-block. For example, you can initialize a variable to the name of the story, but you cannot initialize it to scene.name because there is no current scene.


Example of internal variables being used.

Be sure to follow me on twitter: @pezna_official
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic