{"id":4234,"date":"2023-04-03T19:00:58","date_gmt":"2023-04-03T10:00:58","guid":{"rendered":"https:\/\/blog.criware.com\/?p=4234"},"modified":"2024-05-20T16:36:15","modified_gmt":"2024-05-20T07:36:15","slug":"player-breathing-system","status":"publish","type":"post","link":"https:\/\/blog.criware.com\/index.php\/2023\/04\/03\/player-breathing-system\/","title":{"rendered":"Player Breathing System"},"content":{"rendered":"<p>A convincing breathing system can play a crucial role in enhancing the player&#8217;s experience. It is a great way to provide feedback about the character that can serve both the gameplay and the narrative of a game. In this post, we examine how such a system can be designed in Atom Craft.<\/p>\n<div class=\"wp-video\" style=\"width: 800px; display: block; margin: 40px auto;\">\n<div style=\"width: 800px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-4234-1\" width=\"800\" height=\"450\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/Video_BreathingSystem.mp4?_=1\" \/><a href=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/Video_BreathingSystem.mp4\">https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/Video_BreathingSystem.mp4<\/a><\/video><\/div>\n<\/div>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Assets creation<\/h2>\n<p>In order to control the breath of the character, audio assets with different intensity levels need to be prepared. This implementation includes:<\/p>\n<ul>\n<li>4 levels of breathing intensity, from slow to fast.<\/li>\n<li>Separate inhale and exhale sounds for each intensity level.<\/li>\n<li>Several variations for each state (they must have almost the same duration to avoid timing disparities).<\/li>\n<\/ul>\n<p>Once the assets ready, they are imported in the project\u2019s <em>Materials<\/em> folder.<\/p>\n<p style=\"text-align:center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/01-Assets.png\" alt=\"01 Assets\" width=\"740\" height=\"548\" class=\"alignnone size-full wp-image-4239\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/01-Assets.png 740w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/01-Assets-300x222.png 300w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/>\n<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Cue Integration<\/h2>\n<p>The basis for the breathing system is the alternance between the inhale and exhale sounds. To achieve this:<\/p>\n<ul>\n<li>Create a \u201cBreath\u201d Cue of <strong>Sequential<\/strong> type and add two tracks for Inhale and Exhale. This will allow us to play them successively.<\/li>\n<li>On the Cue properties, change the <strong>Playback Mode<\/strong> to <em>PlayList,<\/em> so that the playback continues repeatedly; and set the <strong>Voice Behavior<\/strong> to <em>Voice Stop<\/em>, which will limit the number of concurrent voices.<\/li>\n<\/ul>\n<p>Then, to manage the intensity of the breathing:<\/p>\n<ul>\n<li>On both the Inhale and Exhale tracks, create a <em>Polyphonic<\/em> <strong>Sub Sequence<\/strong>.<\/li>\n<li>Slightly randomize their <em>Volume<\/em> and <em>Pitch <\/em> ranges.<\/li>\n<li>Within each Sub Sequence, create <strong>four tracks<\/strong> for each level of intensity.<\/li>\n<li>Create a new <strong>Sub Sequence<\/strong> &#8211; this time of type <em>Shuffle<\/em> &#8211; on each of these four tracks.<\/li>\n<li>Drag and drop your Materials in the Shuffle Sub Sequences, making sure you go through the same process for the Inhale and Exhale parts.<\/li>\n<\/ul>\n<p>Finally, in order to make the changes in breathing rate sound more natural, markers are added to the Polyphonic Inhale and Exhale Sub Sequences:<\/p>\n<ul>\n<li>The Shuffle Sub Sequence region for the first level of intensity should be the longest.<\/li>\n<li>Create <em>Sequence Start<\/em> and <em>Sequence End<\/em><strong> Markers<\/strong> at the start and at the end of the region respectively.<\/li>\n<li>Add these markers to both the Inhale and Exhale Sub Sequences.<\/li>\n<\/ul>\n<p>By doing so, the End marker is used to restart the playback instead of the end of a region, which makes adjusting the pace of the breathing easier.<\/p>\n<p>The hierarchy of the Cue should look like this:<\/p>\n<p style=\"text-align:center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/02-Cue-Hierarchy.png\" alt=\"02 Cue Hierarchy\" width=\"1290\" height=\"536\" class=\"alignnone size-full wp-image-4240\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/02-Cue-Hierarchy.png 1290w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/02-Cue-Hierarchy-300x125.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/02-Cue-Hierarchy-768x319.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/02-Cue-Hierarchy-1024x425.png 1024w\" sizes=\"auto, (max-width: 1290px) 100vw, 1290px\" \/>\n<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">AISAC<\/h2>\n<p>Now that the Cue is set up, an AISAC is used to switch between the intensity layers.<\/p>\n<ul>\n<li>First, in the <em>Project Tree<\/em>, create a new <strong>AISAC <\/strong>called \u201cBreath_Control\u201d.<\/li>\n<li>Then, in the Inhale and Exhale Sub Sequences of the breathing Cue, make the AISAC control the <em>Volume<\/em> of each of the four intensity tracks.<\/li>\n<li>Edit the graphs to make them crossfade from Level 1 to 4.<\/li>\n<li>In our case, since there was too much contrast between the attack of the sounds used in Level 2 and 3, we slightly attenuated the attack of the Level 3 sounds by changing the <em>EG \u2013 Attack Time <\/em>during the crossfade.<\/li>\n<\/ul>\n<p>It is now possible to seamlessly increase or decrease the intensity of the breathing.<\/p>\n<p style=\"text-align:center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/03-Aisac-Volume.png\" alt=\"03 Aisac Volume\" width=\"1055\" height=\"490\" class=\"alignnone size-full wp-image-4241\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/03-Aisac-Volume.png 1055w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/03-Aisac-Volume-300x139.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/03-Aisac-Volume-768x357.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/03-Aisac-Volume-1024x476.png 1024w\" sizes=\"auto, (max-width: 1055px) 100vw, 1055px\" \/>\n<\/p>\n<p>To match the speed of the breathing to the intensity, we will rely on the Sequence Start and Stop Markers we previously added, so that the duration of a breath remains constant independently from the duration of the materials used.<\/p>\n<p>This means that the <em>Playback Rate <\/em>of the Cue can now be used to adjust the breathing rate. Since this parameter can only quadruple the rate at the most, we will need to apply it twice to reach the maximal breathing speed:<\/p>\n<ul>\n<li>Both at the Cue and at the Inhale\/Exhale Sub Sequences levels, create a <em>Playback Rate<\/em> graph controlled by the AISAC.<\/li>\n<li>At the Sub Sequence level, the graph should be a straight line going from 1 to 4.<\/li>\n<li>At the Cue level, the graph goes from 0.6 to 2.7, with an intermediate point at 1 when the control value reaches 0.075. Note that these values have to be adjusted depending on the duration of your own materials.<\/li>\n<li>Finally, add a <em>Volume<\/em> graph at the Cue level to reduce the overall volume at low intensity.<\/li>\n<\/ul>\n<p style=\"text-align:center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/04-Aisac-Playback-Rate.png\" alt=\"04 Aisac Playback Rate\" width=\"1055\" height=\"490\" class=\"alignnone size-full wp-image-4242\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/04-Aisac-Playback-Rate.png 1055w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/04-Aisac-Playback-Rate-300x139.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/04-Aisac-Playback-Rate-768x357.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/04-Aisac-Playback-Rate-1024x476.png 1024w\" sizes=\"auto, (max-width: 1055px) 100vw, 1055px\" \/>\n<\/p>\n<p>Here is the final hierarchy for the Cue including the AISAC.<\/p>\n<p style=\"text-align:center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/05-Breakdown.png\" alt=\"05 Breakdown\" width=\"803\" height=\"491\" class=\"alignnone size-full wp-image-4243\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/05-Breakdown.png 803w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/05-Breakdown-300x183.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/05-Breakdown-768x470.png 768w\" sizes=\"auto, (max-width: 803px) 100vw, 803px\" \/>\n<\/p>\n<p>You can try the breathing system by dowloading the project below.<\/p>\n<div style=\"max-width: 800px; margin: 0 auto; margin-bottom: 20px; text-align: center;\"><a style=\"display: block; border: 1px solid #ccc; padding: 20px; max-width: 100%; margin: 0 auto;\" href=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/03\/AtomCraft_Project_BreathingSystem.zip\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1813\" style=\"display: block; margin: 0 auto;\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2018\/06\/zip.png\" alt=\"zip\" width=\"80\" height=\"78\" \/>AtomCraft_Project_BreathingSystem.zip<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>A convincing breathing system can play a crucial role in enhancing the player&#8217;s experience. It is a great way to<\/p>\n","protected":false},"author":2,"featured_media":5433,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[5,7],"tags":[],"class_list":["post-4234","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-adx","category-tutorials"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/4234","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=4234"}],"version-history":[{"count":11,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/4234\/revisions"}],"predecessor-version":[{"id":5432,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/4234\/revisions\/5432"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media\/5433"}],"wp:attachment":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media?parent=4234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/categories?post=4234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/tags?post=4234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}