# Open World Object Management

I'm currently creating a system that essentially creates a world at run-time based on a seed I choose. In this system, I made it so that there are certain "chunks" that divide up different sections of the world, and in these sections, I have different meshes that are completely unique to that chunk. Each chunk is also divided into 4 subchunks, which are exactly half the width and height of it's chunk.

The purpose of the chunks and subchunks is so as the player, you could walk around the level, with the current chunk, as well as the adjacent chunks stored into memory with their meshes, and those adjacent chunks, which cannot be seem from where the player is, are loaded, however their meshes are not currently loaded, and as the player moves, the system will load and unload these chunks meshes into memory, that way only the meshes needed to render are loaded in at this time.

Does anyone have any idea on how I should handle my open world objects? A good reference would be something along the lines of Skyrim or World of Warcraft; They have the large terrain in these worlds and they are most definitely not 100% loaded in the game at once, so how would I go about making it that so as you progress through the world, objects are handled with little to no skip?

Thanks a lot for the help in advance, and if there is clarification needed, simply ask.

Edit: Added code showing my AddVerts function, which is used to pass vertex data to the GPU.

// unsigned int* AddVerts(const VertexFormat *pVerts, const unsigned int nNumVerts)
// returns  :   unsigned int*           offset in buffer to where the mesh is located
// ins      :   const VertexFormat*     vertices to pass on to the GPU
//              const unsigned int      number of vertices allocated for the const VertexFormat*
void *buffer = nullptr;
unsigned int nSize = nNumVerts*sizeof(VertexFormat);

if( ( m_unBufferFlags & D3DUSAGE_DYNAMIC ) != 0 )
m_pVertexBuffer->Lock(nVertLocation*sizeof(VertexFormat), nSize, &buffer, D3DLOCK_NOOVERWRITE);
else
m_pVertexBuffer->Lock(nVertLocation*sizeof(VertexFormat), nSize, &buffer, 0);

// copy data to buffer
memcpy(buffer, pVerts, nNumVerts*sizeof(VertexFormat));
m_pVertexBuffer->Unlock();

return &(m_dllOffsets.GetTail()->element);

• you could post some code or add some explanation on how you manage your GPU Buffers, maybe there are some optmisations you can make to reduce the lag – Luis W Aug 12 '13 at 13:55