Original Post
[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.
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.