Search Unity

Elaborating logic for scripted ( dialogued ) games

Discussion in 'Scripting' started by Guy_Yome, Jul 31, 2015.

  1. Guy_Yome

    Guy_Yome

    Joined:
    Sep 30, 2014
    Posts:
    13
    Hello there! I have a logic problem. I can't seem to find information on how to structure informations for a game that works like a "telltale" game. For example, I want to have dialogues with characters in the game, but somehow the discussion evolves with the game and changes from the person you're speaking to. I would rather do it in XML, but I don't know how to structure it or what nomenclatures to use. If the best way is not with XML, then I shall live with it. Thanks for helping me. If you want more informations because you think this is unclear, then feel free to ask.
     
  2. A.Killingbeck

    A.Killingbeck

    Joined:
    Feb 21, 2014
    Posts:
    483
    Guy_Yome likes this.
  3. Guy_Yome

    Guy_Yome

    Joined:
    Sep 30, 2014
    Posts:
    13
    Okay, so I designed a structure in XML with a special syntax I created or will improve. The ID of the message will be designed as this:

    IdOfSpeaker-IdOfSpeakersImplied-IdOfContext(s)-IdOfOrderInConversation

    The ID of context is memorised in a variable in the controller of the game. So for example:

    12-1+12-A5+<=A7-1 : Hello, I don't know you.
    1-1+12-A5+<=A7-2 : I am Robert.
    12-1+12-A5+<=A7-3 : So you are named Robert!
    1-1+12-A5+<=A7-4 : Exactly!
    12-1+12-A5+<=A7-5! : I will remember you!

    12-12-A5+<=A7>+-6 : Hey! I remember you!
    12-12-A5+<=A7>+-7 : You're Robert, right?

    + is a link between informations in each type of data. For example 1+12 means player 1 and 12 are implied in this.
    For the context, +<= is between two contexts and means that from context A5 to A7 ( included ), this will be the speech. As for the !, it means that after this point, the conversation will be locked from this part, only starting after this one from now on. What do you think about this? I based that from the link you gave, but I might be wrong.
     
  4. DonLoquacious

    DonLoquacious

    Joined:
    Feb 24, 2013
    Posts:
    1,667
    Here's an image I just posted in another thread about an event system I made:



    As you can see, there's no reason you should have to concatenate strings the way that you're doing. XML is more than capable of having many different attributes on one tag.
     
    Guy_Yome likes this.
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    You'll drive yourself crazy manually editing XML. Consider using a visual editor like Twine or Parley (for free options), or Chat Mapper or articy:draft [or the Dialogue System] (for paid options). If you have Neverwinter Nights or Dragon Age (available for cheap on Steam or GoG), you can use their toolsets and then export to XML. Twine can export to a text format that you can parse. Parley also exports to a very simple text format, and also includes code to read and run conversations. There are other options on the Asset Store, too, some of which can import Neverwinter Nights, Chat Mapper, and articy:draft format.

    All of these options have some kind of variable and condition system that can record which lines the player has chosen and choose the next lines and player responses appropriately.

    If you're making a Telltale style game, you might also want to look into Adventure Creator. It's designed for adventure games like those.
     
    Guy_Yome likes this.