{"id":875,"date":"2015-08-09T12:15:32","date_gmt":"2015-08-09T16:15:32","guid":{"rendered":"http:\/\/www.bootdiskrevolution.com\/?p=875"},"modified":"2015-08-23T14:22:55","modified_gmt":"2015-08-23T18:22:55","slug":"game-dev-magic","status":"publish","type":"post","link":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/game-dev-magic\/","title":{"rendered":"Game Dev Magic"},"content":{"rendered":"<p>Got more of level 5 done this week! The fifth level is one of the more complex ones, so it&#8217;s gonna take another week or two unfortunately. One source of the complexity is all the little set-pieces, like this tram scene for example:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-880 aligncenter\" src=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2015\/08\/playerPerspectiveAVI_O.gif?resize=480%2C270\" alt=\"\" width=\"480\" height=\"270\" \/><\/p>\n<p>You board the tram, and it takes you down an infinitely long tunnel. I thought I&#8217;d show how something like that is accomplished &#8212; and it&#8217;s not by just making a really, really long tunnel. Instead you use a little game dev magic!<\/p>\n<p>The first thing to note is that even though it looks like it, the scene isn&#8217;t composed entirely of tiles. In the tile editor, it looks like this.<\/p>\n<figure id=\"attachment_889\" aria-describedby=\"caption-attachment-889\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"wp-image-889 size-large\" src=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2015\/08\/tiles.png?resize=640%2C297\" alt=\"\" width=\"640\" height=\"297\" srcset=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2015\/08\/tiles.png?resize=1024%2C475&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2015\/08\/tiles.png?resize=300%2C139&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2015\/08\/tiles.png?w=1553&amp;ssl=1 1553w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption id=\"caption-attachment-889\" class=\"wp-caption-text\">But where is the tunnel&#8230;?!<\/figcaption><\/figure>\n<p>Most of the tunnel isn&#8217;t even part of the world! It&#8217;s just designed to look that way with large, repeating textures layered over each other in the background.<\/p>\n<p><!--more--><\/p>\n<p>So when you&#8217;re riding the tram down what appears to be an infinitely long tunnel, you&#8217;re actually just standing still while the repeating images zoom past you in the opposite direction, with different layers moving at different speeds to create the illusion of depth.<\/p>\n<figure id=\"attachment_877\" aria-describedby=\"caption-attachment-877\" style=\"width: 512px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"wp-image-877 size-full\" src=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2015\/08\/breakdownAVI.gif?resize=512%2C300\" alt=\"\" width=\"512\" height=\"300\" \/><figcaption id=\"caption-attachment-877\" class=\"wp-caption-text\">The same images are used for both the top and bottom of the tunnel.<\/figcaption><\/figure>\n<p>The tram has to travel a bit from it&#8217;s initial position to reach its final resting place in the tunnel though, and the game&#8217;s camera has to move to follow the tram. During that time, the backgrounds&#8217; movement is altered based on the movement of the camera, which maintains the illusion of the solid tunnel and its depth. From an absolute perspective, it looks something like this.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-887\" src=\"https:\/\/i0.wp.com\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-content\/uploads\/2015\/08\/devPerspective2AVI.gif?resize=600%2C263\" alt=\"\" width=\"600\" height=\"263\" \/><\/p>\n<p>There you go! Another little piece of game dev magic ruined &#8212; hopefully it doesn&#8217;t negatively affect your enjoyment of Bleed 2. I hope you had a good weekend! You&#8217;re looking great!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Got more of level 5 done this week! The fifth level is one of the more complex ones, so it&#8217;s gonna take another week or two unfortunately. One source of the complexity is all the little set-pieces, like this tram scene for example: You board the tram, and it takes you down an infinitely long <a class=\"read-more\" href=\"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/game-dev-magic\/\">[&hellip;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-875","post","type-post","status-publish","format-standard","hentry","category-bleed-2"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/posts\/875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/comments?post=875"}],"version-history":[{"count":6,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/posts\/875\/revisions"}],"predecessor-version":[{"id":890,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/posts\/875\/revisions\/890"}],"wp:attachment":[{"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/media?parent=875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/categories?post=875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bootdiskrevolution.com\/NEW_BLOG\/wp-json\/wp\/v2\/tags?post=875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}