{"id":608,"date":"2016-12-24T19:07:07","date_gmt":"2016-12-25T03:07:07","guid":{"rendered":"https:\/\/jacksontech.net\/?p=608"},"modified":"2016-12-27T21:32:17","modified_gmt":"2016-12-28T05:32:17","slug":"vr-game-project-day-2-of-8","status":"publish","type":"post","link":"https:\/\/jacksontech.net\/index.php\/2016\/12\/vr-game-project-day-2-of-8\/","title":{"rendered":"VR Game Project &#8211; Day 2 of 8"},"content":{"rendered":"<p>Lots of progress today.<\/p>\n<h1>Bug Fixes and Improvements<\/h1>\n<p>Every so often, my &#8220;blink&#8221; mechanic was leading to a black screen with no &#8220;unblink&#8221;. I made some changes that I think have solved the issue. My script removed the targeted cube from the scene when teleporting to it, re-enabling it whenever the user teleported somewhere else. (So the user wouldn&#8217;t be standing on a cube.) I think that using setActive(false) on the cube was causing issues. So instead, I enabled\/disabled the mesh renderer for that cube. Time will tell if this was the issue. It happened much more on my phone than it did on the PC.<\/p>\n<p>I improved my door controller, adding a checkbox that allowed the door to switch between &#8220;toggle&#8221; mode and timed-wait mode, the latter of which causes the door to close again after a few seconds.<\/p>\n<h1>Audio!<\/h1>\n<p>I added sound effects for the door using the Google VR SDK tools. Many thinks to Pempi from the Freesound project for <a href=\"https:\/\/www.freesound.org\/people\/pempi\/sounds\/33873\/\">his awesome elevator sound<\/a>. He says he actually <del>broke into<\/del> snuck into the mechanical penthouse of a building to record it! Whatever the source, I often use it for both elevators and (with some pitch\/length alterations) doors.<\/p>\n<h1>Environment Modeling<\/h1>\n<p>I blocked in all the major areas where I want gameplay. There are three areas. The first is the long balcony. To the left is a small apartment complex (with one apartment that the player can enter). To the right is the main office for the apartment complex. The idea is that the player will first have to go to the apartment office to get the key to get into the apartment itself, after which point they can look for clues.<\/p>\n<div id=\"attachment_616\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_newmodel.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-616 size-medium_large\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_newmodel-768x539.png\" width=\"768\" height=\"539\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_newmodel-768x539.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_newmodel-300x211.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_newmodel-1024x719.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_newmodel.png 1601w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Early morning shot of the game environment.<\/p><\/div>\n<div id=\"attachment_610\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-610 size-medium_large\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment-768x543.png\" width=\"768\" height=\"543\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment-768x543.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment-300x212.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment-1024x724.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment.png 1608w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Apartment hallway<\/p><\/div>\n<div id=\"attachment_611\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-611 size-medium_large\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment2-768x539.png\" width=\"768\" height=\"539\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment2-768x539.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment2-300x210.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment2-1024x718.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_apartment2.png 1595w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Apartment Office<\/p><\/div>\n<h1>Detail Models<\/h1>\n<p>I made a few small detail models, including a desk and a light fixture. I&#8217;m planning on creating some couches, tables, bed, lamp, etc for the apartment.<\/p>\n<div id=\"attachment_613\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_details.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-613 size-medium_large\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_details-768x546.png\" width=\"768\" height=\"546\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_details-768x546.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_details-300x213.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_details-1024x727.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_details.png 1616w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Light Fixture<\/p><\/div>\n<div id=\"attachment_612\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_desk.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-612 size-medium_large\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_desk-768x547.png\" width=\"768\" height=\"547\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_desk-768x547.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_desk-300x213.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_desk-1024x729.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_desk.png 1602w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">The desk. I&#8217;m super happy with the way it turned out!<\/p><\/div>\n<h1>Lighting<\/h1>\n<p>Ugh. Just, ugh. I was originally going to use Blender to bake lightmaps. However, the indirect lighting feature only supports &#8220;approximate&#8221; gathering, which makes for some interesting lighting bugs, like this one, where the light is going through the fixture itself:<\/p>\n<div id=\"attachment_609\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighterror.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium_large wp-image-609\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighterror-768x537.png\" alt=\"\" width=\"768\" height=\"537\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighterror-768x537.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighterror-300x210.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighterror-1024x717.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighterror.png 1622w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">The light from the bulbs is going through the light fixture to shine on the ceiling.<\/p><\/div>\n<p>Strangely, <a href=\"https:\/\/developer.blender.org\/T37015\" target=\"_blank\">there was a patch that enabled true raytracing for indirect lighting for Blender 2.6<\/a>. I&#8217;m not sure why this was removed for Blender 2.7. I think it&#8217;d be very useful!<\/p>\n<p>So, I decided to use Unity instead. I&#8217;m not exactly enthused with Unity&#8217;s lighting system either&#8211;<a href=\"http:\/\/robotinvader.com\/blog\/?p=516\">I gather I&#8217;m not the only one<\/a>&#8211;but it&#8217;s workable.<\/p>\n<p>Here&#8217;s some screenshots.<\/p>\n<div id=\"attachment_614\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_exterior.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium_large wp-image-614\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_exterior-768x550.png\" alt=\"\" width=\"768\" height=\"550\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_exterior-768x550.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_exterior-300x215.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_exterior-1024x733.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_exterior.png 1600w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Early take on the lighting on the balcony.<\/p><\/div>\n<div id=\"attachment_615\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighting.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-615 size-medium_large\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighting-768x506.png\" width=\"768\" height=\"506\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighting-768x506.png 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighting-300x198.png 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighting-1024x675.png 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/day2_lighting.png 1568w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Actual lighting in Unity. Ignore the half-columns. I&#8217;m fixing those!<\/p><\/div>\n<h1>In-Game Screenshots<\/h1>\n<div id=\"attachment_619\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140846.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-619 size-medium_large\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140846-768x432.jpg\" width=\"768\" height=\"432\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140846-768x432.jpg 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140846-300x169.jpg 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140846-1024x576.jpg 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140846.jpg 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Early version of balcony, no lights.<\/p><\/div>\n<div id=\"attachment_621\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140916.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-621 size-medium_large\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140916-768x432.jpg\" width=\"768\" height=\"432\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140916-768x432.jpg 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140916-300x169.jpg 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140916-1024x576.jpg 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-140916.jpg 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Early version of office, no lights.<\/p><\/div>\n<div id=\"attachment_622\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183416.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-622 size-medium_large\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183416-768x432.jpg\" width=\"768\" height=\"432\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183416-768x432.jpg 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183416-300x169.jpg 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183416-1024x576.jpg 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183416.jpg 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Balcony with pre-baked lightmaps in Unity.<\/p><\/div>\n<div id=\"attachment_623\" class=\"wp-caption alignleft\" style=\"width: 768px\"><a href=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183436.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-623 size-medium_large\" src=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183436-768x432.jpg\" width=\"768\" height=\"432\" srcset=\"https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183436-768x432.jpg 768w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183436-300x169.jpg 300w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183436-1024x576.jpg 1024w, https:\/\/jacksontech.net\/wp-content\/uploads\/2016\/12\/Screenshot_20161224-183436.jpg 1920w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><p class=\"wp-caption-text\">Office with pre-baked lightmaps in Unity.<\/p><\/div>\n<h1>Future work<\/h1>\n<p>Tomorrow I plan to get a basic on-screen dialog system working, as well as creating some computer and switch props. I haven&#8217;t decided if I&#8217;m going to put people in the game. Maybe robots! Robots would be easier.<\/p>\n<p>I also need to decide if I want to fight with Unity&#8217;s lightmapper more or try to pull off vertex lighting. I don&#8217;t think vertex lighting will work very well, but I might give it a shot.<\/p>\n<p>Until tomorrow!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lots of progress today. Bug Fixes and Improvements Every so often, my &#8220;blink&#8221; mechanic was leading to a black screen with no &#8220;unblink&#8221;. I made some changes that I think have solved the issue. My script removed the targeted cube from the scene when teleporting to it, re-enabling it whenever the user teleported somewhere else. &#8230; <a class=\"moretag\" href=\"https:\/\/jacksontech.net\/index.php\/2016\/12\/vr-game-project-day-2-of-8\/\">more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102,105,28,9,106],"tags":[110,111,108,49,112,109,107],"class_list":["post-608","post","type-post","status-publish","format-standard","hentry","category-game-dev","category-google-cardboard","category-personal","category-projects","category-vr","tag-eight-day-game-project-1","tag-game-dev","tag-google-cardboard","tag-personal","tag-projects","tag-unity","tag-vr"],"_links":{"self":[{"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/posts\/608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/comments?post=608"}],"version-history":[{"count":3,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/posts\/608\/revisions"}],"predecessor-version":[{"id":626,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/posts\/608\/revisions\/626"}],"wp:attachment":[{"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/media?parent=608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/categories?post=608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jacksontech.net\/index.php\/wp-json\/wp\/v2\/tags?post=608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}