Lua encoding

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

Lua encoding

Post by Coder567 »

Hi
i have been studying the topic of compiling lua and I have a couple of questions

1) What's the difference between luaJIT and luaC? Which one's better?

2) I'm using zero bane studio (windows) which has LOVE in it. Should there be also luaJIT somewhere?

3) Can the lua decompilers exes be downloaded from somewhere? I have only found couple (luajit-decomp, luadec) from here but didn't know how to use the luajit-decomp. And haven't got any luck trying to build one from sources

4) Is it possible to have part of your code compiled and rest not, so you can enable modding?

Edit: Another question

thanks!
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Lua encoding

Post by zorg »

1. LuaC is the PuC version's compiler; LuaJIT is by Mike Pall. The former is only for compiling your lua scripts into bytecode that can be loaded in faster, but it won't get faster execution speeds. LuaJIT is a just-in-time compiler for lua, and what Löve uses by default; It also has facilities to pre-compile lua scripts into bytecode giving you the similar faster load speeds but again, not execution speeds. (LuaJIT is faster in most cases than PuC Lua though)

2. Löve already comes with LuaJIT by default.

3. Dunno, but don't expect the same quality from machine-decompiled content.

4. Yes, but mods can also be compiled of course... thing is, they would need to be compiled with the same lua version löve came with in your project you distributed for those to work that way.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

Re: Lua encoding

Post by Coder567 »

zorg wrote: Mon Oct 07, 2019 4:46 pm 2. Löve already comes with LuaJIT by default.
What does that mean in practice? That the script is run more efficiently? Or that it can be compiled by some command?
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Lua encoding

Post by zorg »

The first definitely, compared to PuC lua, LuaJIT can run stuff way faster (I think i saw benchmarks for specific things that got executed almost as fast as C code); as for the other, not sure whether you can do it through löve or not, but of course, luaJIT also has a way to (pre-)compile files into bytecode... which, again, should be stated that the only reason you'd ever want to do that would be to speed up code loading times.
Last edited by zorg on Mon Oct 07, 2019 9:44 pm, edited 1 time in total.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Lua encoding

Post by raidho36 »

Everything can be decompiled so don't worry about it. If you're worried that someone will steal your great software invention - don't oversell yourself. It will at best be something that million other people already did and millions more will do without your input. There's nothing you can come up with that will be of any interest to other people.
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

Re: Lua encoding

Post by Coder567 »

Thanks everyone for your replies!

raidho36 wrote: Mon Oct 07, 2019 7:03 pm It will at best be something that million other people already did and millions more will do without your input. There's nothing you can come up with that will be of any interest to other people.
Well that's encouraging :awesome:

I was hoping that even decoded, the source code would be obfuscated which would discourage anyone to make couple of changes and uploading it as he's own. It's not ideal protection but all I can do

Plus the license which everyone talks about
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Lua encoding

Post by raidho36 »

Well that's literally what crackers and hackers do so you can't hope to stop people or even meaningfully impede them. And when someone wants to rip you off, they wouldn't even use any of your stuff, they'll just make a close enough copy. Again, don't worry about it.
monolifed
Party member
Posts: 188
Joined: Sat Feb 06, 2016 9:42 pm

Re: Lua encoding

Post by monolifed »

Some game companies release their source code after a while. Some of them are big titles. But I don't remember any notable project using their source code.
So releasing the source code might be the best way to discourage people who are constantly trying to steal your code.
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

Re: Lua encoding

Post by Coder567 »

My projects are always so big I would like to have some protection. Then after some time after the release I could release the code so people can mod it but at start I would like to have the source closed. Or partly open source, for modding.

I tried luajit to compile lua file but love couldn't read the compiled file
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Lua encoding

Post by zorg »

Coder567 wrote: Wed Oct 09, 2019 11:41 am My projects are always so big I would like to have some protection. Then after some time after the release I could release the code so people can mod it but at start I would like to have the source closed. Or partly open source, for modding.

I tried luajit to compile lua file but love couldn't read the compiled file
I think i mentioned it previously, but you need to use the same version of LuaJIT that the Löve version you have uses.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

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