ScummVM running on the web!

995 views
Skip to first unread message

Jukka Jylänki

unread,
Jun 10, 2013, 11:15:58 AM6/10/13
to emscripte...@googlegroups.com
Now that I got a summer break from work, I had a chance to work on something I think is really cool and now it's finally in an appropriate stage for a demo:

http://clb.demon.fi/html5scummvm/

What you are looking at is the ScummVM games engine ported to HTML5/JavaScript! This is yet another success story for Emscripten, a showcase that it is a well-functioning tool for migrating native desktop applications to the web, even those that were not originally architected with the web in mind.

The port is by no means complete, and a good amount of work and polish remains for the future. ScummVM is a large beast, and comprises of multiple internal game engines. Each game engine requires some amount of code restructuring, so at present, only the "Scumm0-6" game engine has been ported, and therefore not all ScummVM games are yet playable. Also, there is a copyright issue, which is why only free game demos have been ported.

The site works best with the Firefox browser (preferably Nightly version to enable asm.js, if you have one). Other browsers have been tested, but they don't currently play back audio.

The ScummVM development team want me to state that this is an unofficial project that the ScummVM team have nothing to do with. Due to the needed refactoring for the code to be JS-friendly, they have expressed disinterest in incorporating the port into upstream, so the codebase will live in its own fork at https://github.com/juj/emscripten-scummvm.

There's some amount of fixes to emscripten upstream that I will bring about once I get a chance for cleanup, but I was positively surprised to find nothing major, and the whole process was relatively painless.

Thanks to the people who contribute to ScummVM, and to Alon Zakai, Mozilla and other Emscripten authors for the awesome Emscripten project!

Have fun :)

Jukka

Alon Zakai

unread,
Jun 10, 2013, 3:18:33 PM6/10/13
to emscripte...@googlegroups.com
Very cool!

I am disappointed ScummVM have no interest in this. Is the refactoring you had to do very extensive?

- Alon



--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jukka Jylänki

unread,
Jun 10, 2013, 3:40:28 PM6/10/13
to emscripte...@googlegroups.com
The major refactoring is that one needs to convert all modally blocking loops into asynchronous once-per-frame callbacks, plus all busywaits for timers to asynchronous as well. When the scumm engine was to do a sleep(x milliseconds), I refactor that into a "emscripten_async_call(updateFrame, x milliseconds)", to not burn CPU, to give the SDL audio callback a time slice to operate, and to avoid the JS engine from getting killed on timing out.

To convert the scumm0-6 engine, there are three such instances. The scumm7-8 engine (curse of monkey island) has one more (that I have identified at least so far), which runs video playback. It should be convertable but I haven't yet gotten around to doing so, although I have run curse of monkey island without video playback, but there are some other yet unknown bugs that make the experience very uncool.

The ScummVM team said that other game engines can have a lot more of separately written blocking loops (some game engine apparently has ~100 of them), and that it would bring unnecessary complexity to maintaining ScummVM and that they didn't see much point in a HTML version since you couldn't play your own full version games on it anyways due to the hosting/copyright problem.

Apart from the async conversion issue, it was mostly about missing SDL features (which is a can of worms I'll get into later on the bug tracker), and #ifdeffing out symbols that emscripten doesn't recognize, or adding in symbols to emscripten headers for being able to build. I'll try to push everything I can to upstream that's clean to do so.


2013/6/10 Alon Zakai <alonm...@gmail.com>

Alon Zakai

unread,
Jun 10, 2013, 9:38:02 PM6/10/13
to emscripte...@googlegroups.com
I see, thanks for the info.

- Alon

Mike Conley

unread,
Jun 15, 2013, 5:35:11 PM6/15/13
to emscripte...@googlegroups.com
Hey Jukka,

Just wanted to say I've been hoping somebody would port ScummVM for a long time. I took a crack at it a few times, but I never got past the blocking loops problem. So kudos!

And I just played some of Monkey Island on my Firefox OS simulator. Quite pleased about that. :)

This is really, _really_, cool. Are you looking for outside contributors? Do you have a mailing list, hacking guide, etc?

-Mike

Mike Conley

unread,
Jun 15, 2013, 5:43:11 PM6/15/13
to emscripte...@googlegroups.com
One more thought - Beneath a Steel Sky (and a few other games, I believe) were released as freeware - the authors giving their "blessing" to the ScummVM project. I think Flight of the Amazon Queen is in that group as well[1].

I would imagine those games wouldn't have much in the way of a copyright problem - so perhaps the full versions of those could be put on your site if their engines get ported. Perhaps they could be brought in as free apps in the Firefox OS Marketplace, and other web-app friendly marketplaces?

-Mike

[1]: http://arstechnica.com/gaming/2012/01/maniac-tentacle-mindbenders-of-atlantis-how-scummvm-kept-adventure-gaming-alive/


On Monday, June 10, 2013 11:15:58 AM UTC-4, jj wrote:

Jukka Jylänki

unread,
Jun 16, 2013, 9:27:48 AM6/16/13
to emscripte...@googlegroups.com
Thanks Mike!

There is only a repository at https://github.com/juj/emscripten-scummvm , and a bug tracker at https://github.com/juj/emscripten-scummvm/issues . Contributions are of course welcome, as you can see there are quite a few issues listed in the bug tracker already, feel free to raise up any topics you are interested in there. I think the tracker can serve as a forum for general discussion, questions and feature requests as well.

I am currently working on adding audio support to Chrome, by implementing Web Audio support to the emscripten SDL library. My primary goal is to clean up the tech debt that has accumulated via the various workarounds, and to get pull requests to emscripten upstream so that these workarounds aren't needed. At present there is no clean procedure to build emscripten-scummvm outside my working tree in my linux box, but once azakai gets around to merging the pull requests I've submitted ( https://github.com/kripken/emscripten/pulls/juj ), I am able to write build instructions so that others can repro the build. I added a task about it as a reminder: https://github.com/juj/emscripten-scummvm/issues/21 Hopefully that won't take too long.

Adding full versions of these freeware games would be great! Firefox OS marketplace sounds viable as well, although I am not very familiar with it. Just go ahead and start working on whatever you are interested in, it looks like there is plenty of surface area to work on,

   Jukka



2013/6/16 Mike Conley <mike.d...@gmail.com>
--

Jukka Jylänki

unread,
Jun 20, 2013, 9:44:39 AM6/20/13
to emscripte...@googlegroups.com
Alon has now merged all of the pull requests I have made so far, except for audio, and I checked today that building ScummVM with the upstream emscripten *incoming* branch works.

I wrote instructions into the README at https://github.com/juj/emscripten-scummvm .


2013/6/16 Jukka Jylänki <juj...@gmail.com>

Lior W. (‫ליאור ויסברוד‬‎)

unread,
Jan 12, 2024, 3:59:53 PMJan 12
to emscripten-discuss
More than a decade later, this project is dead (its GitHub, which became a public archive, seems to have never gotten updates except around the time when this thread started).
There's another GitHub project ScummVM Webassembly Demo but its demo page has broken JavaScript.
I read in this thread why it's so hard, but it still amazes me that webpages everywhere, including the Internet Archive, have been using emscripten DOSBox for years while in ScummVM it's still not possible.
Reply all
Reply to author
Forward
0 new messages