• 06/19/01 11:36 PM
    Sign in to follow this  

    View

    General and Gameplay Programming

    Myopic Rhino
    [i](C) 2000 - Zachary Booth Simpson. Copied with permission from [url="http://www.mine-control.com/zack"]http://www.mine-control.com/zack[/url]. If you find any of this work useful, please sign Zack's guest book: [url="http://www.mine-control.com/cgi/gbook-zbs.cgi"]http://www.mine-cont...i/gbook-zbs.cgi[/url].[/i]


    [size="5"][b]Intent[/b][/size]
    [indent][bquote]Render the visible Models given a P.O.V.[/bquote][/indent]
    [size="5"][b]Problem[/b][/size]
    [indent][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][/indent]
    [size="5"][b]Solution[/b][/size]
    [indent][bquote]The View reads the Model Database via a Spatial Index but does not modify either. Thus, typically: [indent] [list][*]Model is read-only by View.[*]Spatial Index is read-only by View.[*]View is invisible to Model and Spatial Index.[/list] [/indent] 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]
    [/indent] [size="5"][b]Structure[/b][/size]
    [indent][bquote]None at this time.[/bquote][/indent]
    [size="5"][b]Examples[/b][/size]
    [indent][bquote]None at this time.[/bquote][/indent]
    [size="5"][b]Issues and Risks[/b][/size]
    [indent][bquote]None at this time.[/bquote][/indent]
    [size="5"][b]Related Patterns[/b][/size]
    [indent][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][/indent]


      Report Article
    Sign in to follow this  


    User Feedback

    Create an account or sign in to leave a review

    You need to be a member in order to leave a review

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    There are no reviews to display.