thinking about a world

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

thinking about a world

Post by bitplane »

got a crazy idea here...

The idea is to have an outrageously large world streamed from disk at run time, with LOD culling done by some kind of tree (inspired by quadtree node). The tree starts with say a grid of 8by8 nodes which adds X nodes inside it as you approach and removes them as you retreat. Each node has a place in a database where it grabs its list of item parameters, which are then passed (along with current lod) to some user implemented generator function for construction. if something already exists in the scene then the lower LOD gets hidden, the current node pushes it to a stack and pops/shows it on destruction.

Firsly, whats a realistic number for X? I'm assuming that 4 would be right for a binary tree in two dimensions.

Next up is the database. I was originally thinking of using the filesystem but I don't think people would appriciate the half a million folders on their hard drives, most of them unused. I could do one file for each level of detail, but then there's the ever-growing/fragmenting database problem when you move stuff around. Is this a textbook classic of when to use a proper database? Is it even doable? And if so, in what? and has anyone got any db design tips for this kind of layout?

What I really want is a world where the plants grow and the seasons change, where you can plant seeds and harvest crops, where hundreds of agents are accessing and changing the database, paths gets trodden down in the grass, and if you leave your best armor in a damp place it's gonna rust. maybe thats a few years off, but hey, we can all dream right?

anyway, ideas, flames, answers below please :)
zenoid
Posts: 40
Joined: Wed Jul 20, 2005 1:16 pm
Location: france
Contact:

Post by zenoid »

I've dreamt about such thing but I would never start thinking about how to implement that. It's wonderfull you did. I'am on a way to build a sim for tractors and forest vehicles using newton but the fact is that I certainly won't have terrific graphic outdoor scenes and management. LOD is not yet implemented nether terrain tiling. I sadly don't have a relevant C++ skill today to help you define such a thing but I hope this project can be started.
Guest

Post by Guest »

There's something on the way that can do this. I read it in a copy of Edge magazine sometime this summer. Don't remember the name offhand but i think it was a scandinavian company. Will have a search around and if i find the name will post back here :)

But that truly is the future, a world that changes of it's own accord around you.

It's all about procedural modelling I think.

Ben
sRc
Posts: 431
Joined: Thu Jul 28, 2005 1:44 am
Location: Salt Lake City, Utah
Contact:

Post by sRc »

ahh dangit what was the name of that game thats like that....

bah i cant remember now
terefang
Posts: 48
Joined: Tue Jun 21, 2005 9:56 am

Post by terefang »

with a little creative common sense that may actually be possible,
but you may have to solve a number of problems first to realize
your "zoned/sectionized" world-rendering.

ok, lets say that your "world" is roughly earth sized (~42000km
circumference) and round this to 2^16 (=65536km).

since you can't possible model each and every part of your world (unless
using render-monkeys), you have to use some (fractal) world-generator
which produces a sizable heightfield. lets pretend such a soft outputs a map
of 1024x1024 "zones" (=2^10; so each zone is 2^6=64 km).

lets divide each "zone" into 64x64 "sections", so each "section" is 1x1km.

since 1x1km terrains are too large, lets divide each section into 64x64 "tiles"
and fudge "1km" to have "1024m" (again 2^10) which means that each
tile comes up nicely as 16x16m (=2^4; Neverwinter Nights used 10x10m
tiles).

to simplify everything lets say that we use 32bit integer world-coordinates.

if we add up all the bits of the previous assumptions (10+6+6+4=26), we
have a resolution of 2^6 left (thats 1/64 meters) which is enough for
low-poly modeling.

now the problems start appearing:

* irrlicht coordinates are in 32bit floats, which have only a resolution of 24bit.

lets circumvent this by using "zoning-code" using our already established
"zones" from above, so we need only 22bit resolution in each zone.

* how far can someone see in a clear atmosphere?

5129m (assuming a human-sized viewer on earth) -- that means we need to show around 11x11 sections at a time (in variing LOD).

... etc ... etc ...

you may interpolate from that further :).
terefang
nVidia 7800GT/256, AMD64-X2 4k2, Latest Fedora/CentOS
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Okay, I've given this some thought. I'm not planning on making a complete spherical world, just somewhere I can grow my plants, cities, etc.

I've squirted out a little demo, everything is random at the moment and levels of detail don't overwrite each other yet (like the mountains can't become mesh). Next step is a database that holds the position of everything and loads it on the fly, then an editor that writes to the database and works out the lod stuff for forrests, tiles terrains, etc :/

what i'd like it to look like-
Image

more realisticly it'll look like this-
Image

source and exe to demo here: plantlod.zip (messy, half finished!)

and a video in case you can't get it working plantvid1.avi (4.1mb)
Guest

Post by Guest »

It looks alright i guess... I dont see why you need irrlicht or any 3d engine if you want it to like like that though...

from,
my dad says I cant give out my name
Guest

Post by Guest »

MrPotatoes
Posts: 38
Joined: Mon Nov 07, 2005 5:55 am

Post by MrPotatoes »

i'm not gonna start this yet but i planned on doing something very similar to what you are asking. mind you i have no idea how this is going to work tho lol

i also planned to use SQL Lite as my in-memory database. databases are fast as hell and this one is done is C++ so it's of great use. if only there were tutorials being done that i could use to make the SQL Database on my own. that would be even better but SQL Lite is pretty small anyway and will be of a great help

terefang brings up a good point tho. but i dont plan on making the actual world so there is no need to make a world. but making something huge like a city that is incredibly detailed it would be awesome to have the world streaming and no load times for anything that you do or anywhere that you go. for example. it would be awesome to have normal mapped bricks on the building and bumpmapped concrete surrounding that building. this is for every building and you gotta rememeber that alot of these textures are gonna be repeated. so say you have all of NYC and all the boros (that's frikkin' huge) and you can go into most of the main buildings or we'll say for the sake of argument all of them then it would be awesome to have streaming no loadtimes worlds.

would be cool and i'm going to attept it after i get my other things done. because i need to do a real maya loader
Joe_Oliveri
Posts: 448
Joined: Tue Oct 05, 2004 3:24 am
Location: Boston, MA

Post by Joe_Oliveri »

Very interesting I would like to know more... I look forward to seeing more out of this. :)
Irrlicht Moderator || Game Designer
Learn the basics at </dream.in.code>
MrPotatoes
Posts: 38
Joined: Mon Nov 07, 2005 5:55 am

Post by MrPotatoes »

i personally think that it's a great idea. and i have no idea how to do it. but i want to give it a try.

a no loading times games would be frikkin awesome.

i'm seriously going to try this after i get all the other things working first. haven't done 3D game Programming in forever
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

I've been playing around with seamless worlds like this for a while.

http://irrforge.org/index.php/Seamless_World

Basically, I followed the Asheron's Call system of landblocks (LB). A landblock is a 255x255 square. These squares are pasted together into a 1024x1024 world.

Basically, the LB the player was on and one LB away would be loaded in high detail - Players, small foliage, detailed buildings, etc.. Then 2 to 3 would be medium detail - trees, buidings, large statues, etc.. 4 to 9 spaces out were low detail - terrain, low detail of buildings, very large objects.

That way, the load of loading was staggered by distance. Terrain - Large Objects - Small Objects - Detailed object.

All of this detail was stored in one big package and read from at usage.

The last time I played around with this, I had made a piece-meal world where each landblock was it's own ms3d model named after it's world location. When the player hit the edge of a landblock, the previous blocks would be removed and the new ones would be added.

As far as using a db versus tons of files. If you got the DB route, be sure it doesn't use any external drivers or subsystem whatsoever. I can't believe the headaches I had using a Microsoft Access DB to store spawn locations with NAVI 3. For some reason, some people uninstalled parts of DAO or some bad installation destroyed Microsoft's drivers, and even to the point that newer drivers weren't loadable on the machine.
Crud, how do I do this again?
Post Reply