GODOT DEVLOG #3: Okay That Didn't Work


helpful mexican programmer, new scoring system

February 8-18

When I last left you, I was deep into implementing my “waveform idea” for scoring. To quickly recap: I was trying to build a system that could measure and score the accuracy of an in-game bird recording, analyzed against the “pure” recording in the game’s files. My idea was that I could script something that would turn the player’s recording into a visual waveform, analyze that waveform against the pure one by either (measuring the various number points or doing some shape/color analysis) and then rate its accuracy.

By the end of entry #2, I had found some mild success in this endeavor but with some difficulty. I also mentioned in that post that I emailed a Godot audio developer in Mexico. Well, he graciously reached back out to me and we had a nice little chat about Godot’s audio properties. The bottom line is this: it can’t be done! Not in the way I want to anyway.

The problems are myriad, but it’s a combination of a few things: 1. Godot’s audio properties, i.e. the things you can do with audio, are limited. There’s still a lot to work with using Godot’s audio engine, but the really high-level stuff that I want to do is inaccessible to a dev as of now; 2. Analyzing a wav file as pure data is extremely tricky and unpredictable; 3. Even if I can get some waveform analysis going in Godot, there’s no guarantee that my approach will work for my purposes, i.e., it could end up being a ton of work for nothing. Rats!

As I said before, this is kind of part of the process. Time and time again, I’ve seen solo game devs talk about their abandoned versions of projects, and I’m lucky I only lost a few days of work and not months. So I went back to the drawing board to devise a new scoring system.

To break it down to the simplest core question: how can I ensure that that the player is 1. recording the proper critter, 2. recording the proper sound from that critter (in case I do multiple sounds per critter), and 3. getting a clear recording?

I devised a new scoring system. It’ll be based off of a bunch of data points that will be collected at the moment of recording: proximity to the target animal, how “centered” the animal is in the viewspace (you need to get a balanced recording stereo-channel-wise), whether or not the animal performing the correct sound, does the player’s recording length closely resemble the target sound’s length, and how many other creatures are making sounds nearby

I’ll admit this isn’t as good as actually analyzing the sound effect, but that’s okay! At this point, I just want a rudimentary and reasonable system of scoring. And with all this data, I should get something close to that.

Most of these past 10 days has been spent working through these scoring elements. The first thing I did was create an invisible “area” node around the player. Anytime a recordable animal enters this area, it gets logged in an array. When the animal exits the area, it gets removed from the array. So we have a constantly updated list corresponding to which animals are in the listening sphere area at any given moment.

When I take a recording (or more accurately, when I finish taking a recording), the script takes every animal in the listening area array and pulls a bunch of data from it: the proximity to the player, its spot on the screen, whether its making sound, etc. I process some of that information, and can now give a score out of 50, which displatys on screen. I also made a terrain so it’s slightly less ugly to look at.

Hopefully for entry 4, I’ll have a rough version of the scoring system in place and a plan for what to do next. Catch you then! Keep your ears to the ground.