# Brift

Member

4

126 Neutral

• Rank
Newbie
1. ## Unity 3d Octree Voxel data structure via recursion

@ Jefferytitan My goal is to create a tree with physical objects at the bottom most level or leaf nodes.  The idea behind voxels is that I will only draw the faces where one block is filled and it's neighboring block is empty.  In this way I'm not drawing lots of extra faces and killing performance.  So the upper part of the tree will be conceptual and the bottom will actually have the mesh and colliders and all.  I'm thinking that I might just keep all of the tree conceptual and instantiate the prefabs separately.   @Slayemin I have read your article, and while it was useful for object collisions what I am working towards is using the octree structure to draw the blocks in the world.   I am actually working on implementing a different kind of voxel that is a triangular prism with equilateral triangles for top and bottom and squares for sides( I have a simple Html5 demo of what I'm trying to do at http://apoidgames.web44.net/wedge.html).  So I won't be able to use the cube prefab or cubic shapes in general.  To accomplish this I have adapted the cubic coordinate system for hexagons from http://www.redblobgames.com/grids/hexagons and made it 3d.  Basically I am replacing the X and Z axes and replacing them with Q, R, and S axes, which I put together another simple 2d demo of at http://apoidgames.web44.net/trigridX.html to show what I mean.  One of the coordinates is redundant, which means I could represent all of the points with only 2 of these axes, but because of this redundancy I have the attribute of for every QRS value the sum of all the values will always equal 0 ( which has some very useful properties). In the end I will have QRSY coordinates. The octree data structure will allow me to create space partitioning on which I would be able to create the world of what I call triblocks.  I could accomplish the same thing using a 4 dimensional array, three dimensions for the XYZ coordinates and 1 more to split each block in half, but I think that an octree would be more efficient way to store the world.   My biggest problem is that my university training has given me a ton of theory and not a lot of practice, so I know enough to know that this would be a good way to do this, and not enough to be able to implement the theory.  So that is why I was looking for some help from someone who has implemented the octree for the purpose of voxel rendering to help me out.  I may end up implementing this in XNA instead since I have tutors here at school who know that system better.  I just don't like the idea of implementing my own collisions and also being so limited as far as what platform this would run on.
2. ## Unity Unity 3d Octree Voxel data structure via recursion

Hi game developers,   I had a question about recursively creating an octree data structure in Unity 3d for the purpose of creating blocky voxel landscape similar to what is found in Minecraft.  Now before you tell me this has been done many times over and I should give up this endeavor I wish to say that I am implementing this as a school project.  My goal is to make an approximately 1024 x 1024 x 256 area of editable blocks by starting out with a 1024 cube and putting in null for the upper cubes in the children.    I tried creating a class that called itself in the start and Unity gives me an error about not being able to create game objects with the new keyword.  My instructors have only used C# in XNA and the solution they provided me with doesn't work in a Unity context.  I know that there are many people who have worked with voxels and octrees inside of Unity, so I humbly request some help getting started.  I am hoping to have a tree that can be referenced by the voxels for things like neighbors and so on.
3. ## Looking for feedback

It was my first big idea that kind of pushed me towards game development, but it hasn't been the only project I have done.  I've been through quite a few programming courses just to get into the computer science program, and a few of those were game development related as well ( they teach XNA in the undergraduate courses).  I understand just how big an undertaking this is, trust me, but I have already put a lot of work into this and I fully plan to continue.  Even if this idea ends up being too much I have learned a ton of great stuff about computer science and I think I'll be better for the effort.
4. ## Looking for feedback

Hi everyone.  I'm new to these forums and thought I would just put out a little about myself.  I'm a 37 year old disabled veteran looking for a change of career, and I'm currently going to school at the University of Colorado at Colorado Springs for a Masters of Computer Science with a game and media focus.  That being said I really feel like a beginner to the whole programming scene ( my Bachelors is in Liberal Arts with a depth in Chinese and Music, long story that).   So I have been working on a Minecraft like with the concept change that the XZ planes are made of equilateral triangles instead of squares.  I have an example that can be seen at http://apoidgames.web44.net/wedge.html (Using webgl and three.js, may take a bit to load and only works on browsers capable of running it).  Unfortunately this code is not optimized in any way and probably should be relegated to the code horrors side of the forums.  The whole game concept that I have been working on can be found at http://hexwars.blogspot.com/ where I started as an idea guy and have worked to flesh out the concept into what I hope is a respectable, well, game concept.   If any of you are so inclined to follow these links and just peruse the page links on my blog to say whether this idea has merit or not I would greatly appreciate it.  Also I would be curious if anyone knows about voxels in general and what might be the steps for creating a voxel engine. I think that is the direction I am looking at going, but I'm not quite sure how to proceed.   Anyway I think I will be spending a bit of time coming up to speed with the other topics in this forum, and I'll even attempt to add to topics if I am able.   Thanks, Brift aka Dave Hardee