{"id":240,"date":"2016-09-25T16:27:26","date_gmt":"2016-09-25T16:27:26","guid":{"rendered":"http:\/\/lovablestranger.com\/blog\/2016\/09\/25\/refactoring-the-building-mesh-generator\/"},"modified":"2018-12-07T19:35:11","modified_gmt":"2018-12-07T18:35:11","slug":"refactoring-the-building-mesh-generator","status":"publish","type":"post","link":"https:\/\/lovablestranger.com\/blog\/2016\/09\/25\/refactoring-the-building-mesh-generator\/","title":{"rendered":"Refactoring the building mesh generator"},"content":{"rendered":"<p>I revisited some of the earliest code I wrote for this, because it\u2019s been getting more and more outdated, specifically how the building mesh is generated. All of the wallpaper and floor materials were hard-coded and now all of that that has been formalized.<\/p>\n<p>In the beginning I imagined the player placing down individual bedrooms and other rooms of specific types, building their brothel up from scratch. I\u2019ve since scrapped that idea and instead the player will purchase pre-built buildings and instead furnish rooms to indicate their use, i.e. place a bed within an empty room and it becomes a bedroom.\u00a0This meant I had to rewire a bunch of the room logic.<\/p>\n<p>I also took the opportunity to create a few building layouts to test the system.<\/p>\n<div id='gallery-1' class='gallery galleryid-240 gallery-columns-1 gallery-size-large'><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044a.jpg'><img width=\"797\" height=\"694\" src=\"https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044a.jpg\" class=\"attachment-large size-large\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044a.jpg 797w, https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044a-300x261.jpg 300w, https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044a-768x669.jpg 768w, https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044a-210x183.jpg 210w\" sizes=\"(max-width: 797px) 100vw, 797px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044b.jpg'><img width=\"797\" height=\"694\" src=\"https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044b.jpg\" class=\"attachment-large size-large\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044b.jpg 797w, https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044b-300x261.jpg 300w, https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044b-768x669.jpg 768w, https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044b-210x183.jpg 210w\" sizes=\"(max-width: 797px) 100vw, 797px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044c.jpg'><img width=\"797\" height=\"694\" src=\"https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044c.jpg\" class=\"attachment-large size-large\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044c.jpg 797w, https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044c-300x261.jpg 300w, https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044c-768x669.jpg 768w, https:\/\/lovablestranger.com\/blog\/wp-content\/uploads\/2016\/09\/housedominae_044c-210x183.jpg 210w\" sizes=\"(max-width: 797px) 100vw, 797px\" \/><\/a>\n\t\t\t<\/div><\/figure>\n\t\t<\/div>\n\n<p>I\u2019ve also done some profiling and improved the performance of the user interface since it was feeling a bit sluggish. Sadly that effort is hard to convey in screenshots.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I revisited some of the earliest code I wrote for this, because it\u2019s been getting more and more outdated, specifically how the building mesh is generated. All of the wallpaper and floor materials were hard-coded and now all of that that has been formalized. In the beginning I imagined the player placing down individual bedrooms [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[22,14,5,8,47,34],"_links":{"self":[{"href":"https:\/\/lovablestranger.com\/blog\/wp-json\/wp\/v2\/posts\/240"}],"collection":[{"href":"https:\/\/lovablestranger.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lovablestranger.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lovablestranger.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lovablestranger.com\/blog\/wp-json\/wp\/v2\/comments?post=240"}],"version-history":[{"count":2,"href":"https:\/\/lovablestranger.com\/blog\/wp-json\/wp\/v2\/posts\/240\/revisions"}],"predecessor-version":[{"id":426,"href":"https:\/\/lovablestranger.com\/blog\/wp-json\/wp\/v2\/posts\/240\/revisions\/426"}],"wp:attachment":[{"href":"https:\/\/lovablestranger.com\/blog\/wp-json\/wp\/v2\/media?parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lovablestranger.com\/blog\/wp-json\/wp\/v2\/categories?post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lovablestranger.com\/blog\/wp-json\/wp\/v2\/tags?post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}