Debug - A whole new way of debugging your game

Showcase your libraries, tools and other projects that help your fellow love users.
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 »

Ranguna259 wrote:isDown and a timer ? Would that work with the current Debug code ?
I'll demonstrate (give me a few hours :P)
Help us help you: attach a .love.
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

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

Post by Ranguna259 »

Hahaha sure, reading the whole sucks and takes quite a while xP I'm still doing it myself to implement live coding (no breakthroughs :roll: )
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
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 »

That was easier than expected. I fixed some other things. (EDIT: I want to do some other things as well, expect a 1.2.8 soon! (This is addictive...))

Changelog
Version 1.2.7 (Not Official) by Robin
  • Brings back keyRepeat, in a way that doesn't interfere with the game.
  • Fixes printing multiple things in 3 ways (see if you can find them all!).
  • Syntax errors in commands now get a sensible error message.
  • Tab completion now only done when the overlay is visible.
  • Removes a useless loop in _Debug.findLocation.
  • Uses multiple argument form of love.keyboard.isDown in _Debug.handleKey.
Version 1.2.6 (Not Official) by Robin
  • Removes keyRepeat, because that shit's evil.
  • Fixes "double click" bug.
  • Fixes indentation.
Version 1.2.5 (Not Official) by Eamonn
  • We now have repetitive keyboard behavior, AWESOME
Version 1.2.4 (Not Official) by Ranguna259
  • Added a new functionality that jumps you to the last output in the conole when you provide a command
Version 1.2.3 (Not Official) by Walz.
  • Fixed a font related bug
Version 1.2.2 (Not Official) by Ranguna259
  • Added a new functionality that enables you to jump right to the bottom of the console by pressing the middle mouse button.
Version 1.2.1 (Not Official) by Qcode
  • Fixed some bugs
  • Added a new functionality that autocompletes the variable to the current proposal by pressing tab
Version 1.2 (Not Official) by Qcode
  • Converted to LÖVE 0.8.0
  • Added a new functionality that enables you to change the 'f8' key to what you want by changing the _lovedebugpresskey='the key you want'
Version 1.1.5
  • Added Shift + F8 console opening, the old one still remains (Thank you miko)
  • Everything except for settings (which has its own global table) is now put into the local table _Debug (Thank you tentus)
Version 1.1
  • Fixed the console to be hidden at the start
  • Added _OverlayColor to global settings (see _Settings() for a list of settings) Changed location as of 1.1.5 to _DebugSettings.Settings()
Version 1.0
  • Initial version
Attachments
lovedebug.lua
(13.19 KiB) Downloaded 119 times
Help us help you: attach a .love.
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

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

Post by Ranguna259 »

I agree ^^


Hmmm, that loop was probably there for debuging, lol debugging a debugger

Code: Select all

love.keyboard.isDown("lshift", "rshift", "lctrl", "rctrl")
Oh, I didn't knew that we could do that, interesting.

BTW, I might be looking into live coding but you are free to do it too, I'm currently trying to merge both the Debug's and LICK's love.run(), at least that's what LICK's creator told me to try:
it's not really working together because both libraries overwrite love.run - you have to build a solution that merges the two love.run.
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
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 »

That would be very interesting. I'm going to bed now, so I'm not going to look into it myself today. :P

This update mostly makes the auto-complete much, much more awesome.

Changelog
Version 1.2.8 (Not Official) by Robin
  • Improves _Debug.findLocation (including: no more loadstring, no __index side-effects, finding object:methods).
  • Improves _Debug.updateProposals (only valid identifiers are proposed, keywords are proposed if there is no preceding . or :).
  • Adds support for the home and end keys.
  • Cleans up some dead code.
  • Now only allows you to enter characters in ASCII, because the rest of the library handles non-ASCII unicode very poorly.
  • Auto-complete now works when inserting text in the middle instead of only at the end.
  • Up and down change which auto-complete option you're going to select.
  • Much better drawn auto-complete options.
  • Suppresses auto-complete when in the middle of an identifier.
Version 1.2.7 (Not Official) by Robin
  • Brings back keyRepeat, in a way that doesn't interfere with the game.
  • Fixes printing multiple things in 3 ways (see if you can find them all!).
  • Syntax errors in commands now get a sensible error message.
  • Tab completion now only done when the overlay is visible.
  • Removes a useless loop in _Debug.findLocation.
  • Uses multiple argument form of love.keyboard.isDown in _Debug.handleKey.
Version 1.2.6 (Not Official) by Robin
  • Removes keyRepeat, because that shit's evil.
  • Fixes "double click" bug.
  • Fixes indentation.
Version 1.2.5 (Not Official) by Eamonn
  • We now have repetitive keyboard behavior, AWESOME
Version 1.2.4 (Not Official) by Ranguna259
  • Added a new functionality that jumps you to the last output in the conole when you provide a command
Version 1.2.3 (Not Official) by Walz.
  • Fixed a font related bug
Version 1.2.2 (Not Official) by Ranguna259
  • Added a new functionality that enables you to jump right to the bottom of the console by pressing the middle mouse button.
Version 1.2.1 (Not Official) by Qcode
  • Fixed some bugs
  • Added a new functionality that autocompletes the variable to the current proposal by pressing tab
Version 1.2 (Not Official) by Qcode
  • Converted to LÖVE 0.8.0
  • Added a new functionality that enables you to change the 'f8' key to what you want by changing the _lovedebugpresskey='the key you want'
Version 1.1.5
  • Added Shift + F8 console opening, the old one still remains (Thank you miko)
  • Everything except for settings (which has its own global table) is now put into the local table _Debug (Thank you tentus)
Version 1.1
  • Fixed the console to be hidden at the start
  • Added _OverlayColor to global settings (see _Settings() for a list of settings) Changed location as of 1.1.5 to _DebugSettings.Settings()
Version 1.0
  • Initial version
Attachments
lovedebug.lua
(13.21 KiB) Downloaded 124 times
Help us help you: attach a .love.
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

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

Post by Ranguna259 »

Found some bugs:
"Suppresses auto-complete when in the middle of an identifier." If you press tab in the middle of a word, "xpcall' will appear
If you press (exemple) "f" and then backspace it the autocomplete will stay there. (This only happens in the biggining of the input)

EDIT:
"Up and down change which auto-complete option you're going to select." Could you make it so that that only happens when there's an auto-complete on the screen, because you removed the "last command restore" functionality
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
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 »

Ranguna259 wrote:Found some bugs:
"Suppresses auto-complete when in the middle of an identifier." If you press tab in the middle of a word, "xpcall' will appear
If you press (exemple) "f" and then backspace it the autocomplete will stay there. (This only happens in the biggining of the input)
I'll fix those. :)
Ranguna259 wrote:"Up and down change which auto-complete option you're going to select." Could you make it so that that only happens when there's an auto-complete on the screen, because you removed the "last command restore" functionality
It... should have that behaviour, yes. I'll check it out. (Also: you can move through history with shift+up and shift+down, even when there is an auto-complete thingy.

EDIT: oh, I see. I forgot to release 1.2.9. Here it is:
lovedebug.lua
1.2.9
(14.23 KiB) Downloaded 157 times
Changelog
Version 1.2.9 (Not Official) by Robin
  • Some more cleaning up of the code.
  • Fixes auto-complete options not being reset in certain conditions.
  • Adds a command history, navigatable with up and down arrow keys. This conflicts with selection of auto-complete options, but you can force history navigation by using shift+up and shift+down.
  • Reworks error-checking in entered commands. A nice benefit is that the [string "possibly a long command"]:1: part no longer shows up, which just duplicated something that was printed right before.
Version 1.2.8 (Not Official) by Robin
  • Improves _Debug.findLocation (including: no more loadstring, no __index side-effects, finding object:methods).
  • Improves _Debug.updateProposals (only valid identifiers are proposed, keywords are proposed if there is no preceding . or :).
  • Adds support for the home and end keys.
  • Cleans up some dead code.
  • Now only allows you to enter characters in ASCII, because the rest of the library handles non-ASCII unicode very poorly.
  • Auto-complete now works when inserting text in the middle instead of only at the end.
  • Up and down change which auto-complete option you're going to select.
  • Much better drawn auto-complete options.
  • Suppresses auto-complete when in the middle of an identifier.
Version 1.2.7 (Not Official) by Robin
  • Brings back keyRepeat, in a way that doesn't interfere with the game.
  • Fixes printing multiple things in 3 ways (see if you can find them all!).
  • Syntax errors in commands now get a sensible error message.
  • Tab completion now only done when the overlay is visible.
  • Removes a useless loop in _Debug.findLocation.
  • Uses multiple argument form of love.keyboard.isDown in _Debug.handleKey.
Version 1.2.6 (Not Official) by Robin
  • Removes keyRepeat, because that shit's evil.
  • Fixes "double click" bug.
  • Fixes indentation.
Version 1.2.5 (Not Official) by Eamonn
  • We now have repetitive keyboard behavior, AWESOME
Version 1.2.4 (Not Official) by Ranguna259
  • Added a new functionality that jumps you to the last output in the conole when you provide a command
Version 1.2.3 (Not Official) by Walz.
  • Fixed a font related bug
Version 1.2.2 (Not Official) by Ranguna259
  • Added a new functionality that enables you to jump right to the bottom of the console by pressing the middle mouse button.
Version 1.2.1 (Not Official) by Qcode
  • Fixed some bugs
  • Added a new functionality that autocompletes the variable to the current proposal by pressing tab
Version 1.2 (Not Official) by Qcode
  • Converted to LÖVE 0.8.0
  • Added a new functionality that enables you to change the 'f8' key to what you want by changing the _lovedebugpresskey='the key you want'
Version 1.1.5
  • Added Shift + F8 console opening, the old one still remains (Thank you miko)
  • Everything except for settings (which has its own global table) is now put into the local table _Debug (Thank you tentus)
Version 1.1
  • Fixed the console to be hidden at the start
  • Added _OverlayColor to global settings (see _Settings() for a list of settings) Changed location as of 1.1.5 to _DebugSettings.Settings()
Version 1.0
  • Initial version
Last edited by Robin on Thu Sep 12, 2013 9:15 am, edited 1 time in total.
Help us help you: attach a .love.
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

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

Post by Ranguna259 »

Command history, I was thinking of implementing that :rofl:
Yep that fixed them.

lovedebug 1.3 LiveCoding™ here we go :P (probably gonna take a while, I still need to undestand how all it all works)
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

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

Post by Ranguna259 »

And this needs to be updated, first glance it gives error on line 190 saying that it's trying to compar number with boolean but I think lovedebug's main game loops also needs to be updated.

EDIT: Fixed love.run() but I don't know how I'm going to fix the keys since the code's based on unicodes and 0.9.0 removed the unicode of love.keypressed(). Any ideas ?
lovedebug.lua
(14.38 KiB) Downloaded 130 times
EDIT2: The keys are fixed, I'll upload the new lovedebug with a little new feature in a few hours.
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

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

Post by Ranguna259 »

YOU CAN NOW DO LIVE CODING WITH LÖVE !!!!
It is finaly done, live coding with LÖVE is now possible thanks to lovedebug :rofl:
Added to GitHub.

Things that need to be done: add 'ERROR' prefixes to the errors that appear when reloading the code.

Changelog
Version 1.3 (Not Official) by Ranguna259
  • Converted to LÖVE 0.9.0
  • To jump to the bottom of the console you now have to press lCtrl+middle mouse buttons instead of just the middle mouse button.
  • You can now do code hotswapping by accessing the console and by pressing the F5 button.
  • Added two new variables to _DebugSettings, 'LiveFile' and 'LiveReset', see _DebugSettings.Settings() for more information.
Version 1.2.9 (Not Official) by Robin
  • Some more cleaning up of the code.
  • Fixes auto-complete options not being reset in certain conditions.
  • Adds a command history, navigatable with up and down arrow keys. This conflicts with selection of auto-complete options, but you can force history navigation by using shift+up and shift+down.
  • Reworks error-checking in entered commands. A nice benefit is that the [string "possibly a long command"]:1: part no longer shows up, which just duplicated something that was printed right before.
Version 1.2.8 (Not Official) by Robin
  • Improves _Debug.findLocation (including: no more loadstring, no __index side-effects, finding object:methods).
  • Improves _Debug.updateProposals (only valid identifiers are proposed, keywords are proposed if there is no preceding . or :).
  • Adds support for the home and end keys.
  • Cleans up some dead code.
  • Now only allows you to enter characters in ASCII, because the rest of the library handles non-ASCII unicode very poorly.
  • Auto-complete now works when inserting text in the middle instead of only at the end.
  • Up and down change which auto-complete option you're going to select.
  • Much better drawn auto-complete options.
  • Suppresses auto-complete when in the middle of an identifier.
Version 1.2.7 (Not Official) by Robin
  • Brings back keyRepeat, in a way that doesn't interfere with the game.
  • Fixes printing multiple things in 3 ways (see if you can find them all!).
  • Syntax errors in commands now get a sensible error message.
  • Tab completion now only done when the overlay is visible.
  • Removes a useless loop in _Debug.findLocation.
  • Uses multiple argument form of love.keyboard.isDown in _Debug.handleKey.
Version 1.2.6 (Not Official) by Robin
  • Removes keyRepeat, because that shit's evil.
  • Fixes "double click" bug.
  • Fixes indentation.
Version 1.2.5 (Not Official) by Eamonn
  • We now have repetitive keyboard behavior, AWESOME
Version 1.2.4 (Not Official) by Ranguna259
  • Added a new functionality that jumps you to the last output in the conole when you provide a command
Version 1.2.3 (Not Official) by Walz.
  • Fixed a font related bug
Version 1.2.2 (Not Official) by Ranguna259
  • Added a new functionality that enables you to jump right to the bottom of the console by pressing the middle mouse button.
Version 1.2.1 (Not Official) by Qcode
  • Fixed some bugs
  • Added a new functionality that autocompletes the variable to the current proposal by pressing tab
Version 1.2 (Not Official) by Qcode
  • Converted to LÖVE 0.8.0
  • Added a new functionality that enables you to change the 'f8' key to what you want by changing the _lovedebugpresskey='the key you want'
Version 1.1.5
  • Added Shift + F8 console opening, the old one still remains (Thank you miko)
  • Everything except for settings (which has its own global table) is now put into the local table _Debug (Thank you tentus)
Version 1.1
  • Fixed the console to be hidden at the start
  • Added _OverlayColor to global settings (see _Settings() for a list of settings) Changed location as of 1.1.5 to _DebugSettings.Settings()
Version 1.0
  • Initial version
Attachments
lovedebug.lua
lovedebug 1.3
(15.81 KiB) Downloaded 117 times
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests