Making my current game in javascript, and potentially looking to use love for my next one. Anyone with experience in both?

I'll be wrapping my current game up in electron, but for my next game, I was looking to do something a little more native. Love and lua seem to be the perfect combo since they keep much of the expressiveness of javascript.

I have three primary concerns about making the jump that I can't find much info on.

First, I'd like to know how the performance will compare to js running in chrome. I assume this would be better since it doesn't have the overhead of the browser, but I'd like to know for certain what to expect. 2x faster? 20x? Does that go for rendering as well, or is webgl on-par?

Second, I'm wondering about the quality of the available helper libraries. Do most love developers do everything themselves or are there some key libraries that tend to get heavy use? Currently, I'm using Phaser. I'm mostly using it as little more than a proxy to its renderer, Pixi. But, at the same time, I've got things like quadtrees, scene graphs, and animation handling all in arms reach when I do wish to use them, preventing me from reinventing the wheel. Are there any community "go-to"s for these common things that you'd recommend?

Last, I'm wondering if there is anything comparable to the chrome devtools for lua. They strike a good balance between being powerful without the cumbersome-ness of full IDEs. I can't imagine a world without then, and I'm wondering if I just have to expand my horizons. What would you recommend?

Posted Feb 15, 2016, 6:26 AM UTC

54
Omega_ZX•
  1. Love2D is very fast, it does seem faster than the JS canvas. I'm sure SDL2.0+OpenGL (what Love2D uses) is faster than whatever you're using for Javacsript, unless it's... SDL2.0+OpenGL.

  2. Love2D has so many helper libraries all around the forums, from entity component systems, to multiplayer, to GUI libraries... it has all you would ever need.

  3. You can embed your own sort of system like it in your Love2D engine, that's what I did and it is great for debugging.

5
jringstad•

WebGL is generally hardware-accelerated, so in terms of straight-up FLOPS you will get about the same performance as with native GL/GLES (what love2d uses behind the scenes.) Where browser-based stuff tends to suck is all the "surrounding scaffolding". WebGL is very limited in functionality, and native GL/GLES lets you do many more things that WebGL does not let you do. Often these things can translate into a drastic performance improvement. Of course love2d also doesn't (easily) let you access any GPU feature you want (since it tries to stay relatively conformant to both desktop and mobile systems), but you do get a bunch of functionality like HDR canvases or mirroredrepeat sampling that allow you to do things you can't do easily with webgl. Additionally you can expect input latency to be lower and stuff like vsync actually working.

Ultimately though, if you really care about performance and expressiveness, you'll want to go to C++ and opengl or somesuch, there isn't really any way to beat that on either account.

Helper libraries can be an issue. Lua is not a very mainstream language compared to javascript, so you'll find certain things missing when you embark on a larger project. Certain things you might take for granted in other languages either don't exist at all, or are unmaintained/of poor quality (e.g. just some snippet sitting somewhere in a gist or on a wiki.) You should definitely be comfortable with the idea of writing (or at least extending) a good deal of tools yourself. For other things, there are community-accepted go-tos, like animation, networking etc. For yet another things like GUIs there isn't really anything available that isn't garbage and you probably won't have time to create your own GUI framework, so you'll just have to count your losses and/or crowbar something minimal into place. Similarly to how many people augment their JS with things like jquery, you might want to look into some of the libraries available for lua like lume.

To my knowledge nothing like chrome dev tools is available for debugging lua, I've particularly found profiling and heap snapshotting to be sorely missing features.

3
YetAnotherRandomGuyOP•

Thank you very much for the detailed information! This is going to be very useful.

2
PopeOh•

For an overview of libraries check here: https://github.com/love2d-community/awesome-love2d

I have found lovebird very useful for debugging.

2