Forum rules - please read before posting.

Deeper PlayMaker Integration

On this thread I started thinking about the benefits of using PlayMaker to manage and call AC's actions.

Since it wasn't the original focus of that thread, I've decided to move the discussion over here.

The following image is a repost of first design comparison I did between AC and PlayMaker. It seems to me that PlayMaker's state manager interface is really well suited to being able to visualize the branching interactions that occur between lists of actions.

image
This image has been resized to fit in the page. Click to enlarge.

Rather than reinventing the wheel, we could use Playmaker's state machine interface with AC's actions lists. To do this, we'd need a custom Playmaker action for each AC action:
https://hutonggames.fogbugz.com/default.asp?W350

We'd also need a custom Playmaker action for dealing with AC conversations.

With this approach, we'd get a high level overview of how action lists interact with conversations in a cleaner, clearer interface.

Comments

  • Since that original post, I've been working day and night to test out my theory and now I've finally got something working!

    image
  • Just got Conversations working, too.

    Note: I blurred out the camera in the game view for confidentiality reasons, but you can still see the actions having an effect on it if you watch the video above.
  • really cool! ;)

    how does it feel, workflow wise? just so i understand, you add an AC action to every hotspot, interaction, cutscene, etc., which start a FSM (added to the same object?) ? Did you notice any delays or performance issues?

    great work!
  • Yup, that's the current workflow! I haven't tested it too extensively performance-wise, but it shouldn't be any more demanding than having PlayMaker + AC running in the same project. I'll keep y'all updated!
  • This looks great! Please do keep everyone updated on your progress ;)

    I've become convinced that Unity's largest missing feature is integrating visual debugging, and PlayMaker has the best example of it I've seen.

    I would love to see how this progresses.
  • @PixelArtist Any updates on this? Would be interested to know what's your progress
  • edited January 2015
    Hey folks! Quick update on this project:

    I'm using this playmaker/AC hack throughout my project now and it has definitely improved my iteration time and helps me to visualize my game's logic at runtime. However, the current workflow could use some optimization as there are a few annoying/repetitive setup steps, which could trip up a new user (it is a hack, after all).

    I don't have any time to support this tool right now, but I'd like to zip up my current files and share them with you here, in case you're interested in trying out this approach. You will probably need to be proficient in Unity, Adventure Creator, and Playmaker to make this work. If you'd like to help me make more AC actions work in PlayMaker, you'll need a bit of C# knowledge as well. But believe me, it's well worth it!

    First, make sure you have Adventure Creator and Playmaker imported into your current Unity project.

    Then do the following:
    1. Download my zipped up scripts
    2. Import the "AC" folder into your PlayMaker/Actions folder
    3. Import the asset files in the "Templates" folder into your project's PlayMaker/Templates folder
    4. Replace the Conversation.cs file in AdventureCreator/Scripts/Logic with the new Conversation.cs file.
    5. Open your PlayMaker editor window in Unity
    6. Select an in-scene ActionList (I'll be using the "Use: Camera" Interaction from the Basement demo scene)
    7. Add a "Third Party: PlayMaker" action to the ActionList
      image
    8. In your PlayMaker editor window, right click in the large empty space and select Add Template>General>SimpleACTemplate
    9. Then, in the (Do actions here) section, add any actions you'd like PlayMaker to execute when you run the AC ActionList. Of special note here are the actions under the new AC category, which include old favorites such as Camera: Switch, Dialogue: Play Speech, and Character: Animate.
    10. If you'd like to add more states, please note that in order for the AC actions in those states to work, the state must be set to work like an "Action Sequence" in their settings menu. Otherwise, they'll all try to run at once, which is how PlayMaker likes to handle states by default.
    11. Finish setting up the ActionList you used to call the "Third Party: PlayMaker" action and ensure that the "Event to call:" is set to "AC"
      image
    12. You're done! Now you should be able to test your ActionList out at runtime and check your PlayMaker editor window to debug your newly scripted AC actions.
    13. Oh. What's that? You'd like to know how to build Conversations with this tool? Well read on at your own peril...this where I really had to hack PlayMaker to get things working the way I wanted. Editor crash bugs are common.
    14. Ok, let's start by using the PlayMaker editor window to add a ConversationACTemplate to an Interaction ActionList (most likely one that would be triggered by a Hotspot). If you're adding a conversation to an existing PlayMaker FSM, I like to create a new state (remember to set it to Action Sequence), add the Conversation FSM action to the state, and create a conversation object from prefab using the standard Adventure Creator "Game Editor" window. Once you have all that ready, you need to hook the conversation you just created up with the "Conversation FSM" PlayMaker Action created earlier.
      image
    15. Use the "Add new dialogue option" button to add new options to the conversation. Note that this also automatically creates transitions leading out of the current state with names like DialogueOption0, DialogueOption1, etc. Use these transitions to branch your ActionLists in and create easily readable dialogue trees.
      image
    16. Important note: The "Interaction:  " section is intentionally left blank for these dialogue options. The whole point of this hack is to use PlayMaker instead of the old AC Interaction ActionLists. The only reason I left that section in the UI is in case you're converting older conversations to use this new system and you need to remove their associations with a given Interaction ActionList.
      image
    The Conversation should work something like this:

    image


    Cheers!
    Sam
  • Anyone had a chance to try this yet?
  • It's on my todo list @PixelArtist. Sorry about that.
    Will try next week. 
  • What's the latest on this topic?

    For me just calling an AC ActionList from a Playmaker FSM with some parameters would be great. Anyone worked on integrating this way?
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.