Orbitunes Post-Mortem: Building a Toy
I've finally had some time to decompress after this Ludum Dare, and hoo boy, did I need it. This has been one of the toughest game jams for me yet, and for some really weird reasons.
So, without further ado, let's get into it!
Where I Started
I've been developing video games as a hobby for over 5 years now. I've done dozens of game jams (including my very first Ludum Dare a few years back!). I've worked on projects spanning development times from 24 hours to 6 months. I'm not exactly a professional, but I'm not exactly a first-timer either. I've been doing this for a while. However, during this jam, I was faced with a challenge I had never encountered before.
When the theme was announced, I was completely drawing a blank as to what I should make.
I seriously spent hours just sitting around with a notebook, trying desperately to come up with something creative. Anything. But nothing satisfying was coming up. "Oh god," I thought do myself, "Have I forgotten everything?" Although I develop a lot of personal projects in my free time, it's been a while since I've had to come up with an original concept from scratch. And with the pressure of the time limit, I was forcing myself to try to be creative. But that only made me worry about why I wasn't being creative enough, which prevented me from thinking about new game ideas. It was a vicious cycle, and I was REALLY close to just throwing in the towel, and opting to work on my current projects for the weekend instead.
But as I lay in bed on Friday night, about to fall asleep, I had a thought. I was obviously operating at a disadvantage at this point, because I sunk so many hours into brainstorming, with nothing to show for it, and the clock was still ticking. At this point, I don't have time to make a completely fleshed-out game. I needed to think simpler. As simple as I could possibly make it while still being entertaining.
I can't make a fun, unique game in this amount of time, but I could probably make a helluva toy.
No objectives, no lives, not even a player avatar. Just something fun for the player to mess around and engage with. Once I started down this path, I was reminded of another "game" I really enjoyed that was nothing more than a neat little toy: Electroplankton.
What I really admire about Electroplankton is how simple its concepts are to grasp, all while having a wide variety of different tools that you can mess around with to interact with it. I wanted to make something like that. As I mulled it over in my head and I fell asleep, there was one idea that managed to stick out in my mind.

The concept of little asteroids orbiting around a star was simple, and easy to understand. On top of that, it just has this natural sort of mesmerizing appeal watching them zoom around in waves around the center. I had different asteroid types to choose from, representing quarter notes, eighth notes, and sixteenth notes, giving the player the ability to make a simple beat. To give the concept a little more depth, the closer the asteroid got to the center, the higher pitched the notes would get, and vice versa.
I hoped that this would be enough for the player to experiment around and have fun with for at least a few minutes. With no end-goal or objective for the player to work towards, that's really all I had to try to keep them engaged. And while my compo submission is far from perfect, I'm actually really happy with how this project came out in terms of a jumping off point.
What Went Well
Thankfully orbiting physics was something I was able to finish and mess around with within the first hour or two of starting development on Saturday morning. Once you understand the physics at play, implementing it is only about a dozen lines of code. On top of that, it's not the most "unique" thing in the world to try to implement, so there are plenty of resources online of people trying to do the exact same thing.
I probably spent more time tweaking the values in order to make it really simple to successfully obtain orbit while launching asteroids, while at the same time having a little bit of a learning curve to it that would encourage players to try different launching techniques. I specifically wanted the game to have no tutorial, because like I said before, the only potential for "player engagement" I have is how long the player is willing to experiment with my toy before they exhaust everything that they're able to do with it. Once you feel like you can't do anything new with it, the boredom quickly sets in. A tutorial would have put them on the fast-track to boredom-ville had I taken away those precious few minutes of exploration.
Once I got orbiting down, I had a little bit of fun launching asteroids around and watching them spin about. The next task was to implement sound for the game, probably the most important component.
Oh, and would you look at that? We're on to our next section!
What Went Poorly
Everything having to do with audio was way more taxing than I expected it to be. I'm a software engineer through and through with cursory experience with musical theory at best (I played in middle school band, I guess?).
Challenge #1 was making everything sound "nice" when played together. Because this was intended to be a loosely structured music generation toy, and I wanted the player to feel rewarded for experimenting with it in as many creative ways as possible, I had to make sure that no matter what the player did, the game would produce a pleasant noise.
Challenge #2 came in the form of me not knowing of any high-quality audio sources for simple musical notes. Each asteroid in Orbitunes produces its own unique sound, and the difficulty came in not only finding those different sounds, but also making sure the sound was pitched to a middle C, so it could be easily pitched up and down within code. My solution ended up being this abomination:

No mics, no audio jacks, just a 15+ year old keyboard with partially blown out speakers and a built-in microphone on a 4+ year old laptop. With their powers combined (along with some heavy mixing in Audacity) I was able to produce at least some semi-decent sounding notes in the pitch I wanted. But damn if that didn't take a while.
Challenge #3 was discovered a mere hour before submission. As it turns out, when you're trying to keep a beat, I would highly suggest NOT using a coroutine along with WaitForSeconds(), because it's actually not 100% accurate every time. To my dismay, I discovered that I made a rhythm-based toy that was frame dependent.
Joy of joys.
This resulted in the asteroids falling in and out of sync with each other the longer they stayed on the screen. Some beats would play faster sometimes, and slower other times, making it kinda hard to tap your foot along to anything that was going on. Of all the things wrong with my compo submission, this is the one thing I wish I had had time to fix...
But not all is dark and dreary, because moving onto the next segment, we have...
What I Learned
First of all, pentatonic scales are a thing of beauty, and they are the sole reason why my game sounds even remotely nice at all. Basically, a pentatonic scale is a normal scale with all of the half-steps taken out. The result is a set of notes that sound "pleasant" no matter what combination they're played in. These things are magical, to say the least.
Secondly, audio in Unity can be a pain in the butt to work with. I discovered quickly that as I added more and more notes to the scene, an ugly static noise would start to pierce over everything. Evidently, if you have too many noises playing at max volume at the same time, some massive clipping occurs. To resolve that, I had to normalize the volume for every sound playing in the scene, and recalculate it with each new additional asteroid. Because of this, some may notice the game get quieter as more and more asteroids are added...It was a pretty blunt fix, but a fix nonetheless.
Lastly, I found a way to fix the damn syncing issue in my game (unfortunately not in time for the Compo). It turns out that Unity actually has its own separate thread for audio alone, and it's tracked using the variable dspTime. dspTime is a sample-based time tracker that is frame independent, allowing me to accurately determine when the next beat is supposed to play at any given moment. Once I implemented this, it became WAY easier to create consistent melodies and semi-catchy rhythms, as evidenced in my post-compo build.
Oh if only I had known sooner...
But that's okay, because this segues perfectly into the next topic of...
Where I Plan to Go from Here
I would loooooooove to make this a casual little side-project of mine. I have quite a few ideas as to how I can add to it to give the player more ways to experiment and tinker with this thing. After all, the more a player has to tinker around with, the more opportunities there are to discover new things through experimentation. And as long as there are new things to discover, they won't get bored as quickly (assuming they find this silly little thing engaging to begin with). In my opinion, that is the essence of what it means to make a good toy.
In that regard, here are a few things I have on the list to add to this thing: - Remix sound volumes so the "most recent" few asteroids are slightly louder than the rest, instead of being drowned out by whatever cacophony is currently spinning about.
Different beat patterns that are more than just standard 4/4 beat notes. Perhaps some more percussion-like rhythms.
Different instruments to choose from for each of the different beat patterns
Allowing the player to change the mass of the star (affecting the pull of gravity), or the Beats Per Minute
Allowing the player to manually set the fields where the notes change pitch, so it's not just a linear progression from the lowest note to the highest note.
Get some damn high-quality audio to replace the crap I have right now.
My end goal is for this to be something that a person bookmarks to come back to later. Maybe to kill time for a few minutes here and there, as a peaceful little distraction. The important thing would be them coming back though, and that requires having enough neat things to tinker around with to warrant repeat visits. Currently I think everything in this toy can be "discovered" a little too quickly as it is, but hopefully someday in the future that might change. :)
I hope this was informative! If you have some time to kill, I'd really appreciate it if you tried Orbitunes out! You can find my Compo Submission here. And if you'd like to see what it looks like just a few days after submission (aka: WAY better) you can try out the Post-Compo Build here!
Thanks for reading!