## The LÖVE of Tomorrow

General discussion about LÖVE, Lua, game development, puns, and unicorns.
rude
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

### The LÖVE of Tomorrow

It's about time I wrote a few words about what the plans are for the next versions of LÖVE.

The next major development step is a rewrite of love.audio. The current system is based on SDL_mixer, which has a few issues. I'd like to base the next module on OpenAL + SDL_sound instead, which seems pretty solid so far. I'm also considering whether ALUT should be included, which has functions for generating waveforms. In any case, the OpenAL-based audio module will support more file formats, panning, positioning, pitch shifting, and more AL-goodness.

Also, I'm restructuring the internals a little (though I know I'm the only one who cares about this ...). I'm trying to get rid of boost::shared_ptr, because coupled with SWIG, it induces massive bloat in both size and execution time of the generated wrapper code. Besides, SWIG does not handle inheritance between templated types too well. I'm therefore trying to create some sort of Lua-based reference counting system, which will ensure the continued existence of raw-pointers internally. The end-user will in any case not have to worry about this ever; my point is that this will take some undermined amount of time to do.

Third, I'm cosidering whether to include LuaJIT, possibly in the same version as the new love.audio. Check out http://luajit.org/ if you don't know what this means.

Everyone will probably be pleased to hear that the main loop and event handling has been moved to Lua, PyGame style. The current load/update/draw pattern may still be used in its present simplicity; the point is that you now can take control of the main loop if you want, by redefining the love.run function.

Code: Select all

function love.run()

-- Main loop time.
while true do

love.timer.step()
if update then update(love.timer.getDelta()) end
love.graphics.clear()
if draw then draw() end

-- Process events.
for e,a,b,c in love.system.events() do
if e == love.event_quit then return end
love.handlers[e](a,b,c)
end

love.graphics.present()

end

end

The next-next major development step involves improvements to love.graphics, consisting of two major parts:
1. More flexible image drawing, with better control over texels, colors, vertices, etc.
2. A Direct3D-based love.graphics module, identical to the OpenGL one.
(This next-next version is further away, so I don't know the details just yet.)

I say "I" a lot, and not so much "we" these days, because Mike is largely busy with web projects, octarine lasers, deep-space arithmetic, and so forth. However, somewhere between all the above features, Mike claims he's going to add additional features to truetype fonts, eventually.

We usually get a lot of good, constructive feedback, which is awesome. Most communities turn into an acid cesspool of human filth whenever the user count grows beyond FIVE, but thankfully, LÖVE Club isn't one of them. As always, post suggestions if you have them. We'll LÖVE you for it.

-- rude

Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

### Re: The LÖVE of Tomorrow

rude wrote:More flexible image drawing, with better control over texels, colors, vertices, etc.
Can't wait

cag
Citizen
Posts: 65
Joined: Sun Jun 29, 2008 5:09 am

### Re: The LÖVE of Tomorrow

love.run is a godsend. I prefer doing things in frames with framecaps anyways, so that's... pretty awesome stuff.

love.audio will be amazingness. THANKYOUTHANKYOUTHANKYOU.

LuaJIT is an interesting idea. I've actually been looking at that and considering suggesting it to you guys, but lua's already pretty crazy fast for what it's worth. I wouldn't put it as a large priority, but if you get time, it's not a bad idea to try it out and run a couple of benchmarks perhaps. I'm not sure if the program's spending enough time in the script to justify JIT compilation though.

Are we only using boost's shared_ptr in the boost lib? I mean, boost's smart pointers are probably efficiently coded, so I doubt the execution time of the generated wrapper code should suffer... is there any particular reason it would? And does linking to a single template in boostlib really add that much bloat to the compiled code?

Flexible image-drawing is pretty cool... do we really need support of D3D yet, though? I feel that the OpenGL does wonderfully for what it's worth, and getting the graphics and audio engines up-to-date is much more valuable than D3D support.

I'M BEHIND U GUYZ > 9000% KAY?

rude
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

### Re: The LÖVE of Tomorrow

I wrote a super-long post about boost::shared_ptr, SWIG and life, but in the end decided to just say this: There is nothing wrong with boost::shared_ptr. The main problem is related to SWIG, inheritance, templates and casting. Especially when types need to cross module borders this becomes a huge problem internally. In short: using raw pointers will lead to more consistent internals, at least if we want to keep SWIG (which we do, for now).

D3D: I think it would be wise to develop this in parallel with the improvements to the current OpenGL based module. They're supposed to be identical, so if a really super-kewl feature is added to love_opengl, I'll have to make sure it exists in Direct3D as well, and vice-versa. At the very least, I need to keep an eye the on Direct3D API while adding new functions.

bartbes
Sex machine
Posts: 4944
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: The LÖVE of Tomorrow

You might implement both, and choose whichever you like in the game.conf (with openGL as default for backward compatibility).

u9_
Citizen
Posts: 54
Joined: Thu Oct 23, 2008 7:12 am

### Re: The LÖVE of Tomorrow

I must say I don't understand the need for Direct3D either. I figured you would be using opengl on windows also, but you probably know more about that then me. Anyways, the LuaJIT sounds like a good idea. I'm sure a big game quickly can reach Lua limits, but there aren't any big projects going on yet, so I also would give it a low priority.

I think it is a good idea to update the audio system. I would like to see more then 8 sounds played at a time, and also, i really think there should be no difference between sound and music. Well, at least if possible, the same functions should be available for both. I would also definitely like to be able to play more then one music file at a time. This is important when you want to change mood, i.e. fading between the two numbers. It's not exactly "easy to learn" but it can make for some nice transitions.

Keep up the good work!

farvardin
Party member
Posts: 161
Joined: Sat Jun 28, 2008 6:46 pm

### Re: The LÖVE of Tomorrow

what would be the point of direct 3D in comparison to opengl which is much more open ?

rude
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

### Re: The LÖVE of Tomorrow

OpenGL drivers are often very poorly implemented on low-end Windows PCs. Besides, I would like to give DirectX a go. If OpenGL were better supported, though, I probably wouldn't bother.

I can point to some actual facts, if that makes people feel better. On my desktop computer, I have a GeForce 9X00, and the OpenGL performance is great, and it's well implemented (i.e. I haven't found any bugs). If this were the case for all graphics cards, there would be no problem. Now; on my laptop, I have an ATI x1250 graphics controller, which among other things claims to be OpenGL 2.0 compatible, and it reports certain OGL 2.0-only features as available, such as point sprites. If I try to use point sprites, though, I get a most horrible crash. Similarly, if I try to use line stipple, I don't get a crash, but I get abysmal performance (1 FPS at best). And line stipple is a fairly old OpenGL feature.

My point is that OpenGL is very good, but some drivers (sadly) aren't.

I consider the Windows platform especially important for game-related projects, as most gamers use this platform, especially the ones eligible for small PopCap-style games. The DirectX version will not differ from the OpenGL version of love.graphics, though. Don't worry.

You all know I'm not neglecting Linux in any way, so don't even go there (btw: we're now officially in Debian! Yes!). 8-) On a related note: I would still gladly maintain MacOSX binaries, but I can't really buy a Mac just for the sake of LÖVE. I have a Mac temporarily now, but I have to return it at the end of this semester, and I don't want to create Mac binaries once, then suddenly stop.

Well ... went slightly off-topic there.

Merkoth
Party member
Posts: 186
Joined: Mon Feb 04, 2008 11:43 pm
Location: Buenos Aires, Argentina

### Re: The LÖVE of Tomorrow

Even though I'm unlikely to give a damn about it, I agree with rude about the D3D render. Just pick one of those cheapo Savage3d-based mobos and let's see how you like your games without textures and with broken geometry. I wish I kept a few screenshots...

Sound stuff: Great news, I'm no fan of sdl_mixer.
Lua stuff: I'm not really sure how much performance you'll gain by using LuaJIT since Lua itself is pretty fast. But we're talking about just-in-time compilers here, it's like dynarec, it sounds too cool not to implement it. At least for the shits and giggles, I know I'd do it.

On the other hand, after many, many months, I ain't seein' no freakin' ponies 'round here. A man has to keep his promises rude

rude