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 862607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:10:13+00:00 2026-05-15T09:10:13+00:00

I wonder if you can help me. I’m writing a game (2d) which allows

  • 0

I wonder if you can help me.

I’m writing a game (2d) which allows players to take multiple routes, some of which branch/merge – perhaps even loop. Each section of the game will decide which section is loaded next.

I’m calling each section an IStoryElement – And I’m wondering how best to link these elements up in a way that is easily changed/configured and at the same time, graphable

I’m going to have an engine/factory assembly which will load the appropriate StoryElement(s) based on various config options.

I initially planned to give each StoryElement a NextElement() As IStoryElement property and a Completed() event. When the vent fires, the engine reads the NextElement property to find the next StoryElement.

The downside to this is that if I ever wanted to graph all the routes through the game, I would be unable to – I couldn’t determine all possible targets for each StoryElement.

I considered a couple of other solutions but they all feel a little clunky – eg Do I need an additional layer of abstraction? ie StoryElementPlayers or similar – Each one would be responsible for stringing together multiple StoryElement perhaps a Series and a ChoicePlayer with each responsible for graphing its own StoryElement – But this will just move the problem up a layer.

In short, I need some way of emulating a simple but dynamic workflow (but I’d rather not actually use WWF). Is there a pattern for something this simple? All the ones I’ve managed to find relate to more advanced control flow (parallel processing, etc.)

  • 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-15T09:10:14+00:00Added an answer on May 15, 2026 at 9:10 am

    It might help to think about the StoryElement objects as nodes in a directed graph. The edges of the graph could be represented by StoryElementTransition objects (or some similar name). A StoryElementTransition could contain references to the state you want to transition out of, the state you want to transition into, and maybe the event that triggers the transition.

    By setting up your story as a graph, you open up the possibility of running a directed graph traversal algorithm to determine all the possible routes through the game. For example, you can run a Depth First Search algorithm on the Event graph, pushing each state and transition on a stack, and printing the entire stack once you reach an end state.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder whether someone can help me please. I've created this form which allows
I wonder if someone can help shed some light on this: I drop a
I wonder if anyone can help? After Google announced that it will take note
I wonder if someone can help me. I've got a console App which I
I wonder if anyone can help me filter this data in some way? Here
I wonder whether someone can help me please. I've put together this page, which
I wonder whether someone can help me please. I've put together this page which
I wonder whether someone can help me please. I have a mySQL database which
wonder if anyone can help; I have an a two dimensional array which I
Wonder if anyone can help, I'm looking for a way to take an image

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.