Page 1 of 2
Hot Reload
Posted: Wed Aug 15, 2012 10:32 pm
by racarate
Hey everybody!
I just watched this video:
http://vimeo.com/36579366
and I also re-watched a little bit of Notch's Ludum Dare 22 live stream, and both environments seem to rely on code updating without restarting the program.
I imagine this is possible with LOVE2D -- has anybody tried it?
-Nick
Re: Hot Reload
Posted: Thu Aug 16, 2012 6:46 am
by Robin
I haven't tried it, but I think it should be possible if you have a scaffolding in your main.lua, and the actual game is located in a subdirectory or something.
It would probably be a good idea to reload the code once focus has been returned to the game:
Code: Select all
function love.focus(f)
if f then
-- reload code
end
fakelove.focus(f) -- this calls the love.focus in the game
end
Re: Hot Reload
Posted: Thu Aug 16, 2012 9:02 am
by Petunien
There's a library called LICK:
https://github.com/headchant/lick
It enables live coding for LÖVE.
But it doesn't work that well on all projects, respectively on advanced ones.
Re: Hot Reload
Posted: Thu Aug 16, 2012 7:01 pm
by Inny
I had a thread about this recently (it's on page 2,
link), and the summary of it is basically use LICK, or use the love.load version that accepts an arg table parameter, and read out an option that'll move you to the level you wanted to test. I think I like the second option better.
live-coding still sounds sweet though, if you figure out anything, let us know.
Re: Hot Reload
Posted: Tue Aug 21, 2012 6:32 pm
by paulclinger
I have live coding in the IDE I've been working on
ZeroBraneStudio and did a screencast based on Bret Victor's presentation about three months ago (
http://notebook.kulchenko.com/zerobrane ... ctor-style). The IDE also provides Löve integration and the same live coding can be used with Löve too, as shown in this screencast:
http://notebook.kulchenko.com/zerobrane ... -with-love.
The mechanism is different from Lick as the application doesn't have any Löve specific logic and runs under a "normal" debugger, which has its own advantages and disadvantages. The main disadvantage is that I can't intercept run-time errors at the moment (which is something I'm working on). All the compilation errors are intercepted and reported in the IDE.
Re: Hot Reload
Posted: Mon Aug 27, 2012 4:40 pm
by racarate
Thanks for all the replies! Looks like I have a lot of reading to do...
Re: Hot Reload
Posted: Wed Jul 23, 2014 10:27 pm
by dusoft
racarate wrote:Thanks for all the replies! Looks like I have a lot of reading to do...
This enables hot reload:
package.loaded[state]=false
require(state)
state = e.g. "main"
Re: Hot Reload
Posted: Wed Jul 23, 2014 10:57 pm
by josefnpat
I'm surprised no one mentioned RXI's Lurker project
https://github.com/rxi/lurker
Re: Hot Reload
Posted: Thu Jul 24, 2014 1:54 am
by dusoft
very nice, josefnpat! basically same idea as mine, just somebody spent more time on prototyping it for actual debugging :-)
Re: Hot Reload
Posted: Thu Jul 24, 2014 3:28 am
by Ranguna259
LICK is outdated,
LoveDebug uses LICK's (updated) code for hotswapping.