Frequent Flier (updated)

Hi! Here’s my entry to Java4k (hopefully). It’s my very first Java game ;D

Unfortunately the game requires sound input, and the signed jar is over the size limit. Can this still be a valid entry?
The unsigned jar: http://www.cs.auckland.ac.nz/~jteu004/freqflier/freqflier.jar which is under 4k.
Webstart for signed jar: http://www.cs.auckland.ac.nz/~jteu004/freqflier/freqflier.jnlp

http://www.cs.auckland.ac.nz/~jteu004/freqflier/ff.png

You control the flying saucer by the pitch of your voice. High pitch moves it up the screen, low pitch moves it down. If you’re having trouble flying up to the top, a low whistle should be able to get there. If you hit a cloud the game ends.

Your score constantly ticks up, but if you can hold a steady note then you get an ever-increasing multiplier.

Haha, cool idea. I first tried plugging my guitar in, but that didn’t work at all unless I started playing chords. Even then, I didn’t have much control of the ship.

It started responding to the microphone when I started singing in it. I tried singing some scales, but apparently I don’t have enough voice control for this game, haha. I might be tone deaf…

Maybe you should display the current pitch that the game is reading.

Hehe… the pitch tracking isn’t the most perfect. It’s tracking from around 70Hz (D2) at the bottom of the screen up to around 320Hz (E4) at the top. If you’re singing, then an “aa” sound is the easiest to recognise.

I found you can just find one high note and one low note to sing in short bursts and you get reasonable control. Of course, then you miss out on the multipliers…

Thanks for trying it out!

Yes. On the Java4k.com submission page you can submit a unsigned jar. Do it there.

Thanks for the info. All done :slight_smile:

The saucer moves fairly quickly towards the current pitch, so it’s pretty much the indicator you want. If the saucer’s jumping around a lot then that shows that it’s struggling to work out where you are singing (could be singing out of the range, with too much variation, have a loud noise in the background, or it just dislikes you…). Do you think something like a scale on the side showing the accepted pitch range would be useful? I have about 60 bytes left…

Cool game, although I suggest trying to use floats and have a delta to match your voice instead of making it position-based, that would look a lot less twitchy. Also, there get to be too many clouds after not too much time at all.

But the idea is really awesome.

That’s a good idea actually. Yeah, try that.

Good idea. I’ll make a version that does delta by pitch instead of position by pitch for comparison.
And I agree about the clouds. It was good for testing but makes the games a bit short.

Edit: For comparison here is a webstart version using pitch for delta: http://www.cs.auckland.ac.nz/~jteu004/freqflier/freqflier2.jnlp
And it seems like a big improvement. First time playing this version and I broke 3000 points!

Yeah I like it better that way, seems more smooth. Still a bit hokey on recognition, but it remains an awesome idea.

Totally awesome :slight_smile: The implementation might not be perfect (recognition) yet, but the family got a good laugh!

very funny, even more funny when my wife is staring at me in the back…

I’ve managed to find the problem with the recognition / jerkiness. I’m detecting pitch in the frequency domain, which can suffer from pitch doubling: it sometimes thinks you’re singing an octave higher than you are. This is why it could jump around a lot while moving downward - it thought those low notes were much higher.

Anyway, I’m trying a new version that does a SingStar and only cares about the note you sing, not the octave. You need finer voice control but the game is way more playable. I’ll add a gui component to show the current note and update the original jnlp.

Thanks for all the testing guys! ;D

Edit: The webstart in the first post (http://www.cs.auckland.ac.nz/~jteu004/freqflier/freqflier.jnlp) now loads a version that controls by note, not absolute pitch. A “C” is max speed down and a “B” max speed up. A “G” will keep you stationary while increasing the multiplier.

I’ve also added a bar at the top shows where it thinks you are singing.

Hm, seems significantly more difficult now. I can’t make it go up at all, even if I squeak like crazy.

Now you have to hit the notes. Just going high will make it wrap around and you could be heading down again. The trick is to change your tone only a little bit and you can get really fine control.

I usually spend the first few seconds finding the middle note that makes the bar blue, then shift it a bit from there. I’d like to make the game calibrate it so the first note you sing is the middle… but I’ve only got 1 byte left =(

Hold that. I just ran it through Proguard and there’s room to burn. Calibration will be in, and possibly levels…

Hm, you might think about having it just max at the highest note instead of wrapping.

Plenty of changes:

  • It now calibrates on the note you sing to start the game (this will be the “stationary” note)
  • Three levels (see updated screenshot in the first post)
  • “power-ups”
    • If you sing a series 1-2-3-2-1 you turn red and are invincible for 6 seconds
    • If you sing five descending notes you turn blue and the multiplier is set to x20 for 3 seconds
  • Fancier graphics

Edit:
Here’s the source code in case anyone is interested. Unfortunately this was mostly written before I knew about tools like Proguard, so it might be a little cryptic. :persecutioncomplex:
http://www.cs.auckland.ac.nz/~jteu004/freqflier/P.java

I think I am scaring the neighbors but it’s really nice

Hehe… I had to go shut all windows and doors when bug testing. I’m still a bit worried about what the neighbours think :wink: Thanks for trying it out!