So many things
21 December 2019
Ah, the sound of a rocket ship in the morning, soothes the soul, right?
Adding sound turned into a rather involved project, it continued to be challenging even after I thought I had it all worked out. Throw in some real-world time sinks, and here we are, nearly three weeks since the last update.
Never mind, I’m still progressing :) and the game now has sound. Not even just static sound but sound that reacts to the location of the source. If something is on your right, you’ll hear it more in the right ear (assuming you have stereo speakers/headphones). There is backing music, and effects on the menus. And finally, I added game over, and victory sound effects.
I’m glad I kept going with this, sound really does make the game more enjoyable and immersive. I can see myself coming back and adding many more tweaks to this as things progress. Makes me wonder how long it will be before games start involving our other senses more (touch, taste, smell), something must be possible on those lines.
FreeSound
I was lucky enough to discover the FreeSound website. They provide a range of sound effects that can be downloaded and used under a range of licenses. I’ve stuck to CC0 and Attribution licensed files for this game, but that still meant I needed to credit the sources. So along with building the sound system, I also built a Contribution Credit system.
Credit
Contributions are credited in-game, and also in the source repository in credits.md. Both the in-game and in-source accreditation is generated from a XAML resource dictionary so that I only have one place to keep up-to-date. And now the same information is even being generated for viewing on the web, see Credits.
)
(in-game credits)
Challenges
I had the most trouble getting the sound of the enclosing event horizon to work well. All the other sound producers are effectively Point Sources, whereas the enclosing horizon is a Continuous curved source. I spent quite some time trying to mathematically determine how much of the sound was to be played in each ear. I’m sure this is possible, but I didn’t get a good solution. Eventually, I realised that because the containing shape was always a circle, I could take some shortcuts. Now I simply take the closest point and treat it as a Point Source. It seems to work well enough, at least to my ears.
It was almost inevitable, given that I didn’t know what I was doing or precisely what I wanted when I started, but the code is now a bit of a mess. It is in severe need of a good refactoring and simplification. But I’m going to hold off on that for a bit. There is one more area that needs my attention before the full structure is in place, might as well leave refactoring until I see what kind of challenges this brings.
Side challenges
While testing this latest release, I noticed that Windows wasn’t happy with me running the downloaded binary. It kept prompting me about it being an unsafe release. To prevent these prompts being displayed, the code needs signing.
That didn’t sound too bad. I’m sure I can build a signing process into the deployment scripts.
Extended Verification
Unfortunately, for it to be effective, it appears that I would have to purchase an ‘Extended Verification Certificate’. And those don’t come cheap. We are talking 700 bucks a year. Somehow security has been conflated with having to pay big money to third parties. As a hobby project, it’s just not worth it.
My temporary workaround is to add a download page explaining what steps are needed to download and run the game.
I guess at some point I might go ahead and sign it with a free cert, but for now, since it really wouldn’t offer much benefit, I’m just going to forget about it.
Up next
Apart from refactoring, which I’ve already decided to leave for a bit, the next big missing chunk is Levels. The game needs to support more than one level; otherwise, it is quickly over.