Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing a Windows game engine that will let you create Ace Attorney games (Phoenix Wright style, not Investigations).

I have finished developing the data entry parts (Evidence, Profiles, Animations...), and now I am going to create the Scene Editor.

With this editor, you can create Courtroom scenes.

I am having a particular game-flow design problem here: "choice branches". Basically, the player can select an option from many, and something will happen depending on the choice.

How would you design such thing? I have no problems creating a linear flow (action,action,action...), but things like cross-examination or chatting involve branching from your choices (action, IF did something, do this, IF did something else, do that...)

What would be the most efficient mechanism to organize such branches for my design in the simplest way for the user to understand - I don't want to make it too complex for the user to make a game with the engine.

share|improve this question
up vote 3 down vote accepted

A Finite State Machine would seem to fit this type of flow. Users can easily understand a FSM with very little explanation. You might organize individual states such that they have entry and exit events. For instance when you enter the state, graphics/text xyz are displayed.

The exit conditions for each state are simply the choices that the user can choose from. Based on the choice made, you enter a new state or possibly loop back to the existing state. Basic Finite State Machine

share|improve this answer
So this is like, say, making a text-based game with Flash keyframes (as in, if choice A, go to keyframe 30, if choice B, go to keyframe 31)? – Oxide Feb 21 '12 at 16:58
I'm not sure what question you are asking exactly. Yes, you could let the states be specific keyframes. – Error 454 Feb 21 '12 at 22:16
Thanks. I guess I'll go for this model. – Oxide Feb 23 '12 at 21:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.