Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Storing a massive world

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

I am designing a huge world that simply cannot be represented by any one .MPA or 3DS file. The closest thing I can compare it to is a full city (with suburbs and stuff, not just the downtown area). I want to have a full spectrum of detail for everything. For example, I want users to be able to walk into stores and down every street and such. This will be a massive undertaking. My main problem is that I have no idea how to store all of this data. Issue #1 - Flexibility - I want the world to be flexable, so the user only downloads the things they want to experience. For example, they could download storefronts and streets, but they don''t need to download the store-interior package. If they are missing a package while playing a game, they will be informed that they need to download package X to explore that section of the universe, but the game won''t just stop and crash and die because something is missing. The user could still explore the city even though they didn''t download the zoo or amusement park package. Of course, this flexibility would be recursive. Going back to the zoo example, you could have the zoo package. Within this zoo package, you could have the outdoor stuff, plus the interior of the reptile house, or the interior of the bird house, or the interior of the gorilla house. Within these houses, you could have even more sub-packages consisting of movies, exhibits, and whatnot. Issue #2 - Portals - Since this world is going to be both indoors and outdoors, I am torn between two design models. I have considered using portals, but that would make outdoor environments very tricky. My other option is to have sectors and manually define which objects or other sectors are visible from the source sector. For example, if you''re on the highway, you would see upcoming segments of the highway, the adjacent trees, and tall buildings. The trees and details would be part of the sector, but the tall buildings would not. I am leaning toward the zone-based system. It might lead to a little overkill in terms of drawing too much stuff, but it is much easier to implement and more flexible. Issue #3 - Cross-Sector Animations - Animating things within a sector are simple. But how would I animate something that traverses different sectors? Do I make every control point relative to one sector, or are they all relative to the sector that the point lies in? Or, as a worst case scenario (because the world is so big), make every control point relative to some single point in the world. Since the world is so large, that would be inefficient because the variables for each vertex would have to be pretty large. Issue #4 - Data Storage - Since my world is so large, I have considered using a database system (embedded MySQL)for most of the data (everything but movies, textures, and sounds). People would have to import the data into their own respective database when they added a new package. Another option is to use XML files for each sector. However, this becomes ugly when you have things which cross sectors and you need to reference another random XML file. I will likely use XML for my development environment (when my team and other internet users will be developing the world), but I am leaning towards using a simple DB for the end-user''s data. Your thoughts on the matters?

Share this post

Link to post
Share on other sites
Dude we are pointing exactly the same stuff and i can tell you that a city can simply not be stored in one file.There shoud be a lot of stuff,many different systems,traffic light stuff and many THOUSANDS other things.I can see some of the things in my head for example schemes for traffic,basic action(or pressure) area scripts and etc. but it''s too much to handle!Now to the point.Portals?Hmmm...bad idea for a city.Better use quad-tree to optimize the outdoors and BSP for the indoors(it''s faster).Flexibility?Bad idea too if you allow the user to make dirrect mods over your city.Better add a mod options.Data storage?Simply be creative :d!

"You losers better learn...NOONE CONTROLS OUR GOD DAMN LIFE!!!" - MANOWAR

Share this post

Link to post
Share on other sites
For Issue #1, just use collision detection at doors/boundaries that stop the player from going inside a place he doesn''t have textures for. Or, check for packages at startup, and ''shut'' the doors graphically so they can''t be entered.

Share this post

Link to post
Share on other sites
Idea for issue #3:
How about a hierarchical tree of control points? You have a global coordinate system, then each sector has it''s own coordinate system relative to the global one, and each subsector has it''s system relative to the parent sector, ... up to the animated entities.

When crossing an inter-sector boundary, the entity''s point in the new sector is computed, and switched under the new relative parent control point in the tree.

Share this post

Link to post
Share on other sites
Mihail121: Heh. I think you're taking the city example a little too far. For the most part, my world will be very static. I won't be worrying about problems like traffic patterns and things like that.

I also don't think I ever suggested that the world be in one single file. It might be in one database (depending on which direction I take), but it definately won't be in one file (if I go with the individual files).

I might use quadtrees, but that removes the flexibility that I am looking for. I don't want to have to recompute the entire world every time something gets added or changed. I'm looking for more of a crude or "on the fly" method (such as the user-specified visibility).

This is why I am considering the sector-based method. I am also thinking about adding portals to connect the interiors with exteriors.

Honestly, items in my world won't be changing that frequently. I just want people to be able to add or enhance things whenever they want. My world will be a recreation of a famous place, so it's not going to be based on somebodys imaginary world. Since it's based on a real place, I can (and will) have other internet users contribute to this world and it will all eventually piece together.

Squalion: That's the approach I was considering. If something in the world doesn't exist, I could have a fake construction wall or something similar to block the user's path.

Jedyte: I like that idea. That was actually similar to one of my original ideas, but I forgot about it later in the design process. Haha

Using a heirarchal system, objects can be moved without effecting the whole world. If I wanted to move a plant, for example, I would only have to look at the data file for the sector or sub-world instead of some other file.

This brings me to another problem. Where would I store these animations? Would they be stored in the data file for the nearest common parent? For example, if I had an airline flight from Boston to Los Angeles, would the animation data be stored in the the United States (since the US is the next parent that contains the full path)? Also, how do the other sectors in the animation's path know to render the animation? I imagine that I'd loop through the animations to see if they cross through other sectors.

Whew. This is quite an undertaking. Haha

[edited by - dunkelhelmut on July 28, 2003 2:15:24 PM]

Share this post

Link to post
Share on other sites
Have you considered trying to implement a Dungeon Siege-eque engine? (Streaming the appropriate data in as you walk from one region to another, etc.) Scott Bilas has several interesting articles on doing this over at his site.

-Odd the Hermit

Share this post

Link to post
Share on other sites
My thoughts:

Issue 1:
Flexibility is nice, but too much and it creates a nightmare for players. For example, if I started with the downtown area, and only had to download 10 suburbs, no problem. But if I had to download 50 office buildings, 200 houses, 1000 people meshes, 200 cars, etc I''m going to start looking for something else to play. On the other hand, if the downloads were like a bank ATM, or a coke machine, which the engine spread randomly around the city, then cool!

Issue 2:
I''d divide it into sectors (fits into my answer for issue 3 below). In reality, except for the downtown skyline, only the adjacent sectors will be visible in a 360 degree rotation. Cut it down to facing direction, and you''ll only need the current sector, the one in front of you, and the two on either side of that one.

Issue 3:
Why not look at something like a street directory? They''re easy to use. For example, your objects could be setup to show in sector/x-axis/y-axis (similar to the page/across/down of a street directory).

Issue 4:
I''d do a database in this format (top-down)
1. City database
- Sectors in city
- Population
- Centre sector (or downtown if you wish)
- Port sector
- Airport sector
- Bus depot
- etc

2. Sector database
- Sector number
- Suburb sector belongs to
- Population of sector
- Adjacent sectors
- General type of sector (downtown, residential, industrial, rural)

3. (x, y) location
- Layer 1 object (building, road, park, etc)
- Layer 2 objects (people, cars, dogs)

My thoughts anyways.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!