Branching Dialogue using JSON

You're viewing a single comment in a conversation. View all the comments
  • 4 Comments

  • Order by
  • Hi Laura_D

    This has been a great tutorial series, I've been slowly going over it the last couple of days and it's greatly helped my understanding of JSON files.

    Not sure if you noticed, but in the final example the text effects are disabled (think it's Steve's dialogue).

    Anyway, one thing that I'm still trying to get my head around is organising large projects and how that might look like with a system like this. Currently, it feels like the larger a JSON file is, the more difficult it becomes to follow. I'm wondering if it would be best to have separate JSON dialogue files for each layout and have them loaded at the start of each layout, essentially parsing a new file on each level transition. This should allow for a more manageable system, but as I'm still very new to this, I'm wondering if this is a good idea or not.

    Anyway, if you have an idea around this, I'd love to hear it.

    Thanks

      • [-] [+]
      • 2
      • Laura_D's avatar
      • Laura_D
      • Construct Team Community Manager
      • 2 points
      • (2 children)

      The point of having one dialogue file is to keep the dialogue events cleaner. In my main game file, I have the dialogue events stored on my 'global' event sheet to make sure it can be called from wherever. I suppose you could use separate JSON files, but you then end up with a lot of AJAX requests etc for each file, and things will probably start getting a little complicated when you come to call each specific file.

      I started in my game having about 3 different systems and files for dialogue and quickly came to the conclusion that I'd prefer having just the one.

      The large JSON may get complicated, but I find having a separate spreadsheet with all the data in (including IDs, where they link etc) really helps.

      • Thanks for the reply. A spreadsheet sounds like a good idea. Do you manually convert it to JSON format? I guess I just need to spend more time working with it to build familiarity.

        Anyway, thanks for the great tutorial :)

          • [-] [+]
          • 2
          • Laura_D's avatar
          • Laura_D
          • Construct Team Community Manager
          • 2 points
          • *
          • (0 children)

          Essentially yes - I write the dialogue in the spreadsheet so I can assign the IDs, and any other data I may need down the line, then I add the dialogue lines to the JSON file.

          I may be giving myself more work, but it suits my style of thinking.