{"id":54,"date":"2022-04-21T19:32:08","date_gmt":"2022-04-22T01:32:08","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/kennguyen\/?p=54"},"modified":"2022-04-21T19:32:08","modified_gmt":"2022-04-22T01:32:08","slug":"our-final-prototype","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/kennguyen\/2022\/04\/21\/our-final-prototype\/","title":{"rendered":"Our Final Prototype"},"content":{"rendered":"\n<p>After mostly working individually on our initial game prototypes, this past week was dedicated to combining together all of our work that was done in parallel. Good o&#8217; parallelism. Much efficient.<\/p>\n\n\n\n<p>Since each of us created a replica of the same game, this naturally resulted in our game assets being very similar. This made it easier to combine projects. I decided to use my game as the base and import the best parts of everyone else&#8217;s game.<\/p>\n\n\n\n<p>Another group member had already made a main menu and game over screen. We had the parts, but they just weren&#8217;t tied together into a coherent game that flows. As a goal of having a minimum viable prototype, this means it was time to design an architecture.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"945\" height=\"533\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-main-menu.png\" alt=\"\" class=\"wp-image-56\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-main-menu.png 945w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-main-menu-300x169.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-main-menu-768x433.png 768w\" sizes=\"auto, (max-width: 945px) 100vw, 945px\" \/><figcaption>Main Menu<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"943\" height=\"533\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-level-1.png\" alt=\"\" class=\"wp-image-57\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-level-1.png 943w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-level-1-300x170.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-level-1-768x434.png 768w\" sizes=\"auto, (max-width: 943px) 100vw, 943px\" \/><figcaption>Prototype Level 1<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"945\" height=\"533\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-game-over.png\" alt=\"\" class=\"wp-image-58\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-game-over.png 945w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-game-over-300x169.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/blog-4-game-over-768x433.png 768w\" sizes=\"auto, (max-width: 945px) 100vw, 945px\" \/><figcaption>Game Over Menu<\/figcaption><\/figure>\n\n\n\n<p>When designing the architecture of our game, I had to keep in mind 2 things: <br>     1) The player&#8217;s total score and number of remaining lives must be tracked as the player progresses through different levels.<br>     2) Design an architecture that easily allows for adding new levels. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"611\" height=\"736\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/cs-467-ml-breakout-high-level-architecture.drawio-diagrams.net-2022-04-21-19-25-09.png\" alt=\"\" class=\"wp-image-60\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/cs-467-ml-breakout-high-level-architecture.drawio-diagrams.net-2022-04-21-19-25-09.png 611w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5511\/files\/2022\/04\/cs-467-ml-breakout-high-level-architecture.drawio-diagrams.net-2022-04-21-19-25-09-249x300.png 249w\" sizes=\"auto, (max-width: 611px) 100vw, 611px\" \/><figcaption>ML Breakout High Level Architecture Diagram<\/figcaption><\/figure>\n\n\n\n<p>The diagram above shows a high-level flowchart of the architectural design I decided to implement. The game can only start from the scene titled &#8220;Main&#8221;. This is the root scene that contains global scripts that will control which scenes get loaded and unloaded. This Main scene holds the &#8220;GameController&#8221; script, which will be the main driver for the game. The GameController keeps track of the player&#8217;s score and lives, and controls when scenes are loaded and unloaded. The scenes are loaded additively, so the Main scene stays loaded the entire time.<\/p>\n\n\n\n<p>In contrast, each separate level <span style=\"text-decoration: underline\">must<\/span> have its own local controller, called the &#8220;LevelHandler&#8221;. This controller uses the &#8220;LevelHandler&#8221; script, and contains all of the game&#8217;s assets as children in its hierarchy. <\/p>\n\n\n\n<p>The LevelHandler <span style=\"text-decoration: underline\">must<\/span> have a &#8220;BrickManager&#8221; as one of its children elements. The BrickManager uses the &#8220;BrickManager&#8221; script, and is responsible for creating the brick layout of the level, as well as destroying the bricks, and re-constructing the level if necessary. Both of these components are required because the root GameController component utilizes them to control the game.<\/p>\n\n\n\n<p>To add a new level, you would add a new method that constructs the level&#8217;s brick layout inside the BrickManager script. You would also need to add the new scene to the project&#8217;s File &gt; Build Settings, and to the corresponding Enum of Scene names in the SceneLoader (not shown).<\/p>\n\n\n\n<p>That&#8217;s about it for this week&#8217;s update. Stay out of trouble y&#8217;all.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After mostly working individually on our initial game prototypes, this past week was dedicated to combining together all of our work that was done in parallel. Good o&#8217; parallelism. Much efficient. Since each of us created a replica of the same game, this naturally resulted in our game assets being very similar. This made it &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blogs.oregonstate.edu\/kennguyen\/2022\/04\/21\/our-final-prototype\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Our Final Prototype&#8221;<\/span><\/a><\/p>\n","protected":false},"author":12358,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-uncategorized","entry"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/kennguyen\/wp-json\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/kennguyen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/kennguyen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/kennguyen\/wp-json\/wp\/v2\/users\/12358"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/kennguyen\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":10,"href":"https:\/\/blogs.oregonstate.edu\/kennguyen\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":68,"href":"https:\/\/blogs.oregonstate.edu\/kennguyen\/wp-json\/wp\/v2\/posts\/54\/revisions\/68"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/kennguyen\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/kennguyen\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/kennguyen\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}