Love.js - A Direct Emscripten Port

Discuss any ports of LÖVE to different platforms.
danvdragos
Prole
Posts: 2
Joined: Wed Jan 18, 2017 7:24 am

Re: Love.js - A Direct Emscripten Port

Post by danvdragos » Wed Jan 18, 2017 5:40 pm

@Ulydev
Yes but not fully because the browser doesn't support UDP. You can use a websocket in js and proxy bytes from stdin/stdout in no more then ~50 lines of code.
If you are more adventurous you could try WebRTC, implement peer discovery over a known IRC channel and you get P2P multiplayer. This way you pay nothing on servers and use your money to make more games.

Web allows us to get the game to people in the most convenient way possible with few clicks. I focus right now on having a desirable game with a good single player experience. I may post something on WebRTC in the future.

User avatar
Ulydev
Party member
Posts: 390
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: Love.js - A Direct Emscripten Port

Post by Ulydev » Wed Jan 18, 2017 7:16 pm

danvdragos wrote: Yes but not fully because the browser doesn't support UDP [...] I may post something on WebRTC in the future.
Thanks for the reply! So that means enet won't work, right? Either way, I was going for a client-server approach but I might be interested in WebRTC as well. Please keep me updated about it :nyu:

User avatar
Positive07
Party member
Posts: 998
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Love.js - A Direct Emscripten Port

Post by Positive07 » Thu Jan 19, 2017 4:13 am

WebRTC, WebSockets, and XHTTPRequest are the standard ways to contact a server from JS, it would be great to have all three since they are used for entirely different things.

This would be a really amazing addition to Love.js actually
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(Github.com/Positive07)

popcade
Prole
Posts: 2
Joined: Wed Jun 08, 2016 3:42 pm

Re: Love.js - A Direct Emscripten Port

Post by popcade » Fri Apr 14, 2017 4:24 pm

I just noticed WebAssembly is now working on most browsers:

http://webassembly.org/roadmap/

Might worth a try compile to WebAssembly for a try.

lxinuuja
Prole
Posts: 1
Joined: Fri Apr 28, 2017 8:43 pm

Re: Love.js - A Direct Emscripten Port

Post by lxinuuja » Fri Apr 28, 2017 9:04 pm

Hi,
First of all, totally awesome that there is a tool to port my löve to javascript, thank you for creating it! I've been working on a game now for a few months and I think it's ready to be published. However, the ported Love.js throws an exception of, I guess, running out of memory. Here's what I get in the console:

Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 16777216, (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0

I get the same by running the magic script both in release-performance and release-compatibility.

Any clue what to do to make it work? Is my game too big to load? The project folder with all the assets is 120 megabytes. Biggest single file is the mp3 music track which is 10,5 MB.

My repository is here, I just made it public, hoping someone could help me with my web release:
https://gitlab.com/aleksi.nuuja/defendroids/tree/master

Thank you!

User avatar
Tanner
Party member
Posts: 156
Joined: Tue Apr 10, 2012 1:51 am

Re: Love.js - A Direct Emscripten Port

Post by Tanner » Sun Apr 30, 2017 1:59 pm

lxinuuja wrote:
Fri Apr 28, 2017 9:04 pm
Hi,
First of all, totally awesome that there is a tool to port my löve to javascript, thank you for creating it! I've been working on a game now for a few months and I think it's ready to be published. However, the ported Love.js throws an exception of, I guess, running out of memory. Here's what I get in the console:

Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 16777216, (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0

I get the same by running the magic script both in release-performance and release-compatibility.

Any clue what to do to make it work? Is my game too big to load? The project folder with all the assets is 120 megabytes. Biggest single file is the mp3 music track which is 10,5 MB.

My repository is here, I just made it public, hoping someone could help me with my web release:
https://gitlab.com/aleksi.nuuja/defendroids/tree/master

Thank you!
If you have set everything up correctly using release-compatibility, you should not get that error.

That said, your game is very large and I'm not sure how emscripten/a web browser is going to handle trying to load all those assets into the virtual file system. Even if this does work, consider that sending someone to a web page that performs a 120MB download automatically is not a very considerate thing to do.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests