[WIP] Visual Novel Engine in 100 Events

Show us your works in progress and request feedback

Post » Tue Mar 17, 2015 6:31 pm

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 :). 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?
Last edited by mindfaQ on Mon Oct 05, 2015 5:03 pm, edited 6 times in total.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Wed Mar 18, 2015 1:35 pm

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 :)
B
10
S
2
Posts: 39
Reputation: 830

Post » Wed Mar 18, 2015 5:25 pm

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
Last edited by mindfaQ on Sat Mar 21, 2015 6:55 pm, edited 1 time in total.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Wed Mar 18, 2015 6:23 pm

Here is a very simple example of how a script file could look (that the engine is supposed to understand / parse):
Code: Select all
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
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Thu Mar 19, 2015 11:33 am

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 :)
B
10
S
2
Posts: 39
Reputation: 830

Post » Fri Mar 20, 2015 12:37 am

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.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Sat Mar 21, 2015 11:37 am

@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.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Sat Mar 21, 2015 6:54 pm

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.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Sun Mar 22, 2015 2:22 pm

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
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Tue Mar 24, 2015 12:05 pm

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!
B
10
S
3
G
3
Posts: 110
Reputation: 2,206

Next

Return to Works in Progress/Feedback Requests

Who is online

Users browsing this forum: No registered users and 5 guests