Alternate ways to store data files

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
N_K
Prole
Posts: 10
Joined: Fri Mar 09, 2012 11:22 pm

Alternate ways to store data files

Post by N_K »

Hello all!

I'm planning to develop a 2D RPG. Originally, I started to write an SDL-based engine from scratch, but then I found Löve. So I started to play with it, and I like it very much, it's an amazing 2D engine. The only thing that holds me back at the moment is that it's entirely Lua-driven. Even people with limited game development knowledge will eventually figure out how to open .love files, read the scripts, and the whole game will be spoiled.

I know it's possible to append the .love file to the end of the Löve executable. However, I don't really like the idea to distribute the game as a single, extremely large executable. I know it's also possible to compile the lua files to bytecode, but as far as I know, they won't work on platforms different from the one they were compiled on.

What I think about now is to pack only the script files into the executable, and keep all the other data files in an external .love/.zip file. Is it possible to do this?

My other idea is to grab the source code, and use Löve directly from C++. As far as I understand right now, all the functionality are coded in C++, and then the C++ methods are simply exposed to the Lua interpreter, but they can also be called directly, right? Is there anybody who tried this before?

Thanks for your help in advance. :neko:
User avatar
slime
Solid Snayke
Posts: 3129
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Alternate ways to store data files

Post by slime »

Even people with limited game development knowledge will eventually figure out how to open .love files, read the scripts, and the whole game will be spoiled.
Why would the game be spoiled? People who are interested in the code with enough knowledge to understand it would already know the in-game consequences, and there's a high chance that they would have finished the game already.
User avatar
N_K
Prole
Posts: 10
Joined: Fri Mar 09, 2012 11:22 pm

Re: Alternate ways to store data files

Post by N_K »

Thanks for your reply.

Well, trust me, I've seen a few casual gamers who managed to open even proprietary archive formats just to figure out something they couldn't solve ingame. So it's simply not a good idea to serve the whole internal game mechanism to the player. In game that's entirely algorithm-driven, like a tetris clone, they can't figure out much when looking at the code, but, for example, in and RPG, with all the dialogs, events, and items, it's not that hard to spoil the game.
User avatar
pk
Citizen
Posts: 67
Joined: Wed Dec 14, 2011 2:13 am
Location: Texas, United States
Contact:

Re: Alternate ways to store data files

Post by pk »

I think what you are asking for and the way LOVE is designed are mutually incompatible.
ALL CREATURE WILL DIE AND ALL THE THINGS WILL BE BROKEN. THAT'S THE LAW OF SAMURAI.
User avatar
slime
Solid Snayke
Posts: 3129
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Alternate ways to store data files

Post by slime »

N_K wrote:Thanks for your reply.

Well, trust me, I've seen a few casual gamers who managed to open even proprietary archive formats just to figure out something they couldn't solve ingame. So it's simply not a good idea to serve the whole internal game mechanism to the player. In game that's entirely algorithm-driven, like a tetris clone, they can't figure out much when looking at the code, but, for example, in and RPG, with all the dialogs, events, and items, it's not that hard to spoil the game.
Wouldn't they just look online for answers if they can't find out through the game files? Online walkthroughs are certainly nothing new.
User avatar
N_K
Prole
Posts: 10
Joined: Fri Mar 09, 2012 11:22 pm

Re: Alternate ways to store data files

Post by N_K »

pk wrote:I think what you are asking for and the way LOVE is designed are mutually incompatible.
As far as I know, Löve is designed to be a general-purpose 2D engine. What I need is a general-purpose 2D engine. It has a pretty extensive Lua interface, but the engine itself is still coded in C++. And then it seems that nobody tried to do this before, but I guess it wouldn't be hard to use it from C++, so I'll go ahead, and try to get something out of this. :nyu:

So, for now, let's forget about why I don't want to expose my scripts to the players, and let's forget about why I want to code the game in C++, but can someone tell me if it's possible to use external data files (e.g.: there's game.love, which contains only the scripts, an there is data.zip, which contains all the media)?
User avatar
slime
Solid Snayke
Posts: 3129
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Alternate ways to store data files

Post by slime »

Currently everything read by love's virtual filesystem needs to either be in the .love file or in the game's save location (inside appdata in windows, etc). For release, love files are typically packaged with the executable so the user only sees the executable.

I think in the future it would be cool to have different ways for people using love to organize their game data, but this is the only way right now.
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Alternate ways to store data files

Post by tentus »

It's entirely possible to load external zip files in Love. They'd have to be in the save directory, but it's very doable. Just dang inconvenient.
Kurosuke needs beta testers
User avatar
pk
Citizen
Posts: 67
Joined: Wed Dec 14, 2011 2:13 am
Location: Texas, United States
Contact:

Re: Alternate ways to store data files

Post by pk »

Even then, any sufficiently intelligent user can get at the scripts and resources.

If people can hack Minecraft they can definitely hack LOVE. Compiling directly to to a binary format will make it harder, but I doubt you will gain much for all your effort.
ALL CREATURE WILL DIE AND ALL THE THINGS WILL BE BROKEN. THAT'S THE LAW OF SAMURAI.
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Alternate ways to store data files

Post by Boolsheet »

Many of the LÖVE module functions in C++ access the Lua API to get a dynamic number of arguments more conveniently into the arrays. This means it's not possible to use only C++ without modifications. The developers talked about a solution for this issue, but it will not be included in the next version of LÖVE.
Shallow indentations.
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests