Jump to content
  • Advertisement
  • 06/19/01 10:13 PM
    Sign in to follow this  

    Appearance Map

    General and Gameplay Programming

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

    [bquote]Isolate Model state from Model appearance to minimize impact on controllers when art changes.[/bquote]

    [bquote]Controllers are often complicated little state machines which interact with Models in very specific ways. It is common for this interaction to change the appearance of the Model, especially in animation controllers. Since art may change frequently (example: more frames are added to an animation) it makes sense to separate the state from the appearance.[/bquote]

    [bquote]Without an appearance map, a controller is likely to change the "frame" of an animation directly. For example:

    if (state == WALKING) {
    model.frame =
    * (WALK_DURATION / dt)
    In this case, if the animation is changed, the three constants WALK_XXX need to be updated and the game recompiled for the change to take effect.

    An appearance map eliminates these constants and replaces them with a lookup. Typically, a table is loaded at game initialize time which encodes the translation from state and delta time ("state") to frame ("appearance").

    A game with a built-in editor will probably allow this table to either be edited directly or at least to be re-imported on command.[/bquote]
    [bquote]Not available at this time.[/bquote]
    Issues and Risks

    [bquote]None at this time.[/bquote]
    Related Patterns

    [bquote]Appearance Maps translate Model state into an appearance for the View.[/bquote]
    Uses and References

    [bquote]Special thanks to Jim Greer.[/bquote]

      Report Article
    Sign in to follow this  

    User Feedback

    There are no comments to display.

    Create an account or sign in to comment

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

    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

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!