Jump to content
  • Advertisement
Sign in to follow this  
HappyCoder

MVC vs ?

This topic is 2570 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[size=2]So I have known about the Model View Controller model from web development and just yesterday I was talking about it with a roommate and then almost like a slap to the face I realized that separating the Model, View, and Controller in games seemed like a good idea. I am working on a game project as of now and at the beginning of creating it I wanted it to work as such.

I want to be able to create entities that are disconnected from each other. The enemy entities, for example, wouldn't have a reference to the human player class. To know the players position and such I wanted to create an eye and ear class. Attach and eye and/or ear to an entity and it would see/hear objects in the scene and alert the entity it belongs to of the objects. The entity could also cause the eye to ignore certain objects or specifically search for objects. The idea behind this was to modularize the actors in a scene from each other and the scene. The way I have been going about creating this is by making a hierarchal tree of entities and was planning on subclassing the Entity type, the same class that does the rendering, and having the subclasses of it have the logic to update objects.

I am realizing that my View and Model would be in the same object if I continued on this. I am wondering if this is still a good way of doing this or if I should separate the view from the model. Any experience with either of the two design models or comments on this would be appreciated. Thank you.

Share this post


Link to post
Share on other sites
Advertisement
It really isn't worth contorting your design to fit someone's preconceived notions of what "good architecture" involves. Design patterns and prefab architectures like MVC are dangerous - they were meant to describe patterns that emerge from common designs, not to dictate how you do design in the first place. If you find yourself building code by selecting patterns (or architectures like MVC) and strictly conforming to them, you're doing it wrong.

Develop a design that makes sense for your gameplay requirements. Everything else is wasted time.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!