Create an huge world

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Innopeor
Posts: 27
Joined: Wed Aug 20, 2008 5:28 pm

Create an huge world

Post by Innopeor »

Hi, i would know if is possible create a very huge world (realistic dimensions) like this http://www.youtube.com/watch?v=DCzDKj3hjOE .
If yes which method you suggest me to use? I tried adding some huge spheres and adjusting camera visibility with setfarvalue, but it have some limitations and mesh disappear after a definited distance.

Thanks, and pardon my English.

PS. I already searched on this forum, but i didn't found nothing relative to this question.
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Re: Create an huge world

Post by MasterGod »

Innopeor wrote:PS. I already searched on this forum, but i didn't found nothing relative to this question.
Hello.
So search more! I know myself at least two threads I've been reading not long ago discussing that exact issue (with solutions too).
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Innopeor
Posts: 27
Joined: Wed Aug 20, 2008 5:28 pm

Post by Innopeor »

Thanks for the reply.
With a total of 191134 articles i continue to get "No topics or posts met your search criteria". Please, if i don't ask much, could you show me the link with the possible solution?
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

I get 135 matches, searching for "tiled AND terrain" (without the quotes).

Edit:
now 136 ;)
"Whoops..."
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

What you're asking for, Innopeor, is a pretty tall order. Seamless world to terrain transition is not an easy task, which is one reason that it is the main selling point of that game probably. I recommend you start with something smaller.

And I remember the two topics in question that referenced this as well, but for some reason can not find them either. Using the search function and actually getting something useful is an acquired art. So I don't blame you for not being able to find it Innopeor. :D
TheQuestion = 2B || !2B
Innopeor
Posts: 27
Joined: Wed Aug 20, 2008 5:28 pm

Post by Innopeor »

randomMesh wrote:I get 135 matches, searching for "tiled AND terrain" (without the quotes).

Edit:
now 136 ;)
Hi again, well Arras tiled terrain is not exactly the same thing, i already tried it with (2524 svn revision) and looks fine.. just it is "tiled" and not "infinite".
Halifax wrote:Seamless world to terrain transition is not an easy task, which is one reason that it is the main selling point of that game probably
Oh man, i asked the moon :)
Well, realizing that make something like this would be a sort of hell in Irrlicht, i'll find another way to do it.

Thanks guys for the explanations.
Frank Dodd
Posts: 208
Joined: Sun Apr 02, 2006 9:20 pm

Post by Frank Dodd »

I'm not sure how many are solutions though. The infinity engine is very good at what it does, providing a seamless transition from high quality space body to high quality terrain is a very difficult proposition.

You could use a spherical planetary model and then transition to a flat paged terrain perhaps while moving through clouds, or simply accept the transition effect as a visual glitch.

I have played about with spherical terrains myself and implemented an extremely simple one based around multiple spherically distorted terrain objects. It actually works pretty well but supplies nothing like the incredible detail in the Infinity engine.

Some terms I would search for would be "page terrain" "sphere terrain" "spherical terrain" "Chunked LOD" "ROAM"
Innopeor
Posts: 27
Joined: Wed Aug 20, 2008 5:28 pm

Post by Innopeor »

Frank Dodd wrote:I'm not sure how many are solutions though. The infinity engine is very good at what it does, providing a seamless transition from high quality space body to high quality terrain is a very difficult proposition.

You could use a spherical planetary model and then transition to a flat paged terrain perhaps while moving through clouds, or simply accept the transition effect as a visual glitch.

I have played about with spherical terrains myself and implemented an extremely simple one based around multiple spherically distorted terrain objects. It actually works pretty well but supplies nothing like the incredible detail in the Infinity engine.

Some terms I would search for would be "page terrain" "sphere terrain" "spherical terrain" "Chunked LOD" "ROAM"
Oh, i'll be happy also if my sphere mesh (size more than 1000000.0f) will be visible with the maximum possible far value. Btw thanks for the suggest, i do my fourth research in the forum (now i have new keywords to try for happiness of this mySQL database :P).
zillion42
Posts: 324
Joined: Wed Aug 29, 2007 12:32 am
Location: Hamburg, Germany

Post by zillion42 »

hmm, without reading much, that's right down my alley. I'm doing a 0.000001 irrlicht units up to 1000000 irrlicht units solar system simulation and I'm really striving for more precision in 32 bit numbers and numerical stability. Second time today someone mentions my problems in detail. Anyways if you find a good solution please share the code...
EDIT:
My thread on the topic is here:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=33849
And found this link from BlindSide a really good introdudtion on the topic:
http://www.drizzle.com/~scottb/gdc/continuous-world.htm
EDIT2:
to spare you from reading it all, this is the important part:
The Precision Issue

From the beginning, the engineering team knew that the continuous world was going to significantly affect the engine and content design, and the core issue was numerical stability. Imagine two characters walking in formation two meters apart heading east away from the origin. At some point, the distance from each other is overwhelmed by the distance from the origin, and the characters will appear to be “at the same location”.

With floating point, the further you get from the origin, the more precision you lose, which can cause all manner of nasty problems. Things don’t sort right, cracks appear between adjacent meshes, space starts to quantize, and cats and dogs start living together. Dungeon Siege uses the FPU in single precision mode for the obvious performance benefits, and to match the native precision of the video hardware. However, even if we increased the precision, it ultimately could never solve the problem because the world was planned to be, and ended up, incredibly large.

The precision problem meant it would not be possible to have a unified world coordinate space like most other games. Instead, the solution was to segment the continuous world into a set of independent coordinate spaces, and switch among them periodically to reset the precision. A variety of ideas were tried out within these constraints, and we eventually settled on a variation of a standard portal system.

Our solution consists of a relational node-based coordinate system, in which each chunk of geometry (Siege Node) has its own coordinate space, and is linked spatially to neighboring geometry via the doors it shares in common with those neighbors. The arrangement of nodes connected by doors forms a continuous graph that represents the entire world map. This node system evolved over time from its original goal of maintaining FPU precision to become the primary method of efficiently subdividing space, and the root of countless optimizations.

In order to encapsulate the concept of a 3D position relative to a specific node, the traditional (x,y,z) vector had to be augmented with a node ID (x,y,z,node) and represent an offset from the origin of a specific node instead. This 4-tuple is encapsulated as a Siege Node Position, or SiegePos. Later on, we added a SiegeRot (quaternion,node) in order to handle comparisons between orientations across nodes.

The phrase “there is no world space” became a mantra to the team, although it literally took years for everyone to fully grok what it meant.
and edit3:
my attempts so far have not been motivated enough since I have to change a lot of things everywhere in my code, so it's going to be a lot of work to make everything work again. However, I started very simple (as always) and it doesn't work... I'll comment a little for you and paste some code

Code: Select all

void resetWorld()
{
	//It's a solar system enclosed in 
	//a emptySceneNode called world
	world->updateAbsolutePosition();
	closestBody->updateAbsolutePosition();
	
	//In my intended system everytime I'm in proximity of
	//a planet I enter a new 'zone' and reset the origin

	//I'm getting the world position in absolute coordinates
	//and the closest planets position in absolute coordinates
	//and finally subtract to get an offset
	core::vector3df currentOrigin = world->getAbsolutePosition();
	core::vector3df newOrigin = closestBody->getAbsolutePosition();
	core::vector3df offset = currentOrigin - newOrigin;
	
	//I apply the offset to all children of the rootSceneNode
	//(everything which lives in world Space)
	world->setPosition(world->getPosition()+offset);

	flyCam->setPosition(flyCam->getPosition()+offset);
	planetCam->setPosition(planetCam->getPosition()+offset);
	mayaCam->setPosition(mayaCam->getPosition()+offset);
	splitSCam->setPosition(splitSCam->getPosition()+offset);
	
	//and finally update the position of all things which
	//are child of the world node aswell as the world itself
	//since everything happens in the beginning of one
	//frame
	for(u32 i=0; i<planets.size(); i++)
	{
		planets[i]->updateAbsolutePosition();
	}
	
	world->updateAbsolutePosition();
	camPos = flyCam->getAbsolutePosition();
}
and edit4 @ kryton9
unfortunately MasterGod is right, there's a lot of threads about the topic, the problem is not really the solutions (there have been people who were successful) but really understanding the problem which is a requirement to finding your own solution.
Besides your post does absolutely nothing it:
only adds a bad feel to the forums.
Last edited by zillion42 on Thu Jul 30, 2009 2:54 am, edited 4 times in total.
kryton9
Posts: 20
Joined: Sun Feb 22, 2009 7:26 pm

Re: Create an huge world

Post by kryton9 »

MasterGod wrote:
Innopeor wrote:PS. I already searched on this forum, but i didn't found nothing relative to this question.
Hello.
So search more! I know myself at least two threads I've been reading not long ago discussing that exact issue (with solutions too).
I have seen many good questions asked so far on the forums and unfortunately many answers like this. It does nothing to help the questioner and only adds a bad feel to the forums.

The forum answers like this don't reflect well on Irrlicht itself.

It is easy enough to just ignore a post you feel is not worthy of an answer instead of giving a snippy response.

I always look for a replacement for irrlicht because of hating to read these forums for answers.
Innopeor
Posts: 27
Joined: Wed Aug 20, 2008 5:28 pm

Post by Innopeor »

zillion42 wrote:hmm, without reading much, that's right down my alley. I'm doing a 0.000001 irrlicht units up to 1000000 irrlicht units solar system simulation and I'm really striving for more precision in 32 bit numbers and numerical stability. Second time today someone mentions my problems in detail. Anyways if you find a good solution please share the code...
I tried the code but "there is no world space" :p
Apart kidding, very thanks for this useful stuff. I was to realize something of really wrong, like calculating the distance between camera and big object plus an autoscale of it, but i'm just a beginner for now so everything looks a bit complex.
Lil Margin
Posts: 212
Joined: Sun Jul 19, 2009 4:24 am
Location: Netherlands Antilles, Curacao

Post by Lil Margin »

I always look for a replacement for irrlicht because of hating to read these forums for answers.
Welcome to the internet!, you get those replies on all types of forum so a replacement will get you the same results.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Create an huge world

Post by hybrid »

kryton9 wrote:
MasterGod wrote:
Innopeor wrote:PS. I already searched on this forum, but i didn't found nothing relative to this question.
Hello.
So search more! I know myself at least two threads I've been reading not long ago discussing that exact issue (with solutions too).
I have seen many good questions asked so far on the forums and unfortunately many answers like this. It does nothing to help the questioner and only adds a bad feel to the forums.

The forum answers like this don't reflect well on Irrlicht itself.

It is easy enough to just ignore a post you feel is not worthy of an answer instead of giving a snippy response.

I always look for a replacement for irrlicht because of hating to read these forums for answers.
It's also a good idea to post some more than just a link to someone else's video. Maybe some code that shows a little effort towards solving this problem. Or an exact description of what seems to be the actual problem of the task, and what could be easily programmed with existing means. It's really easy to post a rather generic question and hope to get all the work done by someone else (don't know if this was actually the case here, I'm speaking in general). The better the questions, the better the answers. And as Lil said, you can always have people posting this kind of answers, whatever well asked question you did. Though, in this case the question was far from perfect...
cr33
Posts: 22
Joined: Fri Mar 27, 2009 3:37 pm

Post by cr33 »

if you go to forums of this InfinityEngine/Game/Prototype, the InfinityAdmin has been posting regular updates with explaination on how things work. I mean, I haven't read all of those, but you might found there information about how he generates terrain procedurally... :P
ariejan
Posts: 28
Joined: Fri Jul 24, 2009 6:14 pm
Location: Eindhoven, Netherlands
Contact:

Post by ariejan »

If you were to code your own large world with IrrLicht you should consider the word 'streaming'.

Basically the player is at location X, so, you only need to have terrain for a radius of Y tiles around position X. The rest of your map can be ignored.

When the players moves you'll need to unload tiles that leave the player's radius, and load new nodes when they enter it.

This is not easy, but it's how it's done. Games like World of Warcraft use the same technique.
Post Reply