inkle / ink

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

[Discussion] What kind of Unity templates would be useful? #55

Open ViewportGames opened 8 years ago

ViewportGames commented 8 years ago

I think I'm going to make a few basic UI templates for displaying ink stories. One of the things I'm trying to decide is whether to rely on the TextMeshPro plugin, which I believe is essential for anyone trying to make a Unity game with text (in-line styling and animation and everything you could possibly want to do with text is just so simple, not to mention actual accurate word-wrapping and resize to fit and rendering and and and). But it's also $65USD and I'd hate to leave out people who can't afford that. Maybe a separate example that shows specifically what can be accomplished with Ink and TMP working together? Thoughts?

Ideally the Ink stories could serve as practical examples for everything covered in the "Writing With Ink" documentation, but my primary focus is on demonstrating how to display Ink in Unity UI. Here are the examples/templates I'm planning:

  1. Barebones Inkle style of lines being added to previous content. Demonstrate formatting syntax/parsing for paragraph indentation and line breaks. How to dynamically display choices as buttons.
  2. Advanced Inkle style (Sorcery-esque combat? Something new?) that uses ink logic and variables to simulate something interesting. Game observes and sets ink variables. Demonstrate calling game functions from ink script, etc.
  3. Phoenix Wright/JRPG/Visual Novel style of one ink line displayed at a time. Character name and emotion (stage direction) parsing. 283371-phoenix-wright-ace-attorney-nintendo-ds-screenshot-select
  4. Twine style embedded links (??). I got the proof of concept working with TextMeshPro, but I'm not sure how solid I can make this yet.
  5. Something obvious I missed?
joethephish commented 8 years ago

Awesome, really excited that you're thinking of working on this!

I would definitely lean towards reducing the dependencies as much as possible for samples, especially if they cost money. We didn't look into TextMeshPro for the Unity implementation of 80 Days... so I guess we coped without. (Though to be fair, perhaps we might've been massively better off if we had!) Perhaps it's worth focussing on one "advanced" example that does use it...?

I should mention that early next week we're planning to release a sample game of our own called The Intercept, which I guess is a version of (1), although it's quite visually rich.

Here at inkle, @tomkail was mentioning that he was interested in putting together a Sorcery map movement template for a game jam, so that would be pretty awesome to see!

Otherwise, I think I'd be most interested in option 3 from your list. I like the idea of a template that can simply be skinned, and a really visual one at that, allowing them to focus on the content.

RockoDyne commented 8 years ago

For 1, it would be good to see lines fit text boxes automatically, without having to manually define character length to fit the size of the box. Alternately it might be an interesting experiment to try making a text box that fits to the size of the text.

Is 3 really doable in ink now without scripting functions in? I would be worried it would become a mess of functions that have to be bound (nevermind what this would look like from the ink file). It might be good to think about it apart from text boxes, too. That way you could use the same function to focus the camera on a character for example.

The big catch to implementing ink into Unity seems like it would mostly be wiring functions up. Ideally it would be done through the inspector, where it pulls out what functions are needed form the story and handles binding names so that there is no chance of misspelling, conflicts from multiple instances trying to bind, or extraneous functions.

tomkail commented 8 years ago

You can do text fitting in Unity really easily these days using the "best fit" option on a text component, so hopefully that one is solved for us! Assuming I understand your meaning, the way we're looking at handling scripting functionality in ink is to add meta data, which gets parsed as it's read - for example " #Happy #closeupcamera ink is great!" In terms of binding, I think you're right about having a nice inspector interface - it's something I'll look at for the next version of the Ink Unity integration package (we haven't even announced the first one yet, but it's coming real soon!). I'll see if we can use unity's event system - it's got a lovely way of sending data to a function via the inspector.

RockoDyne commented 8 years ago

Meta data could be a good way to go about it, as another layer to read off the story per line. Maybe declare them or something to get some level of spellchecking.

ViewportGames commented 8 years ago

Best Fit in Unity text is actually very poor. And when you get into per character animation it gets even worse (This is one reason why I say TextMeshPro is "essential". See this video: https://www.youtube.com/watch?v=h1Z2jcB4aaQ).

I've already done my own basic ink integration into Unity, so looking forward to seeing what you guys came up with!

ladyisidore commented 8 years ago

Any updates on this? I've had a bear of a time with Unity and I rather despair ever getting the hang of it.

ViewportGames commented 8 years ago

Check out Ink's Unity Integration project here on GitHub, and The Intercept example game. I've been swamped and haven't had a chance to work on my JRPGish template very much...

proganime1200 commented 6 years ago

im planning to recreate this game in unity engine