PDA

View Full Version : Visual novel engines?


Blackavar
2004-10-14, 11:35
Are there any publically usable engines that could be used to run and create something similar to a visual novel?

Er...yep. Short question. Sorry for anybody looking for anything more substantial. =P

Haeleth
2004-10-14, 11:55
Dozens.

The most useful resource for you will probably be the discussion forum for fans making visual novel-type games at Lemma Soft (http://www.lemmasoft.net/forums/) - I'm sure the folk over there would be more than happy to fill you in on the various options. Looks like they're plugging Ren'Py (http://www.bishoujo.us/renpy/) at the moment.

If you feel like a challenge, of course, KAG3 / KiriKiri (http://www.kirikiri.info/) is probably the most powerful free engine there is - it was used for Fate/stay night, for example. But it's only documented in Japanese...

Blackavar
2004-10-14, 12:37
Oh hum. Hey. Thanks. *tosses the Visual .Net disks back into the Pile o' Junk* =P

JudicatorOmega
2004-11-07, 14:55
I want to use AVG32... Isn't it possible for me to keep the Kanon executable, get rid of the CG & Sound, and start with a blank scenario file? Surely there must be a tool to convert bitmap images to to PDT files.

I want to make a game where you are a knight living in a large castle area, and you get to date 3 girls. On the side, there would be comedy scenes involving you and one of the cooks in the kitchen who doesn't like you. I want the game to interactive in such a way that you can choose where to go often times. Such as going to the armory to sharpen your sword (even though you never actualy use the blasted thing), or to the infirmary where you somehow find that certain girl, or to a walk in the nearby forest, where you find some little kid who is lost.

Actually, this sounds like it would have legal issues if I ever made and released such a game onto the internet (even if freeware)... I won't like Ren'Py unless I was able to disable the rollback feature, change the font, and use a different type of options menu.

zalas
2004-11-07, 15:09
Yeah, I don't see why not (Re: Yukiroids) You might be able to use xkanon for it :/ I don't know if Key has an IP thing for the binary format :/

Haeleth
2004-11-07, 15:44
Yes, writing a game for AVG32 would be perfectly possible, and AVG32 is certainly capable of everything you describe. The distribution problem isn't really an issue; AFAIK the binary format isn't copyrightable or patentable, so the only problem would be distributing an interpreter, and you can get round that easily enough by distributing the game without an interpreter and pointing people at one of the many free demos of AVG32 games, as they can just copy the EXE out of one of those and use it.

The only unique problem AVG32 developers face is that the only compiler you'd be able to get your hands on is mine, and it's not particularly user-friendly.

Of course, you'd also face all the non-unique problems all game developers face, namely producing enough graphics, sound, and gameplay to support a game. But if you do decide you can manage it, and that AVG32 is your best option (there are other free alternatives that might be more to your taste than Ren'Py), I'd be happy to let you play with a copy of my compiler...

JudicatorOmega
2004-11-08, 17:34
I have not seen or read anything about how these games work. But I am going to take some guesses. Tell me if I'm wrong:

The engine reads the compiled scenario file which holds all of the script and defines which images and transitions to use when called for. There is a background image for the background and a foreground image for the character you are talking to. The story's direction depends on which choices the player makes, using some kind of variable with numbers that add up in such a way that they can't overwrite each other.

So if you ask Nayuki to help you unpack your stuff, then a certain number is added to "nayuki_points" and a bit later in the game, the story will choose to take you home if "nayuki_points" is equal to that certain number. This number is probably that "1|2|4|8|16|32|64|128|..." thing. I think they were called "flags", but I don't really know anything about that.

Well, I got some questions. What is an interpreter -- do you mean the AVG3216M executable? And, what can be so hard about working the compiler? Don't you just choose the files or folder and the compiler grabs up all of the files and spits out a smaller SEEN.txt?

Where can I get a sample of the Kanon or Air uncompiled scenario files? I am sure that if I look and study one of them, I can mimick the way they work and then make my own game. I once learned some C++ by just looking at random source code in Notepad and trying to figure out how to read it and understand it, so I should be able to figure this out.

Haeleth
2004-11-08, 17:57
You've got the right idea about the way the game works. In practice, in Kanon what happens is there are a number of variables for each character, which start at 0 and are set to 1 if you make certain choices. There is indeed a variable that's set if you ask Nayuki to unpack your stuff, although it's actually called <tt>int.300</tt>.

The way it all works, however, is slightly more complicated than you seem to realise. The script is actually in the form of what's known as bytecode, which is an abstract representation of the game logic that's easier for the computer to read. For example, the commandgrpMulti &#40;'BG001', 22, 'CGAY10', copy&#41;is actually represented by the bytes0x0B 0x22 0x01 0x42 0x47 0x30 0x30 0x31 0x00 0x26 0x01 0x01 0x43 0x47 0x41 0x59 0x31 0x30 0x00 The interpreter (which is AVG3216M or whatever) reads those bytes and loads the bitmap BG001.PDT in the background and CGAY10.PDT in the foreground, displaying the result with transition effect 22.

The compiler is what lets you get from the text to the bytecode. It also handles things like converting the nice variable names like "nayuki_points" into the raw addresses like <tt>int.300</tt> that the interpreter requires, converting things like function calls and <tt>if...then...else</tt> structures into the goto commands that are all the interpreter understands, and so on.

The actual source code of Kanon that I'm working with looks like this:
title &#40;'1月 7日 木曜日'&#41;
int.3 = 7
int.2 = 1
grpMulti &#40;'BG111', 0, 'BG107', 0&#41;
pause
int.0 = 0
grpOpen3 &#40;'SIRO', 26&#41;
str.1 = 'S_OP01'
int.10 = 27
int.11 = 1907
farcall &#40;501&#41;
unless &#40;bit.1001 == 0&#41; goto @1
ClearSkipMode
ClearCanSkipMode
goto @2

@1
SetCanSkipMode
goto @2

@2
bgmLoop &#40;'002'&#41;
int.0 = 0
fade &#40;1&#41;
wavPlay &#40;'DR_CLOSE'&#41;
'バタンッ!'
pause
'遠くから、勢いよくドアの閉まるような音が響く。'
pause
wavPlay &#40;'ROUKA'&#41;
'ドタドタドタ…。'
pause
'直後、板張りの廊下を走るような足音が、冷たい空気を揺らしていた。'
pause
That's mostly so ugly because it's raw disassembled code (you lose all the structure and variable names when you compile code and then disassemble it again), so somebody using the program to write an original game would be able to produce something easier to read...

JudicatorOmega
2004-11-09, 16:42
I think I lost my nerve, as this looks more confusing to the eye than I thought it would be. I hope I don't ever have to learn how to read bytecode to become a good programmer. I think I would go insane if I had to read bytes instead of word functions made from English.

Looking at that sample of code, I can kind of tell this is the first morning in the game right? Its probably because I have no idea what farcall & goto do, but the only real confusing thing is:

farcall &#40;501&#41;
unless &#40;bit.1001 == 0&#41; goto @1
ClearSkipMode
ClearCanSkipMode
goto @2

@1
SetCanSkipMode
goto @2

@2

What is that SkipMode thing? If I draw atleast 2 background scenes and 2 pictures of a character, then may I ask you to help me get started on my amateur game?

Haeleth
2004-11-09, 18:10
Don't worry about the bytecode - the compiler handles all that, so it's my problem not yours. ;)

The SkipMode stuff handles enabling and disabling the "Skip text" option in the right-click menu, based on whether you've viewed the current scene before or not. Ideally you'd be writing for a more recent version of AVG32, like the one AIR uses; that handles text skipping automatically, which is rather convenient.

It was slightly unfair of me to post code straight from Kanon, actually. That chunk, if I'd written it myself, would look like this:
// Display date screen
title &#40;'Thursday 7th January'&#41;
DateVar = 7
grpMulti &#40;'BG111', 0, 'BG107', 0&#41;
pause
grpOpen3 &#40;'SIRO', 26&#41;

// Display intro text with falling snow
SnowIntro &#40;'S_OP01', 27, 7&#41;

// Begin January 7th

CheckSkipMode &#40;bit.1001&#41;
bgmLoop &#40;cd_2StepsToward&#41;
fade &#40;fade_black&#41;
wavPlay &#40;'DR_CLOSE'&#41;
'-slam!-'
pause
'Some way off a door closes noisily.'
pause
wavPlay &#40;'ROUKA'&#41;
'-dotadotadota-'
pause
'The cold air vibrates with the sound of feet running along a wooden floor.'
pause
Hopefully that will look slightly less scary... ^^;

If I draw atleast 2 background scenes and 2 pictures of a character, then may I ask you to help me get started on my amateur game?
I'm always willing to help people with the technical side of AVG32 or RealLive hacking. So yes.
Just don't ask me to help with anything apart from code - I program for fun, but I doubt you'd want to pay my rates for graphics work...

Beneath
2004-11-13, 08:23
Can someone tell me why the script is compiled into bytecode? Is it just for obfuscation purposes?

I cannot see any meaningful speed advantage here to simply interpreting the script directly. I mean, the graphics code, simple as it is, would dwarf the time a good interpreter would spend reading the scene...

Nephillim
2004-11-13, 08:39
Well, I guess the only possible reason would be to prevent nosy players from spoiling the script for themselves :P

Haeleth
2004-11-13, 09:46
Good question. It seems logical to me, but that may be because I've been working with the stuff for so long.

Two possible answers present themselves. One is that while on today's PCs the overhead of interpreting text code would be negligible, things looked a bit different in the mid 90s when they started designing AVG32. The other is, quite simply, that it makes sense to separate the tasks: if you can give one team a compiler to write, and the other an interpreter, you're not actually doing much more work, and you are increasing modularity.

And why not bytecode? Many of the popular general-purpose "interpreted" languages actually work by compiling to bytecode and executing that each time you run the program; I believe Python does, for instance. (The alternative is to parse the code and execute by running through the AST, which is harder to design well, and very hard to keep from being very reliant on the internal memory structures - which is a Bad Thing by anyone's standards.) But if you're going to compile to bytecode anyway, and you're not making easy editing of source code a priority in the same way that Python does, why compile at runtime?

Ahead-of-time compilation is also useful for debugging - it removes the need for syntax checking in the interpreter, for one thing.

I do suspect Nephillim is partly right as well, though - obfuscation is clearly important, or they wouldn't have added the (stupidly weak) XOR encryption in RealLive.

Nandemonai
2004-11-13, 10:00
Java didn't REALLY resolve its speed problems until it adoped a bytecode strategy. It was QUITE slow until it adopted just-in-time compilation.

Beneath
2004-11-13, 10:01
> Two possible answers present themselves. One is that while on today's PCs
> the overhead of interpreting text code would be negligible, things looked a
> bit different in the mid 90s when they started designing AVG32

Maybe. But coupled with an application that has to draw full screen graphics, i can't see the difference being worth it on /any/ specced machine. Oh how frustrating my old DOS days were, realising how much of my time was being taken simply copying to video memory...

> And why not bytecode?

I was not challenging this. Just wondering why any kind of preprocessing was required at all :)

But yes, i had not thought of the idea that it makes the actual game executable much simpler. It was probably a mixture of things... that, and 'oh look if we do that it has these cool side effect also', etc.

Anyway, was just curious to learn if there was a big reason for it. Obviously not :)

One other thing is that you cannot really compare this case to Java or Python. This is much, much more high level and so parsing at run time doesn't have anywhere near as much impact.
It's the difference between a Perl or Python program being expected to run code represented in your source by thousands of lines in less than a second, and the Kanon script seen above where you only have a few lines of code per scene.

Haeleth
2004-11-13, 11:20
You cannot really compare this case to Java or Python. This is much, much more high level and so parsing at run time doesn't have anywhere near as much impact.
Good point. A better comparison would be to other 90s-era game scripting languages, like Quake C, which I believe also compiles to bytecode - and to things like ZZT, which interprets text directly, and for which the interpreter overhead really does affect execution speed noticably for more complex scripts. On a 386, anyway. ^^;

While you're quite right that 99% of AVG32 code is graphics-bound, there are occasional exceptions. For example, my name changing routine in Kanon (which has to do some nasty stuff to work around an AVG32 bug) executes something like 10,000 instructions on average, and uses a huge Shift_JIS lookup table that takes my compiler several seconds to process. With ahead-of-time compilation, the whole thing runs without a noticable pause; I'm not sure how well a pure textual interpreter would do. Of course, that's not typical AVG32 code... in fact, it's the only non-trivial example of a CPU-bound routine I can think of.

It's interesting to compare AVG32 to RealLive, which is noticably higher level - for example, its bytecode includes expressions almost verbatim, with the interpreter even resolving operator precedence rules, whereas AVG32 breaks all arithmetic down into two-position code. It's quite clear that by the RealLive stage, performance has ceased to be a concern. Their compiler doesn't optimise at all - it doesn't even fold constants.

zalas
2004-11-13, 16:12
Keep in mind that bytecode works really well on game consoles, due to the lack of brute general purpose processing power and memory.

Donut
2005-01-13, 01:23
And if you want to keep it simple you could use HTML, it's not that bad actully i was planning to use it :P

Rambo
2005-11-03, 09:56
hey i downloaded a game but its a bunch of txt and it tells me to compile :/

any1 can help me how to compile it?
it says its kirikiri 2core
gonna upload the file to a site thnx

http://rapidshare.de/files/7141807/New_Text_Document.txt.html

if any1 can compile this and send me or tell me how to compile id be grateful :D

GreatSaintLouis
2005-11-03, 12:45
to things like ZZT, which interprets text directly
Funny you should mention that - I just downloaded ZZT the other day in an effort to relive the computer gaming of my youth.
There's an idea: create a <strike>visual</strike> novel title using only ZZT! The horror!

Also, if you're looking into visual novel engines, have a look at the ONScripter page (http://nscripter.insani.org/). All of the documentation has been painstakingly translated to English by the irreplaceable gp32. ONScripter is - to me - a bit scarier-looking than KAG3, but you can't go wrong with full English documentation.

Haeleth
2005-11-03, 13:05
ONScripter is - to me - a bit scarier-looking than KAG3, but you can't go wrong with full English documentation.
Unfortunately there's no such thing as full NScripter documentation. Seriously, a good proportion of the system is completely undocumented. The stuff gp32 translated is as comprehensive as anything, but there's an awful lot missing from it. :/

any1 can help me how to compile it?
it says its kirikiri 2core
Yep, you need KiriKiri, like it says. You can get it here (http://kikyou.info/tvp/).

GreatSaintLouis
2005-11-03, 13:20
Unfortunately there's no such thing as full NScripter documentation. Seriously, a good proportion of the system is completely undocumented. The stuff gp32 translated is as comprehensive as anything, but there's an awful lot missing from it. :/

Symantics. :-P I guess I should amend my earlier erroneous statment to say "full enough documentation for most projects you'd want to start from scratch" or something like that, then.

Rambo
2005-11-03, 14:33
Hey thanks for the reply! :)
Though I download this kirikiri thingy and I haved no idea how to use it XD

Haeleth
2005-11-03, 14:39
I guess I should amend my earlier erroneous statment to say "full enough documentation for most projects you'd want to start from scratch" or something like that, then.
But it doesn't even mention the syntax for displaying text in English! :P

I download this kirikiri thingy and I haved no idea how to use it XD
The next question is, can you read the documentation? If so, it should all be explained in there. If you don't understand Japanese, you have an excuse. ^_^

zalas
2005-11-03, 18:06
He has to load the main program (krkr.exe in the kirikiri2 folder), and tell it where to find the game data files. Either specify the directory, or the xp3 I believe.

GreatSaintLouis
2005-11-03, 22:38
Just a note on the KAG3 documentation: passing it through a machine translator such as Babelfish will not yield grammatically correct results; however, the output IS coherant enough that you should to be able to begin work on a new project.

Rambo
2005-11-06, 09:03
lol when i try to open this xp3 file i get an error message :S
maybe i'm not doing something right -.-

ps: i don't understand japonese :P

mr.aufziehvogel
2005-11-08, 03:51
are there any "point and click" free- visual novel engines out there? i have no programming skillz but it would be fun to "make my onw VN"

STaNLI
2005-11-08, 04:22
Ren'py isn't point & click; but for the purpose of writing a script, it's easier to write with a keyboard than with a mouse~

Compare:
o) type "show [character expression] with [entrance]"
o) go to a list of characters, click, select an expression, click, drag onto the main window, align, do timing, go to another menu to select the entrance style...

Haeleth
2005-11-08, 05:40
There are point-and-click things, like "Ren'ai Maker". But that costs money, isn't in English, and isn't very popular even in its target market.

Like STaNLI says, Ren'py in particular has been specifically designed to be easy to use without needing any programming experience. It also has the largest English-language community of any VN engine, so it's easy to get help if you need it.

PyTom
2005-11-08, 08:31
Heck, sometimes Ren'Py help will even come to you...


Although one of the projects I've been working on in a low-priority manner is improved tools for editing Ren'Py, I think a completely WYSIWYG tool would probably hurt more then help, in the long run. It would force people to make look and feel decisions (like the size of text-boxes) at the start of game development, rather than towards the end as is more appropriate.

How do the Japanese-made engines support concepts like word-wraping and proportional fonts that are in English but aren't really used in Japanese? IIRC, some of the translators had to use heroic measures to get these working.

(Also, why I'm here, could someone point me to the right place to ask questions about io_ChristmasEve?)

Haeleth
2005-11-08, 11:06
How do the Japanese-made engines support concepts like word-wraping and proportional fonts that are in English but aren't really used in Japanese? IIRC, some of the translators had to use heroic measures to get these working.
To put it simply, they don't. Translations of NScripter games typically use versions of the open source clone ONScripter that have been patched to implement word wrapping; translations of AVG32 games use precalculated line breaks; translations of RealLive games will probably use the word wrapping engine I've implemented in RealLive itself. I'm not sure off-hand what's been done with KAG3/KiriKiri games.

<strike>I don't know of any translations of ren'ai games that have actually implemented proportionally-spaced text at all; generally Japanese-designed engines don't even take the possibility into account.</strike>
Edit: See ChocoEd's post below for how they handled proportional spacing in Fate/stay night.

GreatSaintLouis
2005-11-08, 13:12
Hey, maybe we're the ones who have it all screwy - the ancient Romans didn't much care about word-wrapping, either.

Then again, they were busy most of the time conquering the majority of the known world, so it was probably something like a deca-tertiary concern for them in those days...

ChocoEd
2005-11-08, 22:42
I'm not sure off-hand what's been done with KAG3/KiriKiri games.
So far it's been done (for insani projects at least) with some script preprocessing and some patches to the interpreted code that ships with the games. It's a bit of a hack, but it works decently, doesn't have to mess with the executable itself, and can adapt to the character spacing of different user-chosen fonts at runtime.

One thing I didn't appreciate until looking through the existing KiriKiri code is that they did have some word-wrapping for Japanese already, to avoid leaving orphan punctuation marks or splitting up a multi-character syllabic unit like "sha". Using the hooks for those routines to do English word-wrapping instead was very handy.

zalas
2005-11-09, 03:34
If you want a simple visual novel engine, then try out Yuuki Novel (sorry, Japanese only). It's designed for the beginner in mind (in terms of programming) and has a very easy to use GUI.

And if you have questions about io[XE] you can ask them on this forum (just probably not in this thread ^_^;)

Ace_Starleaf
2005-11-25, 01:19
In regards to game engins, does anyone know how the rUGP system by age works?? I'm still trudging along in my attempt at translating Kiminozo, but I'm pretty much at a wall until I figure out how to make a patch.

Eden
2005-11-25, 05:11
In regards to game engins, does anyone know how the rUGP system by age works?? I'm still trudging along in my attempt at translating Kiminozo, but I'm pretty much at a wall until I figure out how to make a patch.

Not knowing a thing about game engines, or programming whatsoever i'm not sure if this will help, but a link for you to check out:

http://www.geocities.com/kolya_kgne/RIODecode/

And a quote from: http://forums.animesuki.com/showthread.php?t=15792 (currently latest post).

Bumping this:

Currently theres someone on the net who has the game hack,script in hand and everything is ready to go. But the problem is.....he needs some translators to help get the show on the road. But at the same time he's worried that because time has passed, noone would be interested anymore. He worries that the demand for games like Shuffle would be stronger. I understand how he feels perfectly. So guys, are you still interested in a translated patch of Kimi ga Nozomu Eien the game, and do you know of any groups who would be interested in being a translator for the game?


I'll post linking him to here as well. Just incase it is useful.

Ace_Starleaf
2005-11-26, 09:14
Thanks Eden, i'll look into it. I've decided almost a year ago to try and translate this game and now it looks like I finally can. Still going to be a while doing it as my Japanese is just barely good enough to pass the JLPT level 4. ^_^

Nowyc
2005-12-02, 05:13
Yo... Before asking this question, I tried searching the 'Net for an answer, but couldn't find one.

What's the difference between the several visual novel engines? What makes one more 'powerful' than the other? Why would companies choose one free engne over the other if they perform the same purpose in the end?

Some of my guesses include: graphics format support; sound format support; easy of use, laguage-wise; and I suppose any word processing capabilites it might have.

Haeleth
2005-12-02, 06:15
Your guesses will be pretty close, though some (like graphic format support) are less important because graphics can easily be converted.

Some other factors:
Existing investment - if their coders know an engine, they'll be tempted to stick with it regardless of new alternatives.
License issues - for example, KiriKiri is more flexible than NScripter, but NScripter is free for any use while KiriKiri is, I believe, GPL'd with an option to buy a commercial license if you don't want to be bound by those terms.
Contract issues - the publisher may require the use of a certain engine (this is apparently the case with VisualArt's, at least).
Visibility - I doubt anyone in Japan has even considered Ren'Py, not because it's not as good as the Japanese engines but simply because they've never heard of it.
And, of course, most companies don't tend to use free engines at all, but rather to develop their own in-house engine that does exactly what they need...

PyTom
2005-12-02, 18:33
I just crunched some numbers, and it winds up that the number of downloads of Ren'Py from Japan is well behind the number from Saudi Arabia. So yes, I think it is fair to say that Ren'Py is virtually unknown in Japan.

I would suggest that there are a couple of other issues that might come up when picking an engine.

Support, in general - It's probably best to choose an engine with an active community behind it, so that one can ask questions and get support. It's probably also best to pick something that's under reasonably active development, to ensure you won't get stuck with a game that can't run anywhere.
Language support - Some engines seem to only support certain character sets. If I read the code correctly, xsystem35 only supports non-ascii shift-JIS characters. (Although it may support double-width characters.) Having unicode support is nice if one wants to support multiple languages. And it's also good to have line-breaking rules for a language, so that you don't have to break the lines manually.


I suspect network effects have a lot to do with peoples choice of engine in practice.

Nowyc
2005-12-02, 20:34
Ah, I see. Haeleth and PyTom, thanks for the answers!

Haeleth, you said that most companies will create their own engine instead tousing an already existing one, right? Do they often license out their own engine to other companies to use? Do they release it to the public, allowing anyone to use RealLive?

Haeleth
2005-12-03, 04:36
Language support - Some engines seem to only support certain character sets. If I read the code correctly, xsystem35 only supports non-ascii shift-JIS characters. (Although it may support double-width characters.) Having unicode support is nice if one wants to support multiple languages. And it's also good to have line-breaking rules for a language, so that you don't have to break the lines manually.
And this is, as you're doubtless aware, exactly where Ren'Py shines for non-Japanese creators. The Shift_JIS-only issue isn't limited to xsystem35, it's common to practically all Japanese-created engines; similarly, Japanese engines usually only handle the minimalistic line-breaking required for Japanese, which is basically restricted to making sure you don't end up with orphaned punctuation.

Do they often license out their own engine to other companies to use?
Sometimes. This is what VisualArt's seems to do - I haven't been able to work out exactly how their corporate structure works, but it appears to comprise a parent company that publishes games and develops a game engine, which is then licensed out to individual brands, like Key and 13cm, as part of their publishing contracts.

I haven't heard of anyone like Leaf licensing out their engines, though.

Do they release it to the public, allowing anyone to use RealLive?
Nope, proprietary engines tend to stay proprietary. Fans have cloned quite a few of them, and there are a few fan-made development kits (plug (http://dev.haeleth.net/)) that you could use to write games for them, but in all the cases I've seen, the only contact the public officially gets with the engine is by buying a game and using the runtime to play it.