{"id":9573,"date":"2023-02-26T19:16:01","date_gmt":"2023-02-26T19:16:01","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=9573"},"modified":"2023-02-26T19:16:01","modified_gmt":"2023-02-26T19:16:01","slug":"p0-b4-part-1203-ground-cover-exclusion-system","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p0-b4-part-1203-ground-cover-exclusion-system\/","title":{"rendered":"P0-B4: Part 1203: Ground Cover Exclusion System"},"content":{"rendered":"\n<p>I replaced the build in terrain function with another solution, which projects a point onto a plane. I could use this to get all of the needed points onto the same plane, so that I could get the distance between them. I could then use this distance to determine which pixels should contain ground cover, and which shouldn&#8217;t.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>This solution was much faster, and seemed to work, but when the player approached areas with a lot of ground cover exclusion objects (such as settlements, etc), it too became slightly too slow.<\/p>\n\n\n\n<p>I am now looking into multithreading as a solution, but I will need to rewrite quite a lot of code to make it thread safe (transform.transformpoint, etc).<\/p>\n\n\n\n<p>I cannot call setpixels from another thread, but the main bottleneck is in loading the array for setpixels, this is where I need to improve performance, so multithreading should be useful.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I replaced the build in terrain function with another solution, which projects a point onto a plane. I could use this to get all of the needed points onto the same plane, so that I could get the distance between them. I could then use this distance to determine which pixels should contain 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-9573","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\/9573"}],"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=9573"}],"version-history":[{"count":1,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/9573\/revisions"}],"predecessor-version":[{"id":9574,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/9573\/revisions\/9574"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=9573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=9573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=9573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}