Jump to content

  • Log In with Google      Sign In   
  • Create Account

TheDastard

Member Since 02 Feb 2012
Offline Last Active Feb 04 2012 10:47 AM

Posts I've Made

In Topic: GameState Architecture Questions

02 February 2012 - 12:44 PM

The separation of tasks that you describe doesn't sound like a good candidate for multithreading to me. In general, separating persistent things like UI logic, game logic, rendering, etc ends up not gaining much from multithreading and makes coding/debugging it much more difficult. Threads are more useful (and manageable) for things like asynchronous resource loading or short term parallel computation (updating unrelated entity components simultaneously or a parallel algorithm for frustum culling, etc).

In my opinion the concept of tasks is a bit redundant since you will naturally separate things like entity logic, inventory management, and interface logic into separate modules anyway. To formalize them into tasks would not give you anything you didn't already have.


Fair points. I think the decision to break down states to tasks may have been more motivated by our reluctance to classify menus and inventories as states, and end up with a huge laundry list of them. We intend to have several menus and interfaces that overlay the game world that can be opened and closed, so the ideal of concurrent objects seemed initially appealing but I suppose unnecessary. So if we wanted to have these interfaces, as well as maintain and render the states beneath them I imagine a state "stack" would be the ideal solution, with the top most states determining if the state beneath it should handle events, update, or render. Would the ideal of breaking large states (menu & game for instance) into a small subset of internal states that manage their own smaller stacks reduce clutter or just be more hassle than its worth? We're trying to get most of the large design decisions made before we start working on things to prevent having to re-code large portions just to add features X and Y.

PARTNERS