Page 1 of 3

Compiling?

Posted: Sat Dec 24, 2011 10:24 pm
by carlman
Hello, i was wondering a thing.
Right now LÖVE can't "hide the source code", and anyone who plays the game can easily go and read the source code without any effort.
So it seems, alot of people want to be able to "hide their source code". Of course, there are the opposite who thinks open-source is awesome and so on.

But however, how hard would it be to add support in LÖVE to "compile" the .love file? Maybe could still use the old system too, for those who want that.

I know some of you hates DRM and stuff like that, but nonetheless some people want it.
This would also, in my opinion, make LÖVE a lot more "professional" engine, and even more if you have the choice of using or not using DRM.

Is this something that can be done? Just as an alternative?

Thank you very much,
Carl

Re: Compiling?

Posted: Sat Dec 24, 2011 11:05 pm
by Robin
Welcome, Carl!
carlman wrote:Is this something that can be done? Just as an alternative?
In short, no.

Re: Compiling?

Posted: Sat Dec 24, 2011 11:07 pm
by carlman
Thank you!
Robin wrote: In short, no.
Why? Even the wiki says:
"LÖVE is totally free, and can be used in anything from friendly open-source hobby projects, to evil, closed-source commercial ones."

Re: Compiling?

Posted: Sat Dec 24, 2011 11:29 pm
by slime
You can use luac to compile your Lua source files to Lua bytecode, however luac will only compile for the architecture it's running as, so you have to make sure your Lua is x86 if love's Lua is x86. Lua byte code will also break between lua versions. Additionally, Lua bytecode is also easily decompiled, however if you use LuaJIT I don't believe there are any tools yet that can easily decompile that into a mostly readable state.

Re: Compiling?

Posted: Sat Dec 24, 2011 11:49 pm
by carlman
Thank you for the answer slime. Two questions:
- How do i go about to do that? Can i just compile the .lua files and LÖVE can still read them or what? (sorry for not understanding, i'm kind of new)
- Why does the wiki say that you can do closed-source games if you, pretty much, can't? (the quote in my previous reply)

Thanks!

Re: Compiling?

Posted: Sat Dec 24, 2011 11:55 pm
by Robin
carlman wrote:Why? Even the wiki says:
"LÖVE is totally free, and can be used in anything from friendly open-source hobby projects, to evil, closed-source commercial ones."
Because closed source is not the same as hidden source.
carlman wrote:Can i just compile the .lua files and LÖVE can still read them or what?
In theory, yes. (Because Lua needs to compile it anyway.) In practice, it doesn't always work. We had someone who compiled their project and uploaded it to the forums -- half the people couldn't run it, probably because of platform differences.
carlman wrote:- Why does the wiki say that you can do closed-source games if you, pretty much, can't? (the quote in my previous reply)
See above.

Re: Compiling?

Posted: Sun Dec 25, 2011 12:09 am
by carlman
Aha, i see! That's too bad :(
Robin wrote: Because closed source is not the same as hidden source.
But shouldn't the forum text read "hidden-source" then? I'm confused :|

Thanks for your time,
Carl

Re: Compiling?

Posted: Sun Dec 25, 2011 12:16 am
by SomethingMoreUnique
Does anyone know if we'll eventually be able to compile games to "hidden source"? I'm not very good at sharing :crazy:

Re: Compiling?

Posted: Sun Dec 25, 2011 7:40 am
by slime
Robin wrote:In practice, it doesn't always work. We had someone who compiled their project and uploaded it to the forums -- half the people couldn't run it, probably because of platform differences.
It should be fine as long as you package the executable along with the .love, which you should be doing anyway if you're releasing a commercial product. The Cobalt developers successfully use compiled LuaJIT files packaged in a similar manner to .love archives for their own engine and game, I believe.

Re: Compiling?

Posted: Sun Dec 25, 2011 9:16 am
by Robin
carlman wrote:But shouldn't the forum text read "hidden-source" then? I'm confused :|
You can make closed-sourced games with LÖVE. It just doesn't really work if you want to hide the source.

Closed or open source is a matter of licensing, hidden source is a matter of mucking around with encryption and compilation to try to hide the way you're doing things.

Commercial and hobby projects can be both open source and closed source.