Help with Visual Novel Engine (CAPX included)

1 favourites
  • 8 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Good day, o wise patrons of Scirra! I have been making a prototype visual novel for two days now, and I just want to ask you guys for advice before this little project of mine gets out of hand.

    You see, I am having trouble figuring out the best/most-code-efficient way to program my game's script. Basically what sprite and background to show, what text to display for dialog and names, what animations and transitions to play, and what BGMs, SFXs and Voices to play. I am trying my best to use arrays because I believe they are the most effective to use in this situation. However, am having trouble deciding how to input my data into the array's indices.

    Using traditional XY coordinates makes it difficult to remove dialog once it's been written in (from editing the script for example), as if it's been set in stone because it would leave big gaping holes inside my array. And I only increment my current position variable one at a time. I figured I could just write a little line that said that whenever my position is in an index with a value of 0 (an empty array index) just increment my position by 1. However I can't seem to find the right place to put this line as my text display code is in a group that gets activated and deactivated per dialog line. (You can thank Construct2 genius Kyatric for that one! Space Jinx was extremely helpful for this little project.)

    The second method I tried was using the Push & Pop method. This method lets me easily remove dialog even after I've written it because they don't leave gaping holes in my array. However this freedom comes at the price of me not being able to easily find at what index I should trigger an event like an animation change.

    Should I just use one array for each aspect of my script? eg. One for the dialog, name of speaker, background, sprite, sprite animation, sprite transition, bgm, sfx and voice?

    I am also having problems figuring out the best way to input story paths that are actually affected by choices (not just simple one-liners like most linear visual novels, as I'm trying for a classic, branching storyline with multiple endings).

    Please help me out guys, I've tried my best here and I keep coding myself into a corner - and not even writing my ideas down on paper helps! <img src="smileys/smiley29.gif" border="0" align="middle" />

    Here are both of my Capx's, commented as best as I can, for those who are brave enough to look at my messy code. Oh, and please don't laugh at my graphics. They are just place holders.<img src="smileys/smiley17.gif" border="0" align="middle" /> Thank you for your time.

    EDIT: They're animated, by the way! Might want to check them out. <img src="smileys/smiley2.gif" border="0" align="middle" />

    Using XY input method

    https://www.dropbox.com/s/atczxz3o3ba41cf/Kouji%27s%20VN%20Engine%20Beta%20XY%20input.capx

    Using push&pop input method

    https://www.dropbox.com/s/s1ukt8g04w7c7p9/Kouji%27s%20VN%20Engine%20Beta%20PUSHPOP%20input.capx

  • I've prototyped a visual novel engine for free Construct 2 (intended to write a tutorial for it) and just put everything into one array. Worked well, imported via CSVtoArray and blank fields are set to -1 and ignored later in the script.

    Why would you need to remove anything from the array in the process? Modify maybe, but even that is not really necessary oO.

  • Thank you for the reply mindfaQ.

    Because the script is still being constructed, some lines of dialog may one day need to be removed (like a bunch of sentences that don't contribute to the story all that much). This causes problems in my system because they're basically inside cells that need to be read one by one - which causes problems due to my line-reading group that only reads one line at a time. Any blank fields cannot simply be skipped because they get read as 0's.

    From what you say maybe I could just use the second dimension of my array to add 1's and 0's to determine whether a certain line needs to be skipped? Hmm..

    Oh, and if you don't mind, could you please clarify what you meant by "CSVtoArray and blank fields are set to -1 and ignored later in the script"? I'm afraid I didn't quite catch that. <img src="smileys/smiley17.gif" border="0" align="middle" />

    I'm looking forward to your tutorial if ever it comes into fruition. <img src="smileys/smiley2.gif" border="0" align="middle" /> Please drop the link below if you find the time to make it! Thanks again!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • CSVtoArray is a Construct 2 plugin. I can write the dialog lines and actions into a table in LibreOffice Calc or Excel, then import the contents into Construct 2.

    My data looks like this:

    <img src="https://www.scirra.com/images/articles/03_5.png" border="0" />

    you see only few fields are filled. Only the filled cells will be processed. The empty ones will be set to -1 in Construct 2 and thus be ignored by the code via a simple condition.

    If you later on wanna add or remove lines inbetween, this is easy to do in Excel/Calc by adding/removing rows.

    And as you said - you could also add a column that tells the script whether to completely ignore the line or not.

    I am at the fifth page of my tutorial, but all the explainations make it really long - so I've paused the writing atm.

  • Thanks again for the quick reply. Wow, that plugin sounds like a lifesaver! Man, I've been missing out, haha! <img src="smileys/smiley32.gif" border="0" align="middle" />

    Anyway, best of luck on your tutorial! Know you always have a fan in me, and drop me a link once it's finished! I'd love to see what you've come up with. Really looking forward to it! <img src="smileys/smiley2.gif" border="0" align="middle" />

    Oh, and for those of you who happen to read this, please continue to post your tips and advice here! Also feel free to modify my .capx and post your improved version here for all to see! Let's help introduce Construct 2 to the world of Visual Novel-making!   <img src="smileys/smiley42.gif" border="0" align="middle" />

  • Can somebody make a Visual Novel creation detailed tutorial please?

  • Make external txt file with array, add that file to your project, and fill it up with dialog ( look up how arrays look in json form) then use ajax to load array from json string. For choices use tokenat and numeriacal variable. same for outcomes.

  • um,.if any of you guys need music for VN please contact me. Here's some samples, Thank you

    soundcloud.com/danguvibe/sets/visual-novel-musics

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)