{"id":9601,"date":"2023-03-12T15:37:26","date_gmt":"2023-03-12T15:37:26","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=9601"},"modified":"2023-03-12T15:37:26","modified_gmt":"2023-03-12T15:37:26","slug":"p0-b4-part-1212-debugging-improvements","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p0-b4-part-1212-debugging-improvements\/","title":{"rendered":"P0-B4: Part 1212: Debugging, Improvements"},"content":{"rendered":"\n<p>I have made some minor improvements to the item placement system, as well as some other minor improvements and bug fixes.<\/p>\n\n\n\n<p>However, the most important improvement that I made was when I discovered a serious bug in the ground cover paging system.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>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).<\/p>\n\n\n\n<p>However, while improving this system using the profiler, I noticed that the distance to each terrain chunk was always 0.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,32,17,31,10,11],"tags":[],"class_list":["post-9601","post","type-post","status-publish","format-standard","hentry","category-astral-realms","category-meridian","category-p-0","category-p0_b4","category-software-and-games","category-spiritus-astrum","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"aioseo_notices":[],"builder_content":"","_links":{"self":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/9601"}],"collection":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/comments?post=9601"}],"version-history":[{"count":1,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/9601\/revisions"}],"predecessor-version":[{"id":9602,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/9601\/revisions\/9602"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=9601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=9601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=9601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}