Archived

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

flying starfish

Very Large World

Recommended Posts

I''ve started doing some preliminary helper coding on a new game engine as a hobby project I''ve been throwing around in my head. My basic idea is as follows: The premise of the game will be that it is set thousands of years in the future on a desolate Earth, so the basic lay of the land is still there but the cities and infrastructure are gone (i.e. lots of natural environments about). My idea is that the player will in some way explore the world about them, which would encompass the entire Earth and dynamically generated ruins etc. What I want to do is use general contour maps of most parts of the Earth and then use random terrain generation to make up the details of areas, as well as some random generation algorithms to place most details and general NPC''s. Specific areas would be defined and then the random terrain would generate out from their edges based on a general set of rules for the surrounding area (i.e. greenery, wasteland etc.) Does anyone have any commentary on how possible this would be to do (bearing in mind many aspects of it are ideas of how general I want the implementation to be). As far as I can tell, most of the problems with the idea are quite solvable (i.e. how to ensure areas stay the same - save them and let them slowly degrade the longer the player is away from them till their wiped clean and due for a refresh). So yeah, what do you all think ? Is this idea feasible / decent frame rateable ? What pitfalls / issues should I be thinking about in implementation? ---- flying starfish

Share this post


Link to post
Share on other sites
Well, in terms of general areas, if you use the same seed, a random generator will always come up with the same numbers in the same order (or you can write your own generator if you want). Since that''s true, then keeping "static" objects randomly generated is relatively simple. From there, you would just have to keep track of differences in any dynamic things on a locational basis. So long as you keep the dynamic set fairly low, you should be fine processor-wise, though I''m not sure how good of an idea using a contour map of earth is (those things are freaking huge. I use them at work.)

-fel

Share this post


Link to post
Share on other sites
I''m working on a similar project, also set in the future. Only, I have decided to abandon random terrain generation instead for havinging everthing stored inside a database. I came to the conclusion that I wanted ultimate control over the environment. I have been working on my own custom database sytem, in which objects are stored in a heirarchial fasion... sort of like a scene graph. Instead of having a single root node of the graph, each square unit of land is a root node. My ultimate goal is to achieve complete state persistance of the environment. Maybe you would be interested in sharing ideas with me in the future?
my AIM s/n is samgzman also.

Share this post


Link to post
Share on other sites
just to throw some data out there, the surface area of the earth is:

10^15 × 0.510 m^2

which, expanded, is:
510,000,000,000,000 m^2

so i don't think you'll be storing any data on contour maps of the earth. given one bit per m^2 (which is much less than you'd actually need, probably) you're already looking at far more storage than you will likely have >> ~510 Terabyes.

my suggestion is that if you're going to be modelling something the size of the earth that you go entirely from randomly generated terrain and not try to actually have the terrain be similar to that of the actual earth (you can use latitude and longitude coordinates as the seeds to generate the respective areas of the terrain or something). the other solution is, of course, to skip the "model the entire earth" aspect and just pick specific regions of the earth to actually model.

so anyway, given the massive size of a planet it's going to be difficult for you to persist information across the entire globe. but i guess that entirely depends on how much you actually want to persist. if you want to persist everything that the player does anywhere on the planet, i'd say no way will you be able to do it given the amount of data you'd need to store. if it's just in a few spots, you can probably do it, but expect to have a massive hard drive (or 10) handy for your storage needs.

-me

[edited by - Palidine on May 26, 2004 1:49:10 PM]

Share this post


Link to post
Share on other sites
I think I was the only one to mention environment state persistance... so let me clairify. While i do want to deal with massive terrains/environments, i never considered something as colossal as the entire planet. My attempt is also, as suggested above, to only deal with regions of a managable size. Perhaps a hundred square miles or so.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Palidine
just to throw some data out there, the surface area of the earth is:

10^15 × 0.510 m^2

which, expanded, is:
510,000,000,000,000 m^2

so i don''t think you''ll be storing any data on contour maps of the earth.


I think he meant to randomly generate the 1-meter details and quite frankly its not easy to find 1-meter terrain data for the earth. There are quite a few 3-meter resources tho, but even those are mostly just satelite images. Likely he meant to store 1km data or larger and generate the smaller details on the fly. Perhaps with some higher detail vector-encoded overlays to incorporate existing rivers and lakes.

Note that the terrain data can be compressed, perhaps to a great degree if hes willing to do so with some estimation (read: lossy compression)

Think about how well a wavelet compressor does on images, reducing a million pixels (a million square kilometers?) into 10k or less with very little overall perceptable data loss. And thats 3 color channels which each could store a different aspect of the earths surface: Height, Climate, and population density.

He could use DCT or Wavelet compression for this for sure. If all he needs are 3 channels of data, then existing algorithms for image compression will do him just fine in this regard.

What he is trying to do is very doable from a technical standpoint. I think however he will spend many months working on the random generation of details. Fix something here and break something there. It can be a vicious cycle. And unless he has the patience to actualy look at every spot on his simulated earth, he will not be sure there arent some very poorly generated areas.

Share this post


Link to post
Share on other sites
quote:
Original post by Palidine
just to throw some data out there, the surface area of the earth is:

10^15 × 0.510 m^2

which, expanded, is:
510,000,000,000,000 m^2

so i don''t think you''ll be storing any data on contour maps of the earth. given one bit per m^2 (which is much less than you''d actually need, probably) you''re already looking at far more storage than you will likely have >> ~510 Terabyes.

[edited by - Palidine on May 26, 2004 1:49:10 PM]


You are forgetting 2 things:

1. compression, so 510 terabytes would be a lot less... still not usefull to put on a DVD and ship to some stores

2. A large part of earth is covered with.... water! do not store that on disk!!!


Are we back in business now?

Share this post


Link to post
Share on other sites
About urban side and AI, once I thought about it but a big issue is that every thing in world does processing on its on all the time. CPU cant process millions things in realtime. GTA3 is not such a huge world but every living thing exist in game only around a region of player, it can''t animate and process all the cars and people in the city.

So how much power a game like sims and simcity combined will take. Where each individual character is doing some thing in the city. So how a single processor is going to move the world?

One idea is to keep every indivual randomly generated it will only be persisted if player interacts with it in a specifed way.

Share this post


Link to post
Share on other sites

I''m trying to develop the way the game is supposed to play to be complementary to the fact that no matter what I definitely can''t store and render the entire Earth + dozens of dynamic objects.

Yes, the plan was to use a reasonable scale for contour maps, and definitely compression of them. The idea is to have a general lay of the land, more then perfect detailing but I think it''d be fun for a player to be able to go somewhere and recognize it.

For dealing with dynamic objects, currently I''m thinking about having a degradation procedure which over game time slowly wipes out old data of the player''s about places they''ve been - i.e. stay away from a town a little while and it hasn''t changed, stay away longer and shop fronts etc will be regenerated when you get back, stay away a long time and it get''s erased to nothing but an entry like "town of size X is here".

----
flying starfish

Share this post


Link to post
Share on other sites
Why would you WANT to use real world data? It''s only from a long way away or at very small scale that the features of Earth will be visible (really if you got coastlines and vegetation right that''t make more difference) and if you are walking on foot you will never get to d=see most things. The planet is just stupidly big for a game because you could play for a century and not visit most of it. I''d recommend setting your game in some part of the eath which is easily recofnisable such as an island group (Japan) or some other area with a natural boundary.

Share this post


Link to post
Share on other sites
quote:

1. compression, so 510 terabytes would be a lot less... still not usefull to put on a DVD and ship to some stores

2. A large part of earth is covered with.... water! do not store that on disk!!!


1. Even with massive compression in the ranks of, say, 99%, you still end up with 5.1 terabytes. Mind you, we''re talking about pretty dang good compression here. 70% would be more like it, but you gotta figure someone would use a custom algorithm made to take advantage of a single, known set of data, anyways.

2. Two thirds. A third of 5.1 terabytes is 1.7 TB.

Even with EXTREMELY optimistic compression rates, this would never fit on a DVD.

Share this post


Link to post
Share on other sites