Jadson G Matos Posted February 1, 2021 Report Share Posted February 1, 2021 I would like to know if there is any project that port the game to webassembly to be able to play in the browser, I think it would be really cool Quote Link to comment Share on other sites More sharing options...
Loki1950 Posted February 1, 2021 Report Share Posted February 1, 2021 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 Quote Link to comment Share on other sites More sharing options...
badosu Posted February 5, 2021 Report Share Posted February 5, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...
edoput Posted February 12, 2021 Report Share Posted February 12, 2021 As the host is running a UDP server to which the others connect I would say it's undoable in the browser but you might get replays to work as all the instructions are in a file Quote Link to comment Share on other sites More sharing options...
Bellaz89 Posted February 22, 2021 Report Share Posted February 22, 2021 (edited) 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 February 24, 2021 by Bellaz89 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.