[WIP] Visual Novel Engine in 100 Events

0 favourites
From the Asset Store
100 high-quality cars / boats. This asset is perfect for a top-down game.
  • result v1.0: https://copy.com/KCTlxMno6FGbhQto

    http://strategy-investor.de/mgz10/vnengine/

    code is not very clear and organized due to trying to stay within the 100 events limitation

    ---

    I will attempt to create a visual novel engine in less than 100 events as a proof of concept. I am not sure if I will succeed though, but I will try <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">. I will add annotations and thoughts on the way. Please bear with me.

    For now, I will try to collect needed features the engine is supposed to be able to do.

    Basic features (have to be in for sure!)

    • main menu with (new, load); this can possibly be worked as a normal game screen
    • import a script file that will tell the game what to do and that can be edited outside of Construct 2 (similar to a RenPy Script maybe, should be kind of human-readable)
    • load images
    • move images
    • display dialog (characters should be able to have differently colored text)
    • display choices for user input
    • keep track of decisions and follow the correct story branch based on that
    • audio (music and speech)
    • simple save and load system
    • an UI

    advanced features (don't have to be inside, but would be nice to have; should be done after all necessary stuff is in the game):

    • transitions
    • history
    • skip function & other navigation (thanks Ofris)
    • options for text display / hud
    • multi language support (thanks Ofris)

    Are there more features, that are needed and I didn't think of?

  • Hi! Very interesting project. I would add:

    • Dialogs should appear progressively (word by word).
    • Conversation record, so user can read past dialogs.
    • Some visual novels have "point & clicks" elements.
    • Navigation features: click on some part of the screen to access a new sceneario.
    • Character animations: different sprites should appear depending on the dialog (neutral, happy, sad...).
    • Languages support.

    Please let us know how the project progress

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, thanks for your input. Most of the things you mentioned are already in my list under a different "label". Text appearing word by word / instantly / text speed would be contained in the options for text display.

    Conversation record would be history.

    Point and click elements is contained in keep track of decisions (which kind of includes being able to make decisions usually by clicking buttons).

    Navigation would be partly skip function, but I guess there can be additional other navigation tools, too, true.

    Different character sprites for different emotions is contained in simply displaying images.

    Language support should be doable by adding a language selection layout and loading the appropriate script file (each language will have one, then). It would go to advanced tools, which I think I will not manage to put in below 100 events, but let's see.

    For now I thought about the kind of functions I need to do my basic tasks:

    functions:

    character | name | characterid | textcolorR | ~G | ~B | font

    # defines a character

    choice | decision | add | label | positionx | positiony

    # spawn a button that lets you make a choice, if label omitted, it is nonclickable

    require | on/off | decision | value

    # another tool for flow control

    # when "on" the following lines will be ignored, if the value for decision is not equal or greater than value

    # when "off" it will turn off the last requirement, that has been imposed

    text | characterid | text

    # display dialog, maybe we should be able to define default positions like left, right, middle

    # /n for newline

    # text will display and then wait for user click until it continues

    image | imagename | imageid | positionx | positiony | scale

    # load a character image

    # we will add a transparent image with name clear to visually clear the screen

    move | imageid | positionx | positiony | movetime

    # will move the image over move time to position x and y

    background | imagename

    # load a background image

    sfx | filename

    # will play voice or sfx once

    music | on/off | filename

    # will loop a piece of music or stop it

    anchor | id

    # let's you create an anchor (can be the start of a scene, etc.)

    goto | id

    # let's you jump to an anchor

  • Here is a very simple example of how a script file could look (that the engine is supposed to understand / parse):

    character | Carl | c | 100 | 20 | 20 | Arial
    character | Steve | s | 20 | 60 | 100 | Arial
    character | System | none | 100 | 100 | 100 | DejaVu Sans
    
    anchor | start
    music | on | main_music
    background | main_screen
      text | none | Where do you want to go?/nPlease make a choice :).
    # comments and empty lines should be ignored
      choice | scene1 | 1 | I want to go to scene 1. | 400 | 100
      choice | scene2 | 1 | I want to go to scene 2. | 400 | 150
        require | on | scene1 | 1
          goto | scene1
        require | off
        goto | scene2
    
    anchor | scene1
    image | carl_happy | 1 | middle | bottom
    music | off
      text | c | You did it!
    image | carl_suspicious | 1
      text | c | But why am I alone here/n and the background didn't even change. 
      text | c | Hmm, no music playing either... I'll be better getting out of here.
    image | clear | 1
    goto | start
    
    anchor | scene2
    background | scene2
    image | carl_happy | 1 | left | bottom
    image | steve_happy | 2 | right | bottom
      text | s | Awesome!
      move | 2 | middle | bottom | 1
      text | c | You did it! Your decision-making is unparalleled.
      sfx | yeah
      choice | success| 1 | Go back to the main menu. | 400 | 100
    image | clear | 1
    image | clear | 2
    goto | start[/code:30ieovtv]
  • That sounds great. Visual Novels are quite popular in Asia and I think it could be a success also in West markets with non-anime visuals & storylines. So this project is very interesting

  • I had made a plugin which will parse commands from a csv format string, then execute them through function object.

    You could make a set of functions then call them by this plugin.

  • rexrainbow: yeah your plugins rock. Still I would like to try it with just the standard stuff of Construct 2. Btw is there a way to evaluate with variable names. Your plugin seems to be able to do evaluation, but can I work it in without it? I know there is the javascript execute of the browser object, but how would I use variables from construct there?

    Ofris: one can't expect a fully capable engine in 100 events, but it might work as basis one could expand, yeah. With RenPy there is already a good and simple to use open source VN engine that people can use, so this is just a for-fun project and maybe a few people will find it interesting or educational.

    I started scripting:

    https://copy.com/RXvmGj2ghnW4AO9J

    version 0.1b; number of events: 10

    done so far:

    • reading the script
    • exection of functions

    and added the most simple to implement functions:

    • sound
    • music
    • wait (added this, can't hurt)

    I adjusted the script (fixed a typo) and added the newly added functions at the start so you can see (or rather hear) them in action.

  • I added new functions:

    https://copy.com/CounHpDqNPCRRyoc

    version 0.2; current number of events: 32

    newly added functions:

    • character
    • background
    • text
    • choice (just noticed a bug there)
    • require
    • goto

    I put in image and move placeholder functions, so the example script pretty much plays through now, just without character images.

  • new version is 0.3; current number of events: 52

    https://copy.com/f0bvviAvgOE9fiAO

    you can try out the current state at:

    http://strategy-investor.de/mgz10/vnengine/

    what's new?

    • image
    • move
    • set (re/set values of decisions)
    • macro / runmacro (define script snippets that can be reused)

    Some finetuning is needed for the music (thinking about fade out and need to detect if the same piece is already playing, and if it is, it should just continue playing).

    Not sure if positional play is needed for sfx.

    Next things I will be working on:

    • fade out/in for images
    • save / load
    • main menu
    • text history
  • I was pointed here by Rex - this looks very interesting!

    For someone who'd love to be able to take advantage of what other things C2 can do, I've been looking into the possibilities of making a VN with it for a while. I'll definitely be following this

    I'll try what has been accomplished so far and let you know if something comes to mind!

  • Vati-nyan: you are welcome to look over it <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    I was busy these days, but now could find spare time to add some new stuff:

    version: 0.4; current number of events: 68 (only 32 spare till we would exceed the free version limits)

    https://copy.com/WE2HmSkZoyJ9MaBz

    you can try out the current state at:

    http://strategy-investor.de/mgz10/vnengine/

    (if you tried it out before and no menu buttons at the bottom appear, try refreshing with F5; some menu buttons do nothing for now btw)

    what's new?

    • fade in and fade out for images
    • history
    • hide the bottom text box

    Thinking about automatically adding a short, default crossfade for images. I will try to add it, after I'm done with the rest of basic features that still need to be added:

    • main menu
    • save / load

    optional:

    • skip
    • auto play
    • options menu

    edit:

    0.4b: https://copy.com/zCIHGcVo4E1JKbUp

    added a fadeout on the edges in the history screen for the looks

  • Loving the history feature! Looks very sleek

  • Hey guys,

    a new update

    version: 0.5b; current number of events: 86

    https://copy.com/IAu3pGzzcoY0xlNB

    Main menu and saving is partly done, I think I can add the other half of it in before 100 events are reached. Not sure about skip and autoplay yet. Options menu will not fit into the 100 events probably.

    edit: fixed a simple error

  • version 0.6; current number of events: 89

    https://copy.com/hJI2Z9pAcYOEDQYc

    Try it out at: http://strategy-investor.de/mgz10/vnengine/

    (if you've tried it out before and it doesn't show the main menu, but starts with the game, try refreshing or deleting the website data)

    What's new?

    • menu done
    • saving / loading done (still has 1-2 bugs I have to squash)

    Next stuff is all optional, let's see what I can improve a bit with the remaining events. Thinking about:

    • skip
    • autoplay
    • options
    • cross fading for music
    • cross fading for images

    When 100 events are reached, I'll try to tidy up the code a bit and add a little up-to-date documentation.

    Added some small music loops that hopefully are more bearable. Credits to:

    menu music: Bamberg - Bamberg 2006

    save music: Iron Bridge Grafix - Midnight Sleep Ballad

    main music: calpomatt - .::A Long Path Ahead::.

  • The optional stuff that doesn't fit into the 100 events - do you still plan on doing those as an extra afterwards, or are you going to stop entirely at 100?

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