Tool RenPyWeb - Ren'Py in your browser

Beuc

New Member
Nov 11, 2018
13
7
Hey,

I've been working on a Ren'Py port for the browser! It's called RenPyWeb:
renpy.beuc.net


It begins to be working fine (if somewhat slowly), so we could well see Ren'Py demos or full games online soon.
I'm all ears if you've got ideas/suggestions/bug reports about this.

Also I setup a Patreon to help me dedicate time on this obsessing project...


The website above contains a sandbox for testing your game, and you can also download a full archive to try and put it online somewhere.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,103
14,757
Error: Uncaught abort("Assertion failed: no binaryen method succeeded."). Build with -s ASSERTIONS=1 for more info. (see JavaScript console for details)

Which is weird since I was able to play it when PyTom tweeted the link.
 
  • Like
Reactions: Palanto

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,103
14,757
Weird indeed.
URL / browser / version ? :)
(FF 63 and Chromium 70 work fine here.)
Whatever your site or the itch.io version, and all games.
Cyberfox 52.1.3 (so not so old version). I'll try to remember to update it tomorrow, because there's something I really want to verify...
 
  • Like
Reactions: Palanto

Beuc

New Member
Nov 11, 2018
13
7
I had introduced a typo in the fallback for older browsers - this is fixed, thanks for the report.
*fox 52 (branched 3/2017) has no webassembly support don't expect huge perfs though.
 
  • Like
Reactions: Palanto

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,103
14,757
[...] thanks for the report.
You're welcome.

This said, behind the technical realization that is interesting, it's not really a suitable solution for games around there. The game need to be fully downloaded before being playable and, except crunched versions and really early releases, there's few under the 500MB.
In another hand it imply that the potential security issue isn't in fact a threat. You aren't opening a full shell on the server, users are opening one (limited to the actual browsing session, and so themselves) on their own computer. And like the whole process is on a virtual system, its probably stronger than a FreeBSD's jail. So potential malicious code included in a game are in fact less a problem than with regular Ren'py games. This while opening Ren'py to less used OSes.

Now you just need to find a way to keep everything except game's scripts on the server side to make it amazing. Ren'py's prediction and its cache (with an increased value compared to the default one) should be enough to make the needed downloads almost transparent for the player ; at least as long as the game's author is a little compliant. Browser's own cache could probably even add it's part over the process.
Then will come the problem of the saves, which is a big problem here since most of the games are released by successive updates. Using browser session data is probably the least bad idea, since it's the one that don't effectively remove all the advantages in terms of security.
 
  • Like
Reactions: Palanto

Beuc

New Member
Nov 11, 2018
13
7
On-demand resource download is in the roadmap, so images/musics will be downloaded while playing :)

This is a purely client-side solution so you can upload your game anywhere, including newgrounds, itch.io, your bare HTTP directory, etc.
(renpytom experimented with server-side a few years ago, this was short-lived.)

Wrt security, current Ren'Py games offer none (since they can execute arbitrary Python). In this port, this is better thanks to browser sandboxing.

Savegames are stored in the browser (IDBFS), import/export is easy to add, I'm mostly wondering how to make that easily accessible for all games without invading the gameplay area.
 
  • Like
Reactions: Palanto

Beuc

New Member
Nov 11, 2018
13
7
More progress on this front!

  • Optimized start-up time by avoiding recompiling Python snippets from .rpyc files; you need to ship renpy/common/ in your game.zip file to leverage this. RenPyWeb now can run unmodified renpy/common/ files. Also the browser is more responsive during game loading.
  • Better mobile support by optimizing memory on start-up (Firefox 63 runs reasonably well).
  • Quit the game cleanly: no crash, and stop audio ; also found a bug in Ren'Py in the process
  • More code clean-up; optimized out unnecessary libraries SDL2_mixer and SDL2_ttf.
  • SDL2: patch audio issue
  • Emscripten: clarified cryptic error message in Emscripten and improved documentation ; reported bug when using pristine SDL2 ; upgraded to 1.38.19.
  • Clarified Roadmap - feedback welcome.
Get the latest dev kit at renpy.beuc.net .
 

Beuc

New Member
Nov 11, 2018
13
7
1543860030670.png
- Improved design
- Screenshot auto-download
- Upgraded to latest Ren'Py
- Bug fixes
Enjoy!
 

Dusky Hallows

Member
Game Developer
Aug 6, 2017
207
621
As someone who would love to upload their game on Newgrounds, I'm very interested in this. Played around with uploading a version of Sanguine Rose to Newgrounds and I have to say, this is impressive. Buggy as hell, yes, but impressive, and it looks like you're making steady progress. I'm looking forward to seeing where this goes.