Solarus-Games English Forum

Solarus => Development => Topic started by: alexgleason on November 02, 2018, 09:16:31 PM

Title: Has anyone tried compiling Solarus for the web?
Post by: alexgleason on November 02, 2018, 09:16:31 PM
There are C++ to ES6 transpilers that seem to work reasonably well, like Emscripten: http://kripken.github.io/emscripten-site/

For example, you can see the open source game FreeDink running in the browser: https://play.freedink.org/ This game is written in C++ and ported to the web with Ecmascripten.

I think Solarus would have to be modified for this to work since it reads the filesystem to load the quest and write save data, but it might be possible.
Title: Re: Has anyone tried compiling Solarus for the web?
Post by: stdgregwar on November 04, 2018, 09:41:42 AM
Hello AlexGleason,

I looked at emscripten a lot of time and finally choosed to do the android port first.

The difficulty is the fairly high amount of solarus dependencies that need to be met. The second problem is that solarus uses some secondary threads to do some work like music playback and background loading. And emscripten does not support multithreading well... (nor does EScript).

I'm also really looking forward to it but it's not as simple as CXX=emscripten make. But there huge probability that this will be done next year or in few months... When I or another team member finds the time.

Greg