Best way to create branching conversation trees?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Vree
Newbie
Posts: 1
Joined: Tue Nov 10, 2015 8:32 am
Contact:

Best way to create branching conversation trees?

#1 Post by Vree » Tue Nov 10, 2015 8:38 am

For the moment, I have been proceeding like this:
label Sally_conv1:
menu:

"Do you know the answer to 1+1=?":
s "Yes, it is 2."
jump Sally_conv1

"Do you know the answer to 3+4=?":
s "No, I don't. Ask Mike."
jump Sally_conv2

"Goodbye.":
pass

label Sally_conv2:
menu:

"Where is Mike?":
s "He's standing right next to me."
jump Sally_conv1

"Actually, I don't care about Mike. Let me ask something else.":
jump Sally_conv1
Ie. topics that branch out into other topics are placed under separate labels, so a character who has a lot to talk about will have a lot of labels covering different subjects, character_conv1, character_conv2, etc.

Is this an economical way of doing things? Or would it save effort/disk space if I used some different solution like embedding menus into each other?

Thanks!

User avatar
mobychan
Veteran
Posts: 275
Joined: Fri Apr 24, 2015 6:31 am
Projects: The Chosen - Sakura Pink & Gentian Blue
Organization: Foresoft
Location: Germany
Contact:

Re: Best way to create branching conversation trees?

#2 Post by mobychan » Tue Nov 10, 2015 9:14 am

Please use [ code][ /code] (without spaces) for your code, not quote

You can use what ever of the two you want, there's not really a difference except for better readability with calling labels

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Best way to create branching conversation trees?

#3 Post by namastaii » Tue Nov 10, 2015 5:37 pm

I think that using it all under one menu conversation would be easier and more organized instead of creating a bunch of short separate scenes to jump to.

Code: Select all

label conversation:
    s "blah blah blah?"
    menu:
        "choice 1":
            s "blah blah blah for choice 1"
            s "blah blah?"
            menu:
                s "blah blah blah"
                s "blah"
        "choice 2":
            s "blah blah blah"
            menu:
                "blah blah":
                    s "blah blah"
                "blah blah blah blah":
                    s "blah blah"
                    menu:
                        "blah":
                            s "blah blah"
                        "blah blahhhh":
                            s "blah blah"

User avatar
Kate
Regular
Posts: 197
Joined: Thu Sep 19, 2013 6:10 pm
Projects: Blackout
Organization: Moonlight Otome
Location: United States
Contact:

Re: Best way to create branching conversation trees?

#4 Post by Kate » Tue Nov 10, 2015 9:03 pm

I would use calls if the conversation is long and complicated and has a bunch of menus, but no jumps in it.
Otherwise, hard code the conversations where you want them to the best of your ability and stack the menus reasonably like namastaii demonstrated.
Current Project:
Blackout [VN][Romance][GxB][Mystery][Suspense] http://lemmasoft.renai.us/forums/viewto ... 43&t=34118
"It is the duty of authors to make the fantastic seem ordinary and the ordinary seem fantastic." - K. Auer

Onishion
Veteran
Posts: 295
Joined: Mon Apr 20, 2015 10:36 am
Contact:

Re: Best way to create branching conversation trees?

#5 Post by Onishion » Wed Nov 11, 2015 1:39 am

Yeah, I basically do like Kate suggests, if it's only a short comment branch I keep it all in a single linear flow, but if it sends the conversation off in a completely different direction from everything else then I might call or jump to a label. It's all about what works for you, what you can write without confusing yourself. So long as you can keep the flow of conversation rational in your head, it's probably fine.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Best way to create branching conversation trees?

#6 Post by namastaii » Wed Nov 11, 2015 2:17 am

Yeah, as long as YOU'RE not confused, it doesn't necessarily matter. You're the one creating this, nobody else. So as long as it keeps you on track, that's what matters. As long as you don't feel lost

Post Reply

Who is online

Users browsing this forum: Google [Bot]