{"id":2043,"date":"2021-08-28T23:03:47","date_gmt":"2021-08-28T21:03:47","guid":{"rendered":"https:\/\/lootburnkillrepeat.wordpress.com\/?p=2043"},"modified":"2023-12-25T13:51:37","modified_gmt":"2023-12-25T13:51:37","slug":"demox-6-new-ai-sensors","status":"publish","type":"post","link":"https:\/\/crumblingsoftware.net\/index.php\/2021\/08\/28\/demox-6-new-ai-sensors\/","title":{"rendered":"Demox AI #2 &#8211; Sensors"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote has-white-color has-text-color has-background has-link-color has-small-font-size wp-elements-2751d638d97c8a0b37584ee2df31282e is-layout-flow wp-block-quote-is-layout-flow\" style=\"background-color:#645449;font-style:italic;font-weight:600\">\n<p>Note!<\/p>\n<cite>This article is part of the, now deprecated, Demox development log. Demox was cancelled and is no longer in active development so this article can be somewhat out of context- however, I felt some information here could still be of use to someone, therefore it&#8217;ll remain for anyone to read.<\/cite><\/blockquote>\n\n\n\n<p>I&#8217;ve made some relatively large updates to AI behaviours and sensors before the summer arrived- something that might sound familiar to you who follow me on <a href=\"https:\/\/twitter.com\/CrumblinGames\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Twitter<\/strong><\/a>, since I&#8217;ve shown some of these things there already. Haven&#8217;t posted any development logs touching the subject though, primarily since I tend to do other things than sitting in front of the nerd-station when the snow finally melt&#8230; anyways, let&#8217;s get on with it!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Dynamic Point System Behaviour<\/h2>\n\n\n\n<p>I&#8217;ve talked about the <strong><span style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">DPBS <\/span><\/strong>earlier already, if not you can find the post <strong><a href=\"https:\/\/crumblingsoftware.net\/index.php\/2021\/03\/19\/demox-3-ai\/\" target=\"_blank\" rel=\"noreferrer noopener\">HERE<\/a><\/strong>, the AI in <strong><span style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">Demox <\/span><\/strong>will continuously evaluate their current situation and perform actions relevant to the conditions of said situation.<br>A new behaviour has been added to this system, to equip items found near the AI agent and to throw the equipment if it&#8217;s beneficial for the AI agent.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"ai hearing wpns throw\" width=\"500\" height=\"375\" src=\"https:\/\/www.youtube.com\/embed\/Hsy1Jd7fAZU?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><figcaption class=\"wp-element-caption\"><em><span class=\"has-inline-color has-luminous-vivid-amber-color\">Clip showcasing both new AI hearing sensor, aswell as AI item useage behaviour<\/span><\/em><\/figcaption><\/figure>\n\n\n\n<p><em>A quite simple behaviour but<\/em> it opens up for more combat challenges, since AI who can collect weapons will increase their damage output. Also, if the AI can throw the weapon they can do so if the player tries to run away from them- giving them a ranged attack opportunity.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Situational Awareness<\/h2>\n\n\n\n<p>Furthermore, I wanted my AI to be a bit more aware of their surroundings, earlier the player could run and jump around right behind the AI and they wouldn&#8217;t notice a thing- two new sensors have been implemented, namely, <strong><span class=\"has-inline-color has-luminous-vivid-orange-color\">&#8220;Smell Sensor&#8221;<\/span><\/strong> and <strong><span class=\"has-inline-color has-luminous-vivid-orange-color\">&#8220;Sound Sensor&#8221;<\/span><\/strong>. Two components that simulate exactly what they sound like.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Smell Sensor<\/h2>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:50%\">\n<p> The <strong><span class=\"has-inline-color has-luminous-vivid-orange-color\">Smell sensor<\/span><\/strong> is not used by all AI, at first I implemented it only for the Maradeur monster since it has no eyes. Another primary way of detecting hostiles was required so the smell sensor felt appropriate. Recently I&#8217;ve also used it for other creatures to some extent.<\/p>\n\n\n\n<p>The way it works is that characters in the game feed the game master logic with some information at regular intervals. First, <em>their own smell<\/em>&#8211; some AI can determine what creature they&#8217;re facing by their smell. Second, a value to determine how far the character&#8217;s smell can be detected is sent. Information about the current area the character is in is sent aswell and the world position of the character when the smell data was registered.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-twitter wp-block-embed-twitter\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"twitter-tweet\" data-width=\"500\" data-dnt=\"true\"><p lang=\"en\" dir=\"ltr\">AI smell sensor now detect nasty odours from other characters and will track the smellyness <a href=\"https:\/\/twitter.com\/hashtag\/indiegamedev?src=hash&amp;ref_src=twsrc%5Etfw\">#indiegamedev<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/indiegames?src=hash&amp;ref_src=twsrc%5Etfw\">#indiegames<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/indiegame?src=hash&amp;ref_src=twsrc%5Etfw\">#indiegame<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/indiegaming?src=hash&amp;ref_src=twsrc%5Etfw\">#indiegaming<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/gamedev?src=hash&amp;ref_src=twsrc%5Etfw\">#gamedev<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/madewithunity?src=hash&amp;ref_src=twsrc%5Etfw\">#madewithunity<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/unity3d?src=hash&amp;ref_src=twsrc%5Etfw\">#unity3d<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/screenshotsaturday?src=hash&amp;ref_src=twsrc%5Etfw\">#screenshotsaturday<\/a> <a href=\"https:\/\/t.co\/ARF6Ywqnq6\">pic.twitter.com\/ARF6Ywqnq6<\/a><\/p>&mdash; Crumblin&#39; Dave (@CrumblinGames) <a href=\"https:\/\/twitter.com\/CrumblinGames\/status\/1383516192510418953?ref_src=twsrc%5Etfw\">April 17, 2021<\/a><\/blockquote><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n<\/div><figcaption class=\"wp-element-caption\"><em><span class=\"has-inline-color has-luminous-vivid-amber-color\">Area and Character smell volumes<\/span><\/em><\/figcaption><\/figure>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lootburnkillrepeat.files.wordpress.com\/2021\/08\/sa.png?w=254\" alt=\"\" class=\"wp-image-2185\"\/><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:50%\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lootburnkillrepeat.files.wordpress.com\/2021\/08\/a_marauder1.gif?w=203\" alt=\"\" class=\"wp-image-2172\"\/><figcaption class=\"wp-element-caption\"><em><span class=\"has-inline-color has-luminous-vivid-amber-color\">The Maradeur<\/span><\/em><\/figcaption><\/figure>\n<\/div>\n\n\n<p>The idea is that some areas with strong smells should cloak a character&#8217;s smell- not completely but for a pre-defined percent of the character&#8217;s scent range.<\/p>\n\n\n\n<p>An example is in an area with very strong smells, a character who has a <em><span class=\"has-inline-color has-vivid-cyan-blue-color\">scent range<\/span><\/em> of 8 meters would receive a <span class=\"has-inline-color has-vivid-cyan-blue-color\">75% smell-cloak<\/span> benefit, resulting in a reduced <span class=\"has-inline-color has-vivid-cyan-blue-color\">scent range<\/span> of 2 meters, therefore making it alot harder for other AI to detect by smell. This can be seen in action in the attached Twitter-post to the left, the red circles represent the player character&#8217;s <span class=\"has-inline-color has-vivid-cyan-blue-color\">scent range<\/span>. When entering different area volumes ( colored boxes ) the size of those red circles are reduced.<\/p>\n\n\n\n<p>As can be seen in the video the trail of smell information left behind the player shrink over time.<\/p>\n\n\n\n<p>So in order for the AI <span class=\"has-inline-color has-luminous-vivid-orange-color\">smell sensor<\/span> to make use of this information it must first be collected from the Game Master, all registered smell information is filtered to find only information relevant to the AI, ie. smell data with a location reference within x meters of the AI&#8217;s world position.<\/p>\n\n\n\n<p>The &#8220;x meters&#8221; is the smell sensors <span class=\"has-inline-color has-vivid-cyan-blue-color\">detection<\/span> <span class=\"has-inline-color has-vivid-cyan-blue-color\">range<\/span>, while the <span class=\"has-inline-color has-vivid-cyan-blue-color\">detection range<\/span> is not printed in the video shown here it can still be noticed since the AI does not have to be inside the red circles to start investigating a smell. This is because only the sensors <span class=\"has-inline-color has-vivid-cyan-blue-color\">detection range volume<\/span> have to intersect with the smell information&#8217;s volume, not the character itself.<\/p>\n<\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-default\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Sound Sensor<\/h2>\n\n\n\n<p>The <span class=\"has-inline-color has-luminous-vivid-orange-color\">sound sensor<\/span> was implemented since I found it weird that as the player you could jump and run around right behind an enemy and they&#8217;ld be completely clueless about what was going on behind their back. All AI characters in the game now use <span class=\"has-inline-color has-luminous-vivid-orange-color\">sound sensors<\/span>, <em>essentially it work the same way as my <span class=\"has-inline-color has-luminous-vivid-orange-color\">smell sensor<\/span><\/em>&#8211; characters and actions happening in the game feed the game master with data containers holding information about the sound: noise radius <span class=\"has-inline-color has-pale-cyan-blue-color\">(volume)<\/span>, origin <span class=\"has-inline-color has-pale-cyan-blue-color\">(friendly, wildlife, hostile, combat, environment, unknown) <\/span>and world position.<\/p>\n\n\n\n<p>The AI regularly check the noises registered within the range that they can hear and depending on how the AI character is set up it will interact with the noise. <\/p>\n\n\n\n<p>Combat sounds will make all combatant characters investigate, while non-combatants will get scared, try to hide, or run away from the sound. Hostile sounds<span class=\"has-inline-color has-pale-cyan-blue-color\"> ( primarily monster voices &amp; footsteps )<\/span> will agitate friendly AI, and scare most wildlife AI, vice verca for friendly sounds, wildlife sounds<span class=\"has-inline-color has-pale-cyan-blue-color\"> ( animal voices &amp; footsteps ) <\/span>is ignored by friendly AI and agitates some of the hostile AI characters. Environment and unknown-flagged sounds depend alot on what type of sound is registered, but these two sound types are either ignored or investigated.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"ai hearSmellScan\" width=\"500\" height=\"375\" src=\"https:\/\/www.youtube.com\/embed\/iKjKi9p4eaU?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<\/div>\n\n\n\n<div class=\"wp-block-column has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-ae53208be526e9a7296e54709aaa2597 is-layout-flow wp-block-column-is-layout-flow\" style=\"font-style:italic;font-weight:500\">\n<p>The video to the left display a Maradeur trying to investigate the sound sources created by the player character.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Additional AI detector\/sensors added at a later stage of development of the cancelled game &#8220;Demox&#8221;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_share_on_mastodon":"0"},"categories":[105],"tags":[108,31],"class_list":["post-2043","post","type-post","status-publish","format-standard","hentry","category-design-scribbles","tag-dev-blog","tag-development"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/crumblingsoftware.net\/index.php\/wp-json\/wp\/v2\/posts\/2043","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crumblingsoftware.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crumblingsoftware.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crumblingsoftware.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crumblingsoftware.net\/index.php\/wp-json\/wp\/v2\/comments?post=2043"}],"version-history":[{"count":1,"href":"https:\/\/crumblingsoftware.net\/index.php\/wp-json\/wp\/v2\/posts\/2043\/revisions"}],"predecessor-version":[{"id":2521,"href":"https:\/\/crumblingsoftware.net\/index.php\/wp-json\/wp\/v2\/posts\/2043\/revisions\/2521"}],"wp:attachment":[{"href":"https:\/\/crumblingsoftware.net\/index.php\/wp-json\/wp\/v2\/media?parent=2043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crumblingsoftware.net\/index.php\/wp-json\/wp\/v2\/categories?post=2043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crumblingsoftware.net\/index.php\/wp-json\/wp\/v2\/tags?post=2043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}