Dev end for Press to Play version 1

Today is a great day!

After, hmmm, a loong time, Press-to-Play release version was just uploaded to AirConsole servers and is in a review state, soon ready for everybody to enjoy on April 6th!

I thought a little feedback on the whole process would be welcome and maybe could also help me debrief myself.

When we submitted Press-to-Play to AirConsole for their game dev contest 2017, I must admit I didn’t think we’d make it third. I’m a little pessimist, I know. And then great news stroke in the evening before the official announcement. I was eating, and jumped on my computer to immediately inform my fellow team members. AirConsole loved our game! With the official announcement came an email to me, asking for a few modifications, cleanups, fixes and the possible release date.

The points were simple: Fix the controller connection issues and add some logic into having more than 4 players that would include the exceeding players in case one of the first four would disconnect. Challenge accepted! So I started to fight against the connection problems. AirConsole emulator doesn’t reflect the live version at all, it’s pretty hard to fix those issues. Especially when the Construct 2 AirConsole plugin wasn’t the best. First things first, I needed a stable plugin, I decided to write a totally new  plugin using their new methods. This helped a lot! But still not 100% stable. Fought for a couple of days more until the connection issues were totally fixed. The next point, that wasn’t detected by AC, was a delay in sounds on the controllers. I was getting let’s say maybe 0.3s delay when playing for the first time a sound. Wert was getting even more. Sounds in html is a real pain. Lots  of incompatibilities between browsers already, add to that apps that want to be browser, and you get the happy mix of non-sense we faced. For the first implementation of P2P, somewhere in the very beginning, I had implemented Howler.js, a javascript library that takes care of preloading and playing music/sounds on demand. Awesome library, very fast and good support. Was working great, until that AC app update… No sounds anymore. After an email to them, it came out that I should give a shot to SoundManager2. Was working, again, on both IOS and Android. But back then, working locally, I didn’t notice that evil delay hidden behind the sound files… So last week, my mission was to correct that, one of the last points to polish for P2P. Tried everything on SoundManager2, their preload tag seemed broken, their support didn’t answer and AirConsole said it works. Created a comparison page between Howler and SoundManager to point out the delay in playing. No, AirConsole wasn’t gonna support me on this, their app works and won’t be fitted to my need of another library they said. Ok, it’s all on me then… Started to look for more sound libraries. After a quick search I found a page detailing 10 audio libraries for the web:

10 JavaScript Audio Libraries for Developers

Cool stuff! Started to implement each one of them, from top to bottom. Implementing means fitting the controller, test it locally on desktop browser and on android phone, ask Wert to test from iOS phone. If tested ok, meaning sounds working with no delay, exporting Press-to-Play with the new controller code, send it to AirConsole dev console, wait for the 100mo to upload and the console to unpack it/distribute it. Then, start the game and try it in a real situation, both on Android and iOS. Couple of scenarios: No sound on Android, no sound on iOS, no sound at all, delayed sound between button presses and audio playing.

Here are the results:

1. Howler => no sound on Android app, no problem on iOS app, instant sound
2. Annyang => offtopic
3. Voix.js => offtopic
4. Audio.js => flash? no!
5. Buzz => ok on both android and iOS. Slight lag (0.2-0.3s) the very first time you use a sound. Whenever a sound is reused, instant play.
6. Soundmanager2 => ok on Android and iOS, huge delay (0.5-1s, up to 6sec in iOS) when first playing. Instant if you reuse the same sound. If you play another one and come back to first, delay again. Using only one WebAudio object?
7. Sound.js => no sound on Android app, no problem on iOS app, instant sound (faster than Howler)
8. Audiolet => Offtopic
9. ION.Sound => Finally one that is working! Works on both Android and iOS, both browser and AirConsole app, with 0 lag, instant sound play. Not the cleanest code around, but gets the job done.
10. Not applicable
As you can see, beside the ones I tried before and that are not listed on the website shared above, I had to go through the entire list to finally find one that was working on both systems and with no delay in playing! I name it ION.Sound. Of course I did send those results to AirConsole, they can do what they want with it now, hopefully look deeper in the Android app to find the source of the problem.
With this problem solved I could finally, in April 2nd (yesterday), move to the remaining parts, such as muting sounds where they weren’t meant to play in AirConsole mode, ghosts sounds after a new mini-game, few illogical things. Turning off debug, enabling AirConsole full support, turning on our home made metrics (so we can see what mini-games are most chosen and we’ll be able to bring better content in the next updates), exporting the project and upload it to AirConsole dev console and submit it for review process.
Everything’s set, we are ready to release on April 6th, as promised! I’m really happy about the work we all did and really hope you’ll enjoy countless rounds on Press-to-Play!



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.