I am developing a Windows game engine that will let you create games styled like "Phoenix Wright: Ace Attorney". I have finished developing the data entry parts (evidence, profiles, animations, etc.), 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 with "choice branches", where the player can select an option from many, and something will happen depending on the choice. How should I design such thing? I have no problems creating a linear flow (action, action, action, etc.), but I am confused by things like cross-examination or chatting involve branching choices (action; if did something, do this; if did something else, do that; etc.).

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.


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

|improve this answer|||||
  • \$\begingroup\$ 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)? \$\endgroup\$ – Oxide Feb 21 '12 at 16:58
  • \$\begingroup\$ I'm not sure what question you are asking exactly. Yes, you could let the states be specific keyframes. \$\endgroup\$ – Error 454 Feb 21 '12 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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