Page 2 of 4

Re: Is luasec a thing?

Posted: Sun Feb 12, 2023 6:26 am
by Andlac028
Please note, that to be able to download build artifacts, you need to be signed in in GitHub.

Re: Is luasec a thing?

Posted: Sun Feb 12, 2023 8:38 am
by ivan
I managed to get luasec working a few months ago:
viewtopic.php?f=4&t=93856
Although like slime said, making sure everything works with the same Lua code between platforms requires a lot of effort.
That is why we need to have more appreciation for slime and everybody else involved with Love2D development.

PS. Forgot to mention, we absolutely need file locking through love.filesystem.

Re: Is luasec a thing?

Posted: Sun Feb 12, 2023 10:01 am
by togFox
I have no problem trying love 12 before official release. I'll take that route firstly!

Re: Is luasec a thing?

Posted: Sun Feb 12, 2023 12:58 pm
by GVovkiv
Bigfoot71 wrote: Sat Feb 11, 2023 9:49 pm For JSON there is already a pure Lua library that works very well: https://github.com/rxi/json.lua
Personally I don't really see why it should be implemented in Love2D, unless something escapes me.
considering saving/loading data is one of "must-have" stuff that you might be doing in your game (save system, language packs, configuration files that you might want expose to users, or maybe even networking?) having out-of-box solution would be definaly handy, no need for additional libraries

Re: Is luasec a thing?

Posted: Sun Feb 12, 2023 2:18 pm
by ivan
JSON is a good format if you plan to interact with a web browser.
If you want to store your Love2D save files, a much better option is to use Lua serialization.

Re: Is luasec a thing?

Posted: Sun Feb 12, 2023 11:05 pm
by Bigfoot71
GVovkiv wrote: Sun Feb 12, 2023 12:58 pm
Bigfoot71 wrote: Sat Feb 11, 2023 9:49 pm For JSON there is already a pure Lua library that works very well: https://github.com/rxi/json.lua
Personally I don't really see why it should be implemented in Love2D, unless something escapes me.
considering saving/loading data is one of "must-have" stuff that you might be doing in your game (save system, language packs, configuration files that you might want expose to users, or maybe even networking?) having out-of-box solution would be definaly handy, no need for additional libraries
Personally, I had never thought of using JSON for local saves, especially since it would make it easier to edit backups and therefore cheat, unless there was some way to obfuscate that (apart from compression and encoding because why use JSON then)? What are the advantages for you of doing like this rather than using a table serialization technique like Ivan says?

I sincerely ask, you must have a reason and I want to know! :ultraglee:

Re: Is luasec a thing?

Posted: Mon Feb 13, 2023 12:17 am
by zorg
ivan wrote: Sun Feb 12, 2023 8:38 am PS. Forgot to mention, we absolutely need file locking through love.filesystem.
Doesn't PhysFS already handle this?

Re: Is luasec a thing?

Posted: Mon Feb 13, 2023 8:05 am
by GVovkiv
Bigfoot71 wrote: Sat Feb 11, 2023 9:49 pm Personally, I had never thought of using JSON for local saves, especially since it would make it easier to edit backups and therefore cheat, unless there was some way to obfuscate that (apart from compression and encoding because why use JSON then)? What are the advantages for you of doing like this rather than using a table serialization technique like Ivan says?

I sincerely ask, you must have a reason and I want to know! :ultraglee:
Personally, I had never thought of using JSON for local saves, especially since it would make it easier to edit backups and therefore cheat, unless there was some way to obfuscate that (apart from compression and encoding because why use JSON then)?
You make single player game where someone with notepad can edit save file. And what?
If save file will be somehow obfuscated, i can instead use cheat engine, 100% save file by someone, hack game, etc. What point in doing so?
What are the advantages for you of doing like this rather than using a table serialization technique like Ivan says?
I like JSON and i like out of box expirience.

Re: Is luasec a thing?

Posted: Mon Feb 13, 2023 10:04 am
by Bigfoot71
GVovkiv wrote: Mon Feb 13, 2023 8:05 am You make single player game where someone with notepad can edit save file. And what?
If save file will be somehow obfuscated, i can instead use cheat engine, 100% save file by someone, hack game, etc. What point in doing so?

I like JSON and i like out of box expirience.
You're right in a sense, personally I'm working mostly on Android and currently on a multiplayer game so I have the means to make (nearly) impossible the means you cite without the player ruining the game, on the other hand on a single player (or not) PC game is another matter indeed...

The out of the box experience seems to me to be a good reason otherwise, excuse my curiosity ^^

Re: Is luasec a thing?

Posted: Mon Feb 13, 2023 3:07 pm
by GVovkiv
Bigfoot71 wrote: Mon Feb 13, 2023 10:04 am You're right in a sense, personally I'm working mostly on Android and currently on a multiplayer game so I have the means to make (nearly) impossible the means you cite without the player ruining the game, on the other hand on a single player (or not) PC game is another matter indeed...
I guess you talk here about multiplayer game where you can connect to other players with your characters, right?
In this case, encoding also just lame and don't do anything useful. If i see that someone is using in my lobby overpowered character (don't matter if it was achieved naturally, via file edit, via cheat engine, etc) and I'm not okay with it, i would just kick them and never ever will play again. Encoding here do nothing.
In multiplayer, server should treat any data from clients as potentialy malicious, so it always should be sanitazed and checked.
And, for example, game should balance players around their items and level and compare it to host of game. For example, like Souls games do: if you cheat character with high gear, but low level, you would connect to player with same level as you and get downgraded gear that will perform on same level as host, which makes character cheating less effective. System still not perfect, as twinks is still thing, but, yeah.
The out of the box experience seems to me to be a good reason otherwise, excuse my curiosity ^^
Yes, and fact that json will be more then enough for 90% of games to save/load data, which would work nice as part of love with documentation and examples, istead of "so, how to i save data in love?" Posts
The only place i think it might not work nicely, is where game needs to store really big amount of data. For example, games such as Minecraft or terraria, because you have big world where you store blocks with properties, etc.
In this case, writing and loading might be slower and data itself will require much more space, in comparison with something that more suited for that. (Maybe csv or even plain text file with custom parsing?)