Friday, 20 February 2015

Multiple Mesh Scene


As said in the last post, the next step was to create multiple instances of the mesh as a '[5,5,5] block' and build the terrain using this block. 


As shown here this is what I have done. There are clearly a few issues with it still, although this is still an early part of this step with it being the last push. The main problem that stand outs currently however is the position calculations.Whilst the meshes are spawning in a somewhat correct position they are still fairly out of place. The blocks should be touching each other creating 1 continous world

--------------------------------------------------------------------------------------------------------------------------

The next step is to correct the position calculations, from there I can start to look into setting multiple textures on the meshes, and that will lead into putting the Perlin Noise work in.

Perlin Noise

So the last few weeks since the last update I have been working on multiple projects so progress has slowed... however I now have 2D Perlin Noise implemented. working on both 2d meshes and 3d meshes with a depth of 1.

2D Meshes

3D Meshes

--------------------------------------------------------------------------------------------------------------------------
Next update is to build 'blocks' of meshes. i.e I will build small meshes of  about [5,5,5] and then use a 'World Manager' to build multiple instances of this mesh and build a world from it


Friday, 23 January 2015

Collisions!

So instead of doing the perlin noise update I decided to quickly implement colliders for the meshes I am generating as this is basically copy & paste code with variable name changes...

To do this, all I took everything I did when creating the normal meshes, renamed some variables to collider#### for whatever that variable represented. The only bit I didn't need was the uv maps as eh colliders don't need to be rendered.



This image shows 1 mesh generated with only the collider being shown here, in the scene view of the unity editor.



This one shows lots of meshes being drawn with the colliders...

--------------------------------------------------------------------------------------------------------------------------

The next update I will be working on is the perlin noise(already working on it), I promise...

Thursday, 22 January 2015

Let There Be Height...


Since getting the tiling to work in 2d(1 layer) I sat and thought about getting extra layers working correctly, as in the last update it was broked.

However I realised that this was due to the fact the loop was setting the position as 1 further than the last y value, whereas the height of each hexagonal prism is only 0.2. Because of this I needed to divide the y value from the loop by 5 in order to get the correct position.




--------------------------------------------------------------------------------------------------------------------------

Next update will be getting perlin noise working in the height as well as some progress on fixing the bugs from the last update

Sunday, 18 January 2015

3D Tiles

so after finally getting the 2D tiling to work, I started getting the 3d tiling to work. This was done rather quickly, however it was incorrect.



As seen in here the hexagonal prisms tiled, but they didn't line up correctly. The shapes were intersecting each other. I solved this by modifying the values that were sent to the function creating the mesh.

--------------------------------------------------------------------------------------------------------------------------

Here is the current tiling 
the current known issues are;
  • a problem in the z axis where it keeps moving further inwards on each row,
  • height - adding hexagons in the y axis doesn't align correctly.

  • mass amounts of rows breaks the program as the uv values go out of bounds
Whilst working on this update I also noticed that this was creating 1 giant mesh, which would not ideal for potential updates in the future, such as adding and removing voxels from the world. To solve this in the next update I will look to implement a method that will build the meshes seperatly using a seperate script. I am hoping this may also help fix the bug with adding height to the world...


Thursday, 15 January 2015

Regression...

I had previously failed to mention that at an earlier stage of this project i had the 2d hexagons tiling...

However they weren't tiling correctly, because of this I decided to leave that behind and hope that i'd just randomly realise I was stupid and it was incredibly simple. Instead of working on the tiling I decided to create the 3d shapes, this is where the problem started...

After turning my hexagons into hexagonal prisms I needed to get them tiling again, luckily for me I had left the work i'd started in the code so i wouldn't need to go about re-writing anything. however when I set the code up to work with the newer shape generation function i wouldn't work. I tested it on my 2d sqaures and it was still working, and I was stumped. I stopped working on the project for a few weeks shifting focus onto other work, and since coming back to this I have stripped the work back.

I have went back to 2d hexagons in an attempt to get the tiling working again. And finally it is! My mistake? removing a variable that kept track of which polygon I was using...

--------------------------------------------------------------------------------------------------------------------------


As shown here the tiles are not lining up correctly, however my next step is to get it working like this in 3D. luckily i still have all the code for setting the 3D shapes up...