Love2D WebPlayer (WebGL)
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Love2D WebPlayer
Man. If this were 0.8.0 with LuaJIT it'd be amazing. The only problem is bandwidth. Though it'd be neat if a deal could be made with NewGrounds to support Löve games like they do Flash and HTML5.
- ghoulsblade
- Party member
- Posts: 111
- Joined: Sun Oct 31, 2010 6:11 pm
Re: Love2D WebPlayer
it is "html5" actually, webgl and javascript are both standard html features now afaik.
luajit : not possible since the webplayer works without a browser-plugin, so it cannot run compiled code, rather lua is "translated" to javascript and then run
love 0.8 : well hurry up and make it stable then =P i have to reimplement the löve api in javascript so it'll take a while to become fully functional,
i go by the api docs in the wiki rather than digging through löve source. webgl is a bit minimal but does support shaders, so might well be possible to implement all 0.8 stuff, i'd appreciate some help tho
luajit : not possible since the webplayer works without a browser-plugin, so it cannot run compiled code, rather lua is "translated" to javascript and then run
love 0.8 : well hurry up and make it stable then =P i have to reimplement the löve api in javascript so it'll take a while to become fully functional,
i go by the api docs in the wiki rather than digging through löve source. webgl is a bit minimal but does support shaders, so might well be possible to implement all 0.8 stuff, i'd appreciate some help tho
love-android - gamejams
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Love2D WebPlayer
http://dev.opera.com/articles/view/an-i ... mentationscoffee wrote:I'm using OSX. For now only working in Chrome. For my surprise not working in updated Safari. Also not working in Firefox 3.6 and Opera. In Chrome seems good.
You should be good if you have an up-to-date Safari. But, it does require the alpha version of Opera 12.
Works great for me on Chrome 17 and Firefox 12.
I mean really, my Android phone can run the demo.
Re: Love2D WebPlayer
Hmmm, I went looking why wasn't working. My Developer Enable WebGL was turned off. Getting now constant MyCheckGLError : gl.getError() : 1280 : INVALID_ENUM stack=undefine errors popping up (need to Force Quit Safari). About Firefox I prefer keep an old version for now but It's good to know then that is working in new versions.TechnoCat wrote:http://dev.opera.com/articles/view/an-i ... mentationscoffee wrote:I'm using OSX. For now only working in Chrome. For my surprise not working in updated Safari. Also not working in Firefox 3.6 and Opera. In Chrome seems good.
You should be good if you have an up-to-date Safari. But, it does require the alpha version of Opera 12.
Works great for me on Chrome 17 and Firefox 12.
I mean really, my Android phone can run the demo.
Re: Love2D WebPlayer
You're interpreting an interpreted language in an interpreted language. This seems crazy..
Perhaps compile lua to javascript? This should take away some of the load on the users end. Though, I'm not sure if its an easy implementation.
I was considering doing a project similar to this, some of the ideas I had are as follows. I'll also list some pros and cons:
Perhaps compile lua to javascript? This should take away some of the load on the users end. Though, I'm not sure if its an easy implementation.
I was considering doing a project similar to this, some of the ideas I had are as follows. I'll also list some pros and cons:
- Love2D in the cloud. Execute the Lua code on the server, draw to frame buffer, get imageData, send string via HTTP, get and draw imageData with Ajax.
-Super Slow, requires tons of bandwidth, hard on the server.
-Probably just an all around bad idea.. - Plugin, use SELove as an engine for a browser plugin.
-Requires you to install a plugin.
-Possible security flaws. Even in a sandboxed environment.
+Native execution speed.
+A bulk of the work is done, just requires porting. - Run Lua in the Java VM. (Kahlua implementation)
-/+They did this with Android for love at first, it ran decently. Performance may be an issue at first glance, but you have to realize running Java on a desktop/laptop is going to be much faster.
+ Java is typically already a browser plugin on most computers.
- Java's 2D graphics libraries aren't that great, would be a pain to port to Java. Not to mention that I hate java.. - Adobe Alchemy(C++/C flash compiler), port Love2D to compile in Adobe Alchemy.
+Most people have flash.
+Flash is pretty fast, Alchemy is even faster.
+Flash has a pretty good engine for 2D graphics.
+Box2D has already be ported to Flash.
-Flash is slower than native execution.
-Almost all graphical code will need to be rewritten.
-No support for Shaders, in fact no direct access to underlaying graphics libraries (DX or ogl). - Run lua in a Javascript environment
-You're interpreting an interpreter for an interpreted language, with an interpreted language. Sounds painful
-Networking will be pretty difficult...
+Box2D has been ported to jscript.
+all modern browser have javascript.
+HTML5 is the way of the future.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Love2D WebPlayer
I did many of the joystick functions. I have not done love.joystick.joystickpressed/joystickreleased yet.
https://github.com/Pindie/love-webplaye ... oystick.js
You can try out my live development site assuming my desktop doesn't go to sleep: http://home.pindie.org:8889/
Hopefully you have a gamepad capable browser. If you are using Chrome, you need to enable it in chrome://flags
I don't think the interpreted part should be a problem. It converts the Lua into js and then runs it at js speed. The two languages are almost 1-to-1 in syntax it seems to me. Javascript is just missing metatables.
https://github.com/Pindie/love-webplaye ... oystick.js
You can try out my live development site assuming my desktop doesn't go to sleep: http://home.pindie.org:8889/
Hopefully you have a gamepad capable browser. If you are using Chrome, you need to enable it in chrome://flags
http://dev.w3.org/html5/websockets/tsturzl wrote: -You're interpreting an interpreter for an interpreted language, with an interpreted language. Sounds painful
-Networking will be pretty difficult...
I don't think the interpreted part should be a problem. It converts the Lua into js and then runs it at js speed. The two languages are almost 1-to-1 in syntax it seems to me. Javascript is just missing metatables.
Last edited by TechnoCat on Tue Mar 20, 2012 5:42 am, edited 4 times in total.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Love2D WebPlayer
This is awesome. I didn't know it was HTML5. How is the framerate with projects that are bigger than just the clouds demo?
What does it currently support and not support. I don't suppose Canvas/Framebuffers are in yet. Or are they?
What does it currently support and not support. I don't suppose Canvas/Framebuffers are in yet. Or are they?
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Love2D WebPlayer
Google NaCl! </fanboy>
Last edited by slime on Tue Mar 20, 2012 4:13 am, edited 2 times in total.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Love2D WebPlayer
Almost nothing is in, newImage and draw pretty much. But the thing is, canvas is definitely possible.Jasoco wrote:What does it currently support and not support. I don't suppose Canvas/Framebuffers are in yet. Or are they?
If you get something up and running as a proof of concept, that'd be cool.slime wrote:Google NaCl! </fanboy>
- ghoulsblade
- Party member
- Posts: 111
- Joined: Sun Oct 31, 2010 6:11 pm
Re: Love2D WebPlayer
i'm the one who made the love-android java part, i'm going to reuse a lot of the code for javascripttsturzl wrote: [*]Run Lua in the Java VM. (Kahlua implementation)
-/+They did this with Android for love at first, it ran decently. Performance may be an issue at first glance, but you have to realize running Java on a desktop/laptop is going to be much faster.
java isn't known as the fastest language tho, i actually think javascript+webgl might be faster than java gui.
Also not everyone has java enabled in browser, i think the "target audience" that can use games in javascript+webgl out of the box will be substantially bigger.
the lib i used to compile lua to js code also supports compiling to actionscript(flash).tsturzl wrote: [*]Adobe Alchemy(C++/C flash compiler), port Love2D to compile in Adobe Alchemy.
+Most people have flash.
+Flash is pretty fast, Alchemy is even faster.
+Flash has a pretty good engine for 2D graphics.
I hate flash, but if you're interested in that part and think you'd get better performance, it might be worth a look :
https://github.com/mherkender/lua.js
love-android - gamejams
Who is online
Users browsing this forum: No registered users and 0 guests