Page 21 of 23

Re: Love.js - A Direct Emscripten Port

Posted: Wed Feb 03, 2021 11:18 am
by Davidobot
ivan wrote: Wed Feb 03, 2021 6:53 am The love file has to be in the same folder as the player until we figure this out.
Happy Wednesday :) I attached a prototype thing I quickly whipped up that allows anyone to drag-and-drop a .love file into your player and it will run. It's incredibly ugly and I hacked together some code to make it work, but it works :) There is also a bunch of needless checks, and I disabled caching (bc I didn't have time to test it) and fallback to compatibility version (bc it needs to be slightly smarter than changing URL)

There is also a live version on my website: https://davidobot.net/lovejs/lovejsplayer/index.html

EDIT: I just want to add that nothing gets uploaded anywhere and it's pretty fast as the browser will be loading from your local FS.

EDIT 2: you can make compat work by probably pre-loading (depending on the user agent) the correct js files.

Re: Love.js - A Direct Emscripten Port

Posted: Wed Feb 03, 2021 12:31 pm
by gianmichele
yep yep yep, definitely working. I love it!

Re: Love.js - A Direct Emscripten Port

Posted: Thu Feb 04, 2021 10:34 pm
by Popolon
Nice job ! On Linux, it works perfectly on Falkon browser (Webkit based) but not at all on Firefox.
The Compatibility version work with Firefox.

Re: Love.js - A Direct Emscripten Port

Posted: Fri Feb 05, 2021 7:05 pm
by Stifu
Popolon wrote: Thu Feb 04, 2021 10:34 pm Nice job ! On Linux, it works perfectly on Falkon browser (Webkit based) but not at all on Firefox.
The Compatibility version work with Firefox.
I guess it doesn't work with Firefox simply because it's missing the required headers:
In Firefox, the normal version can throw Uncaught ReferenceError: SharedArrayBuffer is not defined. Fix is discussed here. TL;DR Enable the following HTML reponse headers on the website you're hosting your project on:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Re: Love.js - A Direct Emscripten Port

Posted: Mon Mar 15, 2021 11:02 pm
by Stifu
Hey guys.

I noticed Zabuyaki stopped working with love.js (remember, it is auto-refreshed from sources, so it's auto-updated regularly). The error visible in the browser console is: "Uncaught RangeError: source array is too long"

According to my tests, it seems related to the size of the game.data file. It seems it got too big for love.js to handle. Now our game is 9478 KB zipped, and doesn't work with love.js anymore. I recompressed it manually using 7zip, using the Ultra compression level, and that slims it down to 9284 KB, enabling it to work again with love.js.

Is this a known issue?

Re: Love.js - A Direct Emscripten Port

Posted: Tue Mar 16, 2021 7:14 am
by ivan
Have you tried defining the allocated memory?
If you are using the love.js player you can change the memory using the &m= argument ?g=game.love&m=MEMORY

Re: Love.js - A Direct Emscripten Port

Posted: Tue Mar 16, 2021 6:36 pm
by Stifu
Actually, it works with the love.js player without any arguments. I guess it does something different.

For what it's worth, I'm on a love.js version from September 2020, but the commits since then don't seem related to my problem, so it doesn't look like it's worth updating to try and fix my issue.

Re: Love.js - A Direct Emscripten Port

Posted: Sat Apr 03, 2021 2:30 pm
by ivan
I have a followup update on the LoveJS Web player.
It can now load files from arbitrary locations:

Code: Select all

example.com/lovejsplayer/?g=path/to/my/game.love
The supplied path is relative to the lovejsplayer's install directory (cross-domain requests will not work)
Some additional arguments:

Code: Select all

&f=1         disables the fullscreen button
&r=1         disables caching
&m=10000000  desired memory to allocate in bytes
&c=1         compatibility mode
Looks like everything works fine although we are still getting some 'out of memory' crashes here and there.
Will post another update if I figure out a good way to handle this.

Re: Love.js - A Direct Emscripten Port

Posted: Sun Nov 07, 2021 3:45 pm
by abhimonk
Hello all!
I've been using love.js to port a game to the web and it's worked great 99% of the time, but a few of my players are getting the following error on firefox:

DOMException: The current transaction exceeded its quota
limitations." at love.js line 9, character 324520

Does this have to do with the game's size? I think it's only ~10mb or so. If I go through the code in love.js, the error occurs on the line where love.js calls 'FS.syncFS'.

I can't reproduce this error myself, but some of my players are getting this error on the armorgames version of my love.js game. Any tips? Is there a way around this error? Would shrinking my assets help?

Re: Love.js - A Direct Emscripten Port

Posted: Mon Nov 08, 2021 9:19 pm
by Davidobot
abhimonk wrote: Sun Nov 07, 2021 3:45 pm Hello all!
I've been using love.js to port a game to the web and it's worked great 99% of the time, but a few of my players are getting the following error on firefox:

DOMException: The current transaction exceeded its quota
limitations." at love.js line 9, character 324520

Does this have to do with the game's size? I think it's only ~10mb or so. If I go through the code in love.js, the error occurs on the line where love.js calls 'FS.syncFS'.

I can't reproduce this error myself, but some of my players are getting this error on the armorgames version of my love.js game. Any tips? Is there a way around this error? Would shrinking my assets help?
Maybe increase the memory allocated to the game with the -m flag?