{"id":284,"date":"2018-10-25T05:28:54","date_gmt":"2018-10-25T05:28:54","guid":{"rendered":"http:\/\/cliffnordman.com\/blog\/?p=284"},"modified":"2019-04-02T11:17:59","modified_gmt":"2019-04-02T11:17:59","slug":"procjam-7dfps-2018-photo-copy-day-2","status":"publish","type":"post","link":"https:\/\/cliffnordman.com\/blog\/2018\/10\/25\/procjam-7dfps-2018-photo-copy-day-2\/","title":{"rendered":"PROCJAM \/ 7DFPS 2018: Photo Copy, Day 2"},"content":{"rendered":"<p><a href=\"http:\/\/www.procjam.com\/\">PROCJAM<\/a>, <a href=\"http:\/\/7dfps.com\/\">7DFPS<\/a><\/p>\n<p><a href=\"https:\/\/cliffnordman.com\/blog\/2018\/10\/23\/procjam-2018-photo-copy-day-1\/\">Day 1<\/a><\/p>\n<p>Today I worked on mostly the non-procedural parts of the game.\u00a0 Of course the procedural generation is the reason I&#8217;m doing the jam, but I have to build a game around it so that other people can actually find and experience what I generate.<\/p>\n<p>Updates to the AI photographer were minor.\u00a0 Instead of placing the camera completely anywhere on the terrain, I picked a distance from my selected landmark based on that landmark&#8217;s size.\u00a0 Distance and a random angle gave me X &amp; Z coordinates, and I ray-casted downwards to place the AI Photographer on the terrain.\u00a0 That ensured the player could reach the same position.<\/p>\n<p>Setting up the camera views were trickier.\u00a0 Unity can send a camera&#8217;s output to something called a RenderTexture instead of the screen. I thought I&#8217;d make a few of these RenderTextures, get the AI photographer to render photos to them, then display them on the UI.\u00a0 But I couldn&#8217;t figure out how to do that, despite clicking around in the Editor and the documentation for a while.<\/p>\n<p>Instead I decided to have two cameras render to the same screen.\u00a0 On the left, the player&#8217;s view, controllable with standard FPS controls.\u00a0 On the right, the AI photographer&#8217;s view.\u00a0 There&#8217;s a key to hide the AI photographer&#8217;s view and fill the screen with the normal FPS view.\u00a0 There&#8217;s a nice transition where the FPS view shrinks and the AI photographer&#8217;s view slides in from the edge of the screen.\u00a0 In photo comparison mode, both viewports are square, regardless of the window the game is running in.\u00a0 Again, the player needs to be able to recreate the AI photographer&#8217;s photos perfectly, so the two views need to be identical.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-281\" src=\"http:\/\/cliffnordman.com\/blog\/wp-content\/uploads\/2018\/10\/firstgif.gif\" alt=\"\" width=\"800\" height=\"373\" \/><\/p>\n<p>With the cameras sorted, I was able to play the game!\u00a0 Even in its simple form, with temporary assets and no scoring system, I found it very satisfying to match up every little thing in the photo.\u00a0 I&#8217;m probably biased, since I really enjoy composing photographs with physical cameras, but it&#8217;s a good sign that this game is going to work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PROCJAM, 7DFPS Day 1 Today I worked on mostly the non-procedural parts of the game.\u00a0 Of course the procedural generation is the reason I&#8217;m doing the jam, but I have to build a game around it so that other people can actually find and experience what I generate. Updates to the AI photographer were minor.\u00a0 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/cliffnordman.com\/blog\/2018\/10\/25\/procjam-7dfps-2018-photo-copy-day-2\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;PROCJAM \/ 7DFPS 2018: Photo Copy, Day 2&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,8],"tags":[],"class_list":["post-284","post","type-post","status-publish","format-standard","hentry","category-photography","category-programming"],"_links":{"self":[{"href":"https:\/\/cliffnordman.com\/blog\/wp-json\/wp\/v2\/posts\/284"}],"collection":[{"href":"https:\/\/cliffnordman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cliffnordman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cliffnordman.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cliffnordman.com\/blog\/wp-json\/wp\/v2\/comments?post=284"}],"version-history":[{"count":5,"href":"https:\/\/cliffnordman.com\/blog\/wp-json\/wp\/v2\/posts\/284\/revisions"}],"predecessor-version":[{"id":298,"href":"https:\/\/cliffnordman.com\/blog\/wp-json\/wp\/v2\/posts\/284\/revisions\/298"}],"wp:attachment":[{"href":"https:\/\/cliffnordman.com\/blog\/wp-json\/wp\/v2\/media?parent=284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cliffnordman.com\/blog\/wp-json\/wp\/v2\/categories?post=284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cliffnordman.com\/blog\/wp-json\/wp\/v2\/tags?post=284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}