Defold and the other LUA engines

I’ve been messing around with game engines as I make my way into game programming. I’ve used unity, love2d, godot and now defold a bit. Of all of these I liked Love2d and defold the best so far. So now my question is how does Defold compare to the other big LUA based engines/frameworks, like gideros, and Corona SDK?

On a side note, I was considering making a simple benchmark for defold, gideros and corona to see how they compare performance wise. What do you guys think would be the best way to go about it?

Have a look at this thread it covers most of what you are looking for, while giving you tips and trix to verify the reminder.

2 Likes

We welcome these kinds of comparisons, and as @DeManiac writes, some performance benchmarks have already been made. While we do not claim to be the fastest or most lightweight I believe we will fare pretty well in most benchmarks. You should also keep in mind that synthetic benchmarks only show one side of the story. The actual day to day workflow of an engine is the other side. Is it easy to work with? Can you do one-click publishing to all supported platforms without external tools? Is it easy to test on device? Can you have a rapid development cycle with short iteration times (thanks to short build times and features such as hot reload)? And so on.

7 Likes

I did see and read that thread! Was a very interesting thread and was one of the inspirations to my idea. Unfortunately only comparisons Ive seen online are between defold, unity and godot. I’d very much rather see a comparison between lua engines, like corona, gideros, love2d, etc. As for ease of use, I figured if I tried them each Id have an idea.

1 Like

Yes, that would be interesting to see for sure! I did a bunnymark test in Love just to get a feel for it. You can get really good speed from Love, but you have no proper editor and you need to set up batching and all of that yourself. Like this:

local BUNNIES = 47500
local bunnies = {}
local spriteBatch = nil
local image = nil

function love.load()
	image = love.graphics.newImage('bunnies.png')
	spriteBatch = love.graphics.newSpriteBatch(image, BUNNIES, "stream")
	for i=1,BUNNIES do
		local bunny = { x = math.random(1, 800), y = 0, velocity = math.random(1, 200) }
		bunny.quad = love.graphics.newQuad(25 * math.random(0, 8), 0, 25, 32, image:getDimensions())
		bunny.id = spriteBatch:add(bunny.quad, bunny.x, bunny.y)
		table.insert(bunnies, bunny)
	end
end

function love.update(dt)
	for i=#bunnies,1,-1 do
		local bunny = bunnies[i]
		bunny.velocity = bunny.velocity + 1200 * dt
		bunny.y = bunny.y + bunny.velocity * dt
		if bunny.y > 500 then
			bunny.y = 500 - (bunny.y - 500)
			bunny.velocity = -bunny.velocity
		end
		spriteBatch:set(bunny.id, bunny.quad, bunny.x, bunny.y)
	end
end

function love.draw()
	love.graphics.draw(spriteBatch)
	love.graphics.print("FPS: "..tostring(love.timer.getFPS()), 10, 550)
	love.graphics.print("Draw Calls: "..tostring(love.graphics.getStats().drawcalls), 10, 570)
end
1 Like

I’m curious, how significant was the speed difference from defold?

I really liked love2d but I think I liked working in defold more. I still have yet to try corona and gideros

No idea. We currently have a cap of 16k sprites (for performance reasons) in Defold and that will obviously run at 60 FPS on a desktop machine. The cap used to be 32k but was reduce to allow us to crank out more performance in general, but even with 32k we ran at 60 FPS.

The Love example I did started to see an FPS drop at around 50k sprites. I’m guessing that if we didn’t have a cap in Defold we’d see something similar.

1 Like

This limit really shouldn’t be a problem for anyone doing a normal game (I hope!). @Mathias_Westerdahl and @sven can probably tell you a bit more about why we have set the limit to the value I mentioned.

2 Likes

It was a change to use 16bit indices for the vertex buffer (65536 indices / 4 indices/sprite = 16384 sprites) . We will add a dynamic check to see if we need more than 65536 indices, and then use 32bit indices instead. Eta unknown.

5 Likes

And if I need more than 4 billion sprites?

11 Likes

Do Gideros and Corona have editors? It doesn’t look like it from their websites, which would be a serious consideration. Defold’s editor is nothing amazing, but it still makes development much faster than it would be in a text-only work environment. And if development is fast then you’re much more likely to actually release a game, even if it means giving up a few nice features that another engine has.

Love2D is pretty great, I’ve been working with it a lot lately, but realistically you should figure on a month or so of work building ‘engine’ code if you plan on making games of any complexity with it. It’s fast to build little prototypes and jam games, but go bigger and you’ll have a tangled mess pretty quickly if you don’t take the time to build some kind of structure.

Things I love about Löve:

  • Desktop support - DefOS is a great project, but it’s not exactly equal to SDL. Defold is mobile/web focused, Love is more desktop focused. It has pretty much everything you need out of the box:
    • Window features: fullscreen, borderless window, multiple monitor support, request attention, set position, size, title, icon, lock, maximize, minimize, restore, etc.
    • Mouse features: get/set position, toggle visibility, lock to window, relative mode, use system-native or completely custom hardware cursors(!).
    • Keyboard scancodes. (necessary for proper international/alternate layout support)
  • Full Box2D access (almost) - joints, proper polygon support, CCD, edge shapes, multiple fixtures, get center of mass, get moment of inertia, synchronous raycasts (multi-hit), AABB, and point checking, dynamically modify or create any body you want…
  • Decent audio support - play, pause, resume, stop, seek, set pitch, and positional audio stuff.

Stuff that isn’t so hot:

  • Absolutely zero structure - no parent/child tree, no draw ordering, not even sprites or basic game components, nada. Flexible? Sure. Time consuming? Yup.
  • No editor - Honestly I thought it would be worse working with only text, so far it’s not too terrible, but it does slow things down a lot and makes anything complex or visually precise take forever to get right. Gotta build your own or adapt to use Tiled or something.
  • Weird, clunky game packaging - (but compared to Defold, what isn’t?)
  • No awesome forum with constant staff and community support. :’(

@britzl - With Love 11 they added automatic batching, though I haven’t performance tested it yet. Supposedly it batches the line & shape drawing stuff too.

9 Likes

Gideros has an editor, it also checks syntax as you type so Lua errors are shown under the current line.

The Gideros version of Lua also has loads of enhancements like built-in macros that can be used to make constants, operators for deg>rad and rad<deg, etc…
http://docs.giderosmobile.com/reference/enhancement

3 Likes

Ah, I see it now, thanks, but does it do level editing? Objects? Physics? Particles? That’s what I was referring to, not just the text editing.

1 Like

Ahh - no, it’s more traditional - you type code.

You can use third party tools to make maps, objects, etc - as long as you know how to load the data and display it (or if someone else has already done that for you).

3 Likes

This should be a priority for us to add to the Defold editor. Perhaps something based on LuaCheck or similar. It’s a huge help when coding.

3 Likes

How hard do you guys think it would be to port a simple bunnymark benchmark to gideros, defold (I think there are a few already) and corona? Im new to lua so I dont want to get into anything too complex yet.

Im interested in gideros because it does have its own ide and is open source, while Im also interested in Corona since it seems to be the most “mature” of the three and of course Im interested in defold since it seems to be the most complete package, easiest to work with (and so far I like this community the best).

1 Like

It took me an hour or two to read up on and experiment with the Love API to do the bunnymark test for that platform. It shouldn’t be that much harder for any of the other platforms.

3 Likes