Debug - A whole new way of debugging your game

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Debug - A whole new way of debugging your game

Post by kikito »

Taehl wrote:(on load, not every frame)
How about searching it only on tab keypress (for example)? You will already have the first characters to narrow the search.

One possible problem I see is metatables; following up the "inheritance" can be complex - and if __index is a function, probably impossible.
When I write def I mean function.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Debug - A whole new way of debugging your game

Post by Taehl »

Yeah, I guess that'd work. But I had in mind something more like the Source engine's console (it shows a list which updates while you type, not just choosing the closest function when a button is pressed).
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
kalle2990
Party member
Posts: 245
Joined: Sat Sep 12, 2009 1:17 pm
Location: Sweden

Re: Debug - A whole new way of debugging your game

Post by kalle2990 »

vrld wrote:Curiously, recently I have done a similar thing: https://github.com/vrld/love-console (attached .love for convenience). Though it is less suited for debugging but focused on live-coding (or stuff)
Looks nice :)
I really like that multiline input, seems promising, however I got stuck when writing something that errors. But as you said, it's not very well suited for debugging as I saw it removes broken functions, not very controversial for a debugging util ;)
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Debug - A whole new way of debugging your game

Post by bartbes »

kikito wrote:One possible problem I see is metatables; following up the "inheritance" can be complex - and if __index is a function, probably impossible.
And why would that be, they work for your search code as well.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Debug - A whole new way of debugging your game

Post by kikito »

bartbes wrote:
kikito wrote:One possible problem I see is metatables; following up the "inheritance" can be complex - and if __index is a function, probably impossible.
And why would that be, they work for your search code as well.
__index as a function is "binary": it either returns nil, or it doesn't (returns an attribute/method/whatever). You can use that property to ask "is this method/attribute defined?" and get a truthy or falsy answer.

But __index (as far as I know) doesn't give you a "dictionary" - you can't ask it "give me all the methods that start with 'dra' ".
When I write def I mean function.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Debug - A whole new way of debugging your game

Post by bartbes »

Shouldn't next() find stuff in __index as well? I never meant calling it yourself..
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Debug - A whole new way of debugging your game

Post by kikito »

bartbes wrote:Shouldn't next() find stuff in __index as well? I never meant calling it yourself..
If index is a table, yes (you will have to make it recursive, that table could have another __index metamethod). But if __index's a function, I don't see how.
When I write def I mean function.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Debug - A whole new way of debugging your game

Post by bartbes »

Hmm.. this is pretty interesting..
User avatar
kalle2990
Party member
Posts: 245
Joined: Sat Sep 12, 2009 1:17 pm
Location: Sweden

Re: Debug - A whole new way of debugging your game

Post by kalle2990 »

Version 1.1.5 released with some minor fixes
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Debug - A whole new way of debugging your game

Post by Robin »

bartbes wrote:Hmm.. this is pretty interesting..
Makes sense. next() looks in the hash table. __index() is called when something isn't in the hash table. There is no way for next() to determine what keys __index() "accepts".
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 56 guests