{"id":45,"date":"2022-10-23T20:12:51","date_gmt":"2022-10-23T20:12:51","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/?p=45"},"modified":"2022-10-23T20:12:51","modified_gmt":"2022-10-23T20:12:51","slug":"capstone-project","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/2022\/10\/23\/capstone-project\/","title":{"rendered":"Capstone Project"},"content":{"rendered":"\n<p>For the Capstone project, I and two other students are working on a 3D Tower Defense game in <a target=\"_blank\" href=\"https:\/\/unity.com\/\" rel=\"noreferrer noopener\">Unity<\/a>. The basic premise is this \u2013 orcs and other fantasy creatures are working their way along a snaking path toward the player\u2019s castle, intent on destroying it. The player is tasked with strategically placing various types of towers along the path to destroy the enemy invaders before they can destroy the castle. It\u2019s a popular game format found in many games, and creative variations of the format can also be found in popular games, such as Plants versus Zombies.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/cdn.discordapp.com\/attachments\/967062291331825687\/1033523522963767316\/unknown.png\" alt=\"\" \/><figcaption>Current state of our Tower Defense game.<\/figcaption><\/figure>\n\n\n\n<p>I have prior experience working in Unity, but it\u2019s been about five years since I spent any time significant time with it. Back then I was modeling real-time 3D assets for a <a rel=\"noreferrer noopener\" href=\"https:\/\/pendulum.artstation.com\/projects\/YNQgq?album_id=974358\" target=\"_blank\">virtual reality <\/a>application and had not yet started the CS program. I enjoyed Unity at the time, but my coding skills were \u201cexploratory\u201d at best. While I was able to get things to work eventually, thanks mostly in part to online forums and tutorials, I didn\u2019t have a good grasp on what was going on. If I couldn\u2019t find a good example via Google, then I often couldn\u2019t go much further. It was frustrating, to say the least.\u00a0<\/p>\n\n\n\n<p><br>Now, as I near the end of this program, I have at least some understanding of what is going on with Object-Oriented Programming and C-style languages, and I\u2019m having a great time working with Unity. It\u2019s a lot of fun.\u00a0<\/p>\n\n\n\n<p><br>Unity is a great environment to work in, providing a central hub that ties all the disparate pieces of a game together. I think of it as a really great Integrated Development Environment, like <a rel=\"noreferrer noopener\" href=\"https:\/\/www.jetbrains.com\/pycharm\/\" target=\"_blank\">PyCharm<\/a> or <a rel=\"noreferrer noopener\" href=\"https:\/\/www.jetbrains.com\/webstorm\/\" target=\"_blank\">WebStorm<\/a>, but even better. It has a Scene view as well as an Inspector to view exposed variables and connections between assets and scripts. It will compile the C# code every time you make a change, and when you press \u201cPlay\u201d in the editor it executes the program and you can see the game in action. It\u2019s a visual testing environment, with a layer of abstraction that I find very helpful when learning to code for games. I think it is a great tool for beginners to experience the joy of coding and seeing the effects quickly and visually.\u00a0<\/p>\n\n\n\n<p><br>One of the most time-consuming parts of game development is building assets. These are the meshes, animations, materials, textures, rigs, sound effects, and other visual and audio components that constitute the \u201cmaterial\u201d the game is made from, all optimized for real-time rendering. This is no easy task to undertake. Fortunately, we could download our game assets from the Unity Asset Store, immediately removing that hurdle. With the assets complete we could focus on programming, developing scripts that we can attach to the assets in the Unity Editor, and building out the overall game behavior.\u00a0<\/p>\n\n\n\n<p><br><strong>Our Assets<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/paper-attachments.dropboxusercontent.com\/s_A7596B4C415364D01596304B73F7454738626BFC59579E0B24338243BB5A382F_1666554167910_image.png\" alt=\"\" \/><figcaption><a href=\"https:\/\/bit.ly\/3CRSJe8\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/bit.ly\/3CRSJe8<\/a><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/paper-attachments.dropboxusercontent.com\/s_A7596B4C415364D01596304B73F7454738626BFC59579E0B24338243BB5A382F_1666554217531_image.png\" alt=\"\" \/><figcaption><a href=\"https:\/\/bit.ly\/3z75dh4\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/bit.ly\/3z75dh4<\/a><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/paper-attachments.dropboxusercontent.com\/s_A7596B4C415364D01596304B73F7454738626BFC59579E0B24338243BB5A382F_1666554297379_image.png\" alt=\"\" \/><figcaption><a href=\"https:\/\/www.kenney.nl\/assets\/tower-defense-kit\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.kenney.nl\/assets\/tower-defense-kit<\/a><\/figcaption><\/figure>\n\n\n\n<p>While Unity is a great environment for piecing together all the assets and code into a cohesive program, it\u2019s not ideal for editing the code itself. I do the actual coding in a companion IDE called <a rel=\"noreferrer noopener\" href=\"https:\/\/www.jetbrains.com\/rider\/\" target=\"_blank\">Ryder<\/a> (from JetBrains) that attaches to the Unity process. This allows me to edit the code in an environment specifically for C#, run Unity from Ryder, set breakpoints, and even debug the game at runtime.\u00a0<\/p>\n\n\n\n<p><br>Another great aspect of working in Unity is the community support and extensive online resources. Because it is such a widely-used game engine, there is no shortage of coding examples and instruction built around it. One interesting avenue I went down in the course of this project was learning about <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.unity3d.com\/Manual\/class-ScriptableObject.html\" target=\"_blank\">ScriptableObjects<\/a> in Unity. These are project-wide serializable assets, created by scripts and adjusted in the editor, that can be accessed in any scene, preserving state across scenes. At a basic level, they can act as novel data containers, but others have built entire game architectures around them, greatly modularizing the various component of a game. Here are a few videos I found useful for learning about ScriptableObjects:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Unite Austin 2017 - Game Architecture with Scriptable Objects\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/raQ3iHhE_Kk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Game architecture with ScriptableObjects | Open Projects Devlog\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/WLDgtRNK2VE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><br>So for now I\u2019m really enjoying this Capstone project and playing around inside Unity. It is very accessible and easy to get started but has tremendous potential for powerful and complex applications. There are also many other <a rel=\"noreferrer noopener\" href=\"https:\/\/transforminteractive.com\/5-best-uses-for-unity\/\" target=\"_blank\">applications<\/a> you can build with Unity that aren\u2019t conventional games, such as Interactive Experiences, Simulations, or Architectural Visualization. This experience has made me even reconsider what jobs I might pursue when I graduate. \u00a0At the very least, I highly recommend trying it out if you have ever been curious about game development or just trying out new methods to make something.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the Capstone project, I and two other students are working on a 3D Tower Defense game in Unity. The basic premise is this \u2013 orcs and other fantasy creatures are working their way along a snaking path toward the player\u2019s castle, intent on destroying it. The player is tasked with strategically placing various types [&hellip;]<\/p>\n","protected":false},"author":12709,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-45","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/wp-json\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/wp-json\/wp\/v2\/users\/12709"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":2,"href":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":47,"href":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/wp-json\/wp\/v2\/posts\/45\/revisions\/47"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/jasonbrown\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}