Freitag, 28. März 2014

DialogScript 0.3.0 and an exciting upcoming feature!

Long time no see (again!).

But I'm happy to tell you that you can download a new version of DialogScriptDSL (0.3.0).
The source code for that version is available on GitHub.

I'm not quite sure what I already had back in version 0.1.0, but the current version features a lot of new cool features and a ton of detailed improvements. Let me start with the character scripting language which allows you to define characters and dynamic character templates, which means that they are made available to the content assist feature dynamically.
I definitely need to do some docu on that, but since I decided to freeze this feature for now to work on something even more exciting (!), it doesn't have the highest priority. In fact, the character definition language is not hooked up with the actual dialog scripting language, just because I haven't thought it through enough. I still included it in version 0.3.0 so you can fool around with the language. I'm especially happy with and interested in your thoughts on the dynamic character templates, so let me elaborate a little bit on that.

Character definition with dynamic templates


 
The character definition language is very declaratively. Use the ".chara" extension to create a character definition file.
In the example above, we see two characters defined using the available default attributes, which are full name, description, age, and type. Type can be PC (playable character) or NPC (non-playable character).

 

You can define templates for characters, like the StarWars template above, defining your own attributes. An attribute needs a type. Right now, NUMBER, TEXT, and ENUMERATION are available. NUMBER and TEXT are pretty straight forward, I think. An enumeration is just a predefined list of constant values an attribute of this type can have. In the example, the jediLevel of a character using the template StarWars is either, None, Padawan, Knight, or Master.

This template is instantly available in the content assist (Hit CTRL+SPACE when the cursor is on the root level of the document, i.e. not inside a character definition).


Here you can see the dynamically added template to the content assist as well as a preview of what that template pastes into your file if selected. Let's add Luke to the party:

 
The dynamic template features template expressions just as we know from any static template, so we can use the TAB key to navigate through the different default values (the framed text) and change them by typing. In the screenshot above, I already filled out the template expressions with values for Luke. Note that "Knight", or in general any value in an ENUMERATION is a real cross reference in our script, so we get an error message when we try to use a value different from the ones defined in the template attribute!
We can even mark custom attributes as being mandatory (I did this for the "hands" attribute as can be seen in the screenshot below).

 
Consequently, when we make use of that template we have an integrated validation that makes sure that we actually use all mandatory attributes. We even get a quickfix that allows us to add missing fields.

I know that there have been even more features, like an import mechanism to reuse character template throughout different files as well as global attributes which are available to any character no matter which template he or she relies on, but I'm not sure if these will make the cut, so I won't describe them any further.

A Live Graph View!?

I don't know if I'm the only one excited about that feature, but boy, I AM excited. What I'm talking about: How would you like to have a graphical representation of your dialog structure for free, right next to your dialog script. Live. Did I mention it's just there, like in 'free'?

Take a look:

This graph is just generated while you type your script and only updated when it detects meaningful changes to the dialog content. As you can see, the graph only supports a subset of the language features so far, which are scenes, dialog lines, and arbitrarily nested conditions. This means no hubs, choices, jumps, and special conditions like the "first time" and "parting" concepts.
It might be only a view, but you have several options as a user to manipulate its representation. I descibe the smal blue and whitish buttons in the view toolbar from left to right:
  • You can toggle the orientation between "top down" (default) and "left to right" and rearrange the views, so that you can work with the tool like this, for example

  • You can toggle if the graph should be kept in synch automatically (default) or pause that behavior
  • You can crop the dialog lines if they extend a certain amount of letters (8 by default, just randomly chosen) to keep the nodes handy, or you can display the complete text per line.

  • You can increase and reduce the horizontal and vertical distance between nodes to avoid node overlaps within reasonable (read: randomly selected) limits
  • Last but not least the view is zoomable. This means you can select a zoom percentage using the small arrow button pointing down at the toolbar

  • I just selected 50%, which might be reasonable especially when the graph gets bigger. In this mode, the nodes act in a fisheye-like manner. This means that, whenever you hover over a node, it is "brought to front" like in its 100% representation so you can easily inspect the nodes by hovering with the mouse above the graph, as shown below for the "Ah, you again..." dialog node.

Of course, this is just the beginning of this exciting new feature and I'm looking forward to map all the language constucts to the graph view in a reasonable way!
But anyway, I think it is pretty cool and I should definitely make a video to show you how it works in motion. Speaking of videos, I also tried to record some "getting started" sessions. But man, that is time consuming and odd... anyway, check out the videos if the written documentation you can find in the downloadable archive is not sufficiant: https://www.youtube.com/user/MrRobWalter/videos

As always, feedback is very welcome!

As a side note: I write all my code for this project with the superior Xtend language. This language is so convenient and pure awesome, that I always fell like being punished whenever I have to read or write Java code, which luckily doesn't happen all to often anymore.

Keine Kommentare:

Kommentar veröffentlichen