{"id":231,"date":"2024-10-07T16:37:40","date_gmt":"2024-10-07T16:37:40","guid":{"rendered":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/?p=231"},"modified":"2024-10-07T16:38:07","modified_gmt":"2024-10-07T16:38:07","slug":"interaction-through-interfaces-devlog_024","status":"publish","type":"post","link":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/2024\/10\/07\/interaction-through-interfaces-devlog_024\/","title":{"rendered":"Interaction Through Interfaces | DevLog_024"},"content":{"rendered":"\n<p>In my World Without game, I wanted interaction with the world to feature a few core mechanics all to do with the theme of Libraries as free, public access to information: Non-Obligatory Play, Discovery, and vital community resource. All these themes feature the tenants of A \u201cThird Place.\u201d &nbsp;<\/p>\n\n\n\n<p>\u201cThe&nbsp;third place&nbsp;refers to the social surroundings that are separate from the two usual social environments of&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Home\">home<\/a>&nbsp;(&#8220;first place&#8221;) and the&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Workplace\">workplace<\/a>&nbsp;(&#8220;second place&#8221;).\u201d <a href=\"https:\/\/en.wikipedia.org\/wiki\/Third_place#:~:text=In%20sociology,%20the%20third%20place%20refers%20to%20the%20social%20surroundings\">Third place &#8211; Wikipedia<\/a><\/p>\n\n\n\n<p>A World Without Libraries would cut off crucial access to many members in their respected communities. To showcase this idea, I want to fill the play space with different objects to interact with in a way that allows the player space to discover the area around them, while highlighting these crucial areas of access.<br><br>From the Development side, making many different interactable objects creates a problem with many solutions. These range from simple to almost needlessly complex in terms of how efficiently I want to make this process. The balance of making a tool programmatically complex and effective to use in terms of design. This led me down the path of Abstraction and extending Classes with Interfaces. In this iteration of the Interact mechanic, I would have a base class and interface that all actors in the game with the same interface, could communicate effectively and efficiently. This process also has the benefit of being very easy to extend, being the benefit of Abstraction larger classes into subclasses that inherit all that functionality and the ability to overwrite anything that is necessary or unique to that individual class.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Interaction Interface<\/h5>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"425\" src=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image.png\" alt=\"\" class=\"wp-image-232\" srcset=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image.png 826w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image-300x154.png 300w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image-768x395.png 768w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\" \/><figcaption class=\"wp-element-caption\">Interface with Functions designed to be overridden <\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"760\" src=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image-1.png\" alt=\"\" class=\"wp-image-233\" srcset=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image-1.png 940w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image-1-300x243.png 300w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image-1-768x621.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><figcaption class=\"wp-element-caption\">Interactable Base Class -> Extends Interface and inherits\/overrides function<\/figcaption><\/figure>\n\n\n\n<p>Playable Character extends the interface as well, making executions of the functions simple by passing in pointer to the actor in which to execute that function in. This is useful for different interactable actors doing different actions but sharing the same base level of functionality that the Player can easily call to.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"494\" src=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image-2.png\" alt=\"\" class=\"wp-image-234\" srcset=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image-2.png 940w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image-2-300x158.png 300w, https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-content\/uploads\/2024\/10\/image-2-768x404.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><figcaption class=\"wp-element-caption\">Temporary functions to test interactions <\/figcaption><\/figure>\n\n\n\n<p>Given the pointer from the Overlap function, the Player class is easily able to check if the overlapped actor can be Interacted with by checking if it Implements the correct interface.<\/p>\n\n\n\n<p>This model is easily extendable and writing custom functionality in the future should be much easier to do, now that I do not have to change what the Player should be looking out for.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my World Without game, I wanted interaction with the world to feature a few core mechanics all to do with the theme of Libraries as free, public access to information: Non-Obligatory Play, Discovery, and vital community resource. All these themes feature the tenants of A \u201cThird Place.\u201d &nbsp; \u201cThe&nbsp;third place&nbsp;refers to the social surroundings&hellip; <a class=\"more-link\" href=\"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/2024\/10\/07\/interaction-through-interfaces-devlog_024\/\">Continue reading <span class=\"screen-reader-text\">Interaction Through Interfaces | DevLog_024<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-devlog","entry"],"_links":{"self":[{"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=231"}],"version-history":[{"count":1,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":235,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/posts\/231\/revisions\/235"}],"wp:attachment":[{"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andrewdalaimo.nuacomputerscience.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}