P0-B4: Part 1212: Debugging, Improvements
I have made some minor improvements to the item placement system, as well as some other minor improvements and bug fixes.
However, the most important improvement that I made was when I discovered a serious bug in the ground cover paging system.
The system works by finding nearby terrain chunks and rendering any ground cover objects on those chunks, and hiding any ground cover objects not on those chunks.
This system was always quite slow, but I assumed that this was due to the large number of ground cover objects that are being rendered (I am not using instancedmeshes yet, this is an optimisation that I will add later).
However, while improving this system using the profiler, I noticed that the distance to each terrain chunk was always 0.
It turned out that there was a simple bug that was resulting in every single terrain chunk being scanned, instead of just the neighbouring ones.
I was not rendering any more objects than necessary, since I had another check in the code for this, but by searching all chunks instead of just neighbouring ones I was effectively searching through tens of thousands more objects than needed.
This problem was solved relatively easily, once I figured out what was causing it, and the performance of the project has increased massively as a result.
