Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Poya

Background Terrain loading from HDD

This topic is 6010 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello I apologise if this has been asked before but I couldn''t find anything by searching this forum. I have already been able to implement a normal heightmap based ROAMing terrain. The problem is for that very large games (eg MMOs) there is not enough RAM on an average comuter to hold a very massive terrain and so I thought I could do dynamic loading, ie as the player moves I load extra amounts of the terrain and destroy the part the player is too far away from I a bit confused about how to approach this. My terrain consists of patches, each of which is 16x16 vertices. I though I could check the patch the player is at, and if it''s closer to one side I load an extra stip of patches in that direction. But this could be very slow (or could it?) Any suggestions which you may have, or any sources which you can refer me to on this topic is greatly appreciated. Thanks

Share this post


Link to post
Share on other sites
Advertisement
I was toying around with this idea for a 2d engine, but I''m sure you can extend it to a 3d engine. What you need to do is break up your huge terrain into smaller chunks. Keep track of which chunk the player is in, and then only draw the chunks that are currently visible. If your chunks are large enough, you could just do that by drawing the chunks that connect to the one that the player is in. Once the player moves to another chunk, update the chunks that are being drawn.

Share this post


Link to post
Share on other sites
I was thinking along the same lines. The problem I thought I would face is this: there will be certain ''lines'' on the map where if the player crosses is it a new chunk of terrain will be loaded, right? So what happens if the player accidentally keeps walking across or over that line. Two chunks of the terrain would keep getting loaded and destroyed and this might kill performance. I hope I explained myself well.

Share this post


Link to post
Share on other sites
If you use my approach, the current chunk the player is on will be surrounded by other chunks on all sides that are already loaded. Once a play moves into another chunk, you then load up all the chunks that are around that one that arn''t already loaded. If your chunks are large enough, the player should never get to a place where something isn''t ready to be shown.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!