{"id":4683,"date":"2017-02-05T22:27:10","date_gmt":"2017-02-05T22:27:10","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=4683"},"modified":"2017-02-05T22:27:10","modified_gmt":"2017-02-05T22:27:10","slug":"p0-p-172-part-101-object-generator","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p0-p-172-part-101-object-generator\/","title":{"rendered":"P0-P-172: Part 101: Object Generator"},"content":{"rendered":"<p>My solution to render the trees correctly (and repeatably) on the client and the server is to use the existing quadtree system of the terrain.<\/p>\n<p>I will add a custom &#8220;seed&#8221; value to each terrain chunk, which will be based on its parent seed. This means that as the chunks subdivide, and more child chunks are generated, I will end up with the same chunkseed numbers each time.<\/p>\n<p>I will then use these chunkseed values to generate the random locations for the trees, or other objects. I am actually using rocks for now, because I have rock objects available.<\/p>\n<p>This system seems to be working well so far, I can reproduce the seed values every time.<\/p>\n<p>I now need to decide how to store the individual objects being generated on each chunk, and load them in and out of the scene.<\/p>\n<p>This could be difficult, since I intend to support reasonably dense forests and clusters of objects.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My solution to render the trees correctly (and repeatably) on the client and the server is to use the existing quadtree system of the terrain. I will add a custom &#8220;seed&#8221; value to each terrain chunk, which will be based on its parent seed. This means that as the chunks subdivide, and more child chunks [&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,17,10,11],"tags":[],"class_list":["post-4683","post","type-post","status-publish","format-standard","hentry","category-astral-realms","category-p-0","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\/4683"}],"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=4683"}],"version-history":[{"count":1,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/4683\/revisions"}],"predecessor-version":[{"id":4684,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/4683\/revisions\/4684"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=4683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=4683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=4683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}