Page 1 of 7

Ren'Py for the web browser

Posted: Sun Sep 30, 2018 6:15 am
by Beuc
Hi,

A few month ago I ported the old-style 2D/RPG Dink Smallwood desktop game to the web.
Since then I've been experimenting on porting the next best thing in the browser: Ren'Py ;)

After lots of pitfalls and dead-ends, several layers of portability, I'm glad to present a first working tech demo!

Image
https://renpy.beuc.net/demo/


Also I'm freelance/self-employed and I'd very much like to dedicate more time on this so it can be 100% functional and integrated in the standard Ren'Py in the end, so I've setup a Patreon if you want to the project get out [faster] :)

Image
https://www.patreon.com/Beuc


More info on this project at:
https://renpy.beuc.net/

-

EDIT: now integrated in Ren'Py!
Image

Naturally I'd very much welcome your feedback (does it work for you, what browser...)

Re: Ren'Py for the Web - first version

Posted: Sun Sep 30, 2018 1:42 pm
by PyTom
This is officially one of the coolest things I've ever seen.

Edit: Would you mind pming me, when you get a chance. I'd be interested in how you managed to get Ren'Py running inside the browser, since it seems like you would have had to eliminate the threading from the main loop. I didn't think that would be possible - I'd like to know how you did it, and see if we can integrate these changes into Ren'Py proper so they don't go stale.

Re: Ren'Py for the Web - first version

Posted: Sun Sep 30, 2018 4:39 pm
by Beuc
Thanks!

Glad to hear you're willing to include web-related changes in standard Ren'Py :)

Currently I have mods in lots of components (Ren'Py and non-Ren'Py), I'm progressively isolating and cleaning each so they can be officially included.
(also sent PM with more technical stuff)

Re: Ren'Py for the Web

Posted: Sun Oct 07, 2018 7:06 am
by Beuc
Hey,

I made some improvements, now it's faster with Firefox, and there's initial sound support.
I also added the Tutorial for testing.

More importantly, you now can test your own local game in the web player:

Image


Check https://renpy.beuc.net/ , share the news if you like this project, and leave feedback!

Re: Ren'Py for the Web

Posted: Sun Oct 14, 2018 2:26 pm
by Beuc
New version uploaded at https://renpy.beuc.net/
- Improve performances (WASM support) for Chrome/Chromium
- Contribute transparency (alpha) fix in official Emscripten
- Start structuring the compilation process to test multiple emscripten versions/patches

Feedback welcome!

Re: Ren'Py for the Web

Posted: Mon Oct 15, 2018 9:02 pm
by PyTom
That really is much nicer in Chrome. I'd say that with the exception of the stuttering in sound, it's rapidly getting playable.

Re: Ren'Py for the Web

Posted: Wed Oct 17, 2018 3:59 pm
by Beuc
Thanks for testing and sharing the feedback, much appreciated.
I myself get audio jitter at game interactions in Chrome, and normally not in Firefox (except sometimes when it happens all the time).

After more testing the bottleneck doesn't seem to be the audio decoding, but simply the rest of Ren'Py taking too long.
Due to a limitation in today's WebAudio, audio is not completely separate, see this fix attempt.

I plan more testing to see if there's a better way.

Re: Ren'Py for the Web

Posted: Sun Oct 21, 2018 4:14 pm
by Beuc
This week's progress:

- Presplash image
- Image prediction now working
- Open web links in a new tab (you'll get a popup warning though, I don't think that can be bypassed)
- emscripten: now can query current WebGL attributes (notably alpha/transparency)
- Audio optimization tests. My current opinion is we'll need multithreading support to get better perfs; this requires me to contribute more with the Emscripten project as well as incoming support in the browsers (more precisely "SharedArrayBuffer" - Chrome starts enabling it but it doesn't work for me yet, and in Firefox you can enable it with a few clicks).
- SharedArrayBuffer experiments

Let me know how well/bad that works for you.

Re: Ren'Py for the Web

Posted: Mon Oct 22, 2018 3:00 pm
by Andredron
Beuc wrote:
Sun Oct 21, 2018 4:14 pm
This week's progress:

- Presplash image
- Image prediction now working
- Open web links in a new tab (you'll get a popup warning though, I don't think that can be bypassed)
- emscripten: now can query current WebGL attributes (notably alpha/transparency)
- Audio optimization tests. My current opinion is we'll need multithreading support to get better perfs; this requires me to contribute more with the Emscripten project as well as incoming support in the browsers (more precisely "SharedArrayBuffer" - Chrome starts enabling it but it doesn't work for me yet, and in Firefox you can enable it with a few clicks).
- SharedArrayBuffer experiments

Let me know how well/bad that works for you.
Hello, With Android can not run your projects online
Image

Black screen

Re: Ren'Py for the Web

Posted: Mon Oct 22, 2018 3:55 pm
by Imperf3kt
Android's Google Chrome is actually Chromium. I'm not sure about Firefox, but my guess is maybe the browser?

Re: Ren'Py for the Web

Posted: Mon Oct 22, 2018 4:39 pm
by Beuc
Thanks for the screenshot!
I got this myself when testing on Android today:
- with the stock browser, I couldn't get the reason
- with new Firefox and Chromium (and remote debugging) I was told "out of memory"
With Android Firefox this works sometimes, so I suspect my phone indeed doesn't have enough memory to run RenPyWeb (I have 2BG, these web things are hungry) :/

Maybe there's a way to optimize the memory footprint.

I also should check how to make these errors more visible, they are hidden by default.

Re: Ren'Py for the Web

Posted: Mon Oct 29, 2018 2:13 pm
by Beuc

Re: Ren'Py for the Web

Posted: Tue Oct 30, 2018 11:01 am
by ComputerArt.Club
Wow! This is cool! I'm surprised it hasn't received more attention! Well done!

Re: Ren'Py for the Web

Posted: Tue Oct 30, 2018 4:43 pm
by Beuc
Thanks!
If you've got suggestions on where to reach out fellow VN devs, I'm all ears ;)

Re: Ren'Py for the Web

Posted: Sun Nov 04, 2018 4:27 pm
by Beuc