Sign in to follow this  
azjerei

Is this wise?

Recommended Posts

azjerei    100
Would this be a wise layout for a 3D game using OpenGL? The game world is constructed from several objects. When the game starts, the bounding box extents for each of those objects is read from a file. Each frame, there is a distance check between the player position and each object's bounding box. Those objects within distance are then dynamically loaded and rendered, the rest remain unloaded and unrendered. I have no clue as to how effective or uneffective this would be. All I know is that it is a complex procedure. Would I be better off just keeping the entire level in memory instead of dynamically loading the parts I want to draw?

Share this post


Link to post
Share on other sites
markr    1692
If the level fits in memory, keep it in memory.

Sounds like manually paging bits in/out is premature optimisation. So unless you are likely to have 1 zillion objects, don't.

Even if your level is too large for memory, you can probably break it up into distinct zones of which only a few need to be loaded at a time (say the one the player's in and all adjacent ones).

If the level is small(ish) and doesn't fit in memory, your designers have made it much too detailed :) . If your level is huge and doesn't fit in memory, you can break it up.

Mark

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this