{"id":4302,"date":"2023-05-08T14:21:28","date_gmt":"2023-05-08T05:21:28","guid":{"rendered":"https:\/\/blog.criware.com\/?p=4302"},"modified":"2023-05-08T14:21:28","modified_gmt":"2023-05-08T05:21:28","slug":"crowd-system","status":"publish","type":"post","link":"https:\/\/blog.criware.com\/index.php\/2023\/05\/08\/crowd-system\/","title":{"rendered":"Crowd System"},"content":{"rendered":"<p>Crowd systems are common in open-world games where many NPCs can assemble, and always present interesting challenges when it comes to their audio implementation. In this post, we describe how to design such a system directly 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-4302-1\" width=\"800\" height=\"450\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/Video_CrowdsSystem2.mp4?_=1\" \/><a href=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/Video_CrowdsSystem2.mp4\">https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/Video_CrowdsSystem2.mp4<\/a><\/video><\/div>\n<\/div>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Assets creation<\/h2>\n<p>First, we create loops for three levels of crowd density: low, medium, and high:<\/p>\n<ul>\n<li>Low density will be for groups of 2 to 4 persons.<\/li>\n<li>Medium density is for 4 to 8 persons.<\/li>\n<li>And finally, high density is for groups of 10 and more.<\/li>\n<\/ul>\n<p>Once your loops are ready, import them as Materials into your Atom Craft project. For each sound, set the <em>Override loop information Flag<\/em> property to <em>True, <\/em>to ensure that it will loop once added to a Cue.<\/p>\n<p style=\"text-align: center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/01-Materials.png\" alt=\"01 Materials\" width=\"548\" height=\"430\" class=\"alignnone size-full wp-image-4309\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/01-Materials.png 548w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/01-Materials-300x235.png 300w\" sizes=\"auto, (max-width: 548px) 100vw, 548px\" \/>\n<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Implementation<\/h2>\n<p>We will start by configuring each density level:<\/p>\n<ul>\n<li>Create three <strong>Polyphonic Cues<\/strong> for Low, Medium, and High density.<\/li>\n<li>Drag and drop the corresponding loop in each Cue.<\/li>\n<li>Change the <em>Pan Type<\/em> to <em>3D Positioning<\/em>.<\/li>\n<li>Set the <em>Voice Behavior<\/em> property as <em>Virtual Voice Retrigger<\/em> and the <em>Cue Limits<\/em> to 3.<\/li>\n<li>Finally, set the <em>Pitch Random Range<\/em> to a small value around 50 cents.<\/li>\n<\/ul>\n<p>To simulate the crowd surrounding the player, use the <em>Circle Random Sound Source Shape<\/em> with a <em>Random radius<\/em> set at 5. This ensures that each new instance of the Cue will start from a random location around the listener. This is useful to quickly test our implementation, but in a game, you will probably have to dynamically create the 3D emitters based on the position of the NPCs.<\/p>\n<p>Since there will be several instances of our Cues &#8211; and to avoid repetitiveness as much as possible &#8211; \u00a0we also randomize the playback start position in the loops:<\/p>\n<ul>\n<li>In the three Cues, create several <strong>Sequence Start Markers<\/strong> and place them at various positions on the Waveform region.<\/li>\n<li>Now the starting playback position will change randomly every time the Cue is triggered.<\/li>\n<\/ul>\n<p style=\"text-align: center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/02-Sequence-start-markers.png\" alt=\"02 Sequence start markers\" width=\"1031\" height=\"531\" class=\"alignnone size-full wp-image-4310\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/02-Sequence-start-markers.png 1031w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/02-Sequence-start-markers-300x155.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/02-Sequence-start-markers-768x396.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/02-Sequence-start-markers-1024x527.png 1024w\" sizes=\"auto, (max-width: 1031px) 100vw, 1031px\" \/>\n<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Changing the Crowd density<\/h2>\n<p>Changing the density of the crowd in real-time can be achieved by following these steps:<\/p>\n<ul>\n<li>Create a new <strong>Polyphonic Cue<\/strong>, named Crowd Main.<\/li>\n<li>In that Cue, create three new tracks and add an <strong>External Link Cue<\/strong> referencing the Low, Medium, and High Cues.<\/li>\n<\/ul>\n<p style=\"text-align: center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/03-Main-cue.png\" alt=\"03 Main cue\" width=\"887\" height=\"540\" class=\"alignnone size-full wp-image-4311\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/03-Main-cue.png 887w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/03-Main-cue-300x183.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/03-Main-cue-768x468.png 768w\" sizes=\"auto, (max-width: 887px) 100vw, 887px\" \/>\n<\/p>\n<p>At this point, the main Cue will play the three sounds at the same time. In order to progressively change the density of the crowd, we will need to use an AISAC:<\/p>\n<ul>\n<li>Create an <strong>AISAC<\/strong> named Crowd Density.<\/li>\n<li>Control the <em>Volume<\/em> of each track from the Crowd Main Cue by using the Crowd Density AISAC.<\/li>\n<li>Make the <em>Volume<\/em> curves crossfade from the Low density track to the High density track like pictured below.<\/li>\n<li>\nUsing the AISAC, it is also possible to modulate the <em>Bandpass \u2013 Cutoff Low<\/em> to create smoother transitions between the different density levels.<\/li>\n<\/ul>\n<p style=\"text-align: center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/04-AISAC.png\" alt=\"04 AISAC\" width=\"1055\" height=\"489\" class=\"alignnone size-full wp-image-4312\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/04-AISAC.png 1055w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/04-AISAC-300x139.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/04-AISAC-768x356.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/05\/04-AISAC-1024x475.png 1024w\" sizes=\"auto, (max-width: 1055px) 100vw, 1055px\" \/>\n<\/p>\n<p>Finally, to test the implementation, open the Session window, drag and drop the Crowd Main Cue and start 3 instances of it. (Since the Cue limit is set to 3, triggering new Cues will not go over our Voice count.)<\/p>\n<p>Adjust the Crowd Density AISAC to change the number of people you can hear. It is also a good idea to route the Cues to a Reverb Bus as it will create a more diffuse sound and glue everything together.<\/p>\n<p>You can download the demo project below to try the crowd system yourself.<\/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\/05\/AtomCraft_Project_CrowdsSystem.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_CrowdsSystem.zip<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Crowd systems are common in open-world games where many NPCs can assemble, and always present interesting challenges when it comes<\/p>\n","protected":false},"author":2,"featured_media":4320,"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-4302","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\/4302","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=4302"}],"version-history":[{"count":10,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/4302\/revisions"}],"predecessor-version":[{"id":5427,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/4302\/revisions\/5427"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media\/4320"}],"wp:attachment":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media?parent=4302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/categories?post=4302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/tags?post=4302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}