Results 1 to 6 of 6

Thread: Storing a tiled map

  1. #1

    Storing a tiled map

    Hi!
    I've made a graphic engine for my roleplay game with the powerdraw components and it works very fine.

    But I have one problem : I'm creating a tiled map and every tick I draw each small tile. I want to store the whole map in one Picture or Backbuffer but I don't know how. Can you help me ?

    For your information : Each tile is in the same bitmap and the size of each one is 32x32.

  2. #2

    Storing a tiled map

    Storing it in large bitmap won't speed things much. You'd better order up rendering calls so you first draw all tiles which are the same image / pattern. i.e. if you have a field of (1,1), (2,1), (1,2), (2,2) and the first and the last tiles are the same image (preferably pattern too), you'd first draw these tiles. PowerDraw does buffering which accelerates things.
    - Lifepower

  3. #3

    Storing a tiled map

    Are you sure that storing the tiles in a big bitmap won't speed it up?
    I have a zooming function and when I scale the card down, the FPS go down to 20...
    But when I draw a big bitmap, it's very fast.
    The speed is also slow when I always draw the same tiles.
    Can you tell me how I can create a big bitmap from small patterns? I want to test it.

  4. #4

    Storing a tiled map

    Well, you'll have to write image data onto TAGFImage either using Pixels property or locking/unlocking the specified texture. Still, I wouldn't recommend it... it's just a waste of video memory. For reference, how big tiles are you rendering? What texture format and video mode do you use? I'm sure you're having a performance hit somewhere... for our project we used to render 32x32 tiles and it ran pretty fast... what's the FPS of Water example supplied with PowerDraw?

    - Lifepower

  5. #5

    Storing a tiled map

    The water example has 280 FPS.
    All the tiles have the size 32x32 and my resolution is 1024x768 with 16 bit.
    The texture format is D3DFMT_A8R8G8B8.
    In my game you can zoom from 50% up to 200%.
    But when scale < 70 or 80% the FPS go down fast. Before I used bigger tiles(64x64) and the game ran much faster. So I thought a big image would solve the problem.

    If you have time, you can download the game with soure code on
    http://mitglied.lycos.de/crazyhunter...oad/cobal4.ace
    The Engine is in the unit UPowerDrawEngine.
    Thanks for your help so far!

  6. #6

    Storing a tiled map

    Ok, I've solved the problem. Thanks for your help!
    When I draw the same tiles successively, FPS ist still fast enough when I scale the map down.

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
  •