Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Hello I'm a web developer and recently I started reading about game development. I followed some tutorials regarding c++ and openGL (whatever I could find online because as you know not many up to date openGL tutorials exist.)

I keep wondering in a case of a rpg game with a huge real world(map) and entities(enemies what so ever) how could it be implemented. Meaning you cant load a huge map and the entities all at once obviously... I was thinking of subdividing the map into blocks and each block to even smaller ones so that each block contains (5x5) 25 sub-blocks.

A map could be consisted of many blocks such as the following one which has 25 sub-blocks:

P = Players current sub-block O = sarounding sub-blocks X = sub-blocks not yet loaded

Entities will be loaded only for the players current sub-block. Keep in mind that P is not just the player is a mesh a piece of map not very big and not as small as the player is.

X X X X X 
X O O O X
X O P O X
X O O O X
X X X X X

And I'm wondering is this a good approach? I suppose each sub-block has to be a different mesh apparently and then stitch them up together?

CASE 2:

What if I stored the map into 1 big height map or a set of height maps and generate the mesh from that. According to the player's position copy the required image height and width where player is always at the center of it and rearrange the data in the vbo?

I'm sorry if this is a silly question but I simply don't now how to approach this and I can't find any references.Also keep in mind that on such a map animations will also happen.

I would really appreciate it if someone could give some references or explain the architecture for a game such as this.

share|improve this question
    
Are you looking to generate the world procedurally? Do you want an infinite world? –  Erik Jan 21 '13 at 12:35
    
Yes an infinite world that will be consisted of smaller chunks –  Panagiotis George Raditsas Jan 21 '13 at 16:07
add comment

2 Answers

up vote 2 down vote accepted

Scott Bilas of Gas Powered Games wrote a good document about how they implemented a continuous world in dungeon siege.

Paper: The Continuous World of Dungeon Siege

Slides: The Continuous World of Dungeon Siege

share|improve this answer
    
Thank you for the information I'll have a look :) –  Panagiotis George Raditsas Jan 21 '13 at 16:08
add comment

Minecraft is a 3D game with a game world that is extremely large in size (practically infinite). Instead of 3D terrain derived from meshes, the terrain is represented by 3D Cubes. The world is procedurally generated and stored in small chunks, similar to what you described in your first potential solution.

While playing Minecraft, chunks near the player are rendered and updated (including any entities in these chunks), while chunks farther away from the player are saved to the disk and not in memory. While the player travels through the world, saved chunks near the player are loaded into memory from the disk and loaded chunks far from the player are saved to the disk and no longer used. When the player quits the game, all loaded chunks are saved to the disk.

Since individual chunks are relatively small, groups of them are saved to the disk as a single file, labeled "regions". In earlier versions of Minecraft, chunks were saved to the disk as individual files, which were loaded about seven times slower than the region files.

The technical section on the Minecraft wiki has some more information regarding Minecraft's chunks and regions.

share|improve this answer
    
Thank you for the information –  Panagiotis George Raditsas Jan 21 '13 at 15:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.