The Architect (Voxel Engine)

Oh, ok…

Block Picking is working

http://pastebin.java-gaming.org/ddc736e1252 for source.

The Face class is just a Block, the block’s position, and a useless integer (supposed to be for finding which face)

It was hacked together, so there will be optimisations.
Also, it sometimes fails when looking diagonally in all 3 directions.

Now I’m working on getting it to find the correct face.

Do you use occlusion culling? If so, do you use a bunch of rays to test all the blocks? Or how do you do it?

Is it better to make cubes out of triangles or quads?

@opiop65: No.

@masteryoom: Triangles.

https://dl.dropboxusercontent.com/u/99583484/3D/Architect/Screenshots/Sat%20Aug%2003%2018-24-29%20NZST%202013.png

More voxels = More fun.

  • World Size: 512x256x512
  • RAM Usage: ~300MB if I use bytes for world storage. ~800MB if I use ints.
  • CPU Usage: ~15%

How did I do it?

Two words: Greedy Meshing.

There are a few lighting bugs to fix due to the change, but it works very, very well.

I have had a few different idea on where I should actually go with this game. Sandbox? Survival? Adventure-RPG? etc.
At the moment I’m leaning towards RPG (after seeing that Cube World is now available)

Need to do a bit of work on shaders atm. Especially SSAO.

Oh, by the way, this is my third voxel engine since the start of this project.

Still working on this, fun! When my project is finished I will maybe jump also in 3D…

Cube World is really nice game, however, it has really bad sides… You almost don’t level up, 2 full days gaming is level 6, you have to be level 300 to be slightly able to do a boss (Oh wait! Its just me, Im noob)… And if you join a multiplayer world, you are level 500 in two seconds, because if others do a boss 99999 kilometers away, you get the experience points also… So the experience systemshit is on all sides the worst (my opinion).
And it gets a big bit boring / taking too long / everything is the same… I only like the veeryyyyy cool graphics.

https://dl.dropboxusercontent.com/u/99583484/3D/Architect/Screenshots/Sat%20Aug%2003%2018-24-29%20NZST%202013.png

More voxels = More fun.

  • World Size: 512x256x512
  • RAM Usage: ~300MB if I use bytes for world storage. ~800MB if I use ints.
  • CPU Usage: ~15%

How did I do it?

Two words: Greedy Meshing.

There are a few lighting bugs to fix due to the change, but it works very, very well.

I have had a few different idea on where I should actually go with this game. Sandbox? Survival? Adventure-RPG? etc.
At the moment I’m leaning towards RPG (after seeing that Cube World is now available)

Need to do a bit of work on shaders atm. Especially SSAO.

Oh, by the way, this is my third voxel engine since the start of this project.

I’ve had problems with CubeWorld, too.

I started playing CubeWorld with a friend, he was mage (healing) and I was Rough, making all the damage and stunning the enemy all the time (which turned out to be the very best combo of classes in the game… we were lucky…).
It takes a lot of time to get from level 1 to level 2, because you can almost only kill enemies, which give you 1 ep (and you need 50), additionally killing an enemy takes a long time and you often die and get no ep at all.

At about level 5 or 6 (I’d say) it got pretty easy. We started doing dungeons, exploring the world and getting tons of ep. It was the most fun part of the whole game. Also, the ep you get on the servers accross the whole map are quests. They give you from 500 to thousands of ep, depending on the level of the best player on the server (I guess? somehow like that).

It stays very fun until about level 32. Then we started creating another player, who stays in the village in an Inn all the time and resets the world when we kill a boss, and our normal characters which killed all the bosses while staying at the same position all the time and resetting until the boss respawned and was a quest, which gave us insanely much ep in a very short time.

I became level 124 in about an hour. It wasn’t fun then anymore, because the effects your skills have are inverse exponential. If you have every skill on level 40 and you level them up a level there is probably a 0.1% difference. Also your power, which is the identifier which says you which armor and weapons you can equip. The power level rises inverse exponentially too. So at about power 80, you won’t get power that much anymore (only like every 10 levels…) and you need to be level 1000+ to have power 99 and level 4.000.000.000+ to have power 100 ( -.- ).

Cube World is really a mess when it comes to balancing. Very, very, very not fun because of that. But the period from level 6 to level 32 however, was pretty good and really fun :slight_smile:

Still working on this, fun! When my project is finished I will maybe jump also in 3D…

Cube World is really nice game, however, it has really bad sides… You almost don’t level up, 2 full days gaming is level 6, you have to be level 300 to be slightly able to do a boss (Oh wait! Its just me, Im noob)… And if you join a multiplayer world, you are level 500 in two seconds, because if others do a boss 99999 kilometers away, you get the experience points also… So the experience systemshit is on all sides the worst (my opinion).
And it gets a big bit boring / taking too long / everything is the same… I only like the veeryyyyy cool graphics.

If I understand you’r code(I may be wrong ^^) you have small bug
Lat say Ray go X+1 Y+0.8 : you check collision every X (x,y) (1. 0.8f), (2, 1.6f) (3, 2.4f)
But you skip Y side collision (1.25f, 1)

Also You create many useless objects that java GC then Delete

=)


	 Vector3Int vec = new Vector3Int(MathUtils.floor(x), MathUtils.floor(y), MathUtils.floor(z));
	            
	            Block b = world.getTile(vec.x, vec.y, vec.z);
	            if(b != null && b.solid)
	            {
	               return new Face(b, vec, 0);
	            }

	            vec = vec.sub(new Vector3Int(1, 0, 0));
	            
	            b = world.getTile(vec.x, vec.y, vec.z);
	            if(b != null && b.solid)
	            {
	               return new Face(b, vec, 0);
	            }
	

my Fix ^^

          
		 int xii = MathUtils.floor(x);
		 int yii = MathUtils.floor(y);
		 int zii = MathUtils.floor(z);
		 Block b = world.getTile(xii, yii, zii);
		 if(b != null && b.solid)
		 {
		    return new Face(b, new Vector3Int(xii, yii, zii), 0);
		 }
	
		 xii -= 1;
		 b = world.getTile(xii, yii, zii);
		 if(b != null && b.solid)
		 {
		    return new Face(b, new Vector3Int(xii, yii, zii), 0);
		 }
	

I’ve had problems with CubeWorld, too.

I started playing CubeWorld with a friend, he was mage (healing) and I was Rough, making all the damage and stunning the enemy all the time (which turned out to be the very best combo of classes in the game… we were lucky…).
It takes a lot of time to get from level 1 to level 2, because you can almost only kill enemies, which give you 1 ep (and you need 50), additionally killing an enemy takes a long time and you often die and get no ep at all.

At about level 5 or 6 (I’d say) it got pretty easy. We started doing dungeons, exploring the world and getting tons of ep. It was the most fun part of the whole game. Also, the ep you get on the servers accross the whole map are quests. They give you from 500 to thousands of ep, depending on the level of the best player on the server (I guess? somehow like that).

It stays very fun until about level 32. Then we started creating another player, who stays in the village in an Inn all the time and resets the world when we kill a boss, and our normal characters which killed all the bosses while staying at the same position all the time and resetting until the boss respawned and was a quest, which gave us insanely much ep in a very short time.

I became level 124 in about an hour. It wasn’t fun then anymore, because the effects your skills have are inverse exponential. If you have every skill on level 40 and you level them up a level there is probably a 0.1% difference. Also your power, which is the identifier which says you which armor and weapons you can equip. The power level rises inverse exponentially too. So at about power 80, you won’t get power that much anymore (only like every 10 levels…) and you need to be level 1000+ to have power 99 and level 4.000.000.000+ to have power 100 ( -.- ).

Cube World is really a mess when it comes to balancing. Very, very, very not fun because of that. But the period from level 6 to level 32 however, was pretty good and really fun :slight_smile:

If I understand you’r code(I may be wrong ^^) you have small bug
Lat say Ray go X+1 Y+0.8 : you check collision every X (x,y) (1. 0.8f), (2, 1.6f) (3, 2.4f)
But you skip Y side collision (1.25f, 1)

Also You create many useless objects that java GC then Delete

=)


	 Vector3Int vec = new Vector3Int(MathUtils.floor(x), MathUtils.floor(y), MathUtils.floor(z));
	            
	            Block b = world.getTile(vec.x, vec.y, vec.z);
	            if(b != null && b.solid)
	            {
	               return new Face(b, vec, 0);
	            }

	            vec = vec.sub(new Vector3Int(1, 0, 0));
	            
	            b = world.getTile(vec.x, vec.y, vec.z);
	            if(b != null && b.solid)
	            {
	               return new Face(b, vec, 0);
	            }
	

my Fix ^^

          
		 int xii = MathUtils.floor(x);
		 int yii = MathUtils.floor(y);
		 int zii = MathUtils.floor(z);
		 Block b = world.getTile(xii, yii, zii);
		 if(b != null && b.solid)
		 {
		    return new Face(b, new Vector3Int(xii, yii, zii), 0);
		 }
	
		 xii -= 1;
		 b = world.getTile(xii, yii, zii);
		 if(b != null && b.solid)
		 {
		    return new Face(b, new Vector3Int(xii, yii, zii), 0);
		 }
	

That code is wrong. It was from the first evolution of the engine, and wasn’t completely finished (although it did work lots of the time). I removed it in the later versions of the engine.

The problem was that the concept was designed for 2D, where there are only 2 axes to check. When rhere are 3, it creates the problem of finding the order in which the ray crosses the axes.

It was also a quick hack, which explains the useless objects.

As for the bug (missing the y side collision), unless I uploaded a buggy version of the code it should work. It (should) check the y coordinates from x to x+1, and if they are different, detect a collision on that face.
However, I can’t be sure if the code works as intended, as the Z-axis made things a mess.

That code is wrong. It was from the first evolution of the engine, and wasn’t completely finished (although it did work lots of the time). I removed it in the later versions of the engine.

The problem was that the concept was designed for 2D, where there are only 2 axes to check. When rhere are 3, it creates the problem of finding the order in which the ray crosses the axes.

It was also a quick hack, which explains the useless objects.

As for the bug (missing the y side collision), unless I uploaded a buggy version of the code it should work. It (should) check the y coordinates from x to x+1, and if they are different, detect a collision on that face.
However, I can’t be sure if the code works as intended, as the Z-axis made things a mess.

Thats a lie! :smiley: I cheated level 113923 ( I gave myself 100000000 XP or so, thats not all I gave myself ^^ However), and I had power 100 ;D ;D

Thats a lie! :smiley: I cheated level 113923 ( I gave myself 100000000 XP or so, thats not all I gave myself ^^ However), and I had power 100 ;D ;D

Ambient Occlusion! Yay!

https://dl.dropboxusercontent.com/u/99583484/3D/Architect/Screenshots/Sun%20Aug%2004%2013-40-46%20NZST%202013.png

Note that it isn’t SSAO. It’s fake AO. Useful Article Here

I also uncommented the fog part of the shader and coloured the sky

More screenshots:

https://dl.dropboxusercontent.com/u/99583484/3D/Architect/Screenshots/Sun%20Aug%2004%2013-40-39%20NZST%202013.png

https://dl.dropboxusercontent.com/u/99583484/3D/Architect/Screenshots/Sun%20Aug%2004%2013-41-20%20NZST%202013.png

I have a lot of work to do on landscape generation.

Ambient Occlusion! Yay!

https://dl.dropboxusercontent.com/u/99583484/3D/Architect/Screenshots/Sun%20Aug%2004%2013-40-46%20NZST%202013.png

Note that it isn’t SSAO. It’s fake AO. Useful Article Here

I also uncommented the fog part of the shader and coloured the sky

More screenshots:

https://dl.dropboxusercontent.com/u/99583484/3D/Architect/Screenshots/Sun%20Aug%2004%2013-40-39%20NZST%202013.png

https://dl.dropboxusercontent.com/u/99583484/3D/Architect/Screenshots/Sun%20Aug%2004%2013-41-20%20NZST%202013.png

I have a lot of work to do on landscape generation.

No, just make sure it always generates two… 8)