inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
3.97k stars 481 forks source link

[Announcement] Palimpsest.NW: ink in a desktop app, built with NW.js and web technologies #121

Open ladyisak opened 7 years ago

ladyisak commented 7 years ago

I can't stand how complicated Unity is and I don't speak C# well enough to implement ink in MonoGame, so now that inkJS has ironed out the initial major bugs, I put together this thing: Palimpsest.NW.

It's hopefully pretty easy to customise and I tried making it as beginner-friendly as possible to modify and test (though I haven't figured out how to quickly and easily package the damn thing into a ready app).

I plan on including some more sophisticated default styles soon in any case. Once I'm sure there are no major bugs, I'll throw it up on NPM or something, too.

The code in game.js was cobbled together from @pineapplemachine's and @y-lohse's efforts. A huge thanks to them both and additional enormous thanks to @y-lohse again for making inkJS and making this thing possible.

pineapplemachine commented 7 years ago

Looking good! Definitely a big step toward better browser support.

joethephish commented 7 years ago

Nice! Just building to check it out.

I never considered using NW.js rather than Electron for Inky - did you consider both? Any thoughts?

ladyisak commented 7 years ago

@pineapplemachine Thank you!

The current default style is definitely form-over-function, I just wanted something that did the job and wasn't too ugly so I could get this thing out the door and stop fussing with it. I'm working on improving the default style right now. (First step: RPG-style "typing out" of text.) I'll add alternate styles at some point, too.

The grey boxes can be turned off by deleting or commenting out edit() in main.styl, incidentally. They're just there to show the grid structure for development. Actually, I think I'll comment it out in the source and provide a note on what it does.

@joethephish Thanks!

I considered both; to be honest, if I'd known Electron just hit 1.0, I might have gone with it over NW.js. Ultimately, I went with NW.js on the off-chance I'll want to use Node.js modules at some point, though I'll definitely consider releasing a version of Palimpsest wrapped in Electron rather than NW.js. We'll see.

joethephish commented 7 years ago

The only thing that I don't like about Electron is the file size - on Mac the download is a 130MB zip, which is pretty horrendous. I've heard that NW.js slightly slimmer. Hopefully they'll improve that! Otherwise, there's probably not much to choose between them for simple apps (Electron is node based too, so can use node modules).

erkyrath commented 7 years ago

The Mac download for Electron is only 45M if you put it in a DMG rather than a zip file. (There are internal symlinks that get squashed into duplicate files when you zip-archive it.)

(Also, zip wrecks your code-signing.)

erkyrath commented 7 years ago

Also, I just emailed Joe about this, but I see I can post it here too. Look! It's steam-engine time!

http://eblong.com/zarf/tmp/lectrote-ink/

(A pre-release update of https://github.com/erkyrath/lectrote , which uses Electron.)

This leans towards being a generic interpreter for Ink games, rather than a framework for releasing a standalone game. Although you can use it to build a standalone game.

I intend to keep the UI simple. No slow-typing text, no fading, no erasing the choice list after a choice is made.

ladyisak commented 7 years ago

@erkyrath, I wanted to give people a chance to make something styled sort of like The Intercept's Unity implementation, though I admit that fancy effects, images, etc. in IF aren't to everyone's taste.

Since you reminded me of that, I think I'll make the "default" as simple as possible and then provide lightly-to-moderately fancy alternatives for people who don't want to fuss with CSS and JS but want something that looks more like 80 Days rather than parser IF (not that there's anything wrong with parser IF, it's just two different styles of presentation and I think ink's uniquely suited to supporting both).

Lectrote supporting ink files is an excellent idea, however. Being able to use the same app for I7 and ink games can only be a good thing.

erkyrath commented 7 years ago

Hey, differentiation is good.

y-lohse commented 7 years ago

That's very cool :-). I don't have enough time to build it at the moment, but i'll be sure to give it a spin once there's a downloadable version somewhere.

@joethephish I've only ever used nwjs, but the file sizes are quite large too — around 80MB last time I checked. I think it's just the Chromium binary that takes up a lot of space? Other than that I believethey are pretty much the same, though Electron has a lot more traction.

joethephish commented 7 years ago

Cool, thanks for the tip @erkyrath! Will definitely have a stab at using the DMG packager next time.

On the UI front - totally agreed about bells n whistles v.s. absolute simplicity. However, I think we should distinguish between style, and UI that makes it physically easier to read. The one thing that I think is missing from Lectrote right now is a smooth scroll. Without any kind of animation, I think it can be slightly jarring when a new chunk of text appears, and your eye has to search again for when it needs to continue on from.

I tried to go for simplicity with the web template when exporting from inky. I'd say the fading is non-critical, but I'd say the scrolling is.

ladyisak commented 7 years ago

I think a good UI thing to do would be to fade already-displayed paragraphs somewhat, so the new content pops better.

erkyrath commented 7 years ago

Lectrote 1.1.0 with inkjs (1.1.0) is now a release.

https://github.com/erkyrath/lectrote/releases

You know, I feel like I must have thought about smooth scrolling way back in this UI's history. (This text-game display code goes back to 2008.) But it's not there now, is it...

I've added issues to https://github.com/erkyrath/lectrote/issues for that and the fade-out idea. I think both would be preferences, and I haven't decided which way the defaults would go. But they're both worth considering.