All Projects → gabrielcuvillier → arxwasm

gabrielcuvillier / arxwasm

Licence: GPL-3.0, Unknown licenses found Licenses found GPL-3.0 LICENSE Unknown COPYING
Port of Arx Libertatis to WebAssembly using Emscripten

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
python
139335 projects - #7 most used programming language
shell
77523 projects
c
50402 projects - #5 most used programming language
Roff
2310 projects

Projects that are alternatives of or similar to arxwasm

Tomb5
Tomb Raider: Chronicles Disassembly translated to C source code.
Stars: ✭ 397 (+1317.86%)
Mutual labels:  emscripten, port
webDOOM
Classic DOOM recompiled with WebAssembly
Stars: ✭ 61 (+117.86%)
Mutual labels:  games, emscripten
uno-game
🎴 An UNO Game made in Javascript
Stars: ✭ 93 (+232.14%)
Mutual labels:  games
zx-spectrum-games
Collection of ZX Spectrum annotated game source code dissasemblies as .skool files
Stars: ✭ 35 (+25%)
Mutual labels:  games
rotation master
Provide conversion between the major representations of 3D rotation and visualize the orientation of a rigid body
Stars: ✭ 157 (+460.71%)
Mutual labels:  emscripten
vgg runtime
VGG Runtime for loading and running designs as apps.
Stars: ✭ 19 (-32.14%)
Mutual labels:  emscripten
jstodef
Library for sending messages from JavaScript to Defold (Lua)
Stars: ✭ 21 (-25%)
Mutual labels:  emscripten
HandyRL
HandyRL is a handy and simple framework based on Python and PyTorch for distributed reinforcement learning that is applicable to your own environments.
Stars: ✭ 228 (+714.29%)
Mutual labels:  games
AI4U
AI4U is a multi-engine plugin (Unity and Godot) that allows you to specify agents with reinforcement learning visually. Non-Player Characters (NPCs) of games can be designed using ready-made components. In addition, AI4U has a low-level API that allows you to connect the agent to any algorithm made available in Python by the reinforcement learni…
Stars: ✭ 34 (+21.43%)
Mutual labels:  games
agario
Python clone of agar.io game, made with pygame.
Stars: ✭ 32 (+14.29%)
Mutual labels:  games
EMF
Extended Mechanics & Flavor
Stars: ✭ 33 (+17.86%)
Mutual labels:  games
ffmpeg-h264-dec
H.264 decoder extracted from FFmpeg.
Stars: ✭ 81 (+189.29%)
Mutual labels:  emscripten
pokerwars.io-starterbot-python
A starter bot written in python for the pokerwars.io platform. To play: pull this code, register on pokerwars.io, get your API token and play!
Stars: ✭ 37 (+32.14%)
Mutual labels:  games
python-wasm
Build scripts and configuration for building CPython for Emscripten
Stars: ✭ 606 (+2064.29%)
Mutual labels:  emscripten
osgc
Open Source Game Collection - mini games created with xygine and SFML!
Stars: ✭ 17 (-39.29%)
Mutual labels:  games
WildWorld
Sandbox freestyle multiplayer game/engine in LÖVE/LUA.
Stars: ✭ 35 (+25%)
Mutual labels:  games
emscripten-webxr
WebXR library for use with Emscripten.
Stars: ✭ 21 (-25%)
Mutual labels:  emscripten
crossbow
Cross-Platform Rust Toolkit for Games 🏹
Stars: ✭ 80 (+185.71%)
Mutual labels:  games
WebAssembly-in-Action
Source code for the book "WebAssembly in Action" (https://www.manning.com/books/webassembly-in-action)
Stars: ✭ 44 (+57.14%)
Mutual labels:  emscripten
cppreeps
WASM C++ Screeps API and utilities pack (beta, proof-of-concepts)
Stars: ✭ 38 (+35.71%)
Mutual labels:  emscripten
        _______________________
       /\                      \
       \_|      Arxwasm        |
         |                     |
         |  An Arx Libertatis  |
         |   WebAssembly port  |_
          \_/____________________/

Arxwasm is an experimental port of the Arx Libertatis project to WebAssembly using Emscripten, allowing to run the Arx Fatalis video game (2002) in modern Web Browsers.

Contents

Port Status

The port is functional and working on all major Desktop Browsers: Firefox, Chrome, Safari, and Edge. So it is really possible to play the game. Mobile Browsers are working too, but the game is actually not playable due to lack of touch-based controls.

Performance is good, with around 40/60 FPS on a modern desktop system. Savegames are supported, and stored locally in Browser storage.

There is however a few minor visual glitches: some visual effects may appear to be missing compared to the original game. Nothing very dramatic though, this does not affect gameplay.

Online Demonstration

The easiest way to see the game running in your browser is simply to go to the following URL:

http://wasm.continuation-labs.com/arxdemo

This is an online demonstration of the project using the Arx Fatalis Demo, that you can run directly in your browser and enjoy playing! It consists of a main HTML file embedding the Wasm module, and some Javascript code to automatically fetch the Arx Fatalis Demo data.

Prerequisites

  • Any modern browser, on any platform, providing it supports WebAssembly, WebGL, and browser storage is enabled (IndexedDB).

  • A good CPU, and 350MB RAM.

  • 150MB of game data will be downloaded, and cached to the IndexedDB browser storage. This is a one time download requirement only.

Tidbits

  • The “Esc” key so commonly used in old PC games have been replaced by the "Home" key, as the web is a very different world. This key is used to go to the main game menu, or to skip cinematics.

  • The game have a very unusual control scheme. Use Right-click to toggle between the "Cursor mode" and "Mouselook mode", Tab to enter "Combat mode", Ctrl to enter "Magic mode", and Enter to equip an object.

  • FPS can be displayed using F11 key. Caution: this will interfere with the Browser key binding (usually "Fullscreen").

  • Fullscreen mode is available using the "Fullscreen" button in the HTML page. Note that this will only rescale the canvas to match your fullscreen resolution, and not actually resize the canvas. You may change the video resolution (ie. the canvas size) directly from the game video settings.

  • It is possible to load/save games. Savegames are stored locally in Browser storage.

Common issues

  • IndexedDB storage will not work if you are in « Private Browsing ». You may disable private browsing safely, as I do not track anything from you.

  • Also, 150MB is somewhat huge for an IndexedDB store. To mitigate this, cached data is chunked into small parts of ~50MB in the data store, but this is very empirical. It might fails on some browser configurations.

  • As already mentioned, there is some missing visual effects (mostly on the magic side) and occasional visual glitches (random fog issues, and weird looking savegames screenshots, no mipmaps). This is due to limitations of the underlying GL emulation layer used.

Legal

The port itself is based on the GPL source code release of Arx Fatalis, and the online demonstration is redistributing the game data coming from the Arx Fatalis Demo available for download freely on the Web (Nordic Games, Fileplanet). However the game Demo does not come with a specific license file like it is usually done.

So, to do my best to comply with legal requirements:

  • The source code of the port is available to the public, as required by the GPL.
  • I have contacted Zenimax Media (owners of Arkane Studios now) to ask for an explicit authorization of redistribution of the Demo. However, I never got any replies from them, which is unfortunate. At least, I tried to be fair and to get in touch with them.

As it is just a Demo of a 20-years old video game, I think there is no harm by redistributing the data that way, in an "instant-runnable" form instead of the usual "download-install-run" form. However, as Zenimax is the IP holder of the Arx Fatalis franchise, they have all the rights reserved. They can ask me to remove access to the online demonstration for whatever reason. In such event, I'll simply remove the access. The port source code would remain public however, being covered by the GPL.

Anyway, if you enjoyed the Demo, you can buy the full commercial version of the game on various distribution platforms. Don't hesitate if you enjoy old-school dungeon crawling PC games, it is a cool one (and somewhat buggy too, but that's another story).

History and Future Directions

The port is the continuation of an earlier experiment to port the game to Portable Native Client back in 2015, the ArxLibertatis-pnacl project. At that time, I wanted to know if it would be possible to run non-trivial C++ programs inside Web Browsers. After many hours of work on hobby time, I finally got the Native Client port to work, but it was limited to Chrome browser only and had some technical limitations.

Eventually, Native Client have been deprecated by Google in favor of WebAssembly, and early 2018, that new technology have been standardized across browsers. So, by the end of 2018, I took opportunity to move this project to WebAssembly to continue my investigations on the topic of running native programs inside Web Browsers. The result of this effort is this Arxwasm project.

There would be still several things to do on this port (fix the visual glitches, re-enable usage of VBOs, rework of the backend renderer to use WebGL), but instead I decided to move on to something much more challenging: to port the Doom 3 engine to WebAssembly and WebGL, in order to finally demonstrate that it is now possible to run some very demanding C++ program inside Web Browsers.

This is the D3wasm project. Don't hesitate to check it out, as results are probably better than you think :)

Source Code

The source code is available on Github:

https://github.com/gabrielcuvillier/arxwasm

It is a fork of the ArxLibertatis-pnacl port, as explained in the previous section, which is itself a fork of Arx Libertatis source port. In turn, Arx Libertatis is a fork of the Arx Fatalis GPL source code released by Arkane Studios a few years ago.

The project is using Emscripten. It allows to compile LLVM bytecode to WebAssembly, and provide all what is necessary to have a C/C++ runtime environment on the Web.

The port is based on a personnal fork of the Regal GL library, which have been updated to support Emscripten and WebAssembly, and released as an Emscripten port for the occasion. This library is a GL 1.x emulation layer on top of OpenGL ES 2.0.

How to build

If you feel brave enough to build the port yourself, detailed build instructions are located in the file BUILD.md.

Technical Details

There used to be some implementation notes in the former port to Portable Native Client, but they are deprecated now.

If you are interested in the technical details involved in porting a game to WebAssembly, you should definitively take a look at the D3wasm project where I detailed the porting process. It is a similar process than this project, albeit much more difficult.

Author and Contact

The author of this project is me, Gabriel Cuvillier, on behalf of my R&D Lab Continuation Labs.

This is an experimental research project, for the purpose of learning WebAssembly, demonstrating what can be done with that technology, and making the Web move forward.

You can reach me at [email protected].

Disclaimer

Arxwasm, the provided online demonstration, me, and Continuation-Labs are in no way associated with or supported by Arkane Studios or ZeniMax Media Inc.

Arx Fatalis, Arkane and related logos are registered trademarks or trademarks of ZeniMax Media Inc. in the U.S. and/or other countries. All Rights Reserved.

The Arxwasm source code is a derivative work of the General Public License source code release of Arx Fatalis.

WebAssembly is a standard being developed by the W3C.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].