Friday, 11 May 2018

Adventuron 0.5.7 released - Fixes for Chrome 66

Adventuron 0.5.7 has been released with fixes for the new audio blocking features of Chrome 66

See Article:

A Google Chrome update breaks the audio in numerous web-based games


Unfortunately, in adventures exported (via HTML5 export) with 0.5.6 or earlier engine, any Adventuron adventures using a BEEP command will hang on Chrome (66 or greater).

This happens because Google appears to have broke web standards in it's implementation of blocking audio on autoplay media.

Google's heart was in the right place, but it just broke thousands if not hundreds of thousands of web based games, many of which were and are absolutely standards compliant.

Adventuron sequences game events using callbacks, so a sequence of commands is structured as a chain. You can think of this as a game of pass-the-parcel, with each task that Adventuron executes, being aware of the person they will pass control to next.

Tasks such as "set the value of a variable", "create a game object - such as a lamp or a shovel", "make a beep sound", "clear the screen", "display an image", etc.

With Chrome 66, the audio playback policy changes created an issue when playing a beep instigated a non-handled error that meant the next command in the callback sequence was not being executed, therefore the person at the end of the chain that is responsible for re-displaying the prompt, never performs their task.

This lead to a hang of any games that used a BEEP command (on the Chrome 66 or above browser).

The fix for 0.5.7 was threefold:

  1. To create the JavaScript AudioContext ONLY when the first beep is played. This is usually after the first user interaction (touch, mouse click, or keyboard press). It's possible that games that start with a beep will still hang (I haven't fully tested it yet), but this should be a fix for 99% of scenarios, which is better than nothing for now. It'll be 100% in the next release, just thought it was better to get this out there.
  2. To call AudioContext.resume() prior to any any beep. This is near-zero cost (in the grand scheme of things).
  3. Strengthen exception handling in the audio playback - this should hopefully mitigate bugs that might occur on games that start with beeps before user interaction.


Future fixes (not in this release):

  1. Detect when games start with beeps before user interaction, and force a "Click to start game button" to appear first.

No comments:

Post a Comment

Keyboard shortcuts in Adventuron Editor

It has come to my attention that I have not properly drew attention to the keyboard shortcuts that make editing in Adventuron's editor ...