Page 3 of 21
Re: Love2D WebPlayer
Posted: Tue Mar 20, 2012 11:57 am
by SiENcE
tsturzl wrote: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:
- 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.
Personally I like the idea of love2d for the flash and the JVM a lot. I like your idea, but I see a lot of performance issues..
I like the idea that no plugin/or vm is used, that i can still code lua and all current games could work in the löve webgl webplayer.
Performance is not a problem of the future. It's only a current temp. problem ;-).
As long as i know NaCl is only free for x86. For ARM it's closed source. So it's also not platform indepandant.
Re: Love2D WebPlayer
Posted: Tue Mar 20, 2012 5:02 pm
by tsturzl
Google NaCl would be probably the best solution, however its basically secluded to chrome browsers. Which narrows the distributing audience.
Also, you can make HTML5 apps for both Android, BlackBerry, ChromeOS, and iOS. PhoneGap, Titanium Framework, tons more... I'm not sure if they support WebGL yet or not, or even if they will. Perhaps hardware acceleration should be a choice? You don't need WebGL to make 2D HTML5 games, though its much faster.
Re: Love2D WebPlayer
Posted: Tue Mar 20, 2012 5:22 pm
by TechnoCat
tsturzl wrote:Perhaps hardware acceleration should be a choice? You don't need WebGL to make 2D HTML5 games, though its much faster.
Perhaps you aren't aware of PixelEffect?
https://love2d.org/wiki/PixelEffect
Re: Love2D WebPlayer
Posted: Tue Mar 20, 2012 5:45 pm
by ishkabible
for those of you considered about speed:
Now, Im not sure how the Lua is run on JS but I bet it uses a translator and sense most JavaScript implementations in modern browsers are already JITed and super well optimized(check out V8, it's almost as fast as LuaJIT) AND JavaScript is so similar to Lua we get almost all of the speed we would get from LuaJIT. we loose out on the fact that tricks have to be done to translate Lua to JS like merging objects and arrays to make tables and the fact that JS is a more complex language than Lua so it's just not quite as fast(almost however!) but these are quite manageable. it should still yield something faster than vanilla Lua
Re: Love2D WebPlayer
Posted: Tue Mar 20, 2012 6:17 pm
by ghoulsblade
tsturzl wrote:Google NaCl would be probably the best solution, however its basically secluded to chrome browsers. Which narrows the distributing audience.
meh, having it work just for chrome users isn't interesting for me
tsturzl wrote:Also, you can make HTML5 apps for both Android, BlackBerry, ChromeOS, and iOS. PhoneGap, Titanium Framework, tons more... I'm not sure if they support WebGL yet or not, or even if they will. Perhaps hardware acceleration should be a choice? You don't need WebGL to make 2D HTML5 games, though its much faster.
hmm, i thought webgl was part of html5. my bad then, love2d webplayer definitely needs webgl to draw stuff.
Re: Love2D WebPlayer
Posted: Tue Mar 20, 2012 7:03 pm
by tsturzl
ghoulsblade wrote:
hmm, i thought webgl was part of html5. my bad then, love2d webplayer definitely needs webgl to draw stuff.
WebGL standards are managed by Khronos, not W3C. WebGL technically isn't a web standard, nor part of HTML5. Though its getting supported in many browsers.
Upon closer inspection, WebGL is getting implemented into the mobile version of Webkit. Therefore in the future, Love2D WebPlayer should work on mobile phone browsers and in HTML5 based mobile applications such as Phonegap.
So it is getting implemented on most mobile platforms. This could possibly kill the Love Android project then. If ishkabible is right about the performance, then I see no perks of Love Android over this, however this will work on iOS also and blackberry.
Also,
@TechnoCat,
ghoulsblade wrote: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
Its not an implementation of love 0.8. Though I see what you mean for future development.
Re: Love2D WebPlayer
Posted: Tue Mar 20, 2012 8:02 pm
by ghoulsblade
tsturzl wrote:This could possibly kill the Love Android project then. If ishkabible is right about the performance, then I see no perks of Love Android over this
but! but! but the awesome thing about android/smartphones are multitouch and sensors (tilt/gravity, compass,...)
love-android-native is closely based on the original löve source (repack+libs+compile on android), so it is relatively easy to maintain when love gets further developed,
whereas
love-webplayer (as well as my love-android-java) are "api-reimplementations" not based on the orignal löve2d source, so new changes of löve2d will take more effort to add.
also there might be technical limits of what's possible in web, e.g. network with websockets afaik doesn't allow binary zeros in the datastream (utf8?), which would prevent most binary network protocols from working in the webplayer.
Love-android-native on the other hand already supports luasocket, including embedded zeroes afaik.
Websockets also won't allow udp based networking code to work without heavy modification.
Re: Love2D WebPlayer
Posted: Tue Mar 20, 2012 8:25 pm
by Robin
ghoulsblade wrote:network with websockets afaik doesn't allow binary zeros in the datastream (utf8?),
I haven't found any data on that. Anyway, you could work around that: send \1\2 instead of \0. If you want a \1, just send \1\1. Problem solved.
Re: Love2D WebPlayer
Posted: Tue Mar 20, 2012 10:35 pm
by SiENcE
tsturzl wrote:ghoulsblade wrote:
hmm, i thought webgl was part of html5. my bad then, love2d webplayer definitely needs webgl to draw stuff.
WebGL standards are managed by Khronos, not W3C. WebGL technically isn't a web standard, nor part of HTML5. Though its getting supported in many browsers.
Upon closer inspection, WebGL is getting implemented into the mobile version of Webkit. Therefore in the future, Love2D WebPlayer should work on mobile phone browsers and in HTML5 based mobile applications such as Phonegap.
So it is getting implemented on most mobile platforms. This could possibly kill the Love Android project then. If ishkabible is right about the performance, then I see no perks of Love Android over this, however this will work on iOS also and blackberry.
Also,
@TechnoCat,
ghoulsblade wrote: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
Its not an implementation of love 0.8. Though I see what you mean for future development.
I think this thread shouldn't be captured by talks about doing things the other way round. This is about the love-webplayer based on webgl and this thread should be about, how to make it api compatible with löve as fast as possible.
Re: Love2D WebPlayer
Posted: Tue Mar 20, 2012 10:36 pm
by ghoulsblade
new vid : in your face city trains starting to work =) (press "MainButton" at bottom of screen since we have no keyboard input yet, jumping doesn't work yet due to missing love.keyboard.isDown)
require and love.filesystem.dofile work now,
also love.graphics.newQuad and .drawq
text still missing.
try for yourself :
http://ghoulsblade.schattenkind.net/lov ... yer/iyfct/