Ren'Py for the web browser

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Message
Author
biZZler
Newbie
Posts: 3
Joined: Tue Apr 16, 2019 10:21 am
Contact:

Re: Ren'Py for the web browser

#46 Post by biZZler »

Hey, I have just tried running my game locally on firefox. But it's not working. Any Idea what's wrong? I'm using the latest version of Renpy and RenpyWeb.

Here is the log generated by RenpyWeb.

Code: Select all

Tue Apr 16 10:34:24 2019
Emscripten-1.0-x86-JS-32bit
Ren'Py 7.2.2.491
 

Bootstrap to the start of init.init took 0.00s
Early init took 0.02s
import encodings.zlib_codec # precompiled from /lib/python2.7/encodings/zlib_codec.pyo
Loader init took 0.12s
Loading error handling took 0.15s
import emscripten # builtin
Loading script took 0.25s
Loading save slot metadata. took 0.01s
Loading persistent took 0.00s

Full traceback:
  File "gui.rpyc", line 11, in script
  File "renpy/ast.py", line 900, in execute
  File "renpy/python.py", line 1930, in py_exec_bytecode
  File "game/gui.rpy", line 12, in <module>
AttributeError: 'StoreModule' object has no attribute 'init'

While running game code:
  File "game/gui.rpy", line 12, in <module>
AttributeError: 'StoreModule' object has no attribute 'init'
DPI scale factor: 1.000000
Interface start took 0.05s
import renpy.gl.gldraw # builtin
import renpy.gl.gltexture # builtin
import renpy.gl.gl # builtin
import array # builtin
import renpy.gl.glblacklist # precompiled from ./renpy/gl/glblacklist.pyo
import renpy.gl.glrtt_copy # builtin
import renpy.gl.glrtt_fbo # builtin
import renpy.gl.glenviron_shader # builtin
import renpy.display.swdraw # precompiled from ./renpy/display/swdraw.pyo

primary display bounds: (0, 0, 1536, 864)
swap interval: 1 frames
Windowed mode.
Screen sizes: virtual=(1280, 720) physical=(1536, 750) drawable=(3840, 1875)
Vendor: 'Mozilla'
Renderer: 'Mozilla'
Version: 'OpenGL ES 2.0 (WebGL 1.0)'
Display Info: <Info({'blit_sw_CC': False, 'refresh_rate': 0, 'bitsize': 32, 'wm': True, 'losses': (0, 0, 0, 8), 'hw': False, 'masks': (16711680L, 65280L, 255L, 0L), 'current_h': 864, 'current_w': 1536, 'shifts': (16, 8, 0, 0), 'blit_sw_A': False, 'blit_hw': False, 'blit_sw': False, 'bytesize': 4, 'blit_hw_CC': False, 'blit_hw_A': False, 'video_mem': 268435456})>
Extensions:
    ANGLE_instanced_arrays
    EXT_blend_minmax
    EXT_color_buffer_half_float
    EXT_frag_depth
    EXT_sRGB
    EXT_shader_texture_lod
    EXT_texture_filter_anisotropic
    GL_ANGLE_instanced_arrays
    GL_EXT_blend_minmax
    GL_EXT_color_buffer_half_float
    GL_EXT_frag_depth
    GL_EXT_sRGB
    GL_EXT_shader_texture_lod
    GL_EXT_texture_filter_anisotropic
    GL_OES_element_index_uint
    GL_OES_standard_derivatives
    GL_OES_texture_float
    GL_OES_texture_float_linear
    GL_OES_texture_half_float
    GL_OES_texture_half_float_linear
    GL_OES_vertex_array_object
    GL_WEBGL_color_buffer_float
    GL_WEBGL_compressed_texture_s3tc
    GL_WEBGL_compressed_texture_s3tc_srgb
    GL_WEBGL_debug_renderer_info
    GL_WEBGL_debug_shaders
    GL_WEBGL_depth_texture
    GL_WEBGL_draw_buffers
    GL_WEBGL_lose_context
    OES_element_index_uint
    OES_standard_derivatives
    OES_texture_float
    OES_texture_float_linear
    OES_texture_half_float
    OES_texture_half_float_linear
    OES_vertex_array_object
    WEBGL_color_buffer_float
    WEBGL_compressed_texture_s3tc
    WEBGL_compressed_texture_s3tc_srgb
    WEBGL_debug_renderer_info
    WEBGL_debug_shaders
    WEBGL_depth_texture
    WEBGL_draw_buffers
    WEBGL_lose_context
Number of texture units: 16
Using shader environment.
Using copy RTT.
Using gl renderer.
Texture testing:
- Hardware max texture size: 16384
- 64px textures work.
- 128px textures work.
- 256px textures work.
- 512px textures work.
- 1024px textures work.
- 2048px textures work.
Total time until interface ready: 1.31599998474s
import encodings.utf_32_be # precompiled from /lib/python2.7/encodings/utf_32_be.pyo
While handling exception:
Traceback (most recent call last):
  File "renpy/display/error.py", line 140, in report_exception
  File "renpy/game.py", line 281, in invoke_in_new_context
  File "renpy/display/error.py", line 45, in call_exception_screen
  File "renpy/ui.py", line 289, in interact
  File "build/renpy/renpy/./display/core.py", line 2700, in interact
  File "build/renpy/renpy/./display/core.py", line 3084, in interact_core
  File "build/renpy/renpy/./display/core.py", line 534, in visit_all
  File "build/renpy/renpy/./display/core.py", line 534, in visit_all
  File "build/renpy/renpy/./display/core.py", line 534, in visit_all
  File "renpy/display/screen.py", line 424, in visit_all
  File "build/renpy/renpy/./display/core.py", line 3084, in <lambda>
  File "renpy/display/screen.py", line 434, in per_interact
  File "renpy/display/screen.py", line 619, in update
  File "renpy/sl2/slast.py", line 2069, in __call__
  File "renpy/sl2/slast.py", line 2012, in execute
  File "renpy/sl2/slast.py", line 407, in execute
  File "renpy/sl2/slast.py", line 887, in execute
  File "renpy/sl2/slast.py", line 887, in execute
  File "renpy/sl2/slast.py", line 887, in execute
  File "renpy/sl2/slast.py", line 849, in execute
  File "renpy/text/text.py", line 1479, in __init__
  File "renpy/text/text.py", line 1598, in set_text
  File "renpy/substitutions.py", line 244, in substitute
  File "//lib/python2.7/string.py", line 563, in vformat
  File "//lib/python2.7/string.py", line 585, in _vformat
  File "//lib/python2.7/string.py", line 652, in get_field
AttributeError: 'StoreModule' object has no attribute 'version'

Full traceback:
  File "build/renpy/renpy/./bootstrap.py", line 313, in bootstrap
  File "build/renpy/renpy/./main.py", line 435, in main
  File "gui.rpyc", line 11, in script
  File "gui.rpyc", line 11, in script
  File "renpy/ast.py", line 900, in execute
  File "renpy/python.py", line 1930, in py_exec_bytecode
  File "game/gui.rpy", line 12, in <module>
AttributeError: 'StoreModule' object has no attribute 'init'

While running game code:
  File "game/gui.rpy", line 12, in <module>
AttributeError: 'StoreModule' object has no attribute 'init'
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
Creating Astros - a cosmic love story!. Link - www.patreon.com/biZZler

User avatar
Beuc
Regular
Posts: 85
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py for the web browser

#47 Post by Beuc »

Hi!

Do you get an error in the browser, or in the browser console?

I just got an "I/O error" while checking another game, it happens when decompressing game.zip and some files get corrupt, I'm investigating.
Maybe that's the same bug.

biZZler
Newbie
Posts: 3
Joined: Tue Apr 16, 2019 10:21 am
Contact:

Re: Ren'Py for the web browser

#48 Post by biZZler »

I'm not getting an error per se, just that the game is failing to start.
Here is a screenshot.
screenshot.JPG
Creating Astros - a cosmic love story!. Link - www.patreon.com/biZZler

User avatar
Beuc
Regular
Posts: 85
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py for the web browser

#49 Post by Beuc »

Can you try replacing pyapp.data and pyapp-data.js with the ones from this previous version?
https://renpy.beuc.net/download/renpywe ... 190331.zip

There seem to be an issue with the recent compression optimization (#8450 for details).

If that still fail, please post what's in the JavaScript Console (Ctrl+Shift+K) :)

biZZler
Newbie
Posts: 3
Joined: Tue Apr 16, 2019 10:21 am
Contact:

Re: Ren'Py for the web browser

#50 Post by biZZler »

Yeah that seems to have fixed things for me. Thanks mate!
Creating Astros - a cosmic love story!. Link - www.patreon.com/biZZler

User avatar
Beuc
Regular
Posts: 85
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py for the web browser

#51 Post by Beuc »

https://www.patreon.com/posts/week-16-report-26259015

- Integration in official Ren'Py: Renpytom has been working some more on it. This week's release is probably one of the last with the current game.zip layout, the next ones should be generated by the Ren'Py launcher directly!

- Hot-fix bug release on the 16th: disable LZ4 compression as this causes problems #8450. Impacted files will soon be moved to game.zip anyway.

- Size-optimization: fallback gzip decompression of the index.wasm file (15MB->4MB) when the web host doesn't do it (itch.io/newgrounds...)

- Size-optimization: clean-up base Ren'Py files some more (removed 1MB)

- Warn player when unzipping game.zip fails (instead of trying to load an incomplete game)

- Improve documentation

- Update to Emscripten 1.38.30

- zee.js: refresh prebuilts with Emscripten 1.38.30 #7

- python-emscripten: now builds fully in parallel

- python-emscripten: LZ4 compression support for pythonhome.data

User avatar
Andredron
Miko-Class Veteran
Posts: 700
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Ren'Py for the web browser

#52 Post by Andredron »

Beuc wrote: Sun Apr 21, 2019 11:44 am https://www.patreon.com/posts/week-16-report-26259015

- Integration in official Ren'Py: Renpytom has been working some more on it. This week's release is probably one of the last with the current game.zip layout, the next ones should be generated by the Ren'Py launcher directly!

- Hot-fix bug release on the 16th: disable LZ4 compression as this causes problems #8450. Impacted files will soon be moved to game.zip anyway.

- Size-optimization: fallback gzip decompression of the index.wasm file (15MB->4MB) when the web host doesn't do it (itch.io/newgrounds...)

- Size-optimization: clean-up base Ren'Py files some more (removed 1MB)

- Warn player when unzipping game.zip fails (instead of trying to load an incomplete game)

- Improve documentation

- Update to Emscripten 1.38.30

- zee.js: refresh prebuilts with Emscripten 1.38.30 #7

- python-emscripten: now builds fully in parallel

- python-emscripten: LZ4 compression support for pythonhome.data
My admiration for you, you did a very great job, and you did not abandon it half way!

The only thing that is pity is, in Chrome, when you enter the application, it translates the text of the site, but in the project itself, the text of the dialogue does not translate. It would be very cool if the text in the dialogs could translate, or at least the text of the translation above the main text. The neural network is developing and someday in the future Google will begin to translate normally into its native language.

Thanks again for the work you've done.

User avatar
Beuc
Regular
Posts: 85
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py for the web browser

#53 Post by Beuc »

Thanks for your encouragement :)

From Chrome's point of view, there's no text, only graphics, so it won't translate them.
I guess Ren'Py itself would need to feed chrome/google the full VN text (to provide context) and get a machine translation (which would need to be clearly marked as such, as it may misrepresent the VN author's work).

I think this is the same in all game engines for the web, but if you know one that does the machine translation, it would be interesting to have a look.

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4084
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Ren'Py for the web browser

#54 Post by jack_norton »

Hello, just found out about this now. Great job. I had a question: are you somehow "translating" the games into HTML5, or using a chrome plug-in to run .exes? (I'm not a big expert about web stuff).
If you're somehow translating the renpy games to HTML5 that's great since it could open the door to many other cool things, for example I know there are ways to port HTML5 games to consoles (switch). This has a lot of potential. I'll be sure to check your Patreon page too :)
follow me on Image Image Image
computer games

User avatar
Beuc
Regular
Posts: 85
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py for the web browser

#55 Post by Beuc »

Hi! You can consider this is a HTML5 "translation" yes.
Your game can run in any recent browser, no plugins involved :)
That includes mobile browsers (though the perfs are slowly coming).

What kind of technique are you thinking about to run HTML5 games on the switch?

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4084
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Ren'Py for the web browser

#56 Post by jack_norton »

I remember time ago there was a tool to convert HTML5 to .exe, not sure if can be done to other platforms, I should look around. But basically Construct uses HTML5 I think and exports to consoles ? maybe I'm wrong :D
follow me on Image Image Image
computer games

User avatar
Beuc
Regular
Posts: 85
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py for the web browser

#57 Post by Beuc »

One technique is to make a new HTML5 game engine (such as Construct 2 or RPGMaker MV) and then ship a minimal .exe browser (NW.js or Electron) that will autoplay your HTML5 files. Usually this works with lin/win/mac and possibly android/ios, but not with consoles AFAICS.

Technically that could be done with RenPyWeb but there are already dedicated ports for these platforms :)
I believe there's some work for Ren'Py on Switch, though, you may want to ask renpytom.

User avatar
uyjulian
Regular
Posts: 128
Joined: Sun Mar 08, 2015 1:40 pm
Github: uyjulian
Contact:

Re: Ren'Py for the web browser

#58 Post by uyjulian »

There is a Ren'Py fork for Switch: https://github.com/nx-python/renpy


Since the emscripten work added support for building statically, I might try to update the version of Ren'Py. Also, pthreads and std::thread support has been added recently to libnx/devkitA64.

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4084
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Ren'Py for the web browser

#59 Post by jack_norton »

Ah interesting thanks! Though sadly doing a port for switch has a lot of issues/costs, and talking with some devs I know, it's probably not worth it anymore. Cool to know though :)
follow me on Image Image Image
computer games

User avatar
Beuc
Regular
Posts: 85
Joined: Sat Sep 29, 2018 3:38 pm
Contact:

Re: Ren'Py for the web browser

#60 Post by Beuc »

https://www.patreon.com/posts/week-17-report-26424914

- More audio tuning to avoid a jitter/silence right after playing a sound
- Size/start-up optimization: drop video codecs since video support is currently not implemented (-25% for index.wasm)
- Start investigating flickering in imagemap/imagebutton with alpha (reported by a new user, thanks!); AFAICS there is a related issue in mobile versions
- Minor fixes to Ren'Py web integration (not ready yet)
- WebGL tuning: using FrameBufferObjects for RenderToTexture

Post Reply

Who is online

Users browsing this forum: No registered users