XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

out of memory

Last post 2/18/2009 9:05 PM by Deej. 3 replies.
  • 2/16/2009 7:38 PM

    out of memory


      hey guys how slow would it be to run a game of the drive using text files ect.(computer game).problem is i have a huge world and i want to store some/most of the data in text files our some other type of file.if i multithread would i be able to do it fast enough that you wouldn't notice it?what are the disadvantages of this?the game is a basic 2d type game,it just needs a lot of memory.am i barking up the wrong tree?any suggestions?
  • 2/18/2009 9:16 AM In reply to

    Re: out of memory

    Well, any large game world will contain far too much data to be loaded entirely in RAM on a typical computer, and most certainly too much for a console system.  Take World of Warcraft, for instance, which has over 12GB of models, textures, sounds, and other data.  They have no choice but to break it up into logical chunks that can be loaded on-demand.

    So, you're definitely not barking up the wrong tree.  Though, you are barking up a very, very tall tree that will be difficult to climb.  This is not an easy problem that we're talking about.  There is an entire sub-science to resource management.

    But there are other ways of reducing your memory requirements that you may not have considered.  For example, any object that doesn't need to hold state information will only require one working instance.  Models, sounds, and textures fall into this category.  The instances of these objects can be referenced rather than copied.

    It's also sometimes possible to create a description of everything that's needed in a level or world, and then dynamically create and destroy objects for everything that's visible.  Though creating and destroying objects is often very expensive, so it's common practice to "pool" these reusable objects.

    Hopefully that gives you a couple ideas. :)


  • 2/18/2009 9:46 AM In reply to

    Re: out of memory

    The simple way to make and store a large world is XML. You can parse it easily and edit it easily too !

    You can make an editor with a system that save all the object position you need in a XML in respect of a special tree.
    So you can parse it in your game and load needed objects in fonction of the player's position.

    It's called streaming ! Object far behind the player are destroyed, and object near the player are loaded.

    Maldus.

  • 2/18/2009 9:05 PM In reply to
    • (920)
    • premium membership
    • Posts 394

    Re: out of memory

    Icarus redux2:

      hey guys how slow would it be to run a game of the drive using text files ect.(computer game).problem is i have a huge world and i want to store some/most of the data in text files our some other type of file.if i multithread would i be able to do it fast enough that you wouldn't notice it?what are the disadvantages of this?the game is a basic 2d type game,it just needs a lot of memory.am i barking up the wrong tree?any suggestions?


    I'd be very surprised if your game world was really that big. When I was a kid and my older brother was playing Frontier: Elite 2 I was amazed that they could store the data for thousands and thousands of stars systems on a couple of floppy disks. As he rightly pointed out (I was too young to know otherwise) it was the textures and graphics that took up the real space.

    All your files (textures, sprites, models) live on the hard drive, and are loaded into RAM at a time of your choosing.
    Managing Director, Binary Tweed Ltd.

    binarytweed.com New games that're a bit like old games, but better.

    Clover: A Curious Tale - Out now £5.99/$9.99

    Free Blitz 1UP games in return for testing!
Page 1 of 1 (4 items) Previous Next