The Architect (Voxel Engine)


	public void check(float x, float y, float z)
	{
		if(isValid(x, pos.y, pos.z))
		{
			pos.x = x;
		}
		else
		{
			vel.x = 0;
		}
		
		if(isValid(pos.x, pos.y, z))
		{
			pos.z = z;
		}
		else
		{
			vel.z = 0;
		}
		
		if(isValid(pos.x, y, pos.z))
		{
			pos.y = y;
		}
		else
		{
			vel.y = 0;
		}
	}

	public boolean isValid(float x, float y, float z)
	{
		for(int i = MathUtils.floor(x - size.x); i <= MathUtils.floor(x + size.x); i++)
		{
			for(int j = MathUtils.floor(y - size.y); j <= MathUtils.floor(y + size.y); j++)
			{
				for(int k = MathUtils.floor(z - size.z); k <= MathUtils.floor(z + size.z); k++)
				{
					if(WorldHelper.isSolid(i, j, k))
						return false;
				}
			}
		}
		
		return true;
	}

Just wondering how you did collision?

This looks really cool!
Is this still not your main project?

I couldnt understand the code you posted for collision, I feel like WorldHelper.isSolid must be a key thing in collision detection. Im really interested in seeing how it works, I was actually going to ask the same question.

Gets the tile at (i,j,k) and checks if it is not null, and marked as solid.

No, not my main project. Every now and then I do a little bit of work on it, but I’m working on something else, which (without trying to build hype) I’m probably going to post within the next week or so.


	public void check(float x, float y, float z)
	{
		if(isValid(x, pos.y, pos.z))
		{
			pos.x = x;
		}
		else
		{
			vel.x = 0;
		}
		
		if(isValid(pos.x, pos.y, z))
		{
			pos.z = z;
		}
		else
		{
			vel.z = 0;
		}
		
		if(isValid(pos.x, y, pos.z))
		{
			pos.y = y;
		}
		else
		{
			vel.y = 0;
		}
	}

	public boolean isValid(float x, float y, float z)
	{
		for(int i = MathUtils.floor(x - size.x); i <= MathUtils.floor(x + size.x); i++)
		{
			for(int j = MathUtils.floor(y - size.y); j <= MathUtils.floor(y + size.y); j++)
			{
				for(int k = MathUtils.floor(z - size.z); k <= MathUtils.floor(z + size.z); k++)
				{
					if(WorldHelper.isSolid(i, j, k))
						return false;
				}
			}
		}
		
		return true;
	}

What happened to your hexagon project?
However, good job! Any kind of download?

This looks really cool!
Is this still not your main project?

I couldnt understand the code you posted for collision, I feel like WorldHelper.isSolid must be a key thing in collision detection. Im really interested in seeing how it works, I was actually going to ask the same question.

Gets the tile at (i,j,k) and checks if it is not null, and marked as solid.

No, not my main project. Every now and then I do a little bit of work on it, but I’m working on something else, which (without trying to build hype) I’m probably going to post within the next week or so.

The math required to do hexagons properly was well above me at the time, and probably still is. I was also using extremely inefficient algorithms for chunk loading and mesh generation.
In general, it was more of an experiment than a real project.

Anyway.

Here’s a download of this in its current state.

I forgot to re-enable fog, but you can get the general idea of what everything looks like.
The shading needs to be fixed (trees look a bit weird), but I’m not working on that right now.

WASD+Space to move around. Left-shift fires you up in the air (normally used for debugging).

What happened to your hexagon project?
However, good job! Any kind of download?

The math required to do hexagons properly was well above me at the time, and probably still is. I was also using extremely inefficient algorithms for chunk loading and mesh generation.
In general, it was more of an experiment than a real project.

Anyway.

Here’s a download of this in its current state.

I forgot to re-enable fog, but you can get the general idea of what everything looks like.
The shading needs to be fixed (trees look a bit weird), but I’m not working on that right now.

WASD+Space to move around. Left-shift fires you up in the air (normally used for debugging).

Looks quite good so far.
Would be nice to see a game made with this in the future!
(If you find a way to increase FPS…)

Is it lagging for you?

View distance is 32x32 chunks (centred on player), and I’ve managed to get up to 48x48 before I get framerate drop on my machine, which is an average laptop.

Looks quite good so far.
Would be nice to see a game made with this in the future!
(If you find a way to increase FPS…)

Is it lagging for you?

View distance is 32x32 chunks (centred on player), and I’ve managed to get up to 48x48 before I get framerate drop on my machine, which is an average laptop.

It varies between 10 and 50 FPS, but normally about 10 when moving constantly forward.

pure lwjgl

Next time I work on this I’ll make the chunk view distance configurable.

Yes, it is just LWJGL, although it uses my personal libraries, so it’s technically not ‘pure LWJGL’

It varies between 10 and 50 FPS, but normally about 10 when moving constantly forward.

pure lwjgl