Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6812345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:26:16+00:00 2026-05-26T20:26:16+00:00

I’m designing a choice based adventure game in VB.NET 2010, where you are presented

  • 0

I’m designing a choice based adventure game in VB.NET 2010, where you are presented with a story label, and you choose between 2 buttons, which choice you want to make. I want to know the most efficient way to do this.

My goals are to store the labels for the buttons and the story in some form of data structure, which is temporarily a hash table right now, and some form of structure for the choices. Right now I am using a custom class that references the indexes of the next 2 choices and their respective label indexes which stores the class instances in a hashtable. I’ve looked into things like arrays, dictionaries, lists, and collections, but I’m not sure which one best fits what I’m after. Any .NET data structure would work. What is the most efficient data structure for these 2 pieces of data? Would just a string array work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:26:17+00:00Added an answer on May 26, 2026 at 8:26 pm

    Here’s how I’d define the structures (assuming by VB.Net-fu isn’t failing me):

    Public Class Decision
        Public Property Title As String
        Public Property Description As String
        Public Property FirstChoice As Decision
        Public Property SecondChoice As Decision
    End Class
    

    The Title is what you display on or above the button to select that choice.

    The Description is what you display once you’ve committed that choice, and are coming to the next decision.

    If FirstChoice or SecondChoice is null, you can choose to hide the button. This will allow you to make only one choice optional, and have it skewed to once side of the frame, for dramatic effect. E.g.:

                      You've found yourself in a narrow corridor
    
    
    
                                                                  [Go Right]
    

    If you want to enable more choices than two, or at least leave yourself free to do so in the future, you could define your data structure like this:

    Public Class Decision
        Public Property Title As String
        Public Property Description As String
        Public Property Decisions As New List(Of Decision)
    End Class
    

    You could use a ListBox or GridView style control to display it to the user, or optionally switch between a list box and buttons depending on how many items you have in the list.

    By the way, the data structure is intentionally recursive. This becomes a tree structure, and at each node of the tree you have a decision, and potentially child decisions.

    Normally you wouldn’t loop such a structure, but there is no reason you couldn’t in this case. If you hit a “game over” style situation, your option can simply be to go back to the beginning, which will be linked to the root instance (and thus be a “cyclic graph”).

    Edit

    Here’s a code sample to show you how you can hook these together:

    Dim darkAlley = New Decision With
    {
        .Title = "Dark Alley",
        .Description = "You are in a deep dark alley." _
            + "  The night surrounds you and you feel a bit claustrophobic." _
            + "  Obvious exits are east and Salisbury street."
    }
    
    Dim eastOfDarkAlley = New Decision With
    {
        .Title = "East of Dark Alley",
        .Description = "You are mauled by a bear!" _
            + "  He was a dire bear, so he had rabies.  Start over?"
    }
    
    Dim salisburyStreet = New Decision With
    {
        .Title = "Salisbury street",
        .Description = "Mmm... Ground beef... Blarrghlhlap (*tongue hangs out*)"
    }
    
    darkAlley.FirstChoice = eastOfDarkAlley
    darkAlley.SecondChoice = salisburyStreet
    
    eastOfDarkAlley.FirstChoice = darkAlley
    
    salisburyStreet.FirstChoice = darkAlley
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a text area in my form which accepts all possible characters from
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.