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 want to learn how to develop a MVC pattern, but i can't find any site in where they focus it to Games and not to Browser / Windows calculator.

Would anyone please link me a tutorial of how to develop MVC patter for games?

Thank you very much

share|improve this question

closed as not constructive by Nicol Bolas, michael.bartnett, bummzack, Byte56, Josh Petrie Oct 19 '12 at 16:30

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

Not an answer, but this should be a very interesting read if you're interested in MVC in games… – Roy T. Sep 9 '12 at 15:35
I haven't used MVP in XNA yet, but its very useful for application development, and particularly unit testing of the display framework. It was designed as an improvement on the traditional MVC framework and I recommend you take a look at it at some point – Daniel Carlsson Sep 10 '12 at 3:39

Take a look at Game Coding Complete. McShaffry makes use of the MVC architecture and explains its uses well.

The basic gist of it in terms of games is usually:

This is your game logic. Game state changes, scripted events, rulesets, etc.

This is mainly the rendering aspect of the game. If you wanted to be cross-platform and support more graphics APIs, you'd just need to change the View portion of the game without touching any of the other code.

Pretty much what it sounds like. This section handles the input events that affect the game state (Model) and in turn what happens on screen (View). You can be a bit clever with this for AI, for example. You could have a PlayerController and an AIController that both send input events to the Model code.

Similarly, the View can be AI sensors in order to observe the environment to make decisions (a heavily subsidised version of the player's view).

Hope that helps.

share|improve this answer
I don't think McShaffry's architecture is MVC, nor does he claim this. It does reflect a similar separation of model and view that MVC does, and he has a three-way separation of concerns (the logic, view and application layers), but these three layers don't really align with model, view and controller. For example, user input goes to the application layer, then to the view layer, then the view sends signals to the logic layer (2nd ed, p. 229); in MVC, the path C->V->M is not allowed. – Nate C-K Apr 2 '13 at 16:59

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