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?
Rapid Programming and Iteration
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Rapid Programming and Iteration
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.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Rapid Programming and Iteration
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).
- OmarShehata
- Party member
- Posts: 259
- Joined: Tue May 29, 2012 6:46 pm
- Location: Egypt
- Contact:
Re: Rapid Programming and Iteration
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
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
LICK is a library that allows you to do something similar to hot code swapping, although it is a bit limited.
GitHub: https://github.com/nate8nate
Re: Rapid Programming and Iteration
Interesting design there. I'm going to have to give it a try, or see if I can do something similar.nate8nate wrote:LICK is a library that allows you to do something similar to hot code swapping, although it is a bit limited.
I generally do this in vim, :!love, so that would totally be doablebartbes 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).
-
- Party member
- Posts: 227
- Joined: Thu Jun 28, 2012 8:46 pm
Re: Rapid Programming and Iteration
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).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
Paul.
Last edited by paulclinger on Fri Sep 21, 2012 3:06 am, edited 1 time in total.
Re: Rapid Programming and Iteration
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.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Who is online
Users browsing this forum: No registered users and 7 guests