{"id":18432,"date":"2024-12-10T04:03:05","date_gmt":"2024-12-10T04:03:05","guid":{"rendered":"https:\/\/astoryisnotatree.net\/?p=18432"},"modified":"2024-12-10T15:17:24","modified_gmt":"2024-12-10T15:17:24","slug":"art-from-code-flocking-game","status":"publish","type":"post","link":"https:\/\/astoryisnotatree.net\/?p=18432","title":{"rendered":"ART FROM CODE: FLOCKING GAME"},"content":{"rendered":"\n<p>This project simulates flocking behavior, inspired by natural phenomena such as birds flying in flocks or fish swimming in schools. It uses a set of simple rules (alignment, cohesion, and separation) to govern the movement of the individual objects that you see onscreen. It allows the player to interact with the objects in a relaxing way, which I found almost gamified the process, hence the name. <br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"794\" height=\"670\" src=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-1.png\" alt=\"\" class=\"wp-image-18434\" srcset=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-1.png 794w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-1-300x253.png 300w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-1-768x648.png 768w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-1-675x570.png 675w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-1-480x405.png 480w\" sizes=\"auto, (max-width: 794px) 100vw, 794px\" \/><\/a><\/figure>\n\n\n\n<p>I became interested by the work of Craig Raynolds, and I was inspired to find a way of incorporating his findings into an interactive art piece. I began by learning the behavior of the objects, and how to incorporate them into my own processing sketches. <br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/Screenshot-2024-12-09-215916.png\"><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"751\" src=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/Screenshot-2024-12-09-215916.png\" alt=\"\" class=\"wp-image-18435\" srcset=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/Screenshot-2024-12-09-215916.png 772w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/Screenshot-2024-12-09-215916-300x292.png 300w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/Screenshot-2024-12-09-215916-768x747.png 768w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/Screenshot-2024-12-09-215916-675x657.png 675w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/Screenshot-2024-12-09-215916-480x467.png 480w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/a><\/figure>\n\n\n\n<p>I first did this by making a simple sketch that got an object to follow my cursor (the circle), which was the first step to incorporate behavior. It better allowed me to understand how to incorporate direction and magnitude for the objects I was going to be making. The cursor represents a dynamic target that constantly changes, which also taught me more about the importance of real time updates, feedback loops, and responsiveness with in systems like these.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"778\" src=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-2.png\" alt=\"\" class=\"wp-image-18436\" srcset=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-2.png 773w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-2-298x300.png 298w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-2-150x150.png 150w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-2-768x773.png 768w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-2-675x679.png 675w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-2-480x483.png 480w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-2-100x100.png 100w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/a><\/figure>\n\n\n\n<p>Next I started working on a sketch with multiple objects that follow a flow field. This helped me switch from working with a single object model to a multi object system. It was not quite a simulation however it allowed me to practice using more forces that I would need to input following this. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"778\" height=\"742\" src=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-7.png\" alt=\"\" class=\"wp-image-18437\" srcset=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-7.png 778w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-7-300x286.png 300w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-7-768x732.png 768w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-7-675x644.png 675w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-7-480x458.png 480w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/><\/a><\/figure>\n\n\n\n<p>After the flow field, I was able to implement forces on the objects that outline a flocking simulation, and from there I started trying to figure out how to make the objects visually appealing. It took a lot of fine tuning, but I eventually got a result that I was satisfied with. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"710\" src=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-8.png\" alt=\"\" class=\"wp-image-18438\" srcset=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-8.png 762w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-8-300x280.png 300w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-8-675x629.png 675w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-8-480x447.png 480w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/a><\/figure>\n\n\n\n<p>The final step in the process for me was making the sketch interactable so that it would somewhat be a game. The way this was done was by making the forces applied to the boids changeable as the sketch ran. Including what I had learned with the beginning sketch I had done, I included attraction or repulsion to the cursor that can be toggled also. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-9.png\"><img loading=\"lazy\" decoding=\"async\" width=\"785\" height=\"740\" src=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-9.png\" alt=\"\" class=\"wp-image-18439\" srcset=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-9.png 785w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-9-300x283.png 300w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-9-768x724.png 768w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-9-675x636.png 675w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2024\/12\/image-9-480x452.png 480w\" sizes=\"auto, (max-width: 785px) 100vw, 785px\" \/><\/a><\/figure>\n\n\n\n<p>This project allowed me to learn and work through many processes that did not come naturally for me. Since I have not taken a formal coding class before this, I was able to find a new appreciation for computer science that I have not had previously. I have taken many pure mathematics courses, so understanding how many topics that I have learned previously are applied to this was also very intriguing. I will be looking forward to applying the skills I have learnt to other similar fields. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>This project simulates flocking behavior, inspired by natural phenomena such as birds flying in flocks or fish swimming in schools. It uses a set of simple rules (alignment, cohesion, and separation) to govern the movement of the individual objects that&#8230;<\/p>\n","protected":false},"author":401,"featured_media":18442,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[225],"tags":[],"class_list":["post-18432","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-art-from-code","wpcat-225-id"],"_links":{"self":[{"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/posts\/18432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/users\/401"}],"replies":[{"embeddable":true,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18432"}],"version-history":[{"count":1,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/posts\/18432\/revisions"}],"predecessor-version":[{"id":18440,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/posts\/18432\/revisions\/18440"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/media\/18442"}],"wp:attachment":[{"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}