{"id":6575,"date":"2025-12-23T12:17:14","date_gmt":"2025-12-23T03:17:14","guid":{"rendered":"https:\/\/blog.criware.com\/?p=6575"},"modified":"2025-12-23T12:17:14","modified_gmt":"2025-12-23T03:17:14","slug":"interactive-creature","status":"publish","type":"post","link":"https:\/\/blog.criware.com\/index.php\/2025\/12\/23\/interactive-creature\/","title":{"rendered":"Interactive Creature"},"content":{"rendered":"<p>In this post, we will design a simple audio system for a creature. The sounds it produces will depend on a game parameter that describes the creature&#8217;s state. In our example, the creature will have three distinct states, as shown in the video below. You can, of course, add other states based on your specific gameplay. <\/p>\n<p><center><div style=\"width: 640px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-6575-1\" width=\"640\" height=\"360\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/creature_showcase-2.mp4?_=1\" \/><a href=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/creature_showcase-2.mp4\">https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/creature_showcase-2.mp4<\/a><\/video><\/div><\/center><\/p>\n<p>For asset creation, you can record your own voice and apply additional effects, such as pitch-shifting, modulations, and equalization. For this post, we have designed three different types of sound effects: attack, sniffing, and idle.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-1.png\" alt=\"\" width=\"672\" height=\"670\" class=\"alignnone size-full wp-image-6578\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-1.png 1345w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-1-300x300.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-1-1024x1019.png 1024w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-1-150x150.png 150w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-1-768x765.png 768w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><\/center><\/p>\n<p>After importing the sound assets into the Material root folder, we create three <strong>Random No Repeat Cues<\/strong>, one for each creature state. We assign the sounds we designed for each state to the corresponding Cue, ensuring that there is a single Material per Track. The Cue\u2019s built-in randomization mechanism will make sure that the same Track is never played twice in a row, adding more realism.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-2.png\" alt=\"\" width=\"666\" height=\"285\" class=\"alignnone size-full wp-image-6579\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-2.png 1333w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-2-300x128.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-2-1024x437.png 1024w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-2-768x328.png 768w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/center><\/p>\n<p>The next step is to create a <strong>Switch Cue<\/strong> that will listen to the game engine. We simply drag the existing <strong>Random No Repeat Cues<\/strong> onto it, allowing the system to choose between different sound effects based on the game\u2019s current state.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-3.png\" alt=\"\" width=\"664\" height=\"223\" class=\"alignnone size-full wp-image-6580\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-3.png 1328w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-3-300x101.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-3-1024x343.png 1024w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-3-768x257.png 768w\" sizes=\"auto, (max-width: 664px) 100vw, 664px\" \/><\/center><\/p>\n<p>At this stage, our sounds are ready to be played, but we still need the system to listen to the game engine. In the Project Tree, under the <strong>Game Variables<\/strong> folder, we create a new variable called &#8220;creature_status&#8221;. (Note that for well defined states, the usual way to do this would be to create a <strong>Selector<\/strong> and <strong>Selector Labels<\/strong>, but we want to show here that it is also possible with a <strong>Game Variable<\/strong>.)  <\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-4.png\" alt=\"\" width=\"650\" height=\"416\" class=\"alignnone size-full wp-image-6581\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-4.png 1301w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-4-300x192.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-4-1024x655.png 1024w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-4-768x491.png 768w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/center><\/p>\n<p>In the <strong>Switch Cue<\/strong>&#8216;s inspector, we assign the newly created game parameter to the <strong>Switch Variable<\/strong>. Then, we can adjust the value ranges that will trigger the different types of sound effects. You can also simply click the &#8220;Evenly&#8221; button to distribute the values equally between each Track (in our case 0.333 for each Track), and adjust them later if necessary. <\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-5.png\" alt=\"\" width=\"849\" height=\"306\" class=\"alignnone size-full wp-image-6582\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-5.png 1698w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-5-300x108.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-5-1024x370.png 1024w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-5-768x277.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-5-1536x555.png 1536w\" sizes=\"auto, (max-width: 849px) 100vw, 849px\" \/><\/center><\/p>\n<p>Finally, to test the system, go to View > Session Window, then drag and drop the <strong>Switch Cue<\/strong> into the Player. Activate the &#8220;creature status&#8221; variable, and you will hear the correct sound effect play based on the value you set with the slider. <\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-6.png\" alt=\"\" width=\"517\" height=\"358\" class=\"alignnone size-full wp-image-6583\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-6.png 1034w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-6-300x207.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-6-1024x708.png 1024w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-6-768x531.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-6-392x272.png 392w, https:\/\/blog.criware.com\/wp-content\/uploads\/2025\/12\/screen-6-130x90.png 130w\" sizes=\"auto, (max-width: 517px) 100vw, 517px\" \/><\/center><\/p>\n<p>This system, with the help of a programmer, enables you to play different sounds for a single source depending on the value of a game variable.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we will design a simple audio system for a creature. The sounds it produces will depend on<\/p>\n","protected":false},"author":2,"featured_media":6576,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[5],"tags":[],"class_list":["post-6575","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-adx"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/6575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/comments?post=6575"}],"version-history":[{"count":6,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/6575\/revisions"}],"predecessor-version":[{"id":6590,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/6575\/revisions\/6590"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media\/6576"}],"wp:attachment":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media?parent=6575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/categories?post=6575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/tags?post=6575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}