(Graphic) memory usage

Discussion in 'Game Development (Technical)' started by Gilzu, Aug 14, 2004.

  1. Gilzu

    Moderator Original Member

    Joined:
    Jul 27, 2004
    Messages:
    368
    Likes Received:
    8
    Since i'm porting Goose Chase to 2D from 3D, I decided to take a closer look at how much memory I can allocate for my sprite sheets. I'm interested mostly in performance and hardware support for memory surfaces in DirectDraw3 (tried using the lowest common denominator for win32 systems, so it will run in most systems and in good performance).

    I know that once video memory is full, DirectDraw should use system memory - but i had problems with DX and "should" with Direct3D. Also, I'm about to use a nice sum of memory (about 10-15mb) for my sprite sheets (lots of characters, effects, ect.), so I'm quite worried about performance in older machines.

    Should anyone have experience with memory allocation in platform/other-graphically-rich games, please share :)
     
  2. Mark Fassett

    Moderator Indie Author

    Joined:
    Jul 26, 2004
    Messages:
    541
    Likes Received:
    0
    I don't believe DDraw will manage where your graphic data goes for you. You will have to make those decisions. I don't really understand why you chose DX3 - DX5 is the lowest common denominator for OS's supported by MS, and even that's not going to be the case for too much longer.

    And as far as performance - when Derelict was a DirectDraw game, the best performance I saw out of it was when I put basically everything in system memory, blitted it all to a system memory buffer, and then did one blit of that system memory buffer to the back buffer of the card. If you are going to have that much graphic data, this will likely be the case for you, too, and will also allow support of cards with much lower memory sizes.
     
    #2 Mark Fassett, Aug 14, 2004
    Last edited: Aug 14, 2004
  3. Gilzu

    Moderator Original Member

    Joined:
    Jul 27, 2004
    Messages:
    368
    Likes Received:
    8
    Actually, it is DX5 - its DirectDraw version is 3 :)

    Thanks for the advice, I was worried about system&video card memory managment. What about performance? was it acceptable (especially in older machines) ?
     
  4. Mark Sheeky

    Indie Author

    Joined:
    Aug 7, 2004
    Messages:
    448
    Likes Received:
    0
    Speed is best when blitting from graphics card memory to graphics card memory, and next best when blitting from system to system. On AGP cards the speed at which data can cross from system memory to graphics card memory is also very good, (that is the whole point of AGP cards).

    Most have PC's are AGP now, but DX5 era machines generally aren't, and in that case blitting from system to graphics card memory is slowest of all.

    So for top performance, put everything on the card and make sure the backbuffer is on it too (it generally HAS to be but I think that DirectX will simulate one under some circumstances, specifically in Windowed mode).

    After saying all of that, on a modern machine this is all pretty immaterial. No matter where you put your graphics then it's going to be fast. Unless you're writing specifically for 100mhz PC's with DirectX5 then you can safely forget about memory location and just make sure your program will function if for some reason someone with a 1 or 2Mb graphics card tries to run it.

    Mark
    Cornutopia Games
    http://www.cornutopia.net
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer