Branched Dialogue Template and Tutorial

Guides Branched Dialogue Template and Tutorial

Note: This tutorial should be considered outdated since its spiritual successor and far better system called VAMStory has been released by @hazmhox https://hub.virtamate.com/resources/vamstory.28256/


This is a tutorial for my Branched Dialogue system I made for Space Force which you can check out here: https://www.reddit.com/r/VAMscenes/comments/gsh5zv/space_force_episode_1/

It supports 3 way conversations and unlimited branched storylines.

This system opened up a whole new world of possibilities for me so I wanted to share it with the community and do a proper tutorial. It is fully customisable so I encourage people to tinker and improve on what I’ve done.

In this tutorial we will cover:

  • Setting up Branched Dialogue in your existing scene
  • Adding dialogue to a scene
  • Moving the dialogue system around
  • Merge Loading general principals
  • Merge Loading dialogue scenes
  • Branching dialogue
  • Setting who speaks the first line
  • Dialogue timing and advanced techniques
  • General tips and tricks
Setting up Branched Dialogue in your existing scene

Start by downloading the Branched Dialogue Template attached to this post.

You can build your scene straight from my template but I expect most people will want to add this to an existing scene so here’s how to do it. I will assume your scene has at least 2 people in it.

Unzip the Branched Dialogue template and put it somewhere in your VAM Scenes directory you can find easily.

Open your existing scene in Edit mode and in the Scene Audio menu add the 2 sound files from the template Sound directory. For this step it needs to be specifically these files in this location, you can change them for what you want after.

iXyOSOWkt7Un81Yf8cPMcAWTgRapYAVTq2CVwBnt8jjHP_uIIUmYE2wp8mKZepU2zk7QkCvmu7rRhCkQE8lNDbXCvQ21_SMQQgRtn9AlqfcB5d2UZduNnulKwMdxj5EUWFN0_6ey


Make a note of the exact names of your characters in your scene, or if you have 3 then the two who are the non-player characters that you want to have replies. Their name is in the top of their Control menu in VAM.

mFdyd1peYEzdNr6loyDuQR0IgFZmEPdXnbsukrwYcEUZEEjszCknzsVT3kkmOC9ddv5sBZStmczaI9zuu40oYBz21IN_sZy0jXaM_Pc4orNx5sNpGCUMfsj6XUvodc2oH3kRdfJZ


Save your scene and load the Branched Dialogue template scene. Rename Actor#1 and Actor#2 to the names you noted in your existing scene, just click the name and type the new one over it. Select Merge Load Scene in the VAM main menu and select your scene.

kR-mfeBlpeKX111TMzZKhd4N067ll84u8GyJBrEMxAEh8etdilxD83HNbPw82VfP9B-mUd-sH16SVc-tNLe8uGW3s6ssD-iGBRcFpoy3Jdj5kVMbb1yfVQORL8Po8M9CtDiO4wpn


That’s it! Branched Dialogue should now be ready to use on your first scene.

Important note: Before you do anything else save your scene and make a copy of it to keep aside. I’ll explain why later.

If you have other scenes in a series already built you need to add the 2 audio files to them first too, you can add them in VAM or you can copy and paste the sounds from your first scene .json using a text editor. Always keep a backup in case you mess something up doing this.

Y23SS6Lkx1z084ZpeF94k5Qg0BErLIQznajPkZxB_RVFODxszQK07WbsqjiCCTfy-UAxrSDPM0dL4VnI1-o0M2T27g6_g0DKfRQU2axEzTh4a0Jdof2ccFO445baqm6ztXuvicfg


Adding dialogue to a scene

First we start with clearing any existing open dialogue buttons. Click the Select button (arrow) on the VAM main menu.

D12pPx-qi5iD0XNbNyRdOxefoSaMiM_JPfL7HcV7t_fJiZ277iFO7xCgNWUtnFRqw8F7GGsXd9iz38R6zHwY-N9sPvGJXJmYOveFERdqee98xwvKr-0Nj80zMmWeKNdv3b1Ajz9j


Select the “CloseAllButtonsDebugButton” atom, click it’s Control tab and tick On.

0_wO157V5xqLCI9yFkEaJeIpz21v1ohS4JEK6pWZrcyBWVr90YAoUgwHovxZkJBj85NI_7ITSBl7pk5eWSB0TkMJueN8KgVhgkBAyPvE3xJbSJCf8XfFFbG01tDrEEiNAs_-WLaD


You should see a new button appear to the right of any existing open dialogue buttons. Press the button and they will all close. This will become a very handy button as you build scenes so don’t forget it is there!

Now we’re ready to add some dialogue. Press the select (arrow) button again on the VAM menu and select dialogueUIButton1. Press it's “Button” tab and here you can put your first line of dialogue.

qHsNDN_UF_JTKMEJ_8c0YO8_vEnmHhKdwQu30D1K5zMHaCi_pxNweB_vvBmLEcSC_K111ZFQo35k-dafotpovqpERC_yuJdEspbOqXJ4QgP8JMMNG9C6Jiz8gdbMO9Wis7vqNMOf


Test it out by turning the button On in it’s Control tab. If the text is too big to fit then back in the Button tab increase the Canvas Y size so it all fits.

Good stuff, we have a line done!

Now to add a response press the Button Trigger tab and press Settings by “Actor#1 dialogue text” and you can put your text in and press OK. If you want the other person to be speaking untick Actor#1 dialogue text and tick Actor#2 dialogue text and do the same thing.

wJVSUUIloDR1fskOn0kxS-u8BCAC4f9514NgHygQpu5au9aVVOMUtnPjiov-0oTNqdfsw9JG1CHyuFuVo3FCxpkVt7atmgChlDghb6fG7n7NJGbkfSq3ohvqgTajGBsu4szB8xbj


By default lines spoken by characters will stay open for 5 seconds which is usually fine, but if it is a longer line you can increase the number of seconds it is open in “Actor#1 (or #2) dialogue lifetime”.

Now we can test our scene!

Select “CloseAllButtonsDebugButton” again, turn it on and press it. All the dialogue buttons will close and now save your scene. When you save the first line will trigger automatically and you will be able to press it and see the response.

Repeat these steps for each dialogueUIButton2 - 10 in sequence until you want a scene transition. There is a dialogueUIButtonFinal which doesn’t have a response if you need an extra last line in the scene.

Moving the dialogue system around

To place the buttons in your scene select the DialogueGrabPoint which is a green hand icon below the buttons and you can move the whole system where you want and it will keep it all neat and level for you.

Merge Loading general principals

Once you have filled in dialogue for your first scene we now want to merge load to the next one.

Merge loading is an incredibly powerful feature of VAM that I think everyone should be using so I’ll go into a bit of detail of how to use it properly.

The idea is that you have your starting scene load with everything your future scenes will use. This means that VAM only needs to load it all once, and after that scene transitions will be very fast.

If you have an item that you will use in later scenes but not in your opening scene, put it in your opening scene but untick it's On button in it’s Control menu. VAM will load it but not use it

Similarly if you have an item that appears in your early scenes but not in later ones just untick it’s On button (don’t delete it!) and VAM will pretend it isn’t there in all subsequent scenes.

Many atoms like Animation Patterns and CycleForces can be repurposed for different things across different scenes.

Merge loading also works with attached objects. For example if you have a hat asset you want a person to wear, you can attach it to the person using “Select Link To From Scene” and attach it to the “Head” node and place it how you want it. When you merge load the hat will be placed correctly on their head in all other existing scenes no matter how they are posed.

If the hat was already in a scene you merge loaded to it will stay where it was. If you want it on the person’s head, delete it from that scene and merge load back into it from a scene where it is on their head and it will be placed properly.

Merge Loading dialogue scenes

Now we need that copy of the scene you saved earlier before you started adding dialogue text, we’ll call this your “clean” scene.

When building scenes you want to always keep a “clean” copy in each area that has no dialogue in it to make it easier to keep track of where you are in the sequence when adding dialogue. I learned this lesson the hard way, it gets very confusing when you are overwriting existing dialogue with new dialogue.

Merge Load your “clean” scene and you can start building your next scene from it. Make sure of course to save it to a new file and not overwrite the original. When you’re done Merge Load back to your starting scene so we can set up the transition.

Select the last dialogue button that you have written text in and in it's Button Trigger tab Untick everything (you can ignore Actor#1 and Actor#2 dialogue lifetimes if you want) and tick Merge Load. Press it's settings button and choose your next scene. Now use “CloseAllButtonsDebugButton” and save your opening scene.
3lszUO7O5nT7UiFX-u3Pil2w53lWJPUEZ0C6T4xWw4ilLwly9IGQ3GVWPXXxBUM3BKjZDLvt0INDlX6uStVgqOUmv9lABEJ_FEktWgkmnX8ERtfVgXVH-wRiJk_rTTkPw3eKrDbB


Congratulations, your scene should now play through and transition to the next one at the correct point!

Branching Dialogue

To branch dialogue it is much the same as a normal dialogue except untick “Enable next with animation pattern” and tick “Dialogue Branch”.

fbxniSU7KU6I5B8VL8HEAtWYd3UXk2jFaQeR1BuelKFl9Uud14PXDrcCPAsOwXs-TLFBOUFIrG2_R0aLLQtEYqFz4dTtEVeSsV73KMPhv-IG4m8t8wNDzdPe5Pw7mXpFxOpj_Tkq


When played through this will trigger 2 new buttons “dialogueUIButtonBranch1” and “dialogueUIButtonBranch2” which will each merge load to a new scene, it can be the same scene if you want.

Select these buttons and as with normal dialogue buttons add your text for each one in it's Button tab and in the Button Trigger tab press settings on “Merge load branch scene” and choose your scene to branch to.

jyczjNHxXFFOnujigl4YVBiFMndDlkOXhfgKD0o7wJoDhi503aXXirPGyCTqp0tS2otDQIYPIbZvnF-Vp0T_xWuCdkeRq5QaIyIfEWD8LK0LPvsSfBgznbq9o2pYHJ8r9HbJaund


Now use “CloseAllButtonsDebugButton” again and save your scene and you should be able to play through and branch the storyline!

Setting who speaks the first line

By default the player always speaks first but you can change this by selecting the DialogueFirstLine atom.

In it's Animation Triggers tab select the Actions button next to “Dialogue text and lifetime”

U81aFh4lCArd_EG1fRtighZ09ifPyS47QyXbKTwLD3zV_fgSqN7dKU-MZL-7AJkmgEWNdaxI4NRsKH09sg_Dj-X4cfu_We9jVich4_VOg50I6o3dhGRG7LAD356b-mUTqhIHKfbC


Now tick Actor#1 or #2 dialogue text (or both if you want) and “Play Sound 2”. You can press settings next to the dialogue text of the actor you want to speak and put the line in there.

2MyCKNQviVouFYsk1-1S2y0HA6EY8eth9KhIlhiQoc1Yk6ggvssu67Zuq0Zb_r0DpUC8f-74JGGuKiLsr3Pnwb1AGFX_cePwiz9nWye24p_4JytgwoLy5vwyG4Zc41oRsp8xlRqH


Dialogue timing and advanced techniques

Branched Dialogue is very versatile and I encourage people to refine and improve on what I’ve done. One thing that was particularly hard to gauge was timing the lines. I settled on 2 seconds as a default from when a character replies to when the player’s response appears but you can change this. In the Select menu tick “Show Hidden” and you will see all the Animation Patterns behind the scenes. DialogueFirstLine is an Animation Pattern too but is not hidden, the same principles apply to this too.

Xz21lsRg-AXDZj-oKbz6cqNXqIQcznLXaNPqokR1oajRrpOrI0RccrQZvveA7caP1-MG8RT7H3Hd49_uDqxYMy2-kUHTVAcPjaNS771NEp92RpDpQdBztiAKBiU1t1Do7nCxt1aA


When you press a dialogue button it triggers one of these Animation Patterns, so Dialogue Button 5 for example will trigger Dialogue5AnimationPattern. Ignore the ones that end in “Step1” and choose the one corresponding to the button you want to change.

nVhlSlYi4gNNLggUq5xKIuEL27ePUDL_MUiEjt_zx2MBNx4_XsJU67j7Pdr1__fPMrFwT5IZdV_24Y93bddO6dm-fuSPoN0NIaDBFxbzU5y-W4fDgCGULcvL6K9qJzWwz7VV-G6I


In here the Animation Speed slider sets the timing for the next button, it is a 1 second pattern and at default it is at 0.5 speed making it 2 seconds. Increase this to make the button appear faster or decrease it to make it appear slower.

If you are feeling really fancy you can click the Animation Triggers button and add different things to trigger during the transition. I used this in Space Force to trigger orgasms which I think worked quite well.

General tips and tricks

Write your dialogue in your favourite word processing package so you have spell checking and you can refer back to it as you go. Once you get into the swing of things it is surprisingly quick to copy and paste lines across into VAM.

Try to keep your lines short and snappy, big walls of text can be very off putting.

You will notice 3 deactivated colour template buttons to the left of the dialogue buttons. I put these here so you can choose a colour scheme and quickly copy and paste out the colours to indicate playing a different character or the button performing some other function than speaking a line. I haven’t used them much yet but I thought they might be useful.

I think that’s about enough for one tutorial, I hope this helps some of the budding VAM writers out there!

Thanks for reading!
Author
Spacedog
Downloads
1,095
Views
5,549
Version
2020-05-29
First release
Last update
Rating
4.67 star(s) 3 ratings

More resources from Spacedog

Latest reviews

5 stars just for doing this. I know you didn't have too.
I feel that this is an EXCELLENT resource for those of us that would like to get into telling stories in VaM and letting other's experience this.
Now, I have yet to try it, but if you are just giving this out of the kindness of your heart to the community... Then bam, 5 stars.
I can't wait to try this. I'm a noob, but you know? Noobs like us might just be the primary consumers of VaM content, so there we are.
Thank you, Sir. Please... May I have another?
xD
Upvote 0
thanks for the explanation, very useful
Upvote 0
Really appreciate the effort to explain your work in detail. Have had some problems, mainly because I have not consulted your tutorial here. :D Good stuff! Keep it up!
Upvote 0
Back
Top Bottom