Hexagon/Triangle Prism Engine (Game in development)

My latest project:

A 3D game. Construction-based similar to Minecraft, but with a difference. A big difference.
I will not be using cubes
(For the landscape. Characters will by made from cubes because it’s easier and looks reasonable)

New Screenshots:

For more, see my posts below, or check out my blog.

Old Stuff:

I started off with cubes because they were easy to render. But a box looks boring, so I made a sphere:

http://dl.dropbox.com/u/99583484/3D/Sphere.png

Then, I messed around with trig functions and randomness:

http://dl.dropbox.com/u/99583484/3D/Broken%20Sphere.png

Then, I was ready… to do Hexagon Prisms:

http://dl.dropbox.com/u/99583484/3D/Hexagon.png

I may use triangle prisms instead once I create the world, because hexagons make it impossible to create flat surfaces. Then again, I may not. It’s too early to decide.

Anyway, I had better get back to work. I will post updates as I get cool things working.

EDIT: There are currently NO optimizations in place. That explains the FPS drop in one of the screenshots.
EDIT 2: Some optimizations in place.

Well, This is certainly nice.
I like the way it all fits so nicely, Not that this really is a game or anything yet.
But very nice! Any chance for a little early test ride just for the lolz?

Not of the screenshots shown earlier, because that was just rendered data.
Now I have implemented an actual world.

Along the way I learnt how Simplex Noise generation works, as well as messing around with my own implementation.
I removed the normal permutations table and made it generate one from a seed.

I have also been messing around with the GL11 lighting functions which work quite nicely for so little work.

Here are some screenshots:

http://dl.dropbox.com/u/99583484/3D/Sat%20Jan%2005%2016-57-05%20NZDT%202013.png

http://dl.dropbox.com/u/99583484/3D/Sat%20Jan%2005%2016-58-05%20NZDT%202013.png

http://dl.dropbox.com/u/99583484/3D/Sat%20Jan%2005%2016-56-10%20NZDT%202013.png

More can be found here on my blog.

Okay, I finally got shaders working.
Well actually, they could have been working a few weeks ago, I just didn’t realise I didn’t need uniform variables (which were what I needed to finish of my Shader loading class).
Anyway, I skipped the Uniforms, and had a test run. It worked fine, but obviously the lighting was gone. I spent a while learning GLSL and all the functions etc. before google-ing lighting shaders. Eventually, I found enough info to merge a few together, and that gave me the effect I wanted.

Screenshots:

http://dl.dropbox.com/u/99583484/3D/Sun%20Jan%2006%2019-00-03%20NZDT%202013.png

http://dl.dropbox.com/u/99583484/3D/Sun%20Jan%2006%2018-58-45%20NZDT%202013.png

EDIT: Special thanks to davedes for his tutorials. :slight_smile: (Even though they got me confused about uniforms ;))

Looks awesome so far! It will be great to see where this might go! I’d love to see a fighting mechanic that revolves around stealth over brute force, or at least an option to use non-lethal force that is rewarded in gameplay. This is a project I’ll be looking out for! Way to go so far!

Yeah, it looks pretty awesome in such a short amount of time! The hexagonal prisms add really nice “whoosh” to the terrain! 8D

hehehe…

This afternoon I’ve been hunting down an annoying bug. Still haven’t found it. Don’t expect the momentum to last for long.
EDIT: Fixed bug. momentum going again for now.

I’m unsure of where to go with the fighting mechanics. It’s too early. I will post something on my blog when I think of it, but almost everything will probably change before this is done.

What was confusing about uniforms? I could change it up to make it less confusing for new readers. :slight_smile:

This week, not much was done as I was on holiday.

However, I did get infinite terrain generation working with minimal fps drop, and I also made a fog shader knowing abaolutely nothing about them except the effect I wanted. I also changed the background colour to make it more sky-like, and made the player-controlled entity.

Then I got stuck on collision detection. Still working on this one.

The uniform part is fine… If you already know about shaders. You should explain what the code is doing for setting uniforms, getting the uniform location etc.
The part that confused me was how to actually use the code, as your tutorials on shaders rely on the spritebatcher.
I reckon an example of rendering a quad using uniform variables would be enough.
An explanation of how to set up the attributes would also be nice, as I had to dig through your source code to find what I was supposed to put in the HashMap, but then again, I guess it filters out the n00bs :wink:

I almost forgot the new screenshots:

Are you planning on doing something with the 3D simplex noise? It’d be great for floating island levels, but outside that I can’t see much use. This thing really makes me want to make my own take on the system ;D too bad I don’t have the skill yet…

The world is infinite (to the limit of 32 bits), so I may generate floating islands way, way, way above the ground. Maybe even asteroids in space. :o And don’t forget that 3D noise can be used for caves way, way, way below the ground. :persecutioncomplex:

Still stuck on collision detection ???
May just have to leave it as is and come back later.

Just realized something we both overlooked :stuck_out_tongue: these would make some epic looking overhangs/mountainsides :slight_smile: and that sucks about collision detection, hope you get it working soon!

Black is where I want the collisions to be.
Red is where they are.

Yes, I know that I am not checking it right. This is just the closest I’ve got to working. Everything else so far results in getting stuck where there’s nothing and falling through the ‘gaps’ between blocks. The problem is my coordinate system. It’s skewed, like it should be, but that makes it hard to work out the specific hexagonal coordinates from Cartesian coordinates. (unskewing is easy though)

This is going to require some heavy maths…

Turn you hex into triangles and do collision detection / response with those.

I’ve been trying to avoid this as long as possible in the hope there is a quicker method, but now it seems like that’s my only best choice.

(Secretly, the hexagons actually are triangles. :persecutioncomplex:)

What else could they be?

I meant this:

You could approximate hexagon as cylinder that would make math easier and probably faster too.

I was considering that a while ago.
But because of my grid skewing, it will just turn the rhombi in the image further up into ovals. Not what I want.
I’ll see what I can do though.