{"id":4428,"date":"2023-06-16T13:36:27","date_gmt":"2023-06-16T04:36:27","guid":{"rendered":"https:\/\/blog.criware.com\/?p=4428"},"modified":"2024-05-20T14:48:57","modified_gmt":"2024-05-20T05:48:57","slug":"proximity-radar","status":"publish","type":"post","link":"https:\/\/blog.criware.com\/index.php\/2023\/06\/16\/proximity-radar\/","title":{"rendered":"Proximity Radar"},"content":{"rendered":"<p>Popularized by the Alien franchise in entertainment, the proximity radar is now a staple of action games. It is an easy way to build tension for the player as its ominous tones repeat faster and with an increasing pitch as the danger gets closer. In this post, we will see how we can easily implement it 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-4428-1\" width=\"800\" height=\"422\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/Video_ProximityRadar.mp4?_=1\" \/><a href=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/Video_ProximityRadar.mp4\">https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/Video_ProximityRadar.mp4<\/a><\/video><\/div>\n<\/div>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Asset Creation<\/h2>\n<p>The radar sound is made of short beeps. You can use your favorite synthesizer to generate them. Here is how we did it:<\/p>\n<ul>\n<li>Since the sound will be repeated frequently, we chose a soft waveform (such as a sine or triangle).<\/li>\n<li>Then, we set the attack and decay segments of the amplitude envelope to about 200ms, and the release to 400ms.<\/li>\n<li>You can add a bit of modulation to the pitch and the amplitude in order to make the sound a bit more interesting.<\/li>\n<li>Finally, the sound is played at a relatively high pitch.<\/li>\n<\/ul>\n<p>For this type of sound, only a single file is really necessary, but feel free to generate variations to test different settings.<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Implementation<\/h2>\n<p>It is time to import your audio files in the <em>Material<\/em> folder and start the implementation:<\/p>\n<ul>\n<li>Create a <em>Polyphonic<\/em> Cue.<\/li>\n<li>Add a track, and drag and drop your beep sound on it.<\/li>\n<\/ul>\n<p>Now, we need to make that repeat automatically.<\/p>\n<ul>\n<li>In the Cue, click on the <em>Waveform region<\/em>.<\/li>\n<li>In the <em>Inspector<\/em>, scroll to the <em>Timing Contro<\/em>l section and set the <em>Auto Repeat Interval<\/em> to 350ms.<\/li>\n<\/ul>\n<p>You will see ghost regions appearing the timeline every 350 ms. If you play the cue, the beep will now repeat indefinitely.<\/p>\n<p style=\"text-align:center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/02-AutoRepeat-Region.png\" alt=\"02 AutoRepeat Region\" width=\"1429\" height=\"592\" class=\"alignnone size-full wp-image-4433\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/02-AutoRepeat-Region.png 1429w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/02-AutoRepeat-Region-300x124.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/02-AutoRepeat-Region-768x318.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/02-AutoRepeat-Region-1024x424.png 1024w\" sizes=\"auto, (max-width: 1429px) 100vw, 1429px\" \/>\n<\/p>\n<p>Finally, we need to be able to adjust the timing between the beeps dynamically. Of course, we will use an AISAC for this purpose:<\/p>\n<ul>\n<li>First, create an <em>AISAC-Control<\/em> called RadarProximity.<\/li>\n<li>At the Cue level, use the RadarProximity AISAC to control the <em>Pitch<\/em> and <em>Playback Rate<\/em>.<\/li>\n<li>The <em>pitch<\/em> modulation should not be too strong. Between 0 and 0.5 raise the pitch by only 30 cents. Then speed up the increase to reach 200 cents when the AISAC value is 1. By having the pitch changing more significanty between 0.5 and 1, more emphasis is put on closer targets.<\/li>\n<\/ul>\n<p style=\"text-align:center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/03-Pitch.png\" alt=\"03 Pitch\" width=\"987\" height=\"474\" class=\"alignnone size-full wp-image-4434\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/03-Pitch.png 987w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/03-Pitch-300x144.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/03-Pitch-768x369.png 768w\" sizes=\"auto, (max-width: 987px) 100vw, 987px\" \/>\n<\/p>\n<ul>\n<li>The <em>Playback Rate<\/em> graph should start from 0.2 and end at 4. As for the pitch graph, the increase should first be moderate &#8211; when the AISAC value is between 0 and 0.5 -, and then rise quickly until the AISAC value reaches 1<\/li>\n<\/ul>\n<p style=\"text-align:center;\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/04-Playback-Rate.png\" alt=\"04 Playback Rate\" width=\"987\" height=\"474\" class=\"alignnone size-full wp-image-4435\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/04-Playback-Rate.png 987w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/04-Playback-Rate-300x144.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2023\/06\/04-Playback-Rate-768x369.png 768w\" sizes=\"auto, (max-width: 987px) 100vw, 987px\" \/>\n<\/p>\n<p>As the Playback Rate changes, the waveform regions will be triggered slower or faster. So, as the player gets closer to the danger, the radar will beep progressively faster. Try it yourself in our demo project!<\/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\/06\/AtomCraft_Project_ProximityRadar.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_ProximityRadar.zip<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Popularized by the Alien franchise in entertainment, the proximity radar is now a staple of action games. It is an<\/p>\n","protected":false},"author":2,"featured_media":4445,"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-4428","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\/4428","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=4428"}],"version-history":[{"count":10,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/4428\/revisions"}],"predecessor-version":[{"id":4446,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/4428\/revisions\/4446"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media\/4445"}],"wp:attachment":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media?parent=4428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/categories?post=4428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/tags?post=4428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}