Jump to content

webassembly


Jadson G Matos
 Share

Recommended Posts

Technically very hard to do as each players copy of the game computes independently the game state and most of those calculations use C++ not JavaScript which is browser friendly then there are differences of each browser's JavaScript engine.A further complication is each players game state must be the same otherwise we get synchronisation errors.

Enjoy the Choice :)    

Link to comment
Share on other sites

Actually emscripten should be able to translate C/C++ to javascript/webassembly. The question is if this is a worthy effort. If it does not run well with native code, with webassembly I wouldn't expect it to be any better.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

I don't know the 0ad developers plans, but I think that some dependencies of 0ad would be very difficult to compile with emscripten.

For example, there should be a limitation in JIT generation from webassembly. This is a limitation for the Javascript engine of 0ad, Spidermonkey (https://stackoverflow.com/questions/53760444/is-it-possible-to-compile-javascript-enginelike-spidermonkey-and-run-on-webass). Even without that, making something as complicate as a modern JIT engine to run on an unsupported platform is extremely difficult (if possible at all..).

IMHO even getting rid of Spidermonkey to make 0ad run on webassembly/emscripten would require a too big effort. This would mean to rethink all the foundations of the 0ad engine (pyrogenesis). At this point, it might be even easier to rewrite all 0ad C++ codebase from scratch...

For comparison, just porting the JS engine  (so, most of the code was already written) from version 45 to version 78 took ~1 year 'only' to fix all the API changes.

Edited by Bellaz89
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...