Love.js - A Direct Emscripten Port

Discuss any ports of LÖVE to different platforms.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Love.js v11.3

Post by Davidobot »

Hey everyone!

I've been slowly tinkering away at the v11.3 port. I've recently released proper build instructions for Windows, and a compatibility version just today. The latter makes things a bit slower if your game uses threads, but makes the exported game available in basically every browser you can think of (including mobile browsers!)

I've updated the demos on my website. The coolest one to try on mobile is the G3D Demo.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
Stifu
Party member
Posts: 106
Joined: Mon Mar 14, 2016 9:53 am
Contact:

Re: Love.js - A Direct Emscripten Port

Post by Stifu »

I got that to work on the first try by simply following the new readme.me on the repo, and without even checking my older posts here. That's good. :)

I used Another Kind of World as the source love file. That one works flawlessly.
It doesn't work with our own game yet (it didn't work before either, but I didn't bring it up), probably we're doing things that are not compatible. I think we can figure it out on our own. Disabling shaders and removing the usage of the inspect.lua lib (as it results in a weird Error: Syntax error: lib/debug/inspect.lua:1: unexpected symbol near '燎 error) makes our game load, at least! Then it freezes as you select a character.

Amazingly, our .xm music files play for a second before stopping, I didn't expect them to work at all. I thought only mp3 or ogg would work on the web.

Just for fun, this is what it looks like now (I'll probably take that link down soon): https://www.zabuyaki.com/play3/

PS: I'm thankful for the compatibility version which will be useful for us.
Zabuyaki, our upcoming beat 'em up: https://www.zabuyaki.com
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: Love.js - A Direct Emscripten Port

Post by Davidobot »

Stifu wrote: Sat Sep 12, 2020 1:06 pm I got that to work on the first try by simply following the new readme.me on the repo, and without even checking my older posts here. That's good. :)
Super! I think I'm getting down to the problem behind shaders not working - I think it has to do with different memory alignments in emscripten. It's 16 in WASM, but 8 in asm.js
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
yetneverdone
Party member
Posts: 448
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Love.js - A Direct Emscripten Port

Post by yetneverdone »

Did i just read that threads work in web but is slower?
User avatar
Stifu
Party member
Posts: 106
Joined: Mon Mar 14, 2016 9:53 am
Contact:

Re: Love.js - A Direct Emscripten Port

Post by Stifu »

Davidobot, can you recommend how to write code paths that are only for lovejs? Maybe through start-up command line arguments?
This would enable us to write code such as "if not lovejs, then go fullscreen", and so on. Thank you.
Zabuyaki, our upcoming beat 'em up: https://www.zabuyaki.com
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: Love.js - A Direct Emscripten Port

Post by Davidobot »

yetneverdone wrote: Sat Sep 12, 2020 2:05 pm Did i just read that threads work in web but is slower?
Threads work both on the compatibility and normal release. On the former, they are slower.
Stifu wrote: Sat Sep 12, 2020 2:11 pm Davidobot, can you recommend how to write code paths that are only for lovejs? Maybe through start-up command line arguments?
This would enable us to write code such as "if not lovejs, then go fullscreen", and so on. Thank you.
love.system.getOS returns Web in-browser. ;)
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
MadByte
Party member
Posts: 533
Joined: Fri May 03, 2013 6:42 pm
Location: Braunschweig, Germany

Re: Love.js - A Direct Emscripten Port

Post by MadByte »

I noticed that Another Kind of World has some visual problems like the stuff seen on the image (background tile not visible etc). I wonder what is causing this as this doesn't happen in the normal version of the game.
Also for me the music cuts out right after it started playing in the love.js port.

Image
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: Love.js - A Direct Emscripten Port

Post by Davidobot »

Stifu wrote: Sat Sep 12, 2020 1:06 pm Amazingly, our .xm music files play for a second before stopping, I didn't expect them to work at all. I thought only mp3 or ogg would work on the web.
MadByte wrote: Sat Sep 12, 2020 4:58 pm Also for me the music cuts out right after it started playing in the love.js port.
My bad, I forgot to mention that threading is necessary for proper audio support. I updated the README on the GitHub with both the full and compat versions of the demos, so you can see the difference.
MadByte wrote: Sat Sep 12, 2020 4:58 pm I noticed that Another Kind of World has some visual problems like the stuff seen on the image (background tile not visible etc). I wonder what is causing this as this doesn't happen in the normal version of the game.
Firefox seems to be having some graphical glitches, e.g. the depth buffer not working on desktop Firefox but working on (mobile) Chrome. For audio, see the above comment.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
MadByte
Party member
Posts: 533
Joined: Fri May 03, 2013 6:42 pm
Location: Braunschweig, Germany

Re: Love.js - A Direct Emscripten Port

Post by MadByte »

Davidobot wrote: Sat Sep 12, 2020 6:56 pm Firefox seems to be having some graphical glitches, e.g. the depth buffer not working on desktop Firefox but working on (mobile) Chrome. For audio, see the above comment.
I tested it on desktop Chrome / Chromium as well - same issue. :P
User avatar
D0NM
Party member
Posts: 250
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: Love.js - A Direct Emscripten Port

Post by D0NM »

Dear friends!
This lovejs is such a cool think
It should be way more popular. Now trying to see where does our Zabuyaki stop working with lovejs.
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest