Page 5 of 23

Re: Love.js - A Direct Emscript'em Port

Posted: Sat Feb 20, 2016 9:58 pm
by Homosexual
I just gave it a shot with a little project using only draw.circle and draw.text, and while the debug version worked fine the release on threw me a js exception. As I'm completely oblivious to .js, web stuff, and code in general, I haven't dug deeper into the problem.
I'm just here to say thank you, tanner. This is a -massive- step towards a future full of löve. :awesome:

Re: Love.js - A Direct Emscripten Port

Posted: Mon Feb 22, 2016 10:54 am
by Tjakka5
Coming back to my previous question on getting data from JS.

There's 2 things I really need love.js to do.
First one being, passing me the resolution of the browser window, so the game can scale accordingly.
And second.
Somehow reading data from the server, so I can, for example, put in block data in a .json, which it then will read and add to the game, without having to recompile the game.

You were saying you cant do that "right now", does that mean that we'll be able to in the (hopefully soon) future?

Re: Love.js - A Direct Emscripten Port

Posted: Mon Feb 22, 2016 1:14 pm
by Tanner
Tjakka5 wrote:Coming back to my previous question on getting data from JS.

There's 2 things I really need love.js to do.
First one being, passing me the resolution of the browser window, so the game can scale accordingly.
And second.
Somehow reading data from the server, so I can, for example, put in block data in a .json, which it then will read and add to the game, without having to recompile the game.

You were saying you cant do that "right now", does that mean that we'll be able to in the (hopefully soon) future?
You don't need love.js to do either of those. You can change the canvas size with css and you can write arbitrary data to the emscripten filesystem from JS using the same API emscripten does in its compiled code.

https://kripken.github.io/emscripten-si ... rview.html

https://kripken.github.io/emscripten-si ... m-API.html

Re: Love.js - A Direct Emscripten Port

Posted: Mon Feb 22, 2016 4:59 pm
by Tjakka5
Ah, thank you very much, I was already thinking of all kinds of complex ways to get data into love, totally forgot about the filesystem.

Re: Love.js - A Direct Emscripten Port

Posted: Mon Feb 29, 2016 5:15 pm
by Bambo
Hey, trying to build a game using the performance release doesn't seem to work for me.

It does work using the debug and compatability folder.

Here's a log:

Code: Select all

unreachable code after return statement love.js:8:100113
unreachable code after return statement love.js:11:65646
unreachable code after return statement love.js:14:205640
unreachable code after return statement love.js:8:100113
bad name in getProcAddress: glIsVertexArrayOES,glIsVertexArray love.js:1:27303

Error: [string "boot.lua"]:229: Already initialized love.js:1:3399
stack traceback: love.js:1:3399
	[C]: in function 'init' love.js:1:3399
	[string "boot.lua"]:229: in function <[string "boot.lua"]:223> love.js:1:3399
	[C]: in function 'xpcall' love.js:1:3399
Assertion failed: emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters. love.js:1:3399
Assertion failed: emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters. love.js:24:15713

uncaught exception: abort("Assertion failed: emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.") at jsStackTrace@http://localhost:8000/love.js:1:17162
stackTrace@http://localhost:8000/love.js:1:17345
abort@http://localhost:8000/love.js:24:15936
assert@http://localhost:8000/love.js:1:7547
_emscripten_set_main_loop@http://localhost:8000/love.js:1:70494
_emscripten_set_main_loop_arg@http://localhost:8000/love.js:1:281879
bl@http://localhost:8000/love.js:6:1273
callMain@http://localhost:8000/love.js:24:14301
Module.setStatus@http://localhost:8000/:61:13
run/</<@http://localhost:8000/love.js:24:15143

If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information. <unknown>

Re: Love.js - A Direct Emscripten Port

Posted: Sat Mar 05, 2016 4:32 pm
by Tanner
It's hard to know what the issue might be without being able to see your code. The release builds don't give very helpful error messages.

Re: Love.js - A Direct Emscripten Port

Posted: Thu Mar 10, 2016 11:30 am
by MadByte
I've trouble setting up the server. It gets stuck after the game file has been downloaded. It says "running" but nothing else happen (using Chrome).
Here is my installation:
Image

Pack.bat:

Code: Select all

@echo off 
%~dp0/python/python %~dp0/emscripten/tools/file_packager.py game.data --preload %~dp0/game@/ --js-output=game.js
Packages get created. I put them into the "release-compatibility" directory to test them.
Any obvious mistakes? Thanks in advance.

Re: Love.js - A Direct Emscripten Port

Posted: Thu Mar 10, 2016 12:45 pm
by Tanner
Not sure. Can you use the debug directory and then post what you get in your browser console?

Re: Love.js - A Direct Emscripten Port

Posted: Thu Mar 10, 2016 1:19 pm
by MadByte
edit
alright, my mistake (case sensitivity issue in code).
thanks anyway.

Re: Love.js - A Direct Emscripten Port

Posted: Thu Mar 17, 2016 7:26 pm
by Tanner
I've put a lot of work into getting Love to build with emscripten using the existing Love cmake build system. Everything seems to be working now. It's still not for the faint of heart but everything is much more consolidated and straightforward than it was before.

It requires, of course, the emscripten SDK to be installed. This project won't compile with the released binaries so you will need to use the pseudo-release tagged as `sdk-incoming-64bit`. If you can get that compiled and installed then the rest of this should be a cakewalk.

Clone my fork of Megasource.
https://bitbucket.org/TannerRogalsky/megasource

And then clone my fork of Love into `libs/love` as per the megasource instructions.
https://bitbucket.org/TannerRogalsky/love

Check out the `emscripten` branch of each of these. Then make a build folder inside of megasource and run `emcmake cmake -H.. -B. && emmake make`. It should spit out a debug `.js` build.