Jump to content
  • Advertisement
Sign in to follow this  
Colossus_1

3d map loader system with RAM handling

This topic is 5390 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

Hi, do you know a game like GTA III or GTA Vice City ? Ok, I would like to know how to implement such a scene loading system. I have 128 MB, sometimes during the game play it pauses some seconds while the engine loads another section of Vice City as soon as I move into while driving. So my question is: are there available some snippets of code to start from ? I would like to implement such a loading system that keeps also "in mind" the available memory. I think BSP are not related to this or they are ? I tried with google but maybe the english keywords I used (I'm italian) are not good. May someone of you share light on this matter ? Thank you, [Edited by - Colossus_1 on October 13, 2004 7:13:20 AM]

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure whether you would be able to find much, as I think this feature is going to be different for every game, and is going to be

One method I can think of is, after you have divided the map into "scenes", or "zones" or whatever, you could make different LOD (Level of Detail) meshes for each scene, with extremely low detail versions available. Note the RAM cost of storing each mesh. You will always want the most detailed mesh for the current scene that the player is inside. When you cross the border, if you don't have the new scene's highest level mesh, calculate how much RAM is free and how much the mesh requires. If it is more than what is available, search through your list of what meshes are currently loaded and decide which ones would be most beneficial (in terms of RAM savings)if you stepped down their LOD-level.

Of course, a single mesh for an entire scene is a bit simplistic, you probably have objects with their own meshes that are unique to a scene, but the general idea is the same.

One thing that you probably would want to do is have scenes overlapping slightly. If they didn't overlap, you could stand on a point at the border, walk left a millimeter, load the new scene, then walk right a millimeter and be forced to load the old scene again. Having a buffer zone means that you would have to walk back a decent distance into the old scene before you have to do another scene loading transition.

Share this post


Link to post
Share on other sites
Aside:
Sorry, that last post is slightly incomplete and I can't seem to get edit to work today with mozilla. I click on edit and it asks me to log in. When I do I go to the forum menu and when I browse back to the message and click on edit again it again asks me to log in.
I do have cookies turned on and this is the first time I have had this problem.

So just ignore the unfinished sentence on the first line.. it would end something like "is going to be deeply integrated into the game or rendering engine"

Share this post


Link to post
Share on other sites
Really thank you for your exaustive reply. I have a line to follow now. Just a question on the different LOD (Level of Detail) meshes for each scene. Are they really needed ? I know GTA uses them but if a scene is visible I will render it, if not I will not render it, right ?

Thank you again for replying,

Share this post


Link to post
Share on other sites
I think he is referring to the times when you can see the next zone ahead of you. Render the zone the player is in, don't render zones the player can't see, and use a lower level of detail for the zones the player can see (but is not inside of).

Share this post


Link to post
Share on other sites
I don't know how applicable this is to a 3D game, but the game Dungeon Siege had quite an innovative game engine that loaded levels on the fly; in fact, one of its design goals was to never display a loading screen.

Depending on the power of the hardware / available storage, you could generate the low-LOD models dynamically, or have them loaded along with the full-featured mesh.
I haven't studied GTA at all, but I've played a bit. Since you can't go from one island to the next without a loading screen, the model for the next island that you see from the one you're on is probably just the loading zone, or the starting point of the island; everything else would be extremely low LOD, or even just be a background.

Share this post


Link to post
Share on other sites
Quote:
Original post by odiousangel
Render the zone the player is in, don't render zones the player can't see, and use a lower level of detail for the zones the player can see (but is not inside of).


So, this is frustum culling right ?

Share this post


Link to post
Share on other sites
Quote:
Original post by Colossus_1
Quote:
Original post by odiousangel
Render the zone the player is in, don't render zones the player can't see, and use a lower level of detail for the zones the player can see (but is not inside of).


So, this is frustum culling right ?


It involves a little frustum culling, but it shouldn't be labled as 'frustum culling'. Not rendering the nodes the player cannot see is a frustum test, but you don't need to test the zone the player is in against the frustum, and frustum culling has nothing to do with LOD.

Share this post


Link to post
Share on other sites
The grid system is really the only way I can think of to achieve it, although you need to have 9 squares loaded at any one time (even if your useing LOD, you still need 9 grid sections loaded).

|A|B|C|
|D|X|E|
|F|H|I|

X is the section the player is currently in and the other 8 sections are also loaded (imgine this somewhere in a huge grid, say 100*100, but with only these 9 sections actually in memory). That way when you get to the very edge of a section and are looking straight out into the next section it'll be there ready and waiting. So when the player moves up you'd unload F, H and I and load the next 3 above A, B and C in. That way when you get near B or cross into it you'll always be able to see that section and you'd never have it just appearing out of nowhere when you entered it. Computers can hold quite a big of data in memory these days so the sections could be quite large. If you make them smaller you'd get better load times but might be able to see the section edges loading/dissapearing. Experiment and find out a good size!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!