Jump to content

What Site Work Would You Like To See?

Please consider taking this survey (Link) and let me know what you want to see fixed/improved upon across the various Fuwanovel sites. Your feedback will determine my work priorities this Summer/Fall. (Forum Post)

< 3 - Tay

You can dismiss this alert by clicking on the "X" button

mnakamura

Mikan Engine: ScummVM-like HTML5 VN engine to port everything to

Recommended Posts

Hi there, fellow VN fans,

I always had a thought: why do we have so many proprietary and semi-proprietary VN engines? There are *many* defiencies in having a closed source engine (and kinda inaccessible VN content): there are problems with running it on many platforms (like 95% of modern VNs are released for Windows, good luck trying to read them on your Android / iOS device), there are these infamous problems with "Japanese locale required", sooner or later platforms become inaccessible (good luck trying to run some less popular games of Windows 95-98 era - they won't
run on modern Windows 7/8/10 in any of the compatibility modes). If one wants to grab text for translation, one has to resort to really ugly API hooking hacks. Etc, etc.

So, why not just convert VNs to some easier, more universal, accessible format? I've followed the pattern of ScummVM project (a universal engine that runs adventure games) and thought - why not?

There are 2 projects close to what I thought: that is VNDS, which is, unfortunately, dead, and Asenheim, which is, unfortunately, not free/open source and I can't participate in it.

Today I'd like to share some of my progress, proof-of-concepts and ideas.

I've studied several VN engines, namely:

  • Kirikiri2 (AKA TVP)
  • NScripter
  • BGI (Buriko General Interpreter)
  • Whale
  • Caramelbox
  • SysAdv
  • Ren'Py
  • Tyrano
  • Yuka
  • VNDS
  • Asenheim

What do I have now:

  • An understanding of some common baseline capabilities that all these engines have
  • A project of JSON-based format (basically, some metainformation plus an array of simple instructions like "show text", "show graphics", "play sound", etc)
  • A proof-of-concept engine written in HTML5+JavaScript (well, actually CoffeeScript)
  • Most important: some working converters for several games that can be used on original games' data to make a "port" that my engine will be able to run

A list of VNs I currently support and working on:

Here's how it looks like:

50p1J1Y2S1X83811.png

A few nice things that I already have is full customizability (like using any skin for every VN for UI), support for multiple simultaneous languages (like showing original Japanese + English translation for the sake of learning Japanese from it), support for annotated Japanese (i.e. adding furigana and/or hovering tooltips with word translations), etc. It's very easy to run HTML5 engine on Android and iOS (tried both), thus enabling one to enjoy reading VNs on the go.

I want to ask if anyone would be interested to take a look and possibly join me in developing / using such a concept? I'm almost ready to publish it all as open source software - actually, I just need a good name for the engine ;) Any ideas?

If anyone wants to try translating any of mentioned games using my engine - please contact me too. Anyone who wants to participate in any way (i.e. checking out demos, porting more games, playtesting, etc) - also feel free to contact.

UPDATE: The engine is released in public and available to download at https://github.com/mnakamura1337/mikan_engine

Edited by mnakamura
Engine is released => updated announce

Share this post


Link to post
Share on other sites

@mnakamura Yeah, I remember you. These are very recent VNs here, and no one would allow you to put it online (like asenheim). So... Ehrm... You will give a redistributable packages, which will convert Windows copies to Android ones? Or how?

Share this post


Link to post
Share on other sites

Yeah, something like that. I have several converters that basically extract all the assets, disassemble the script, convert it and assemble everything back in a JSON-based format. Technically, you end up with

  • a folder that has all the assets in usable formats (i.e. PNG, Ogg/Vorbis, etc)
  • JSON file with a script
  • HTML+JS source of the engine

Then you just load that HTML in any browser, in any OS, and voilà. It's easy to translate JSON scripts, I've already been contacted by 2 teams that translate Noratoto and Otoboku using my method.

From the legal point of view, obviously, it would be illegal to distribute converted, ready-to-run packages.

Share this post


Link to post
Share on other sites

As much as I love this as a concept, I too wonder about distributing some VN reader, which is able to read closed sourced encrypted files. The comparison with ScummVM is good from a technical point of view, but the main difference is that you propose an engine for really recent titles while ScummVM works on mainly titles from the 90s. There is a major difference between "engine for games, which can't be played on modern computers" and "engine for games I think will not be able to work in the future, but does work right now".

Share this post


Link to post
Share on other sites
28 minutes ago, mnakamura said:

Yeah, something like that. I have several converters that basically extract all the assets, disassemble the script, convert it and assemble everything back in a JSON-based format. Technically, you end up with

  • a folder that has all the assets in usable formats (i.e. PNG, Ogg/Vorbis, etc)
  • JSON file with a script
  • HTML+JS source of the engine

Then you just load that HTML in any browser, in any OS, and voilà. It's easy to translate JSON scripts, I've already been contacted by 2 teams that translate Noratoto and Otoboku using my method.

Russian teams, figures... Anyway if you plan to release it for Android/IOS, much better would be to create separate app, which would open that HTML inside (far better than navigate using browser, moreover I doubt there would be enough permissions to read assets on IOS, and putting online - who could do it?).

 

About idea for a name... "Mikan".

Share this post


Link to post
Share on other sites
9 minutes ago, tymmur said:

As much as I love this as a concept, I too wonder about distributing some VN reader, which is able to read closed sourced encrypted files. The comparison with ScummVM is good from a technical point of view, but the main difference is that you propose an engine for really recent titles while ScummVM works on mainly titles from the 90s. There is a major difference between "engine for games, which can't be played on modern computers" and "engine for games I think will not be able to work in the future, but does work right now".

Well, as for me - it *does not* work right now. I can't read my favorite VNs on my iPad / Android phone while commuting. I can't read them on my Macs / Linux boxes either. That alone is enough reason for me.

Share this post


Link to post
Share on other sites
9 minutes ago, mnakamura said:

Well, as for me - it *does not* work right now. I can't read my favorite VNs on my iPad / Android phone while commuting. I can't read them on my Macs / Linux boxes either. That alone is enough reason for me.

Do not tell me you do not know what a VM is. I would not believe anyway. And you can play on Android almost any krkr2 game already (and you know it, I suppose).

If I were you I would rather concentrate on real rarities, which people not able to run nowadays (PC-98 games, for example, or DOS ports, or first Windows games).

Almost any VN fan, who like to read on the go (like me) already bought a Windows tablet for that reason. They are quite common nowadays, you know.

Share this post


Link to post
Share on other sites
19 minutes ago, Scorp said:

Anyway if you plan to release it for Android/IOS, much better would be to create separate app, which would open that HTML inside (far better than navigate using browser, moreover I doubt there would be enough permissions to read assets on IOS, and putting online - who could do it?).

About idea for a name... "Mikan" (:))

Point taken, thanks - both about a distinct app and a name.

9 minutes ago, Scorp said:

And you can play on Android almost any krkr2 game already (and you know it).

Not really. krkr2 nowadays is one of the most elusive, most intricate engines. It provides assembler-like capabilities to the developer, thus 95% of games I've seen for it develop its own complex system of macros / subroutines. On top of that, there are several proprietary enhancements which are hard to emulate, such as e-mote or Live2D.

That said, it's not like I propose or have some miracle maker for krkr2 games. My krkr2 converter's lacks these features too.

Share this post


Link to post
Share on other sites
20 minutes ago, mnakamura said:

Not really. krkr2 nowadays is one of the most elusive, most intricate engines. It provides assembler-like capabilities to the developer, thus 95% of games I've seen for it develop its own complex system of macros / subroutines. On top of that, there are several proprietary enhancements which are hard to emulate, such as e-mote or Live2D.

All macroses work perfectly, because krkr2 was just recompiled for Android (you can compile it for Linux/Mac/whatever, actually, it is open-source and repo is open). Speaking about additional functionality in dll files - yes, this would not work, but actually this used quite rarely (comparing to a huge amount of games we have), Apart that all custom macroses/tjs scripts/etc will work as intended in Kirikiriroid2. That's why I doubt you can do anything better than we already have for krkr2.

Btw, you live in Japan. Is what you plan to do legal? I doubt that eroge reverse-engineering is legal in Japan (having in mind ExtractData case).

Share this post


Link to post
Share on other sites
9 minutes ago, Scorp said:

All macroses work perfectly, because krkr2 was just recompiled for Android (you can compile it for Linux/Mac/whatever, actually, it is open-source and repo is open). Speaking about additional functionality in dll files - yes, this would not work, but actually this used quite rarely (comparing to a huge amount of games we have), Apart that all custom macroses/tjs scripts/etc will work as intended in Kirikiriroid2. That's why I doubt you can do anything better than we already have for krkr2.

Our mileage obvious varies. First of all, vast majority of modern (~2008+) games require some intervention because of obfuscation / encryption keys, slightly-non-standard xp3 files, etc, etc. One has to unpack / deobfuscate / repack xp3s first (and that frequently requires at least some basic reverse engineering skills) before at least attempting to run it using generic krkr2 implementation. Even if one overcomes that, many VNs fail somewhere around the title just because of some fancy DLL functionality such a yet-another-custom-crossfade or yet-another-video-file-playback-format. Of course, it's possible to find that place and remove the offending line(s), but, again, it's not that straightforward for your regular Joe.

As for "doing better" - that's not what I have in mind. I don't want to make a better replica of krkr2 than it already is. I want extra functionality. I want better, customizable UI. I want to be able to read in 2 languages and improve my Japanese through it (yeah, I know of GoGoNippon and NekoPara, but that's all). And I want it for all games, not just krkr2 ;)

Share this post


Link to post
Share on other sites

@mnakamura okay, anyway if you really try to check all the 500 eroge coming out each year in kirikiri there is no significant amount of custom DLLs or crypt or whatever. Only big companies like Akabeisoft really do that, most of other people or not too good in KR2, or just not care enough and use all the built-in modules. If you want to improve japanese, your best choice is to use ChiiTrans by me, 2 language would not help here.

Whatever, if you see the point in it - choice is yours. But the HTML+JS+converter tools is not good way, I would prefer something separate, compilable and faster working, like ScummVM you mentioned in title.

Share this post


Link to post
Share on other sites
46 minutes ago, Scorp said:

Btw, you live in Japan. Is what you plan to do legal? I doubt that eroge reverse-engineering is legal in Japan (having in mind ExtractData case).

It's a very gray legal area, that's exactly why I try to keep low-profile (and want to get people from other countries to help).

18 minutes ago, Scorp said:

If you want to improve japanese, your best choice is to use ChiiTrans by me, 2 language would not help here.

Whatever, if you see the point in it - choice is yours. But the HTML+JS+converter tools is not good way, I would prefer something separate, compilable and faster working, like ScummVM you mentioned in title.

Unfortunately, from ~10-12 titles I've tried with ChiiTrans / ChiiTrans Lite / AGTH / ITH / that kind of stuff, I've got only ~2 to work properly. But yeah, ChiiTrans is exactly where I've got the idea of MeCab parsing + fast dictionary lookups + multi-language.

Share this post


Link to post
Share on other sites
1 hour ago, mnakamura said:

Well, as for me - it *does not* work right now. I can't read my favorite VNs on my iPad / Android phone while commuting. I can't read them on my Macs / Linux boxes either. That alone is enough reason for me.

It works on the platform(s) they were released for, which is precisely what they want. The fact that you want to port it to a new platform is besides the point. Also all the VNs you used as examples are 18+. Do you plan on reading those while commuting. People might not be happy about sitting on a train and the guy on the next seat is playing through a loli H scene.

Share this post


Link to post
Share on other sites
40 minutes ago, tymmur said:

It works on the platform(s) they were released for, which is precisely what they want. The fact that you want to port it to a new platform is besides the point. Also all the VNs you used as examples are 18+. Do you plan on reading those while commuting. People might not be happy about sitting on a train and the guy on the next seat is playing through a loli H scene.

For starters, it's not unusual to see people in Japan reading H manga on their way to work/school. Seen it a lot of times, nobody cares.

That aside, that's exactly where having a controlled engine shines. There are plethora of options - you can just skip H scenes (saving bookmarks to read them later), you can disable graphics and just read the text, etc, etc.

Share this post


Link to post
Share on other sites
1 hour ago, mnakamura said:

That aside, that's exactly where having a controlled engine shines. There are plethora of options - you can just skip H scenes (saving bookmarks to read them later), you can disable graphics and just read the text, etc, etc.

It could be done only if you will modify the script to allow all this. But if you know script format - you can do all this without any need of separate engine (bookmark = save). So controlled engine does not help here, knowledge of inner script opcodes does.

Share this post


Link to post
Share on other sites
15 hours ago, Scorp said:

It could be done only if you will modify the script to allow all this. But if you know script format - you can do all this without any need of separate engine (bookmark = save). So controlled engine does not help here, knowledge of inner script opcodes does.

It seems that I wasn't clear enough :)

That's exactly what I'm doing: I'm getting to know "inner script opcodes" and translate them all into some higher-level format. For example, if you'd want to implement skipping of H scenes in a relatively low-level engine like krkr2 or BGI, most likely you'll end up registering some flag variable + doing conditional jumps in script to work around H scenes + add tons of settings UI code to allow user to switch this flag on and off.

When you have a higher-level engine, you just have to mark up a scene as "H" - and engine takes care of skipping / warnings / blacking out CGs / etc in itself. So you only need to do it once in the engine, not in the script of every game. And marking up whole scene in some way is not that hard too - very frequently there are already some indications in original scripts like "_h" suffix in file names or something like that - a converter just needs to understand these marks and convert them into format's markup.

That's exactly what's different between my project and VNDS (which markup is very close to NScript and thus, very low-level), interpreting krkr2 directly (like Android ports do, or like Tyranobuilder which is implemented very close to krkr2), etc.

Share this post


Link to post
Share on other sites

I thought I'll post some more screenshots to prove that my engine works with multiple donor engines. Here's Otome wa Boku ni Koishiteru, AKA Otoboku. Sprites, normal dialogue lines, that like of stuff:

40w1U1A226B0O5z3.png

And here's the very simple settings dialog so far:

E0B191i2q6h0g5A5.png

Share this post


Link to post
Share on other sites

It looks nice, though not perfect. I have a few comments, which are mainly aimed at improving the quality.

 

Why is the settings button visible at all time? It looks quite bad. If you could make something where it vanished unless you hover the mouse on top of it or near it, then it would be way better.

What about full screen? If youtube can go to fullscreen in a browser, then you can too.

Settings for font, font size and color would be nice.

It would be better if you could add support for the textbox png as well as settings for text area to move the text to match various pngs.

 

Also how does it work for the player? Just open the correct html file in a browser?

Share this post


Link to post
Share on other sites
52 minutes ago, tymmur said:

It looks nice, though not perfect. I have a few comments, which are mainly aimed at improving the quality.

 

Why is the settings button visible at all time? It looks quite bad. If you could make something where it vanished unless you hover the mouse on top of it or near it, then it would be way better.

What about full screen? If youtube can go to fullscreen in a browser, then you can too.

Settings for font, font size and color would be nice.

It would be better if you could add support for the textbox png as well as settings for text area to move the text to match various pngs.

 

Also how does it work for the player? Just open the correct html file in a browser?

Actually, what I wanted to demonstrate is the ability to run VNs originally using various engines. Otoboku uses Caramelbox engine, for instance.

I believe that UI implementations (I'm talking about both text window and settings/save/load/etc dialogue) should be modular and pluggable into engine. If one wants to run a given VN with its original UI - here you go. If one wants, for example, to run Otoboku with UI from, say, Nekopara - here you go too, shouldn't be a problem. As for me, UI of the majority of VNs have been a major pain in the ass for me: it's counter-intuitive, doesn't allow certain things, etc, etc.

Full screen is not actually a problem even right now: you just set to to "stretch to full window" and press F11 - and voila, you have a full screen VN.

I have lots of settings planned, like sound volume levels, per-character settings, etc, etc - should be plenty for everyone. And, of course, we're talking about one "reference" settings UI: probably there would be more (like changing themes) and you could be choosing any you like.

I'll post a screenshot of how Noratoto works, for example, with an UI that tries to match original game's UI.

Yeah, for now for the player it's just opening a single HTML file in the browser. Or a given URL, if it's deployed somewhere on the web.

Share this post


Link to post
Share on other sites
1 minute ago, mnakamura said:

As for me, UI of the majority of VNs have been a major pain in the ass for me: it's counter-intuitive, doesn't allow certain things, etc, etc.

That line instantly made me think of Private Nurse. Played it years ago and wanted to play it again, but the UI is so horrible that I stopped. I accepted it back then because it was the first VN I ever tried, but now I know better. Would love to go through it with a proper UI.

 

This also brings up another question: how do you forward to next line? Private Nurse is really annoying in the fact that clicking the mouse is the only option. I prefer enter. It also brings up the issue of saving. Can you save everywhere?

5 minutes ago, mnakamura said:

Or a given URL, if it's deployed somewhere on the web.

iPad in bed given the URL to a server on the LAN looks like a decent solution. At least that would minimize the issues there would be towards getting iOS to play nicely. However getting it to run from it's own "HD" would be a good thing if you plan to use it while commuting. Even with a good server, connecting from a moving train would cause lag (presumably).

Share this post


Link to post
Share on other sites
7 minutes ago, tymmur said:

That line instantly made me think of Private Nurse. Played it years ago and wanted to play it again, but the UI is so horrible that I stopped. I accepted it back then because it was the first VN I ever tried, but now I know better. Would love to go through it with a proper UI.

I've seen lots of VNs with horrible interfaces. For example, I really *hate* default krkr2 keybinding with Ctrl = skip everything as fast as possible. One occassional Ctrl combination (like Ctrl+C to copy) that went to the wrong window - and you've skipped like half of chapter you've never read so far.

There's a nice thread nearby where people discuss what's good and bad with UIs. I really look forward that a vision of an ideal UI would crystallize there.

8 minutes ago, tymmur said:

This also brings up another question: how do you forward to next line? Private Nurse is really annoying in the fact that clicking the mouse is the only option. I prefer enter. It also brings up the issue of saving. Can you save everywhere?

To be honest, right now I have a special off-screen button to maintain precise control over "next line" invocation ;)

I hope to come down to some customizable behavior here: i.e. a list of checkboxes like "a mouse click anywhere", "a mouse click on text window", "Space", "Enter", etc, etc.

Saving can be implemented in 2 different ways:

  1. Saving state in localStorage - thus you'll be able to load it only on the save device/browser you've played the novel so far.
  2. Saving state to some central remote server - it would obviously require internet connection and registering/logging in to it, but once you have that, you have access to all your savegames from all the devices you want. This way one can start reading a novel from home PC, continue to read it (loading the same state from a server) on the go using one's Android device / iPad, and continue to read it on a PC at school/work.

Share this post


Link to post
Share on other sites

Ok, just wanted to give a sneak peek at "customized" UI that more or less follows UI of original VN, Noratoto in this example. That's the BG effect (blur) + sprite + a character talking:

90Q1S1K2X651I7N0.png

Blurred BG + CG + face avatar:

40C171C2o621L7w2.png

And, yeah, that is, by the way, and unannounced yet exclusive English translation ;)

Share this post


Link to post
Share on other sites

I thought I should post an update on what's going on:

Currently I'm working on better support for BGI engine with never (subroutine-based) scripts.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

×