Page 1 of 1

Rapid Programming and Iteration

Posted: Tue Jul 31, 2012 10:59 pm
by Inny
A few days ago, the Lua Mailing List had a thread in praise of Lua game development because of the reduced code-compile-test iteration cycle. Specifically, the game author called out performing live code injection as the big thing that he really liked. And in today's Reddit AMA with Notch, he calls code hot swapping as his favorite feature in Java/Eclipse. So, I feel like raising the discussion here: does anyone use this technique, and if so, how?

A very long time ago, I wrote a game engine in C and Lua, and would kind of perform this technique. Specifically, I wasn't using require to load code, I was nil'ing out variables between level loading, and using dofile (we would use love.filesystem.load). In my current stuff, I'm not doing any form of hot-swap.

What does everyone else do?

Re: Rapid Programming and Iteration

Posted: Wed Aug 01, 2012 8:35 am
by slime
My data files auto reload in-game when changed (e.g. weapon stat definitions). I don't like doing real live code changes (aside from minor things, which can be accomplished using debug.debug()) in Lua, especially because it tends to be really fast already just to quit the game and reload after making a change.

Re: Rapid Programming and Iteration

Posted: Wed Aug 01, 2012 9:00 am
by bartbes
I agree with slime, I'm more of a "clean testing environment" guy, though I'd like to make some stuff hot-swappable. Another thing I generally do, is make the game read its starting gamestate from the command line, that way I don't have to navigate menus, or sit through intros (though those should always be skippable, imo).

Re: Rapid Programming and Iteration

Posted: Wed Aug 01, 2012 1:27 pm
by OmarShehata
Bret Victor shows how brilliant such a technique can be here:

http://www.wimp.com/videogames/

And has a 1 hour long presentation talking about how crucial this is as a design principle here: http://vimeo.com/36579366

Re: Rapid Programming and Iteration

Posted: Wed Aug 01, 2012 5:18 pm
by nate8nate
LICK is a library that allows you to do something similar to hot code swapping, although it is a bit limited.

Re: Rapid Programming and Iteration

Posted: Thu Aug 02, 2012 3:19 am
by Inny
nate8nate wrote:LICK is a library that allows you to do something similar to hot code swapping, although it is a bit limited.
Interesting design there. I'm going to have to give it a try, or see if I can do something similar.
bartbes wrote:I agree with slime, I'm more of a "clean testing environment" guy, though I'd like to make some stuff hot-swappable. Another thing I generally do, is make the game read its starting gamestate from the command line, that way I don't have to navigate menus, or sit through intros (though those should always be skippable, imo).
I generally do this in vim, :!love, so that would totally be doable :P

Re: Rapid Programming and Iteration

Posted: Fri Aug 03, 2012 4:19 am
by paulclinger
OmarShehata wrote:Bret Victor shows how brilliant such a technique can be here:

http://www.wimp.com/videogames/

And has a 1 hour long presentation talking about how crucial this is as a design principle here: http://vimeo.com/36579366
I also got inspired by Bret Victor's presentation and added something similar to the Lua IDE I've been working on: http://notebook.kulchenko.com/zerobrane ... ctor-style. There is also Love2d support in the IDE and live coding works for love2d scripts (although I don't have a screencast with that functionality, only with love2d debugging: http://notebook.kulchenko.com/zerobrane ... -debugging).

Paul.

Re: Rapid Programming and Iteration

Posted: Sun Aug 05, 2012 8:59 am
by T-Bone
While I always want to be able to start my game straight from the text editor (like gedit allows) I would never want something like that. You want to look at every iteration of your program as a program of its own, and see its shortcomings and problems, and then work on them.