New guy, performance question

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

New guy, performance question

Post by Plu »

Hello gentlepeople,

I was out looking for a cool framework to build some games in, and I stumbled upon LÖVE. And at first glance, this looks like the kind of thing I'm looking for as my new tool of choice :D
But I did wonder about what kind of performance I can expect to get out of LÖVE? I'm coming in from GameMaker, which is a cool tool to quickly build a game but seems to suffer from terrible performance when it comes to anything slightly more complicated. One of the key things I wanted from a new language/framework was going to be the ability to build bigger. And to hold their own when it comes to things like physics, lighting, a bit of pathfinding, etc.

So are there any examples out there that show what LÖVE is capable of? I looked around a bit but the samples I saw were all pretty simple and I couldn't really find much that pushed it to its limits.

Any help or suggestions is much obliged :)
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: New guy, performance question

Post by MarekkPie »

We can wait for the actual LOVE developers to give you some "hardcore" information, but here are a few examples of games made with LOVE:
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: New guy, performance question

Post by josefnpat »

Love is a very cool framework. Here are your points enumerated;
  1. the ability to build bigger - I have found love to be able to handle thousands of elements on screen at once. For "Bigger", as long as you're coding in a smart fashion (e.g. not drawing everything off screen) then you should be fine. If there ever is an issue with calculating vectors and such that starts bogging you down, you can start using LuaJIT. I have never run into an instance where my game has lagged a lot due to too many things on screen (assuming I hadn't done anything done).
  2. physics - I haven't used the physics of LOVE much, but from what I understand, Box2d is battle tested, and shouldn't be any problem.
  3. lighting - Take a look at the forums. Not only is there a lot of sneaky tricks you can use (e.g. alpha blending) but LOVE has full access to a forked version of GLSL.
  4. pathfinding - Again, a little bit of forum searching or checking the wiki page for libraries would show you there are quite a few path finding libraries you can use!
  5. GameMaker - I hope you're comfortable with scripting, because LOVE won't give you any GUI based hand holding. LOVE is an excellent framework to mature to from GameMaker, as I have followed this path with GameMaker 5, back before yo yo games bought them.
tl;dr; As long as you don't mind getting your hands dirty, and learning lots, LOVE is an amazing engine that fits all of your needs.
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: New guy, performance question

Post by Plu »

Don't worry about the scripting thing, I hardly used the graphical interface for gamemaker. My last game was built almost entirely using GML and I already found it to be a bit lacking in expressiveness :)

Thanks for the feedback. Sounds like this could indeed be the framework for me. I'm going to start diving in tomorrow, good thing it's weekend.
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: New guy, performance question

Post by josefnpat »

Be sure to check out the tutorials on the wiki!
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
scutheotaku
Party member
Posts: 235
Joined: Sat Dec 15, 2012 6:54 am

Re: New guy, performance question

Post by scutheotaku »

I used Game Maker from around v4 up to v7, and, unless it's gotten significant performance boosts since then, I can guarantee you that you will get far better performance with LOVE than you do with Game Maker. I would go so far as to say that the performance will often be anywhere from 10 to 100x better (depending, of course, on what you're doing).

One thing to keep in mind: Game Maker is object-oriented. LOVE uses Lua, so it does not have many object oriented programming (OOP) features setup at start. Now setting up OOP (either prototype-based or class-based) features in Lua is fairly painless (though some parts are harder than others...but those parts probably won't be required for most simpler games), but the point is that it's not setup to start with. In Lua, you typically setup objects using tables. A table in Lua is an associative array, but it is also has many qualities that an "object" typically has. Read here if you're interested: http://www.lua.org/pil/2.5.html & http://www.lua.org/pil/16.html (the entire "Programming in Lua" book, of which the first edition is free online, is a great place to learn Lua btw: http://www.lua.org/pil/contents.html ).

Oh, and to expand on something that josefnpat mentioned, one great thing about LOVE and the LOVE community is all the free libraries and code snippets available. Almost every feature I've missed or problem I've had has already been implemented by a library or solved by a code snippet on the forum.
Here is the wiki's list of libraries:
https://www.love2d.org/wiki/Category:Libraries

I definitely recommend going through the tutorials (especially the video tutorials). They're all easy to follow, and they really give you a great idea of whether you like LOVE and Lua:
https://www.love2d.org/wiki/Category:Tutorials
User avatar
Hexenhammer
Party member
Posts: 175
Joined: Sun Feb 17, 2013 8:19 am

Re: New guy, performance question

Post by Hexenhammer »

There is a LuaJIT based build of LÖVE. LuaJIT is one of the fastest dynamic languages implementations around (it runs circles around every implementation of Python and Ruby for example). I don't think there is anything LuaJIT is too slow for. Remember that Lua uses a garbage collector though. GC languages and real-time action games aren't a natural couple because normal GCs (including Lua's) "stop the world" while collecting garbage and thus can cause noticeable delays. People who use Ruby or Python for games crash into that issue all the time. Ruby is particularly horrible because idiomatic Ruby code creates and destroy objects all the time.

However, you can work around that issue by avoiding the creation/destruction of objects during the action parts of your game. Note that if you are coding the type of game which could run on a 16-bit era console e.g. Super Mario (which seems to be the frame of reference for most people here) you don't need to worry about that. However if you plan to write say a PC-grade real-time strategy game like Age of Empires you don't want to create/destroy objects every time a unit moves. That could get problematic. Fortunately it is very easy in Lua to avoid object creation/destruction if you want to.

So yeah I think basically there are no limits as long as you use the LuaJIT build. However, again, the standard Lua interpreter should handle Super Mario just fine.
User avatar
timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

Re: New guy, performance question

Post by timmeh42 »

I've found GameMaker has some features that aren't in Löve yet - eg advanced drawing functions such as mapping textures to triangles - and sometimes you look for a function that should exist but doesnt yet.
(the lack of texture mapping I find rather hampers making exceptionally "pretty" games)
Also, Löve doesn't have built-in pathfinding that GameMaker does - but it does have built-in (more or less) physics, that GameMaker doesnt have.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: New guy, performance question

Post by Nixola »

LÖVE 0.9.0 will probably have geometries, that allow people to map textures to a polygon (I don't even remember if vertices is right >.<)
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
spectralcanine
Citizen
Posts: 65
Joined: Sat Dec 22, 2012 8:17 am

Re: New guy, performance question

Post by spectralcanine »

Just out of curiosity, why would you need to map texture coordinates to triangles in a 2D game?

In the case of having a polygonal shape with texture, I always found it easier to render a rectangle with the image you want on the bounding box of the actual physical shape (e.g. a Box2D polygon shape).
Post Reply

Who is online

Users browsing this forum: No registered users and 232 guests