robocode-dev / tank-royale

Git repository for Robocode Tank Royale
Apache License 2.0
145 stars 29 forks source link

WebAssembly build #15

Open elliott-wen opened 2 years ago

elliott-wen commented 2 years ago

Hi, thanks for sharing this cool project. It would be cool if we have a webassembly version of robocode so that people can watch a robocode game session in a browser. :D

I could offer some help on that. I guess this should be relatively easy, since we just need to fetch the game state and render it as is. I could implement it either in Rust or C++ with sdl.

Let me know what you think. :D

flemming-n-larsen commented 2 years ago

@elliott-wen This is an excellent idea that I fully support and welcome! 🤗 I have had this in mind for a web version of Robocode as well from the start - at least for the GUI/view part but started out with the JVM-based version (as it is somewhat similar to the original Robocode UI).

With a web-based UI/view people would be able to follow/view a battle going on a remote server without the need of using the GUI application (JVM-based). But it would also be cool for people that want to develop a web bot without the need to install a classic IDE, but just write some code in the browser or even point to some bot code available on a Git repository.

The server(s) needs to run beside the UI, and we could make a containerized version of the server (📦), so it could be started in the cloud for the purpose, and the UI just needs a URL to the server and know the server secret in order to connect to the server.

I guess in its simplest form (prototype), the WebAssembly version just needs to visualize battles (observer). Later, it might be able. Later, it might be possible to control the battle as well, e.g. doing a control panel for pausing, stopping, restarting a battle etc.

I will create a repository here at robocode-dev for you so you can get started. I just need a good name for it. I propose something like tank-royale-web-ui or similar? A better name is very welcome. Keep in mind that more sub repositories will be added beside tank-royale, which is the "core" of the game. 🙂

I am not sure what is the better choice for doing the WebAssembly version. But I guess that Rust will be easier to develop and maintain than C++? And I guess Rust is very popular with other developers as well. 🙂

elliott-wen commented 2 years ago

I entirely agree with you. I am thinking if this platform can be entirely web-based, i can then ask my AI students (I am teaching some AI courses this semester) to submit their controllers. We may even rank them in real-time. Quite an excitement work to be done. :D I will start working on it soon