Saturday, December 31, 2016

Before the end


I changed the orthographic camera to perspective as you can see in the above video, we decided to do this because the sense of depth was necessary and we might need to move the camera closer to the character in places like caves.

I also created multiple arrays of vertices/tris/normals/etc which will act as buffers for when I'm generating a mesh from chunks, this will reduce the amount of garbage that would have otherwise produced by the temporary mesh arrays, the only downside with these buffers is that they will use up a small amount of memory. Of course this could be avoided if I could just create a single buffer of each vertices/tris/etc and give it to unity's mesh class with a length parameter but I can't.

PS: Happy new year!

Wednesday, December 21, 2016

Designing, optimizing and moving forward

The new cube creator is finished for now, I will be adding more options and features to it later.


I haven't mentioned anything about greedy meshing and there's a good reason for that, you might have noticed that there are several different textures near each other making the greedy meshing very small and not all that useful, the other problem is that I have all of the textures in one atlas so repeating a certain texture would be problematic because you can't overflow the uv coordinates in an atlas so that the texture would repeat, so I had to created a shader which could repeat a texture inside an atlas by adding a certain amount, let's say 512, to the uv coordinates which would tell the shader how many times the texture would repeat, after that it would be just a few calculations to determine the current texture index by just dividing the uv by 512 after which we can get the actual uv coordinates for the certain part in the mesh.

While we can now repeat a certain texture it still does not remove the problem that we have multiple textures near each other, for that I would just need to create a new atlas and combine textures in a 2 * 2 texture in every possible combination so I can create 2 * 2 * 2 size cubes with one texture that has 4 different texture combinations for each side instead of 1 * 1 * 1 with one texture for each side.

There might be better ways to do this but I can't dwell for too long in optimizing the terrain generator or it might become a never ending project.

Me and Samuli have been designing crafting for the game and an interface for it and it looks great.

A mockup of the crafting interface.

I've also been creating a house editor for the game, we are going to make preset assets for NPCs, players can create custom houses in the game but they can also use presets as well. A house will be created in 3 different stages, first a player will place walls for the house after which he can place the floor or the roof or even more layers, after the house is designed players can predetermine what furniture the house will have before building it.