Results 1 to 10 of 14

Thread: game data and rendering mechanism

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ok thanks. I think I understand your template.
    But now I want the TGame (mechanics only) to be as basic/fast as possible, because later on I want TGame to be ready for running on a server too.
    So: no graphics involved I think. Only areas (rectangles) for characters and a collision 'bitmap'.
    And there comes the point of 'splitting' code up: TGame needs data and TRenderer needs additional data.
    The problem is not the loading of the data, but loading the different data twice and linking those together when TRenderer comes into play.
    How does TRenderer 'know' that Character[N] has a bitmap[N] for drawing?

    Well I hope this kind of thoughts are a bit clear... If not tell me

  2. #2
    Quote Originally Posted by ericlangedijk View Post
    How does TRenderer 'know' that Character[N] has a bitmap[N] for drawing?
    The question is made slightly wrong. Character doesn't have any bitmaps, only different properties and states (such as "humanoid type 4 with blue helmet and white armor is jumping at animation phase 0.6, at coords X, Y"). How you define those is only limited by your imagination Only renderer class/unit needs to store the possible bitmap/texture/model data. Make good use of indexes sometimes. For example:
    Code:
    Renderer unit has:
    model: array of T3DModel;
    
    Game unit has:
    TPlayer = class
      modelIndex: integer; // This would refer to model in renderer class
      animFrame, animDelta: single;
    end;

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •