From nicktrout at shaw.ca Mon Feb 2 02:23:37 2004 From: nicktrout at shaw.ca (Nick Trout) Date: Sun, 01 Feb 2004 23:23:37 -0800 Subject: [q2x] OT: Lua questions References: <200413020285.566029@GATEWAY> Message-ID: <002001c3e95d$7994efa0$6400a8c0@quith1> >> You can do this with metatables. >That's a run time thing, not compile time. Yes. >> BTW I've almost got the flyer converted over to Lua in q2x. >They not keep you busy up at that studio? =) This is hobby time! :) >> written a Python script to generate an auto binding wrapper for the >> q2x stuff. Even after the refactoring Quake seems quite hardcoded. > It is still very hardcoded, and it's not done being refactored. good. >> going to be too much work for me to convert all of the monsters > I was actually envisioning 100% of the game logic in Lua, like this: > gamex86.dll => gameluax86.dll Do you mean renamed from "gamex86.dll => gameluax86.dll"? If so, this is trivial, but if you mean an additional DLL, then this could be trouble, i.e. common game code will have to be factored out etc. > Same interface, so the server doesn't notice any change, it's just >talking to the Lua subsystem. The Lua subsystem, however, talks to >all its own Lua modules, and provides entry points for the Lua stuff >to do heavy-lifting, i.e. kernel traps. I think we're sort of on the same wavelength. Yep. So the server doesnt know there's Lua there. And because I've wrapped the C calls in a seperate binding file, not altered them, C and Lua monsters can coexist. I'm just doing the bare minimum of work to get the monster logic working working at the moment. I'm taking the AI calls from the monster and mmove type and adding Lua bindings for callbacks from C -> Lua and binding C calls that Lua needs for Lua->C. Perhaps we should think about unit testing if you have significant refactoring in mind and you dont want to break Lua. This would be interesting research for me, and possibly you. Extreme programming and all that... Nick From hook_l at pyrogon.com Mon Feb 2 11:39:58 2004 From: hook_l at pyrogon.com (Brian Hook) Date: Mon, 2 Feb 2004 11:39:58 -0500 Subject: [q2x] OT: Lua questions In-Reply-To: <002001c3e95d$7994efa0$6400a8c0@quith1> Message-ID: <200422113958.283102@GATEWAY> > I think we're sort of on the same wavelength. Yep. So the server > doesnt know there's Lua there. And because I've wrapped the C calls > in a seperate binding file, not altered them, C and Lua monsters > can coexist. right...I think. It might be easier to use the CTF game as a base line, since it lacks all the monsters. Brian From nick at rockstarvancouver.com Mon Feb 2 13:40:32 2004 From: nick at rockstarvancouver.com (Nick Trout) Date: Mon, 2 Feb 2004 10:40:32 -0800 Subject: [q2x] OT: Lua questions Message-ID: <911F8C8EB7A8084AAEDD55CEDC54D8F84B0C8C@iggy.rockstarvancouver.com> > > I think we're sort of on the same wavelength. Yep. So the server > > doesnt know there's Lua there. And because I've wrapped the C calls > > in a seperate binding file, not altered them, C and Lua monsters > > can coexist. > > right...I think. > > It might be easier to use the CTF game as a base line, since it lacks > all the monsters. I hadn't thought of that. I don't know how I'd test that though? I suppose both parts will have to work in the end. I don't know exactly which functions and variables I have to expose to get everything working in Lua so I'm doing it a bit at a time. Its not an exact analogue either, I'm trying to beautify the API as I go as well! From nicktrout at shaw.ca Sun Feb 8 22:57:41 2004 From: nicktrout at shaw.ca (Nick Trout) Date: Sun, 08 Feb 2004 19:57:41 -0800 Subject: [q2x] OT: Lua questions References: <200422113958.283102@GATEWAY> Message-ID: <002301c3eec0$de6a3620$6400a8c0@quith1> >It might be easier to use the CTF game as a base line, since it lacks >all the monsters. I suppose part of my motivation for tackling the game part is to play Q2 with Lua monsters! Is there anything in CTF that would have to be merged into the game dll to allow CTF functionality to be done in the game DLL. i.e. you dont want to have multiple DLLs with a Lua scripted game, you just want to swap the Lua scripts. Guess the noise levels are rising about the Lua C API. I'm getting emails asking questions now. Should try and fill in some blanks on the wiki about Lua C programming. I have this crazy idea about writing a book about it at the moment. I like writing, technical or not, I've never written a book though. There are other texts out there with Lua info in them, but none really have much useful information. It would be nice to have a "Lua gems" with contribs from Lua expert users and everyone has a different angle on the language. Nick From theoddone33 at icculus.org Sun Feb 8 23:08:26 2004 From: theoddone33 at icculus.org (Dan Olson) Date: Sun, 8 Feb 2004 22:08:26 -0600 Subject: [q2x] OT: Lua questions In-Reply-To: <002301c3eec0$de6a3620$6400a8c0@quith1> References: <200422113958.283102@GATEWAY> <002301c3eec0$de6a3620$6400a8c0@quith1> Message-ID: <20040209040826.GA15165@localhost> On Sun, Feb 08, 2004 at 07:57:41PM -0800, Nick Trout wrote: > Guess the noise levels are rising about the Lua C API. I'm getting emails > asking questions now. Should try and fill in some blanks on the wiki about > Lua C programming. I have this crazy idea about writing a book about it at > the moment. I like writing, technical or not, I've never written a book > though. There are other texts out there with Lua info in them, but none > really have much useful information. It would be nice to have a "Lua gems" > with contribs from Lua expert users and everyone has a different angle on > the language. I bet O'Reilly's arm wouldn't have to be twisted much to publish an "Algorithms in Lua" book, or something similar. A book on just the C API would seem a little thin to me. -- Dan Olson From hook_l at pyrogon.com Sun Feb 8 23:11:55 2004 From: hook_l at pyrogon.com (Brian Hook) Date: Sun, 8 Feb 2004 23:11:55 -0500 Subject: [q2x] OT: Lua questions In-Reply-To: <002301c3eec0$de6a3620$6400a8c0@quith1> Message-ID: <200428231155.201678@GATEWAY> > I suppose part of my motivation for tackling the game part is to > play Q2 with Lua monsters! Well, there's still a lot of interesting game-specific stuff that isn't monsters, e.g. weapons. Lua weapons would be fun as well =) > Is there anything in CTF that would have to be merged into the game > dll to allow CTF functionality to be done in the game DLL. i.e. you > dont want to have multiple DLLs with a Lua scripted game, you just > want to swap the Lua scripts. CTF is just a separate game DLL, i.e. game_ctfx86.dll or something like that. > Guess the noise levels are rising about the Lua C API. You mean the fact that it's poorly documented and confusing? =) > emails asking questions now. Should try and fill in some blanks on > the wiki about Lua C programming. the lua_pcall thing is a big one, it seems like that has caused a lot of confusion for people (myself included). > I have this crazy idea about > writing a book about it at the moment. Go for it! It's hard work with little payoff, but hey, you can you're published, and it increases your marketability on the off chance you end up out on the open market someday. Roberto's book is "pretty good", but it's, um, "concise". It could have really stood to be twice its size covering the same area. Common Lua idioms are something that people don't know enough about. Brian From hook_l at pyrogon.com Sun Feb 8 23:13:32 2004 From: hook_l at pyrogon.com (Brian Hook) Date: Sun, 8 Feb 2004 23:13:32 -0500 Subject: [q2x] OT: Lua questions In-Reply-To: <20040209040826.GA15165@localhost> Message-ID: <200428231332.206577@GATEWAY> > I bet O'Reilly's arm wouldn't have to be twisted much to publish an > "Algorithms in Lua" book, or something similar. They turned down Roberto, saying that the market wasn't large enough. Freakin' Premier Press didn't even pick it up, so they had to self-publish. I offered to get him in touch with someone at No Starch, but Roberto never responded to me. Brian From nick at rockstarvancouver.com Mon Feb 9 13:39:17 2004 From: nick at rockstarvancouver.com (Nick Trout) Date: Mon, 9 Feb 2004 10:39:17 -0800 Subject: [q2x] OT: Lua questions Message-ID: <911F8C8EB7A8084AAEDD55CEDC54D8F851FC7E@iggy.rockstarvancouver.com> BH> > I suppose part of my motivation for tackling the game part is to > > play Q2 with Lua monsters! > Well, there's still a lot of interesting game-specific stuff that > isn't monsters, e.g. weapons. Lua weapons would be fun as well =) The whole thing is fun! I really loved Quake and Quake2. For some reason I never got round to Quake3, maybe too much work at the time. I'm possibly more of a Doom2 fan! That would be fun in Lua! Would probably run on handhelds as well. Mmmmm. Anyway, one thing at a time. > CTF is just a separate game DLL, i.e. game_ctfx86.dll or something > like that. I was wondering if any code from that DLL would have to migrate to the game DLL in order that CTF could be done in Lua in the game DLL (i.e. as Lua implements game features, not the system stuff). This is something I wouldn't be too keen on moving if there is anything. I don't really want to get sucked into maintaining the "system" stuff. > > Guess the noise levels are rising about the Lua C API. > You mean the fact that it's poorly documented and confusing? =) It is, and after doing work on Q2X I'm finding parts of it are quite cryptic and you need to have insight to understand why something is like that (which perhaps I have more of because I've been on lua-l for a number of years), which is a classic sign of a lack of documentation! > > emails asking questions now. Should try and fill in some blanks on > > the wiki about Lua C programming. > the lua_pcall thing is a big one, it seems like that has caused a lot > of confusion for people (myself included). Hopefully there is a clearer picture now. > > I have this crazy idea about > > writing a book about it at the moment. > > Go for it! It's hard work with little payoff, but hey, you can you're > published, and it increases your marketability on the off chance you > end up out on the open market someday. > > Roberto's book is "pretty good", but it's, um, "concise". It could > have really stood to be twice its size covering the same area. Common > Lua idioms are something that people don't know enough about. Perhaps I could use q2x as a working example for a book as well. Mmmm. We'll see, perhaps I could fire off some emails to Roberto asking him how the book is working out. Nick From nick at rockstarvancouver.com Mon Feb 9 13:45:52 2004 From: nick at rockstarvancouver.com (Nick Trout) Date: Mon, 9 Feb 2004 10:45:52 -0800 Subject: [q2x] OT: Lua questions Message-ID: <911F8C8EB7A8084AAEDD55CEDC54D8F851FC7F@iggy.rockstarvancouver.com> > From: Dan Olson [mailto:theoddone33 at icculus.org] > I bet O'Reilly's arm wouldn't have to be twisted much to publish an > "Algorithms in Lua" book, or something similar. > > A book on just the C API would seem a little thin to me. Actually, I dispute that! When you get into the more complex aspects of Lua, binding and the API there is plenty of room for discussion. E.g. strategies for binding, efficiency etc. This hasn't been covered in any books I've read and is more applicable to games. I don't think most game are (or should) be writing huge amount of algorithmic code in Lua. I quite like doing research, and I'd see this as a research project, I really couldn't see it being a cash cow. I think I'd have to be careful, having a conflict of interests with work. Not that I'd ever release any information about what we're doing, but that time and effort are conflicted. I've done the wiki docs and q2x work in hobby time though. Nick From theoddone33 at icculus.org Mon Feb 9 14:39:35 2004 From: theoddone33 at icculus.org (theoddone33 at icculus.org) Date: Mon, 9 Feb 2004 14:39:35 -0500 Subject: [q2x] OT: Lua questions In-Reply-To: <911F8C8EB7A8084AAEDD55CEDC54D8F851FC7E@iggy.rockstarvancouver.com> References: <911F8C8EB7A8084AAEDD55CEDC54D8F851FC7E@iggy.rockstarvancouver.com> Message-ID: <1076355575.4027e1f77b4fe@mail.icculus.org> Quoting Nick Trout : > BH> > I suppose part of my motivation for tackling the game part is to > > > play Q2 with Lua monsters! > > Well, there's still a lot of interesting game-specific stuff that > > isn't monsters, e.g. weapons. Lua weapons would be fun as well =) > > The whole thing is fun! I really loved Quake and Quake2. For some reason > I never got round to Quake3, maybe too much work at the time. I'm > possibly more of a Doom2 fan! That would be fun in Lua! Would probably > run on handhelds as well. Mmmmm. Anyway, one thing at a time. I'd actually really like to do something similar to Doom engine games. I'd like nothing more than a high-quality, cross-platform Doom engine that runs all 5 games as Lua code. (The 5 games being Heretic, Hexen, Doom, Doom 2, and Strife... with all relevant expansion packs) I've been screwing with Heretic and Hexen for about 5 years now, off and on. Actually doing something useful with them would be just about the coolest thing ever. From hook_l at pyrogon.com Tue Feb 17 15:24:00 2004 From: hook_l at pyrogon.com (Brian Hook) Date: Tue, 17 Feb 2004 15:24:00 -0500 Subject: Scripting article In-Reply-To: <1076355575.4027e1f77b4fe@mail.icculus.org> Message-ID: <200421715240.417571@GATEWAY> http://www.bookofhook.com/Article/GameDevelopment/TheSecretLifeofGameS cript.html If you guys could, please read and let me know if you have any comments. Brian From nick at rockstarvancouver.com Fri Feb 20 18:31:34 2004 From: nick at rockstarvancouver.com (Nick Trout) Date: Fri, 20 Feb 2004 15:31:34 -0800 Subject: [q2x] Scripting article Message-ID: <911F8C8EB7A8084AAEDD55CEDC54D8F84B0DA4@iggy.rockstarvancouver.com> Have you looked at LuaPlus? > -----Original Message----- > From: Brian Hook [mailto:hook_l at pyrogon.com] > Sent: Tuesday, February 17, 2004 12:24 PM > To: q2x at icculus.org > Subject: [q2x] Scripting article > > http://www.bookofhook.com/Article/GameDevelopment/TheSecretLifeofGameS > cript.html > > If you guys could, please read and let me know if you have any > comments. > > Brian > From hook_l at pyrogon.com Fri Feb 20 18:44:15 2004 From: hook_l at pyrogon.com (Brian Hook) Date: Fri, 20 Feb 2004 18:44:15 -0500 Subject: [q2x] Scripting article In-Reply-To: <911F8C8EB7A8084AAEDD55CEDC54D8F84B0DA4@iggy.rockstarvancouver.com> Message-ID: <2004220184415.323038@GATEWAY> > Have you looked at LuaPlus? Hadn't even heard of it until now. Wow, very cool (assuming it works =) ). Brian