Hello Guys,
Recently I read in a book related to Game coding that the games we code must follow the MVC Design Pattern.
Is it necessary that we strictly follow this pattern.
And do most of the games follow this pattern
MVC pattern for games
Started by sujay, May 01 2012 01:00 PM
4 replies to this topic
#1
Posted 01 May 2012 - 01:00 PM
#2
Posted 01 May 2012 - 01:40 PM
I have never read about games explicitly using the MVC pattern, but some sort of similar concept will usually be the result if the engine is at all well designed.
I think it is more common to have a component based approach, where a game object (like a monster) has an AI, a mesh renderer, a physics simulation etc.
I think it is more common to have a component based approach, where a game object (like a monster) has an AI, a mesh renderer, a physics simulation etc.
#3
Posted 01 May 2012 - 08:08 PM
MVC is one of many general patterns to architect an app. MVC is simply a practice/pattern that makes you separate data, logic and presentation in a certain way. The reason that MVC isn't strongly useful in all game subtypes is that, in most games, the Model is pretty close to the Presentation, esp. in 3D worlds. With a business-line app, the Model is often very different from the View, and there may be multiple Views of the same Model.
Hyperbole is, like, the absolute best, most wonderful thing ever! However, you'd be an idiot to not think dogmatism is always bad.
#4
Posted 02 May 2012 - 02:18 PM
alphadog, on 01 May 2012 - 08:08 PM, said:
MVC is one of many general patterns to architect an app. MVC is simply a practice/pattern that makes you separate data, logic and presentation in a certain way. The reason that MVC isn't strongly useful in all game subtypes is that, in most games, the Model is pretty close to the Presentation, esp. in 3D worlds. With a business-line app, the Model is often very different from the View, and there may be multiple Views of the same Model.
Thanks.
#5
Posted 02 May 2012 - 06:18 PM
The Model exist to track a system-level representation of data, and the View exists to track a user-level representation. So, in a sense, I mean both. There is usually a limited number of views on the user side, and there's little transformation between the two (ie. all that game world data becomes a fixed-size set of viewed pixels.)
This is different from the Observer pattern, from which MVC is modeled from. The Observer pattern is a little more universal, and can apply at the subsystem level or even on just one class. So, don't confuse the purpose of the two.
This is different from the Observer pattern, from which MVC is modeled from. The Observer pattern is a little more universal, and can apply at the subsystem level or even on just one class. So, don't confuse the purpose of the two.
Hyperbole is, like, the absolute best, most wonderful thing ever! However, you'd be an idiot to not think dogmatism is always bad.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












