{"id":4465,"date":"2016-12-18T21:22:25","date_gmt":"2016-12-18T21:22:25","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=4465"},"modified":"2016-12-18T21:23:09","modified_gmt":"2016-12-18T21:23:09","slug":"p0-p-172-part-69-procedural-city-generator","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p0-p-172-part-69-procedural-city-generator\/","title":{"rendered":"P0-P-172: Part 69: Procedural City Generator"},"content":{"rendered":"<p>I have started working on one of the last new features in MS1, which is the Procedural City Generator. While researching this feature, I discovered quite a number of other, very well-developed assets on the Unity asset store that solve this problem, so I am not sure at the moment if I want to develop my own solution or purchase one.<\/p>\n<p>What I have decided to do is to implement all of the database and server side code now, and just create a very basic city generator. I will just randomly place, rotate, and scale some buildings.<\/p>\n<p>After some difficulties, I have created a basic grid for the city generator:<\/p>\n<figure id=\"attachment_4457\" aria-describedby=\"caption-attachment-4457\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/12\/PhoenixGameDevelopment-13_12_2016-10_34_55-PM.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4457\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/12\/PhoenixGameDevelopment-13_12_2016-10_34_55-PM-300x163.jpg\" alt=\"Unity 13\/12\/2016 , 10:34:55 PM Unity Personal (64bit) - P0Main.unity - New Unity Project - PC, Mac &amp; Linux Standalone \" width=\"300\" height=\"163\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/12\/PhoenixGameDevelopment-13_12_2016-10_34_55-PM-300x163.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/12\/PhoenixGameDevelopment-13_12_2016-10_34_55-PM-768x416.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/12\/PhoenixGameDevelopment-13_12_2016-10_34_55-PM-1024x555.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/12\/PhoenixGameDevelopment-13_12_2016-10_34_55-PM.jpg 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-4457\" class=\"wp-caption-text\">Unity<br \/>13\/12\/2016 , 10:34:55 PM<br \/>Unity Personal (64bit) &#8211; P0Main.unity &#8211; New Unity Project &#8211; PC, Mac &amp; Linux Standalone<\/figcaption><\/figure>\n<p>I am using simple raycasting for this (The green lines) onto the Space Exploration Engine Terrain. The problem is that the colliders are only activated on the SEE terrain when the player is very close to the terrain chunk, which makes it very difficult to place the city&#8217;s buildings.<\/p>\n<p>I have solved the problem for now by simple increasing the distance that the terrain chunks enable their colliders, but this is not ideal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have started working on one of the last new features in MS1, which is the Procedural City Generator. While researching this feature, I discovered quite a number of other, very well-developed assets on the Unity asset store that solve this problem, so I am not sure at the moment if I want to develop [&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-4465","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\/4465"}],"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=4465"}],"version-history":[{"count":2,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/4465\/revisions"}],"predecessor-version":[{"id":4467,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/4465\/revisions\/4467"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=4465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=4465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=4465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}