Lume & Lurker : Utility functions and auto-hotswapping

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
MGinshe
Prole
Posts: 31
Joined: Sun Apr 17, 2011 3:50 am
Location: New Zealand

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by MGinshe »

Puzzlem00n wrote:
rxi wrote:Of course, this isn't to say you can't fork a version and add a console yourself, or use lurker as part of a larger debugging package you build.
I just want everyone to know that if anyone ever does this, I thought of the perfect name for it: "ladybug." Starts with L and includes the word "bug."

You see, now I'm tempted to create this for no other reason than to use the name. :awesome:
this is going to be my next project, once i'm done fixing up the lurker-thread repo :)

i've had a few ideas (and even have a working demo) but i'm still a little unsure on some of the details. should it be a Source-style console, with commands that can be bound to variables/functions, or just a simple lua console? i think the latter fits into lurker/lume's style a little better, but i really like the idea of a simple, download-and-go debug console. let me know what you think!

demo:
Image

P.S. the next release of lurker-thread will be a stand-alone module, as opposed to a full conversion of lurker.
User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by Puzzlem00n »

MGinshe wrote:this is going to be my next project, once i'm done fixing up the lurker-thread repo :)
Aww, now I can EDIT:can't make it. But then again, you are!

I'd just go with a plain lua console, personally, but you can do whatever you want, it's your thing. Also, it should probably have a transparent background so you can see the game behind it... Most built-in console libs seem to do it that way.

What does this threading thing improve, anyway? Just performance or what?
Last edited by Puzzlem00n on Wed Mar 12, 2014 12:30 am, edited 2 times in total.
I LÖVE, therefore I am.
User avatar
MGinshe
Prole
Posts: 31
Joined: Sun Apr 17, 2011 3:50 am
Location: New Zealand

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by MGinshe »

Puzzlem00n wrote:
Aww, now I can make it. But then again, you are!

I'd just go with a plain lua console, personally, but you can do whatever you want, it's your thing. Also, it should probably have a transparent background so you can see the game behind it... Most built-in console libs seem to do it that way.

What does this threading thing improve, anyway? Just performance or what?
yeah i think plain lua is the way to go, maybe i'll release a more fully-featured one later down the line.

the threaded version runs lurker.scan in the background, as opposed to your main love.update(). this means that you won't get any fps drops or jitters while it scans. it works with lurker.interval, and there will (hopefully) be support for lurkers error catching within the next few days.
User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by Puzzlem00n »

MGinshe wrote:the threaded version runs lurker.scan in the background, as opposed to your main love.update(). this means that you won't get any fps drops or jitters while it scans. it works with lurker.interval, and there will (hopefully) be support for lurkers error catching within the next few days.
This threaded version should be called linen. Both "L" and "thread."

I AM ON FIRE. :ultrahappy:
I LÖVE, therefore I am.
User avatar
MGinshe
Prole
Posts: 31
Joined: Sun Apr 17, 2011 3:50 am
Location: New Zealand

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by MGinshe »

Puzzlem00n wrote:
This threaded version should be called linen. Both "L" and "thread."

I AM ON FIRE. :ultrahappy:
i hereby nominate you as Community Head Of Commendably Delicate and Expert naming conventions.

also, i present to you linen.lua! the setup is super simple, just drop it in your project next to lume and lurker, then add require("linen") somewhere under require("lurker"), and you're done. it uses lurker's lurker.interval variable, which can even be changed during run-time. tell me if you guys find any bugs or have any feedback :)

EDIT:

forgot to mention that it now supports the latest version of lurker, with error catching and recovery.
rxi
Prole
Posts: 47
Joined: Sun Mar 02, 2014 10:22 pm

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by rxi »

Zarty55 wrote:I had some function ideas for Lume:
[...]
polygonScale(polygon, x, y) // Scales a polygon
polygonTranslate(polygon, x, y) // translate a polygon
getPolygonBoundingBox(polygon) // returns the polygon bounding box. derp
[...]
getFontSize(font, text) // the same as doing "font:getWidth(text), font:getHeight(text)" but in one function only.
getFontCenter(font, text) // returns the center position of the text
Unfortunately the transform functions are a bit too math-orientated for the lib, where I feel a small matrix library would serve a lot better. The AABB-from-polygon one did look interesting so I'll keep that in mind for the future.

The font functions would be LÖVE dependant where as I am keeping Lume only Lua dependant so it can be used with all the Lua game frameworks.

Let me know if you think of any more ideas, though. I do like to see things being suggested.

MGinshe wrote:...i've had a few ideas (and even have a working demo) but i'm still a little unsure on some of the details. should it be a Source-style console, with commands that can be bound to variables/functions, or just a simple lua console?...
I'm unsure what you meant by this. Regardless, the console in the .gif was looking pretty smart, The colour-scheme gave a sort of classy feel to the whole thing.
User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Above the Pocket Dimension
Contact:

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by HugoBDesigner »

Zarty55 wrote: For drawing:
getFontSize(font, text) // the same as doing "font:getWidth(text), font:getHeight(text)" but in one function only.
getFontCenter(font, text) // returns the center position of the text
If you allow me, rxi, I think these 2 functions are pretty easy. It wouldn't be hard to implement them manually...

getFontSize(font, text):

Code: Select all

function getFontSize(font, text)
    return font:getWidth(text), font:getHeight(text)
end
getFontCenter(font, text):

Code: Select all

function getFontCenter(font, text)
    return font:getWidth(text)/2, font:getHeight(text)/2
end
@HugoBDesigner - Twitter
HugoBDesigner - Blog
User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by Puzzlem00n »

MGinshe wrote:i present to you linen.lua!
This lib does not work for me at all. It completely breaks things. It just prints "[lurker] initing lurker" at the beginning, then never hotswaps a thing.
EDIT: Wait, it might be because I put everything in a subfolder-- and it seems to be lurker's fault.

EDIT2: Nevermind, I'm just an idiot who edits things too much. Turns out you still have to call lurker.update even with linen. That shoulda been obvious.

Also, why not do this at the top of the file so you only have to require linen and not lurker above it? Seems to make more sense.

Code: Select all

local path_to_lume = "llibs/lume"	-- replace with absolute
local path_to_lurker = "llibs/lurker" -- path to lume/lurker
lume = require(path_to_lume)
lurker = require(path_to_lurker)
EDIT: Nope, that apparently breaks it for reasons I do not in any way understand. So I guess this post has in the end contributed nothing. Oh well.
I LÖVE, therefore I am.
User avatar
MGinshe
Prole
Posts: 31
Joined: Sun Apr 17, 2011 3:50 am
Location: New Zealand

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by MGinshe »

Puzzlem00n wrote:
MGinshe wrote:i present to you linen.lua!
This lib does not work for me at all. It completely breaks things. It just prints "[lurker] initing lurker" at the beginning, then never hotswaps a thing.
EDIT: Wait, it might be because I put everything in a subfolder-- and it seems to be lurker's fault.

EDIT2: Nevermind, I'm just an idiot who edits things too much. Turns out you still have to call lurker.update even with linen. That shoulda been obvious.

Also, why not do this at the top of the file so you only have to require linen and not lurker above it? Seems to make more sense.

Code: Select all

local path_to_lume = "llibs/lume"	-- replace with absolute
local path_to_lurker = "llibs/lurker" -- path to lume/lurker
lume = require(path_to_lume)
lurker = require(path_to_lurker)
EDIT: Nope, that apparently breaks it for reasons I do not in any way understand. So I guess this post has in the end contributed nothing. Oh well.
it definitely did contribute something! what kind of error does it print when you set path_to_lume and path_to_lurker? just for reference, thread errors are caught silently and won't actually produce any error in love, so it may not have actually said anything. i'll add a function to check for and display errors :) i'll also update the readme to be a little more clear about the lurker.update/path_to_X thing.

i would require the modules earlier, but then they would be required a total of 3 times each. keeping them inside the "thread block" means that they'll only be required once, inside the actual thread. for reference, my lume/lurker modules are installed under /lua/lib/lume/lume and /lua/lib/lume/lurker. it seems to work find for me, but i'll have to play around with it.

has it worked at all for you? how did the performance compare to stock lurker? are there any feature suggestions you can think of?
User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: Lume & Lurker : Utility functions and auto-hotswapping

Post by Puzzlem00n »

MGinshe wrote:it definitely did contribute something! what kind of error does it print when you set path_to_lume and path_to_lurker?
If I put it at the top like that, you mean? It doesn't print any errors, it just plain stops working. I wish I could put it like that so I'd only have to require linen and then the other two would be automatic, but it just doesn't fly, apparently.
MGinshe wrote:has it worked at all for you? how did the performance compare to stock lurker? are there any feature suggestions you can think of?
1) Yes, it's working now. 2) To be honest, I have no idea, I'm just running under the assumption that it's faster. 3) Not really.
I LÖVE, therefore I am.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 143 guests