[size="5"]Intent
[bquote]Render the visible Models given a P.O.V.[/bquote]
[size="5"]Problem
[bquote]Renderers are often the most custom part of any game; they often define the game''s technology and determine the envelope of design. Thus, not surprisingly, extreme optimizations are common often at the expense of organization or maintainability.[/bquote]
[size="5"]Solution
[bquote]The View reads the Model Database via a Spatial Index but does not modify either. Thus, typically: The communication between a Spatial Index and a View is often the determining factor in game performance and deserves great attention. Not uncommonly, the spatial index and the view are so intimately related that the index is considered View code. However, one may argue that a spatial index more properly belongs in the model domain due to its read-write status. (See Spatial Index - Implementation.)
Most View implementations translate a model "state" into an "appearance". For example, a model instance "orc1" is de-referenced and is found to be type==ORC_TYPE and frame==10. The View then finds an artwork pointer via type and frame and draws.
The translation from "state" to "appearance" often has exceptions which clot the render code. (See Render Delegation and Appearance Map.)
There are frequently more than one View implementation per game. For example, there may be a custom rear-view mirror in a driving game, or an overhead-view mini-map in a strategy game. However, there is usually one View implementation which predominates.[/bquote]
[size="5"]Structure- Model is read-only by View.
- Spatial Index is read-only by View.
- View is invisible to Model and Spatial Index.
Most View implementations translate a model "state" into an "appearance". For example, a model instance "orc1" is de-referenced and is found to be type==ORC_TYPE and frame==10. The View then finds an artwork pointer via type and frame and draws.
The translation from "state" to "appearance" often has exceptions which clot the render code. (See Render Delegation and Appearance Map.)
There are frequently more than one View implementation per game. For example, there may be a custom rear-view mirror in a driving game, or an overhead-view mini-map in a strategy game. However, there is usually one View implementation which predominates.[/bquote]
[bquote]None at this time.[/bquote]
[size="5"]Examples
[bquote]None at this time.[/bquote]
[size="5"]Issues and Risks
[bquote]None at this time.[/bquote]
[size="5"]Related Patterns
[bquote]Views renders Models that it looked-up in the Model Database via a Spatial Index.
Views often derive artwork pointers from a Type Database.
Views may choose to defer customized drawing via Render Delegation.
Views may translate a model''s state to its appearance via an Appearance Map.[/bquote]
Views often derive artwork pointers from a Type Database.
Views may choose to defer customized drawing via Render Delegation.
Views may translate a model''s state to its appearance via an Appearance Map.[/bquote]