Results 1 to 14 of 14

Thread: Graphics Memory Problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    27

    Graphics Memory Problem

    i wander if anyone can help, i am making a map editor for a RTS game, at the moment i am loading each of the 2000 differnt tiles (32x32 pixels per tile) into an array and name each tile according to the tile value in the map file, this way as the map file is processed all the editor has to do it load the same name as what is highlighted in the map file, i did it this way to save it checking other values and it works out much faster. I have had this editor workin 100% in win NT win 2k and win XP but on win 9x and win ME it wont even load half of the 2000 images into the array before it has a memory problem i know nt based operating systems and 9x based systems handle memry differntly but i was wandering if there is a differnt method i could use to load them into the array that will solve my 9x memory problem

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    You have 2000 different tiles?!?! Is there anyway you can group them by type (terrain, structures, natural objects, etc) and only load them when necessary?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    27
    the problem comes when loading the map, if they are already in memory then it loads the map very quick, but with so many variations it will take an age to load all necisary tiles

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Restrict your maps to, say, 100 different tiles. Then, each map can have its own 'tile set'. Then, upon loading a new map, change the tileset and load the tiles.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    27
    it isnt a game i made, its for a game that has already been released by an actual company

  6. #6
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Well, how much space do the tiles take up on the HD then? Are they compressed?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    27
    they are only a couple of meg, but when loaded in 32x32 sections it runs outta mem

  8. #8
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Don't load the tiles all at once; sacrifice a bit of speed and load each tile into memory when it is used, and then destroy it if it is no longer being used.
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    27
    some maps use nearly all 2000 tiles, is there a fster way to load than loadpicture? ill b there for hours otherwise

  10. #10
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    If the tile pictures aren't changing, you can load them into a DLL using the resource editor, and then have a simple function in the DLL that returns a picture based on an ID; it would take some work but not too bad if you write a script to build the .RES file for you.
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    27
    hmm res files might work, can u bitblt image data from, resource files?

  12. #12
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    Originally posted by martynd
    they are only a couple of meg, but when loaded in 32x32 sections it runs outta mem
    How can that be?

  13. #13
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Originally posted by martynd
    hmm res files might work, can u bitblt image data from, resource files?

    No; but you can use LoadResPicture to return a StdPicture just like the LoadPicture function does.
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  14. #14

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    27
    cheers, loading it then using bitblt mite make it a little slower but having it working in the 1st plaec is my main goal

Posting Permissions

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



Click Here to Expand Forum to Full Width