Thursday, 19 September 2013

Block Placement

Hey guys,

I spent the last few days adding a few important features such as Block Placement, Chunk Notification and used some of the very nice unity pro features to make my game look a lot better. I took two screenshots of a scene, one with unity pro features enabled and one with them disabled, here is the difference:


As you can see, the top one is from the free and the bottom one is the pro version, I used SSAO ( Screen Space Ambient Occlusion, Light rays and real-time shadows to achieve the nice effect of the bottom screenshot, these are pro only features which is why I am trying to get hold of Unity Pro, for now I am using the 30 day Pro Trial.

Anyway guys, Here is a link to the latest build of the game :

https://dl.dropboxusercontent.com/u/177467929/0.0.11/0.0.11.html


Controls:

W S A D = Movement.

Left Click = Break Block.
Right Click = Place Block.
Scroll Wheel = Change Block.

P = Enable Console ( Not very useful at the moment but in the future, I plan to make it programmable ).

As usual, thanks for reading and keep checking the blog for more info!

Friday, 13 September 2013

Recoded Rendering

Hey guys, sorry for the long period of time without an update, but the reason for that is because I have been spending my time to re code the rendering to include custom shaped blocks as well!

The way i do it is similar to the way minecraft does it, I have render types which allow me to base the block off a mesh, this way i can quickly load custom shaped blocks by referring to the mesh files.

Here are a few previews of what i have achieved :

( Transparent Blocks )

( Custom Log Render Type )

( Thin Block Render Type )

I have also managed to activate a trial version of Unity Pro, the reason for this is because the pro version has a script profiling which helps me manage my CPU and Memory usage and find sources of lag, I would get the pro version but its quite hard to raise the kind of money needed to pay for it , ( $1,500 ) which to me is a lot!

Anyway, as always, keep checking the blog for more updates!

Sunday, 25 August 2013

Terrain Updates!

Its been a short while since i last posted so i guess i should notify you guys of my progress. Over the last week, i have been focused on the chunk loading and terrain part of the game, i have managed to overhaul the chunk loading and terrain completely for a much better looking world, i doubled the size of the loaded area, however it still looks too small, i need to think about how i am going to do for long ranged terrain, I might possibly use a simple mesh deformed with the height map data to look like you can see far away.

Here is a preview of how the new terrain looks :





As you can see, it looks much more realistic, more " smoother " and much bigger which allows for much more emphasis on the look of the world, before, the hills were rapid and very repetitive which made the game look very plain and boring, I think this feature lets the game feel much better.

Anyway, thanks for reading and as always, keep checking the blog for more updates!

Saturday, 17 August 2013

Improved chunk loading

Hello again,
The last few days i have been working hard on trying to make the chunk loading work and I finally got it to work! I found out that the issue was due to floating point precision, unity was turning values such as "0" into "0.00000381497" which is pretty much 0, however when your searching for a certain value, it gives null errors everywhere, this was easily solved by rounding / flooring the values to integers.

I also worked on adding basic terrain to the world, it generates at a decent speed with a couple of lag spikes in between loading chunks, this is increased when you move the chunks faster and faster, bringing the FPS down to around 5 if you spam the key, however this wont happen in game because the player wont be able to move that fast.

For any of you who want to try the game, please visit this link :

https://dl.dropboxusercontent.com/u/177467929/build_0.0.1/build_0.0.1.html

There are still rendering issues with chunks, you will still see through a few faces of the chunks, just a little bug i need to fix, but the main focus is on the chunk loading and not rendering for now.

The controls are ( W , S , A , D ) for movement. Please note, there may possibly be some Null Errors still, these are due to the grass blocks trying to spread outside the chunk bounds, this wont affect anything right now.

As always, thanks for reading this entry and keep checking the blog for more updates!


Saturday, 10 August 2013

Chunk Loading

Hello again, For the last few days i have been working on the chunk loading / unloading, and after hours of pulling my hair out, i finally started to get somewhere. I have been reworking my mathematical functions, optimizing them and allowing for the game to run a lot faster. If you want to see how far i have gotten with the chunk loading, please click this link :

https://dl.dropboxusercontent.com/u/177467929/WEB_Output.html

( W S A D to move the chunk loading area around )

This version is still glitchy however, sometimes you cannot move the chunks around ( something i am currently working on fixing ) however apart from that, it runs pretty well.

This blog post is quite short because i have lots of work to do, so as usual, keep checking the blog for more progress!

Tuesday, 30 July 2013

Random Ores

Another update, for the last few days i have been working on adding a dynamic system to allow me to get a block anywhere in the loaded range of the world, this is quite a task because it means i need to convert world coordinates to local chunk coordinates, the way i did this was by dividing the values to get the chunk that contained the block, then i would use the modulo operator to get the remainder of the calculation , allowing me to get the local block coordinate. I also worked this morning on fixing a lot of bug fixes and added a simple ore generation system, which generates chunks of ores , this system is far from complete but at the moment, it generates some pretty decent looking veins of ore.

Here is a preview of ores generating in the world :


and this is a preview of the distribution of ores :


The texture i am using for the ores is just a test texture i made, so i can easily see a difference between the stone and the ore block, it is meant to be some sort of coal ore, but for now it will do.

Thanks for reading and keep checking the blog for more updates!

Saturday, 27 July 2013

Random Tick

Another update guys , i managed to implement random ticks, i can now add basic natural features such as growing grass and plants, this is a vital feature which will be needed to create a diverse world full of life. These chunk updates however are quite expensive so i will need to keep the updates to a minimum if i can.

This is only a quick post because its getting quite late. I will post an image below of the grass / dirt which grows, currently the process is backwards, the grass turns into dirt, so i can see how " random " it looks. I will of course change this later on. Looking at the image below, all of the dirt spots are randomly chosen from the built in " Random.Range " function built into unity.



Thanks and as always, keep check of the blog for more updates!

Block Updates

So, today i spent a lot of my time working on a dynamic block updating system. I found it quite challenging to overcome block updates , this is because if i place a block, i need it to send a message to the 6 surrounding blocks, these blocks will then do whatever they need to, this part is kind of the easy part, the hardest part is getting the surrounding chunks to receive block updates too.

I managed to successfully complete this system, it took me several hours to create it and i think that it could do with an optimization, but for now it works fine.

Here is a preview of the block updates :


As you can see from the image below, for testing purposes, i made it so that stone blocks are set to " air " when they receive a block update, so for a test, i made the world place a block in the middle of the chunk, as you can see, it successfully updates in every direction.

So far, this system runs pretty smoothly, it does not really have to do much calculation to achieve this, so i don't think that it will be very intensive to do this.

Thanks for reading and keep checking the blog for more updates!

Friday, 26 July 2013

Basic Rendering

Over the last few days, i began working on the basis of the chunk rendering, the way that i make the chunks render is by looping through each block in the chunk and checking the blocks at the side of the current block. I have each block store their texture , id value and render type. When looping, i check whether the block at the current side has a transparent render type, if it is transparent, it will render the face. This system is quite efficient because the chunks are pretty small and therefore allows them to loop fast. One challenge i came across was for blocks at the edge of a chunk, because they are on the end, i need to search for the adjacent chunk so that i can check its render type.

 I also implemented a system for updating the render system when a block is changed, so if a block on the edge of a chunk is destroyed, it will have to send a message to the adjacent chunk and tell it to re render its faces because otherwise there will be a hole where the chunk " thinks " there is still a block.

Here is a preview of my rendering



On a side note, i am not breaching Copyright of the textures , i am not going to be using the textures in the final version, i am just using them as placeholder textures until i can get some nice looking textures of my own.

 Thanks for reading and keep checking the blog for more progress!

Introduction

Hello there , I am working on a project in my free time called " The Cube Project " , this name may or not be the actual name of the project in the end , but for now i guess this will be the nickname of the project. Basically, i have a simple goal, i want to make a game , similar to the way Minecraft works, with the blocks, but i want to make a more realistic alternative, one which follows how humans developed, how humans created tools from the natural sources of stone and wood, i want to be able to simulate this in a block genre because these seem like a good way to start.

 I am going to be making this game with the Unity 3D Game Engine, mainly because of how user friendly and extremely easy it is to put a project together with full control of what happens. I have used Unity for a few years now, i have not however completed a project fully yet, so this will be the first project i dedicate my time to complete. I will be using the C# programming in unity, mainly because of how much more powerful it is over the Boo / Javascript alternative which unity offers. For the Voxel engine side of the game, i have already experimented and successfully made many examples of Voxel terrain which runs well. Recently, I managed to re-write my code to make it even more optimized, allowing me to use block updates many times a second.

 So for now, i shall be developing the project in my spare time, which at the moment is pretty much all of my time, Its the summer holidays and i don't have much to do :)

Thanks for reading this and i hope you keep up to date with the progress of the game!