Showcase: Parser & Dictator

Hi folks, today I’ll be talking (at length) about Carnal Souls’ parser and dictator systems, why I think they’re awesome, and actually showing them working! There’s also some gifs to show the current GUI in action as well. Warning: a long post and lots of images after the break.

Also, we have a gallery now! Stereo set it up today. There you can find all the CS arts made so far.

More than words

We’ve talked about how resuming the original Unity build actually puts us a decent step ahead in terms of development, so rather than just say so, I thought it best to actually show some of it in action. First, let’s have a look at the current state of the GUI (graphical user interface).

The main text box is going to be what the player is looking at a huge portion of the time, so I want to make sure it’s smooth and lovely both to look at and use. You can scroll using the mousewheel, dragging the bar, using the arrow keys, and dragging the text itself with intertia – more of a mobile device style.

They see me scrollin', they hatin'

They see me scrollin’, they hatin’

 

Not only that, when there’s enough text in the box at one time to activate the scrollbar, a shadow appears at the bottom. It fades as you scroll down, until you get to the bottom where it disappears. I feel this gives a nice visual cue that there’s more to read, as well as making the GUI a bit more interesting to look at.

Shadow-(opt)

Snazzy!

 

And, as a final touch, there’s a smooth transition between pages/scenes, so there’s no jarring wall of text blinking into existence.

So smoove.

So smoove.

 

The Stats pane on the left is also going to be a big focus for the player. There’s not a lot hooked up to go in it yet, but it drops down smoothly and remembers which submenus inside are expanded or collapsed. Ignore the text shown for now, that’s just some test lines for the parser/dictator, which we’ll move onto next.

Dropdown like it's hot~

Dropdown like it’s hot~

 

The Parser

Some of you might be familiar with what the parser’s actually for, but for those who aren’t, I’ll start with the basics. Either way I thought it’d be good to show it actually working in the game. This is working on the code I wrote myself a long while ago.

Firstly, scenes in Carnal Souls aren’t actually written directly into the code. They’re simply plain text files which sit in the game’s files, and are pulled up when the scene’s code demands them. Unity supports HTML tags too, so bold and italics and things like that are still fine (you can see some bolding in the third gif down).

Parser tags are written with {brackets} either side of them. The parser looks through the text, picks them out, then replaces them with proper words. Here’s a super simple example, followed by what the parser turns it into in-game:

Parser Demo 3 Parser Demo 4

Nothing fancy yet, but that’s the basics of what the parser is for. The three parser tags have been removed and replaced with words from the game’s data, in this case the player’s name, main species, and an applicable adjective for their junk. The adjective take lots of things into account, like the total body size (height, fatness, muscles, etc), the total volume of the penis (length, thickness, and including any exotic bits like knots and flares), and compares the two to give an accurate adjective relative to your body.

In short, the parser is for describing things that can change. Location, name, adjectives, colour, species – there are tons of parser tags to suit our writers’ needs.

The Dictator

I’ve been talking about the dictator system for well over a year now, ever since I first had the idea (and actually got it to work), so it’s probably about time I showed what it does. I think anyone interested in writing for Carnal Souls will really like this feature.

The dictator works much like the parser, except it lets the writer dictate what the tag is changed to. While we can have a huge list of parser tags to use, it won’t always have a tag for everything. Furthermore, the dictator will allow us to dynamically change how scenes play out depending on small or large factors. All a writer has to do is put in a tag as normal, this time in [brackets] so the game knows it’s a dictator tag, then somewhere in the file provide the options for it. First, a simple example, and what the dictator changes it to:

Dictator Demo 1 Dictator Demo 2 Dictator Demo 3

The first result is what happens when the player hasn’t got a penis (penisCount = 0), and the second is if they have one (penisCount = 1). The dictator will look for the options for that tag, find the right one, and replace the tag with everything after the = sign. It’ll then go and clean up everything it didn’t use. Note you can include parser tags in the options as well, as seen above.

The dictator will have a long list of its own unique tags that writers can use. There’s also a [random] tag, which will choose a random option from what you provide, like so:

Dictator Demo 4 Dictator Demo 5 Dictator Demo 6

You can add as many as you like (within reason), and the dictator will choose at random each time that scene is presented to the player.

Dictator Demo 7 Dictator Demo 8

Now, if actual stuff has to happen as a result of that random outcome, it has to be done in code. This is just for showing some random text. But, for little random touches here and there, it can easily add some variation to scenes. This is shown in the next few screenshots, as well as showing how it’s possible to nest dictator tags inside others, and how it also accepts comparisons! Don’t worry, it looks worse than it is. I’ll walk us through each of these to show what’s happening. First, the plain text:

Dictator Demo 9

First, the dictator reaches [playerHeight], and goes off looking for the right replacement for it. (For this example, it would be best to have an option in case the player’s height is exactly 72 inches, but ignore that for now). If your height is less than 72 inches (written with a < sign), it will change it to:

Dictator Demo 10

Note how everything the dictator didn’t use is all cleaned up. It never encounters the [random] tag, so it just removes the options for it. However, if your height is greater than 72 inches (written with a > sign), it will find that replacement and then see there’s another tag, [random]. It’ll then go looking for the replacements for that, 50% of the time returning random 0, and 50% of the time returning random 1. Here’s what it looks like in-game:

Dictator Demo 11 Dictator Demo 12

There are tons and tons of fun applications for the dictator. Writers can easily add flavour and extra detail to their scenes, like having to crouch to get through doors, struggling with a chest’s lid because the player’s strength is low, adjusting their pants because they’re horny, etc. The dictator can do a great deal to add a level of detail not seen before in games like this.

So, how would this apply to a real scene? I mentioned how it can change how a scene plays out, so let’s have a look at a little snippet of a dirty scene with a female fox NPC. The scene itself is for players who have one or more dicks. The text:

Dictator Demo 14

In this example, we’re writing a dictator tag so this part of the scene can deal with players with one OR two dicks. It can happily handle even more, as well as any other exotic things that can serve as dicks; anything the writer wants to include. For this example I’ve not used any parser tags, to keep it simple. And the results:

Dictator Demo 15 Dictator Demo 16

As you can see, the game has presented neat text to the player depending on the value of [penisCount]. This puts a ton of power in the writers’ hands to create interesting, varied scenes that can easily handle tons of player variation (which is good, because there is a whole hell of a lot of possible player variation).

So, that’s a look at the parser and dictator systems in action! They still need some work as there are a bajillion tags to add to their internal dictionaries, but they’re working, and I hope it conveys the sort of awesome stuff we and our writers can do with them. :3

Until next time!

41 Responses to “Showcase: Parser & Dictator”

  1. Alternative Compound says:

    Excited for the game.

  2. JfromfarPY says:

    Nice examples, easily to understand and those details on the shadow while scrolling is awesome! great work!

  3. Ryagon says:

    Whew, that’s a lot what can be done. °-°
    I’m a little worried as of right now what happens when the dictating and nesting becomes arbitrarily complicated (for instance, when you have three dictator options, all with their own [random] branching), but I’m sure that you will make a solid system with that.
    Also, the text box make-up is really neat. 😀

    • Benji says:

      That would be a bit of a misuse of it, haha. Nesting dictator tags is possible and can totally be done, but I doubt it’s something that’s going to crop up all the time. It really depends on the demands of the scene though.

      • Ryagon says:

        Good, that’s fair enough. X3
        I think it’d be on the hard side to write a scene with so much branching anyway. I’m very curious about how everything turns out, but there’s still some months to go, so… patience.

        But in any case, I’m very certain that this is going to be a {gameQualityAdjec} game! 😀

        (Fantastic, of course.)

      • lashcharge says:

        Bess/Ben TiTS doc had soo many branches within branches it was a utter mess.

      • WulfesHeafod says:

        Considering that character customization is the core aspect of the game, it seems like scenes with multiple nested dictator/parser tags would be almost required in order to capture the feel that your character’s appearance is actually being taken into account.
        I know TiTs has a lot of scenes that simply swap out adjectives without changing the rest of the scene, meaning that whether your junk is “normal” sized or the size of a small car, the only part of the scene that changes is the word that precedes it and generally defeats the purpose of character customization.

        • Fenoxo says:

          That’s one of the reasons TiTS puts its scenes in code of instead of a giant parser. Code is nicely set up to handle nested variations, while it’s very easy for parser stuff to become a maze of illegible brackets.

          On the latter point, that’s down to the writers. Personally, I prefer to give giganto-cocks their own specific scenes.

          • WulfesHeafod says:

            You’re right, I was rather over-generalizing with the second point, and there are definitely well written scenes that take size into account. Unfortunately, it is, like you said, up to the discretion of the writer. Perhaps the nesting system might encourage people to utilize it’s features, or end up like others said a nest of brackets. Time will tell I suppose.

  4. BigBadCat says:

    It looks really promising. I love that dictator can do to scenes =)

  5. Strawkitty says:

    Rather impressed with the Dictator and the opportunities it presents. Although it makes me curious about there being a semi-global check for appearances when in towns. As in if the player has managed to grow themselves to such endowment or height that they actually can’t fit through normal doorways into buildings.

    For Parser I think that some scenes might later get a bit over use of it depending how you write the guidelines for writing scenes. XP

    • Benji says:

      We’ve already got lots of documentation about proper use, as well as an almost-complete directory of tags for both the parser and dictator. It’s about 100 pages and took me nearly two weeks solid to write, haha.

  6. lashcharge says:

    This is very similar (if not identical) to the system used by TiTS, which is something I know since I helped lot of people reformatting their GDocs there. Although tits uses [] for parsers and {} for variables/dictators.

    The only issue I see in here is that TiTS does it better by having the parser has [pc.penis] instead of {playerPenis}. The dot in the middle helps distinguish between the target of the parser and what kind of information is there so things like {enemy.Penis} and {character.Penis} is easier to distinguish.

    Then again I know very little of coding so I could just be flailing shit everywhere.

    • Benji says:

      TiTS doesn’t have a dictator system. A parser, yes. As far as I know from TiTS’ parser documentation, “the {}’s merely denote optional text that requires coding to accomplish.” The CS dictator handles them automatically. As the post says, CS scene prose is kept isolated from the code. In TiTS, the scenes texts are inside the scripts.

      I think this’ll become clearer once I can show off the parser/dictator documentation. As for the brackets, you’re right about those. This is based on the original Unity version I wrote. Gedan pointed out the same thing that the brackets should be the other way around, I agreed, and we changed it. The documentation has parser tags as [] and dictator tags as {}. We changed a lot of other things with the parser too, like making the target clearer as you mentioned.

      I’ll try to get the documentation tidied up a bit soon so I can show what I mean. For this I wanted to just show it working and explain a bit about what it does.

  7. Cage says:

    Please include an option to disable the shadowing of the text.

    I can understand that it looks nice, but if the shadow makes it harder to read, you are in essence sacrificing screen real state for it’s sake. Either the player will suffer through having to read shadowy text, or he will have to interrupt his reading to scroll down a great deal more than he would otherwise, since now the readable portion of the screen is smaller.

    If you want it to look nice, without sacrificing readability, maybe make it less gradual, a more steep shadowing that begins and ends in the very last line currently displayed.

    Or, really, just add it as a toggle in the options screen, and literally everyone would be happy.

    • Benji says:

      I think the gif there might make it look worse than it is, but it never hurts to have options to customise things. I’ll make a note of it. :3

  8. Zanzuki93 says:

    It sounds really good benji i am so excited for CS 🙂

  9. Godwin says:

    The systems themselves sound intuitive and easy to use, let alone extremely helpful, but I’m more concerned about the line length of the text in the dialogue box at the bottom. It is excessively long right now. To the point where it’s kind of uncomfortable for me to read. It may just be placeholder for the moment, but did you have any planned systems to vary the padding/margin of the text space for individual users? Or general point size too, which could help as well.

    I’m afraid the dark gradient at the bottom, while acting as a lead on for text continuing further down, might be too distracting too. It overlays the white text, making it gray, causing it to blend with the dialogue box behind it. At a certain point it becomes frustrating to read through, which does cause the user to scroll down, but it really limits the amount of space for comfortably readable text you have in the dialogue box at the top, which seems like a waste. I would consider trying smaller gradient sizes/intensity, or explore other avenues to use as a lead on. I’d think the scroll bar’s presence alone would tell the user more content is hidden, but I can understand the want for something a little extra.

    Just my thoughts on the progress so far (although it really wasn’t on what you were focusing on). All in all I like what I’m seeing, and continue to be excited about this project.

    • Godwin says:

      Since I don’t know how to edit my own post, or if I even can currently, after looking at the blown up picture on the gallery page the gradient doesn’t cause near as much muddying of the text as the embedded picture you have here implies. I rescind my previous thoughts in that regard. I do still think the line length is too long though.

      • Benji says:

        You could be right, actually. Upgrading to Unity 5 (this was all written on 4.3, or around that area) made a lot of the text in places go a bit screwy, so it’s possible it made it smaller and I didn’t notice. Either way, we’ll be including options to change the font size and possibly customise colours too.

  10. Derpy says:

    Now that looks pretty promising! I suppose the possibilities are endless here… I’m so curious how all of this will turn out!

    Also I think the graphics are really pleasant to look at 🙂 Spiced up with artwork and or chibis here and there it’s going to be such a blast!

    Keep up the great work!

  11. Derpy says:

    On a totally unrelated note: Is there any chance for beasty content? I kinda like shadman’s Witcher 3 artworks *blush* *duck-and-cover*

    • Perrin says:

      Shadman has some great stuff outright. DMITRYS has some hot stuff too, but it’s not everyone’s cup of spunk-filled tea.

  12. NyuVixen says:

    When can we test it?

    • Benji says:

      Hard to say until Crimson gets back, but we’ll be releasing something people can poke at as soon as we can, possibly late January/early February.

  13. Rajah says:

    Nice setup!

    I have a suggestion with regard to the dictator. As you’ve presented it, it appears to allow branching based on the values of arbitrary name-value pairs, which opens the door for all kinds of run-time errors if writers aren’t scrupulous about the logic in their dictator tags. (Witness the playerHeight == 72 example.) I think writers who aren’t programmers will find that really hard to get right.

    If you require writers to define all their dictator tag variables and enumerate all allowed values for each variable up front, that will let you build a checker that can check whether a defined replacement exists for every legal value of each dictator tag. I think that’ll give you a dramatic boost to the usability of the system.

    • Benji says:

      Quite right! In fact, Crimson has a script in mind already that he used on a previous job, namely the call-scripting software he worked on before. He has an idea for a script that’ll check things like that for us, based on a script he wrote to do almost the same thing. As-is the dictator’s pretty good at error-checking and letting me know if something went wrong and where exactly the problem occurred, but there are likely to be exceptions. So yeah, your concerns are valid but we’ve got things in mind for them already. :3

  14. Perrin says:

    Am I the only one bothered by the inefficiently written code in that last example?
    I mean, the last sentence or so was the same in both events, so it’d have been better to keep it out of the parsed portions, leaving it as the end in both outside of them… Right?

    Or is does any of that matter with this system…?

    • Benji says:

      That doesn’t really affect anything, no. X3 But you’re correct in that it’s kinda shared the last part. That’s because I wanted to make it very clearly the text again but changed for two cocks, so it’s clearer what the intention of the dictator is. It’s not really inefficiently-written code, either way the dictator’s choosing one of two strings set up for it. They can share some similarities or be totally different.

  15. Flake says:

    I wanted to ask, if there is any chance that you would accepts donations in bitcoin?

    Keep up the good work.

  16. Farlun says:

    Just a few short questions.

    One – Will there be an option to change the font size?

    Two – What is the planned average lengh of a scene? I’m not a fan of a “wall of text” approach, but I know many people like it and that’s what currently is the norm in TiTS. Actualy, an option to cut the text into smaller chunks shown on seperate screens would be a nice alternative to scrolling. But I doubt that’s really worth doing.

    Three – Do you plan (or did I miss) an entry about types of NPCs in game? I mean male to female to herm ratio, number of romancable characters, the planned depth of such relationships, writing examples, sex prefferences/fetishes, amount of sexable NPCs, stuff like that. Of course, only the general plans and stuff like that, considering how early in production the game is.

    • Benji says:

      1: Yup. Answered in a comment on this post, in fact.
      2: We actually plan for a decent length scene, cut into chunks with player choices between each one. You can read more about the rough plan here: https://www.carnalsouls.com/lets-talk-about-sex/
      3: Things like that are stuff that grows over time after the initial release, really. It’d be premature to say anything at this stage. We do plan on having a decent spread of genders though.

  17. KittyPurry says:

    As I read this, I was struck that this system isn’t terribly complex. I was thinking, is this even special? I’m pretty sure this is standard for most RPGs, though I suppose it manifests in different ways.

    Does this system allow for real branching, across files or with “GOTO” functions? Or is it forced to flow linearly? I’d be mindful that, unlike call scripting software, a game has multiple interconnected states, and I would expect something closer to a state machine to handle this kind of text flow.

    But maybe that’s just the programmer in me talking.

    • Perrin says:

      Find some RPGs with programmers and paychecks comparable to games like these, then get back to them.

      Seriously, how many games stick you with a character whose form you can’t alter beyond two or three skins? Interchangeable bits and pieces… Those small details in what makes your character YOURS is what makes it special. Even more so as it’s in an ero-game sort of setting.

      Try to find programmers of an international level that are willing to put in the work for a concept like this, consider wages. THAT is what makes it special.

      Also, it panders to teh pandurs.

  18. Drakath says:

    Will there be an option in the game for an opaque background? I find that translucent textboxes with an image background can be tricky reading sometimes.

    • Benji says:

      Possibly! I want to include as many customisation options as we can provide so that people can read it and enjoy it to their liking.

  19. MrRoboShadow says:

    possibly off topic but i wanted to ask a few questions

    will there be portraits for npcs? (like the in TITS)
    if so will there be one for the pc too?

    and will the pc’s portrait change based on equipment, body etc? (this one is a long shot but worth asking)

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.