arcade
arcade copied to clipboard
Enhancement request - Python Arcade for browser games
Enhancement request:
I would like to share the game I have created with friends. The easiest way to do it is via the internet. It would be great to run a docker container where my game is executed on the cloud. Via link people could run the container and access the game in their browser.
Is it possible to implement? Do I have to switch to a different game development framework?
It would only work if you did the actual rendering in the container and transferred pixel data. That's definitely doable. Being able to run everything in the browser itself would be such a giant undertaking you would probably need to design a new game library from scratch using WebGPU.
We've had our focus on the following platforms: Windows (GL), Linux (GL), Mac (GL), Raspi4 (GLES) and other tiny comptuers like Nvidia Jetson. This also includes headless rendering in docker containers and/or linux servers meaning it also works on services like Replit.
The new advancements with PyScript are very interesting. Apparently there's a project to adapt PyGame to the browser using it. But WebGL does not support an OpenGL version advanced enough for our back-end, and WebGPU is still experimental and disabled by default. I'm not sure where we'll go with browser support.
A workaround could be Repl it
they are able to render the ui into the browser, still that has some performance issues.
Hi @pvcraven
Apparently there's a project to adapt PyGame to the browser using it.
May i know which one ? because i added wasm support to pygame for stock libcpython-wasm and its use is actually not compatible with pyodide or pyscript. The only project i know that could eventually help loading pygame on pyscript use a fork of pyodide and is https://github.com/kitao/pyxel .
WebGL does not support an OpenGL version advanced enough for our back-end
Emscripten provide some emulation for OpenGL over EGL/GLES but you would need some intermediate library like libglvnd to allow ctypes to find something to bind.
@Cleptomania just created a new framework called arcade-web, its really really really alpha version, the only thing it can do is arcade.gl module but that still has a lot of work to do and has a lot of bugs, if you wanna contribute to the project, here is the link for the arcade-web library: https://github.com/pythonarcade/arcade-web It uses pyodide and WebGL to render,but clepto said he is going to switch to WebGPU because WebGL is really outdated. if you wanna see the latest news about it, join the arcade discord server: https://discord.gg/ZjGDqMp
I'm going to close this issue. We are building https://github.com/pythonarcade/arcade-web so if anyone is interested in this they can follow that repo for updates about this specifically. At this point there are no plans to integrate the two packages into one, though we will likely create documentation for arcade-web within the primary Arcade docs.
When the time comes, we can make separate issues for building that documentation, but anything relating to the actual library running in the browser should be posted to the arcade-web repo.