love.bundle

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
kalle2990
Party member
Posts: 245
Joined: Sat Sep 12, 2009 1:17 pm
Location: Sweden

love.bundle

Post by kalle2990 »

Introducing love.bundle

love.bundle is a library for storing game data between sessions. Unlike the most used saving systems, you don't have to make your own converting algorithm for data to text and the opposite. Here all you have to do is putting your data in a created bundle, and save it. The library also features a function for setting a function to be called when the game exits, here the user can put stuff like saving their bundles. The bundle can store 4 types of values:
  • String
  • Number
  • Boolean
  • Nil
Those 4 different types of values can easily be put into a created bundle or read from one with this:

Code: Select all

Bundle = love.bundle.newBundle("A Bundle Name") --Creates a bundle with the given name/identifier
Bundle:setIdentity("Another Bundle Name") --Changes the identity of the bundle
Bundle:save() --Saves the bundle to the saving directory
Bundle = love.bundle.loadBundle("Another Bundle Name") --Loads a saved bundle with that name if it exists
love.bundle.setExitFunction(aFunction) --Sets aFunction to be called when someone exits the game
success = Bundle:put("Name Of The Value", 42) --Returns if the operation succeeded or not
var = Bundle:get("Name Of The Value") --Returns the value with that name, or nil if not found
var = Bundle:get("Name Of A Not Created Value", true) --Returns the value with that name, or the 2nd argument if not found
To understand this more, you can download the documentation I have created which is just like the LÖVE Documentation one. It looks the same to make it easier to understand since you don't have to get used to a new type.
bundle.lua
love.bundle Version 1
(3.65 KiB) Downloaded 836 times
Bundle Documentation.zip
The documentation (recommended)
(19.38 KiB) Downloaded 625 times
Feedback is welcome ^^
User avatar
kicknbritt
Citizen
Posts: 96
Joined: Sat May 30, 2015 2:15 am
Location: Chicago, IL/Anchorage,AK

Re: love.bundle

Post by kicknbritt »

Cool!... But why has no one commented? Lol sad that you dont get much forum activity but this looks like a cool library and im going to try it out....
"I AM THE ARBITER!!!" *Pulls out Energy sword and kills everything*
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: love.bundle

Post by Positive07 »

Dude did you check the date? It says 2010!!! That is 6 years ago, this library targeted other LÖVE version, and hasn't received any update since then!! Not even the author of this thread has commented.

Also this is not a commonly used feature. Most people roll their own since they may have different needs. For serialization I recommend you check out binser, bitser, ser, lady or smallfolk (note that most of these libraries where made by Robin which has way too much experience with serialization hahaha). There are also ini and json parsers. Saving and loading files with [wiki]love.filesystem[/wiki] is really simple.

Also there are some other libraries like protobuf (alternative) or msgpack which you may be interested in... In resume, this post is for just another library in a realm with far better and updated options.

What do I mean by better? Well Lua has far too many edge cases, inf, -inf which may serialize different depending on the Lua version, nested tables which may have circular references, metatables, class implementations, floats having different lengths depending on compilation, complex names for hash tables... I don't know if Bundle supports all these things but most of the libraries mentioned first support such things.

I recommend you check newer threads and not threads more than 1 year old, since LÖVE has changed a lot in the last few years
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
zorg
Party member
Posts: 3441
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: love.bundle

Post by zorg »

I'm not saying that an autolock-after-x-time would be a neat feature, but maybe a huge ass-notice or something could welcome them when people google for forum threads and find themselves old ones like these.
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
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: love.bundle

Post by Positive07 »

PLEASE! Except for the General forum the others get outdated on each release of LÖVE, it would be better if people understood that they are looking at an old thread. So if the last reply/post is 1 year old then huge-ass-notice-before-necroposting, else nothing just post normally
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: love.bundle

Post by Jasoco »

zorg wrote:I'm not saying that an autolock-after-x-time would be a neat feature, but maybe a huge ass-notice or something could welcome them when people google for forum threads and find themselves old ones like these.
Exactly what I've been saying forever. I bet there's a mod for the software to add it and if not I could write code to do it myself possibly. Though it's been years (Longer than the age of This thread itself.) since I wrote PHP. On second thought I could never write a mod to lock threads. But it'd be quite simple to add a notice to the top of a post.php page when the "time since last reply" is longer than a certain amount of time.

From there you could then just not show the Post button and text boxes rendering the page useless.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: love.bundle

Post by Positive07 »

I think locking may be going too far, say if you decided to revisit your OLD game/library and wanted to make an update without creating a new thread for it (You should create a new thread though) to notify old players of the game/users of the library, then necrposting in your own thread may be "fine".

I would dissallow the Quick Reply at the end and would force you to open the Full Editor, then I would open a HUGE alert stating that the thread is old and necroposting is bad, blah blah blah, then we you go and press the Submit button to actually post I would ask for confirmation like "Would you really really really like to necropost? Are you sure you are not stupid or have something wrong in the head? Isn't it just Google's fault???" then if this person goes further... well just let him be... Otherwise this folk would probably write another forum post stating how bad the LÖVE forum is because he can't necropost on a two year old post!! ¬¬
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: love.bundle

Post by Jasoco »

Yeah, don't lock. But remove Quick Reply if it detects the "last update" time for the thread is further than a set amount, and then on the post page make it hard to post. Show an alert that takes up the whole screen or most and hide the post button with JavaScript that requires confirmation to make visible again. It'd be the easier mod to write if one doesn't exist yet. Hell, put a smaller bright red message at he bottom of the page where the Quick Reply would be too right above the Reply button. "This thread is 2 years old. Due to the nature of Löve, the information may be EXTREMELY out of date. Therefore it is not recommended you bump it if you are having problems with getting it run. If you need to, create a new thread. Something something, I dunno."

Passively-aggressively discourage bumping, but don't completely prevent it. (In case the person bumping needs to bump it for a good reason, as rare as that may be) Then at least if a thread does end up getting bumped like this one by someone new who Googled, our making fun of them is justified.
User avatar
zorg
Party member
Posts: 3441
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: love.bundle

Post by zorg »

A good time in my opinion could be the release of the last minor version. (0.9, 0.10 once 0.11 comes out, etc.) Wouldn't be completely arbitrary then. :3
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
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: love.bundle

Post by Jasoco »

That would make sense too. But it would get complicated since some projects are designed for other versions and who knows if one was designed during the alpha period of a version that wasn't out yet but may now be.

I say just have it be a limit of 1 or 2 years since that seems to be the general time these threads show up. This one was what, 6 years? Since Löve moves so fast, just do a year. As I said, it doesn't need to prevent posting, just make the poster think twice. Most of the time they just don't know that Löve's nature is to be constantly changing and that projects will die quickly. So alerting them to that would be the best course.

I don't remember much about my PHP and forum coding (I worked with PHPBB for a while, then later punBB.) but it is probably pretty simple to get the "thread ID last posted date" variable and subtract the current time and check if it's > 1 year, which I guess in seconds is what, 31,536,000 seconds?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests