Wednesday, June 22, 2016

Latent optimizations

So I've been refactoring the project and changing most of the integers to long so I can generate larger maps is going well, there were some hiccups here and there but it's still an ongoing process.

I also noticed some potential optimizations in the chunk rendering part which I've now added, I noticed these because I changed the cube array in the chunk to the length of 4096 from 2048 to take advantage of the previous optimizations (which I mentioned here Rivers, streams and more optimizations), the change was a double edge sword as the chunk rendering took twice the amount of time to render a chunk, fortunately I noticed that there were some potential optimizations as it sped up the rendering from 5 to 11 times faster.

I've also reduced memory usage by hundreds of megabytes depending on how many chunks are possibly visible, I only removed index an int variable and a vector3 position from the cube class as they can be easily generated if needed, as I mentioned a chunk has 4096 cubes and over 8000 chunks can be visible, the amount of memory needed for position and index is massive.

Tuesday, June 7, 2016

One down, thousands to go

So I finished creating the GUI based on Samuli's concept art and I can now start working on the gameplay... not.

I found a memory leak in the terrain generation that's resulting either in garbage collector not clearing or it's something I've done, I'm guessing both, so I have to trace it which means refactoring the terrain generation, although this prevents me from continuing the gameplay, but good news is that I can modify the terrain so I can create the actual size I was planning.

I was also planning in adding the cube unwrap which I've talked for so long now, but it dawned on me that the normals in the mesh would suffer, rendering a cube properly would need all 20 verticies otherwise I would need to rotate the angle of the normals and I have no idea what that would look like...