Hello guys.
I've recently bought the book and reading it at the moment and have couple of questions already.
At the very high level book mentions that there should be separation into 3 main layers: application, game view and game logic. That being said, there was a note that this is like mvc plus application layer on top. After that there goes brief description of what other two layers contain.
More exactly, game view is said to be responsible for rendering, checking controls and sending commands. Here is where my confusion starts. In classic MVC AFAIK the C part, which is controller, is responsible for doing input fetch and command sending to the model. But here the V and C are merged together.
For example, I have simple character which can just WalkTo(point). This is my model (game logic). I want it to talk while walking (V part of the MVC should be responsible for that). And a character could be controlled by the human player or by some bot brain (C part of the MVC).
However there are no controllers in the book and I'm a bit lost actually. Can anyone enlighten me why there are only two separate modules instead of three?
--
Another a bit unrelated question is about the input. Author says that invoking model api directly is a bad bad thing and that one should prefer sending commands. This looks like another pattern - command pattern if I understand it right. It is also said that the benefit is in the ability to plug in the console from which you can send those commands.
I do not really understand the idea. If I have
if (button is pressed)
{
model.WalkTo(...);
}
in the controller, why can't I do the same from the console parser? Which looks like just another controller for me btw! The command pattern AFAIK is used for undo/redo and buffering the commands but here we don't need both.
So again, what of the purpose of introducing another layer of indirection into input pipeline?
Thanks in advance, the book really gave me a bunch of thoughts on the game engine and I suppose it's only the beginning
I've recently bought the book and reading it at the moment and have couple of questions already.
At the very high level book mentions that there should be separation into 3 main layers: application, game view and game logic. That being said, there was a note that this is like mvc plus application layer on top. After that there goes brief description of what other two layers contain.
More exactly, game view is said to be responsible for rendering, checking controls and sending commands. Here is where my confusion starts. In classic MVC AFAIK the C part, which is controller, is responsible for doing input fetch and command sending to the model. But here the V and C are merged together.
For example, I have simple character which can just WalkTo(point). This is my model (game logic). I want it to talk while walking (V part of the MVC should be responsible for that). And a character could be controlled by the human player or by some bot brain (C part of the MVC).
However there are no controllers in the book and I'm a bit lost actually. Can anyone enlighten me why there are only two separate modules instead of three?
--
Another a bit unrelated question is about the input. Author says that invoking model api directly is a bad bad thing and that one should prefer sending commands. This looks like another pattern - command pattern if I understand it right. It is also said that the benefit is in the ability to plug in the console from which you can send those commands.
I do not really understand the idea. If I have
if (button is pressed)
{
model.WalkTo(...);
}
in the controller, why can't I do the same from the console parser? Which looks like just another controller for me btw! The command pattern AFAIK is used for undo/redo and buffering the commands but here we don't need both.
So again, what of the purpose of introducing another layer of indirection into input pipeline?
Thanks in advance, the book really gave me a bunch of thoughts on the game engine and I suppose it's only the beginning
Looking for a job!
My LinkedIn Profile
My LinkedIn Profile