Forum rules - please read before posting.

Integrating ink with Adventure Creator

So there's a CYOA/branching dialogue engine called ink. It's open-source and has Unity integration already. I'd like to use it to augment or replace AC's native, node-based Conversation system, but I've got no clue where to start with writing the integration between the two. I have some C# knowledge, but I'm fairly new to programming overall.

My initial idea was to create a custom ActionList that has two potential actions: "talk" and "cancel". This ActionList would pop up when the player selected an NPC. The "cancel" choice cancels the interaction, hiding the text box with the action choices. The "talk" choice would then somehow call ink's method for running a particular knot, and I would manage which dialogue choices turn up from within the ink file.

Now, I have two problems. One, I'm not entirely sure how to do all that. Two, I'd need to keep game variables consistent between AC and ink and I have no idea how to do that.

Anyone got any advice or ideas? Thanks in advance!

Comments

  • All of AC's existing Actions work by calling functions within the rest of the code base, so you can open them up to see how they work.  The scripting guide is also available to assist you.

    It sounds like you'll want to call AC's speech functions via another method to the Actions.  Speech is played by using the Dialog script's StartDialog function:


    Variables can also be read and manipulated through script - see the Manual and the front page of the scripting guide.

    As for the Talk/Cancel choices, you could do this using either AC's existing Conversation system.  Though it's intended for an array of varying options like with most adventures, it's really just a way of listing multiple choices for the player easily, and running more Actions accordingly when one is clicked.  You could incorporate your own custom Actions to run when the player chooses either one.
  • From what I understand of how AC works, I don't think I'll need to call StartDialog, since I want to replace AC's own way of handling and displaying text and use ink for that instead -- pop up a text field over everything else that displays the text and choices generated by ink and then somehow close it when there's no more content in the knot or the player chooses to end the conversation.

    I guess I'd have to turn off parts of AC's engine, but I'm not sure which parts.
  • I was testing it some time ago as a dialogue solution in an AC project, two of the main reasons being that it uses a human-readable text file format and is comparatively easy to grasp for non-technical people. In the end, I went with a combination of ChatMapper and Pixelcrushers' Dialogue System instead for that particular project, but that was mostly because there was a fully working integration available.

    As chance would have it, I'm currently working on an eLearning project which would actually make sense to build with AC, but the content creators won't be using Unity (or AC or ChatMapper), and will be updating texts continually after launch, so maybe now would be a good time to dig up the old scripts and see if I can still make sense of my own code from the past ... :(|)

    Synchronisation of variables would still need to be added, but I'll definitely try this setup, and share any findings here.
  • If the display of your speech is kept separate from AC, I don't see there being a problem.  You may need your custom Action that handles the display to wait for the speech to finish before the Action itself is considered completed - this way you can have AC consider the display of subtitles as gameplay-blocking to prevent unwanted interactions.  The comments for the Run function of the included ActionTemplate file explain the process more.
  • Has anyone made any headaway on this?
  • Not much in my part of the world, I'm afraid - the project in question is currently waiting for overall design input.
  • edited December 2016
    Any word on this? I'm currently swamped with other stuff, and my current projects aren't too heavy on narration/conversation, but I'll probably be exploring this too, for a future project. Would be great if someone manages to nail it first though, hehe. I'd definitely like to see if we can give ink the ability (as a keyword) to run actionlists assets by name/resources path, that way it would be easier to control animation and sound fx for characters by just using an assorted group of AC actionlist assets. (I haven't read their docs yet so I'm just rambling though, hehe)
  • The project I was planning to use this for seems completely dead in the water, so unfortunately no progress whatsoever to report.
  • I'd love to be able to use Ink for small AC projects that Dialogue System is just too bloated for, but unfortunately the workings behind it go over my head too. I saw the Inkle guys at Unite last year and they said they're up to help anyone get started with Ink or integrating it into something, so maybe the best bet is to shoot them an email sometime and ask if they're interested in integrating it with AC.
  • I looked into Ink very seriously since my project has a ton of custom character interaction requirements (not the least of which is allowing my wife to work on character interactions and dialogue without touching Unity or C#). Truly a lovely and well-planned system. Well worth the integration time IMO IF - and I repeat IF - it really suits your project. In the end it did not suit mine and I ended up writing a rather extensive custom scripting solution that fit my project. What it has in common with Ink is that it allows the writing of dialogue and interactions in a simple human-readable text format (similar to a screenplay) that is very workable for non-technical people (again, I'll pin this on my wife). :)

    All that is to say: one thing which I CANNOT overstate the value of is writing interactions through a simple scripting language. I'd (roughly) estimate it's at least 10x faster on my project than using Unity editors. Mileage will definitely vary depending on the complexity of dialogue/interactions. But I can edit and completely change interactions while the game is running or in a standalone build and iterate just by re-saving a text file. I still use AC cutscenes extensively (which can be triggered through my custom scripting language) and most of the other AC features: IE - I integrate with inventory, menuing, Global Variables, etc.

    I'd strongly encourage anyone with custom needs to try Ink or even writing their own system... AC is thoughtfully designed for customization and I've learned lots of new C# tricks along the way. I'm really an intermediate level C# guy (at best) but it's very doable if you have the inclination. One of my favorite things about AC is that while it can drive 100% of your project, it can also drive 90% of your project and let you focus on custom solutions that really matter.

    Now I actually have to work on gameplay instead of laboring over systems design. 

    :-O
  • Any news on this one?
    I'm writing with Inky too.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.