HTML5 live update

In a separate HTML5 application running in the browser (NOT Unity/UE4), is live update to the Studio supported? I seem to be able to initialize the system to enable liveupdate (the log says everything works fine), but connecting via Studio does not work (gives socketError).

Also, it’s kind of confusing to me how it would work, since HTML5 websockets (which the API probably uses) can’t ‘listen’ for connections on clientside, instead it can only initiate connections.

Do I need to follow any additional steps besides the ones outlined at https://www.fmod.com/resources/documentation-studio?page=editing-during-live-update.html#preparing-your-game-for-connection ?

If it isn’t supported for browser-side, would I get it to work in a NW.JS (which is node.js + DOM) application?

Hi ,
Live connect is not supported in HTML5 runtime of FMOD, as there is no appropriate socket API to allow this to happen that we are aware of (I seem to remember about hearing about web sockets but it wasnt supported on all browsers or something like this).

2 Likes

Thanks for the answer. My project is node.js based, i.e. locally I have access to the C API if need be, but I need to laboriously write writer wrappers to expose that stuff to node.js. Do you think there is any way to leverage the existing emscripten port to make this easier? I.e. only add the missing functionality (live updating, etc.) somehow.

Is this still an accurate statement? If so, could the API docs be updated to mention this? I thought I had a bug somewhere when trying to get this working on my project.

https://www.fmod.com/resources/documentation-api?version=2.1&page=studio-api-system.html#fmod_studio_initflags

We are looking into sockets and thread support required to make our live update system work but at this stage those features aren’t supported. We plan to update our documentation for our next release to make this clear.

It is still accurate now yes. I’m experimenting with it now but the involvement of threads and no dynamic memory growth means a significant change in requirements / setup for the developer.

upon further investigation, standard socket support is not supported on the web. A browser can connect to a ‘websocket’ (usually defined with ‘ws://url’, which is a different concept, so it means html5 cannot by default connect to an arbitrary address/port.

If a websocket server was set up , then html5 code can connect to it. This is what some html5 games would do.
Another way is to run a proxy server that forwards websockets to real ones, there is a package called websockify which could do that, ie https://github.com/novnc/websockify

Thanks for looking into this!

An update for this support.

  1. It needs pthread support enabled. This means SharedArrayBuffer support - https://caniuse.com/#feat=sharedarraybuffer shows that only certain browsers support this.
  2. You need to run a proxy application in the background (ie tools/websocket_to_posix_proxy/ in emscripten) to allow websocket data to be converted to socket data. We can supply this (I have bulit this for windows, not mac or linux, but it is open source). I have only got this to partially work.
  3. It would have to be a special build that is for development purposes only, mainly due to point #1.

If these things are ok we can release a version with this stuff included, though I have not got websocket_to_posix_proxy to work properly yet, it is only sending data in one direction. I am testing different browsers because it may be a browser support problem.

1 Like