I wanted to make a 3D game with a hexagonal grid.
The problem is there are only 2D greeds but the 2D hexagons don’t have the depth I need.
anybody knows how can I make a 3D hexagonal grid?
A hexagon is a 2 dimensional shape. In 2D, they fit neatly into each other and allow forming a grid.
In 3D… it depends. There is different ways to have a hexagonal shape in 3D. A hexagonal prism would allow creating a 3D grid, since it’s effectively just the 2D shape extruded into a third dimension.
You cannot have a 3D hexagon made out of hexagons.
The closest thing would be something like a truncated octahedron:
Or something like a Buckyball, which is made of hexagons, but likely is not what you are looking for:
You can use neither of these two as a basis for a 3D grid.
At least not without filling in the gaps with something else.
Just go with the cubes, thank me later.
How can I make hexagonal prism grid?
That’s too broad a question. What is it you actually want to do? What did you try and what are your problems with that? Based on your description, your usecase is not actually clear.
A 3D grid, to me, would be basically a full voxel world made of hexagonal prisms. Which would be a highly advanced topic, unrelated to the chosen voxel shape. For this you would best start by learning about minecraft-type world generation. If you truly understand what’s going on there and implemented one which works, then going from cubes to hexagonal prisms would be a comparably easy translation, involving only a change of shape and some offsets on uneven coordinates.
But you may also just mean a 2D grid containing 3D objects, so mostly a grid for the bottom of your 3D world. Which would be pretty much the same complexity as creating a 2D tile grid, which you implied you already looked into, so im not sure what to help you with.
I meant something like that
like Minecraft’s grid but with Hexagonal prisms instead of cubes. just not auto-generated but custom-made.
Get Blender and make one…
But if ill make a pallet of hexagonal tiles how do I put them? I need a grid to do that
You can create one in Blender, then arrange as many as you want in blender…or put it in Unity and arrange them in Unity. In Blender there is probably ways to do it using arrays or scripting, and in Unity you could also use one prefab and then by code arrange them using its dimensions.
There’s probably a million tutorials on how to do this.
But you might want to ask @koirat why he is saying just use cubes…He may have some insight that will save you some time.
Wait why use cubes insted?
I start to understand, So you basically just want to have world made from extruded hexagons.
In the beginning I thought you are aiming for 3d voxels.
Are you sure this screen you have posted is using 3d hexagons ?
Please tell us best project you have already made so we can help you accordingly.
Im sure this is a 3D hexagons its just not using Unity but other game engine called Impact JS. I just wanted to make the same kind of terrain in unity.
But I’m not sure I have the best project. I learned csharp using Unity engine but every project I did made was in 2D but I don’t think I ever finished one. When I learned we made almost only 3D projects but I never fully ended a project out of the class I had.
If I could give you and advice I would encourage you to create small 3d game first where there is no need for fancy algorithms for culling, managing big numbers of objects and scratching your head with optimization.
Small polished 3d game is still crazy amount of work, so there is no shame in it.
How so? Using hexagons you cannot create a straight line, see for reference:
Visually at least, the top part of your image looks like it has a straight line that is longer than the length of one hexagon. There is also details in the lower part of the image which wouldnt fit, what i perceive to be, the hexagonal grid resolution, unless those details are just painted on the hexagon. But if you want to use the hexagons as colliders or paths, as would be usually done in such an approach, you would then either be able to walk through it from above, or be blocked before reaching the painted terrain from below.
While i dont really have experience with 2D games, this just looks like a visual effect, not an actual grid, to me.
A hexagonal 3D grid will require such complex algorithms?
When I saw the game project it looked hexagonal. Maybe it isnt I don’t sure because it’s a diffrent game engine I never used before. This is the project I am pretty sure it’s 3D hexagonal grid system:
I doubt it. I don’t see anything in that video that indicates it’s more than a simple rectangular grid. You can draw sprites to look like they’re using a fancier system without actually having the fancy system in place.
@LazyGhost15 How knowledgeable are you in general? I can definitely help you if you’re past a certain level.
Btw here’s a full tutorial regarding chunkified hexagonal prisms.