Running into some octree problem

Started by
4 comments, last by lucky6969b 7 years, 6 months ago

When I finished reworking on my Octree module,

I found one problem.

When I was specifying the origin of the root at 0, 0, 0

and half size of length/2, height/2, width/2

and with a depth of 6

The world is divided into 2,

One is above the ground,

One is under the ground which I don't think I have a use.

So How do I get rid of the lower part of the root octree?

Do I just hard code it, or I can adjust the parameter so that I can start up

from the 0, height/2, 0 instead of 0, 0, 0?

Is this the correct way of doing it?

Thanks

Jack

Advertisement
So How do I get rid of the lower part of the root octree?

Just put the origin at a higher value (y=world.size.y/2).

Or ignore the problem. The empty nodes at the bottom probably don't take up a whole lot of space. Deal with it when you run into any problems with it (likely never).

Don’t ignore it. Ignoring obvious problems leads to at least half of the performance problems we have today.

Either move the origin of the octree as mentioned above or use a better method for the vertical component of the tree.
Octrees are typically not used due to memory constraints and because they are a poor match for the landscapes in most games (hence the problem you are having).

What is typically implemented is a quadtree for the X and Z planes and a stack of flat boxes for the Y (vertical). Dividing the world into vertical slices fits better with actual in-game landscapes and requires very little memory.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Empty nodes in the tree are to be expected, don't subdivide the structure for empty nodes and it shouldn't be an issue.

If your levels are that predictable though you might be using a more complicated structure than you actually need though.

I am looking back in my previous work in trees of voxels now.

They get flood-filled in shorter time.

The voxels are made of squares.

So now I want to group/merge part of it.

I am planning to prune a seed somewhere on the map, and start expanding out

Because the octree (loose tree) counterparts is so slow in cost precomputations.

I am looking into ways to use back voxel tree now

Does anyone know how to merge a tree of voxels in any better ways?

Thanks Mr. Spiro,

The Voxel approach does decrease the number of layers from 44 -> 15

Thanks

Jack

This topic is closed to new replies.

Advertisement