Outdoor world with infinite "cells".....how?

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
Quinnx
Posts: 9
Joined: Thu Dec 16, 2010 4:17 am

Outdoor world with infinite "cells".....how?

Post by Quinnx »

Currently I'm working on a project and I'm having a hard time figuring out how I can create a "seamless" outdoor world.

What I have thought:
Using an empty scene node for the game world as a whole called "World", and then creating an infinite gird of "cells" which are tide with another empty scene node and is a child of the World node.

There's a cell at 0,0 (default) then cells around that, each side, and corner. It makes 8 cells. Expands beyond that to 16 cells, so on and so forth, infinitely, but only so many cells are active at a time around the players position. (variable for high/low system specs).

Say a player is in Cell [0,0], then moves to cell[-1,-1], and we are only going out from the players position one....."layer of cells" away for discussion sake. Then all "positive" cells are deactived (or deleted after being saved), and new cells activated beyond -1. -2.

I know this method would take an infinite amount of memory...so to shrink it as small as possible that I know of..is to "save" each cell encountered externally. if the player enters a cell never created before, more cells are made, and saved.

The elder scrolls series world's are based on this idea......but I don't even know where to being code wise for the cells.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Simplify your problem.

You have one cell. That cell may have 8 or 27 neighbour cells (2D cells, or 3D cells).

The simplest thing is to consider the position of the player, and move around the cells, enabling (rendering, loading...) only those which are close enough, iterating through the neighbours if needed, and unloading/not considering those far. Simply keep a trace of the neighbours of each cell, act accordingly to the cell you are currently on, and you should be done. That's a rough idea.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Fury.
Posts: 25
Joined: Mon Dec 20, 2010 2:03 pm

Post by Fury. »

just look up for eden terra forming or for shangrilla world editor. they are in developing but free. ;-)
Post Reply