Compiling?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
carlman
Prole
Posts: 4
Joined: Sat Dec 24, 2011 10:17 pm

Compiling?

Post by carlman » Sat Dec 24, 2011 10:24 pm

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

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Compiling?

Post by Robin » Sat Dec 24, 2011 11:05 pm

Welcome, Carl!
carlman wrote:Is this something that can be done? Just as an alternative?
In short, no.
Help us help you: attach a .love.

carlman
Prole
Posts: 4
Joined: Sat Dec 24, 2011 10:17 pm

Re: Compiling?

Post by carlman » Sat Dec 24, 2011 11:07 pm

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."

User avatar
slime
Solid Snayke
Posts: 2904
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Compiling?

Post by slime » Sat Dec 24, 2011 11:29 pm

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.

carlman
Prole
Posts: 4
Joined: Sat Dec 24, 2011 10:17 pm

Re: Compiling?

Post by carlman » Sat Dec 24, 2011 11:49 pm

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!

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Compiling?

Post by Robin » Sat Dec 24, 2011 11:55 pm

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.
Help us help you: attach a .love.

carlman
Prole
Posts: 4
Joined: Sat Dec 24, 2011 10:17 pm

Re: Compiling?

Post by carlman » Sun Dec 25, 2011 12:09 am

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

SomethingMoreUnique
Prole
Posts: 12
Joined: Sat Dec 24, 2011 6:03 pm

Re: Compiling?

Post by SomethingMoreUnique » Sun Dec 25, 2011 12:16 am

Does anyone know if we'll eventually be able to compile games to "hidden source"? I'm not very good at sharing :crazy:

User avatar
slime
Solid Snayke
Posts: 2904
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Compiling?

Post by slime » Sun Dec 25, 2011 7:40 am

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.

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Compiling?

Post by Robin » Sun Dec 25, 2011 9:16 am

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.
Help us help you: attach a .love.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 28 guests