Skip to main content
GameDev.net gamedev.net
🔒 Locked

Memory required for map

Started by Mr Grinch Sep 26, 2002 at 2:56 PM 4 replies 250+ views
Original Post
Mr Grinch
Mr Grinch
I''m doing a little sail around in the ocean style game where I generate a 2-dimensional heightmap array for my land. That array is currently made of floats and is 512x826. It runs fine (I have a fixed perspective, so I just draw the area that is visible). However, I believe that array would take like 13.5 megs of memory. Is that acceptable? Currently I just have it pump out what I need in triangle strips each time. If I converted it to vertex arrays, would that be too much? I haven''t done much game programming, so I''m not real sure what''s considered good form. Something like UT2003 must use much more than that, right? Anyway, my map seems to work fine on my linux box w/ 256 megs of memory though. What do you guys think?
tuita
tuita
I don''t think you should have any problems with what you''ve done. Use as much memory as you need. When the computer slows down, then you might start looking at cutting back.

The one possible problem that may occur (I know most people prefer to use arrays for speed), but a single array using up large amounts of storage could cause eventual problems if it is dynamically allocated. Note that an array stores it elements sequentially in memory, which could eventually cause it to ''crash'' into something else or have no room to be created. (Of course, this is only referring to dynamic arrays.)

In the future, you may find it to be more beneficial to use another data structure (BSPtrees, lists etc.)

But basically, if it runs without slowing down, I see no problems.
JuNC
JuNC
Maybe I''m missing something in your post but

512*826*4 = 1691648 bytes, approx 1.5 MB

Even if there is something else you are storing, 13MB doesn''t sound like a horrendous amount, however you must specify minimum system requirements before anyone can possibly make a judgement that it is too much.
Ready4Dis
Ready4Dis
Yeah, your array is ~1.61mb, not 13.6mb. Less than 2mb is perfectly fine for a game.

Billy
davepermen
davepermen
my current header file is 2giga big, still generating..

okay thats just for fun and utterly stupid.. but i had to say it:D

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.