Question about 3D engines...

Started by
1 comment, last by Max_Payne 19 years, 9 months ago
It seems I cant stay away from programming, Im about to pick up where I left off: building my 3D engine. I am currently able to manipulate models and certain geometry, but I have questions about how things are stored on a larger scale. Lets take a world in a game for instance, like in a game like Dark Age or Everquest. How exactly is the world stored and translated to the client for rendering? I mean all in all, terrain, landscape, buildings etc. Im sure there are many ways to do this, but can someone give me an example so I can have some perspective as to where to start? Thanks! -Noods
Advertisement
in MMPOGs the world is local to every client. the only thing going over the wire is state change stuff. object 1 moved to here. bob activated "Giant Death Storm" etc. you get the whole world on the CD when you buy it. later on your updater tool or game executable will just pull down new data in huge downloads and store it on your HD. they don't stream the world out to clients at runtime. that would slow everything to death.

if you're asking about how are the worlds stored, you'll want to look into spatial partitioning techniques like octrees or quadtrees, and then you can just write that data out to a binary file. one file per level or per zone or whatever. the size of that file will probably be determined by memory constraints. how much memory do you have budgeted for the level data, how much needs to be resident in memory and how much can be "streamed" off the hard drive.

basically to start, you can just throw all your objects into a single file that gets read in at runtime and drawn by your engine. the format of the file will be entirely up to you and what your engine likes.

-me
You can't really ask how "exactly" the levels are stored, because pretty much each game has its own technique.

Yes, the world is usually local. This is because level files usually get quite big, and require external data (models, textures, sounds), which can become a very massive download. However, more and more games allow you to download maps you don't have from the server. This means the first time you connect, if you don't have the map, you can download it, and then load it locally everytime you need to play it.

Some MMORPGs rely on tile based maps. This means that maps are basically made of many small square areas, which each defines some specific geometry. The main map file will simply tell how the tiles are placed, and the geometry for each tile can be stored in several external files (which could be simple model files).

The way the worlds are stored will not necessarily be the same as it is in memory, but FPS games will usually store precomputed tree structures (like BSP trees), in order to improve the loading speed. You can define your own level format depending on what you need, it really depends on what kind of game you want to make, and what you intend to do. A very simple map file could simply be an ASCII text file with a description of all the polygons in your world and a description of each world object. Your world file could also be a text file that specifies a heightmap to load, for terrain, and specifies where to place external model files on that terrain (place a house model at this position, at this angle). Like I said, it really depends on what you want to do.

Looking for a serious game project?
www.xgameproject.com

This topic is closed to new replies.

Advertisement