From hook_l at pyrogon.com Wed May 14 16:54:04 2003 From: hook_l at pyrogon.com (Brian Hook) Date: Wed, 14 May 2003 13:54:04 -0700 Subject: test Message-ID: <200351413544.452045@centrino> From nick at rockstarvancouver.com Wed May 14 17:11:18 2003 From: nick at rockstarvancouver.com (Nick Trout) Date: Wed, 14 May 2003 14:11:18 -0700 Subject: Lua Message-ID: <911F8C8EB7A8084AAEDD55CEDC54D8F810D437@iggy.rockstarvancouver.com> > > >I'm interested in embedding Lua in the Quake2 engine to play around > > >with Lua scripting. I got the latest code from CVS, mirrored your MSVC project workspace structure, and built q2x. The software version runs just fine. I couldn't get the GL version to compile because of a missing "GL/glext.h" file. I can't seem to find this file anywhere. I take it from a post you made on the Lua mailing list a while ago that you want to replace the guts of q2x with Lua to perform all of the cvar and command functionality. I could help with this if you like. It might be best to phase in Lua replacement code one area at a time, e.g.: * replace cvar functionality (src/common/q_cvar.c) with access to Lua tables which are read from config files, or set from command prompt. There could be several ways of doing this, e.g., functionally or by using Lua tables and adding metamethods. * replace cmd functionality with Lua calls (src/common/q_cmd.c) - provide bindings to q2x core functionality. Should bindings be generated automatically? I read you only want to use C which I can understand. Here's where I need to do more reading... * Create binding to edict (entity dictionary?) and other core game APIs to allow recoding of AI in Lua. * Put in code for creating mframe arrays from Lua tables, rather than statically compiling into the game. Edict binding would allow control of AI entities. * replace src/game/m_.c AI one at a time. This is a little na?ve and makes lots of assumptions. The codebase would probably need a significant refactoring and plenty binding code in order for this to happen. Are there any details on the "luagame" module mentioned on the q2x description page? Where were you thinking of drawing the binding line? What might help your project quite significantly is a wiki. They are great for discussing ideas, documentation, and retaining a history of descision making. One could be set up for the whole Icculus site (IcculiWiki?) or just for q2x (Qwiki?!) ? I very much like MoinMoin (http://moin.sf.net/). And BTW, what a great game Quake is! Nick From hook_l at pyrogon.com Wed May 14 17:25:15 2003 From: hook_l at pyrogon.com (Brian Hook) Date: Wed, 14 May 2003 14:25:15 -0700 Subject: [q2x] Lua In-Reply-To: <911F8C8EB7A8084AAEDD55CEDC54D8F810D437@iggy.rockstarvancouver.com> Message-ID: <2003514142515.970589@centrino> >I got the latest code from CVS, mirrored your MSVC project workspace >structure, and built q2x. The software version runs just fine. I'm not sure how up to date the q2x code base is. >couldn't get the GL version to compile because of a missing >"GL/glext.h" file. I can't seem to find this file anywhere. you'll have to hunt for it somewhere on sgi.com If you can't find it there, let me know and I'll try to dig it up. Dan Olson, who should also be getting these messages (Dan, you alive?), also wanted to dork with the Lua implementation, but until the SDL stuff is done (*cough*) I'm really hesitant to push ahead on anything at this point. Getting the "single SDL source" version up and running is our base camp we're trying to achieve. www.q2x.org in case you haven't seen it My general plan has been to maintain the C game capability in parallel with the Lua functionality. They'll adhere to the same API that's in place now, the difference is when you load up the Lua version, it starts up the Lua VM and loads up the game in .lua files. Doing this incrementally will take a lot of forethought, which I had done at some point but since been distracted away from =) My general idea was that the base version would: 1. have the rest of the dir tree cleaned up 2. have the rest of the code cleaned up, including SDL-ified Once we were happy with the general structure, THEN we'd shove in Lua functionality a bit at a time, bottom up on the game side. >Are there any details on the "luagame" module mentioned on the q2x >description page? Where were you thinking of drawing the binding >line? The binding line would be below that of the actual game API as defined by Q2. This way a q2x server itself would not need Lua in any form, which I think would be a nice break line. As for a Wiki, I'm not sure we're quite there yet. =) Brian From nick at rockstarvancouver.com Wed May 14 17:48:57 2003 From: nick at rockstarvancouver.com (Nick Trout) Date: Wed, 14 May 2003 14:48:57 -0700 Subject: [q2x] Lua Message-ID: <911F8C8EB7A8084AAEDD55CEDC54D8F80CB455@iggy.rockstarvancouver.com> > >I got the latest code from CVS, mirrored your MSVC project workspace > >structure, and built q2x. The software version runs just fine. > > I'm not sure how up to date the q2x code base is. What's out of date: The SDL stuff? Are there any plans to update this soon? > >couldn't get the GL version to compile because of a missing > >"GL/glext.h" file. I can't seem to find this file anywhere. > you'll have to hunt for it somewhere on sgi.com If you can't find it > there, let me know and I'll try to dig it up. I had a quick look and it also doesn't turn up on the search. Since its only one file could you post it to me or the list please. > Dan Olson, who should also be getting these messages (Dan, you > alive?), also wanted to dork with the Lua implementation, but until > the SDL stuff is done (*cough*) I'm really hesitant to push ahead on > anything at this point. > > Getting the "single SDL source" version up and running is our base > camp we're trying to achieve. > > www.q2x.org in case you haven't seen it It redirects to the icculus page, so I have seen it, thanks. > My general plan has been to maintain the C game capability in > parallel with the Lua functionality. They'll adhere to the same API > that's in place now, the difference is when you load up the Lua > version, it starts up the Lua VM and loads up the game in .lua files. > Doing this incrementally will take a lot of forethought, Agreed. Wouldn't it be simpler to go all Lua? > My general idea was that the base version would: > 1. have the rest of the dir tree cleaned up > 2. have the rest of the code cleaned up, including SDL-ified > Once we were happy with the general structure, THEN we'd shove in Lua > functionality a bit at a time, bottom up on the game side. So I'll either have to be patient or maybe I should just fork the quake2 project rather than q2x. > >Are there any details on the "luagame" module mentioned on the q2x > >description page? Where were you thinking of drawing the binding line? > The binding line would be below that of the actual game API as defined by Q2. This way a q2x server itself would not need Lua in any form, which I think would be a nice break line. No Lua code in the src/server? It would be nice to have a unified cvar/cmd system, rather than a layered system, i.e. Lua sat on cmd. Seems a bit inefficient, maybe confusing, writing a binding to call cmds or having 2 binding systems? > As for a Wiki, I'm not sure we're quite there yet. =) Are you sure? You could have left all your forethoughts as a reminder to you and a guide for others! :-) Nick From hook_l at pyrogon.com Wed May 14 21:33:43 2003 From: hook_l at pyrogon.com (Brian Hook) Date: Wed, 14 May 2003 18:33:43 -0700 Subject: [q2x] Lua In-Reply-To: <911F8C8EB7A8084AAEDD55CEDC54D8F80CB455@iggy.rockstarvancouver.com> Message-ID: <2003514183343.568567@centrino> >What's out of date: The SDL stuff? Are there any plans to update >this soon? I think so. Also, not sure if the "blessed" Lua distro is 5.0 or 5.0alpha yet. >I had a quick look and it also doesn't turn up on the search. Since >its only one file could you post it to me or the list please. http://oss.sgi.com/projects/ogl-sample/ABI/glext.h >Agreed. Wouldn't it be simpler to go all Lua? Depends on what you mean by "simpler"? It would probably be cleaner to go 100% Lua, but that would be a full jumping in on the task instead of consistently having a fallback to the C version. I happen to like having an alternate verification system at all times, I think that makes the porting that much easier. >So I'll either have to be patient or maybe I should just fork the >quake2 project rather than q2x. Right, but since you're interested, I'll get on Dan's case and see what the situation is with the SDL port. >No Lua code in the src/server? Right. The goal is to use Lua, initially, for the game scripting. Once we're comfortable with that level of integration, then >It would be nice to have a unified >cvar/cmd system, rather than a layered system, i.e. Lua sat on cmd. >Seems a bit inefficient, maybe confusing, writing a binding to call >cmds or having 2 binding systems? At the outset there will be some overlap and confusion, but hopefully the final result will be mostly Lua, as you state. Replacing the cvar system by itself would be trivial to do in a non-destructive manner. If you'd like to give that a shot as a first step, that would be very reasonable, since it doesn't impact anything else and there's already a clean interface to the cvar system (ri.cvar*, Cvar_*, etc.). >>As for a Wiki, I'm not sure we're quite there yet. =) >Are you sure? You could have left all your forethoughts as a >reminder to you and a guide for others! :-) Bah, that only weakens the mind =) Brian From nick at rockstarvancouver.com Thu May 15 15:18:42 2003 From: nick at rockstarvancouver.com (Nick Trout) Date: Thu, 15 May 2003 12:18:42 -0700 Subject: [q2x] Lua Message-ID: <911F8C8EB7A8084AAEDD55CEDC54D8F80CB457@iggy.rockstarvancouver.com> > >What's out of date: The SDL stuff? Are there any plans to > update this > >soon? > > I think so. Also, not sure if the "blessed" Lua distro is 5.0 or > 5.0alpha yet. Do you mean the one you have chosen? The official Lua distro is now "5.0 final". I can't see any evidence of Lua code in q2x CVS so its surely not a problem to use 5.0 final. There are changes and bug fixes since alpha so final is really the only choice. > http://oss.sgi.com/projects/ogl-sample/ABI/glext.h Great thanks. > >Agreed. Wouldn't it be simpler to go all Lua? > > Depends on what you mean by "simpler"? It would probably be cleaner > to go 100% Lua, but that would be a full jumping in on the task > instead of consistently having a fallback to the C version. I happen > to like having an alternate verification system at all times, I think > that makes the porting that much easier. I suppose there are two reasons for using Lua here. Firstly to configure q2x, and then secondly as a scripting mechanism through a binding to the game. > >So I'll either have to be patient or maybe I should just fork the > >quake2 project rather than q2x. > Right, but since you're interested, I'll get on Dan's case and see > what the situation is with the SDL port. I have a Lua project (http://doris.sf.net/) which I was going to use for some simple example of coroutines, perhaps a couple of little games. It would be nice to have a proper game engine with sound and networking though. A lot of the open source solutions have a fair amount of dependencies or extranious features though so I think q2x would be a cleaner solution. I managed to get all the components and build it in half an hour or so and I'm sure this could be improved by including the dependent libraries. > >It would be nice to have a unified > >cvar/cmd system, rather than a layered system, i.e. Lua sat on cmd. > >Seems a bit inefficient, maybe confusing, writing a binding to call > >cmds or having 2 binding systems? > > At the outset there will be some overlap and confusion, but hopefully > the final result will be mostly Lua, as you state. Replacing the > cvar system by itself would be trivial to do in a non-destructive > manner. If you'd like to give that a shot as a first step, that > would be very reasonable, since it doesn't impact anything else and > there's already a clean interface to the cvar system (ri.cvar*, > Cvar_*, etc.). I'll look into this. > >>As for a Wiki, I'm not sure we're quite there yet. =) > > >Are you sure? You could have left all your forethoughts as a > reminder > >to you and a guide for others! :-) > > Bah, that only weakens the mind =) Its about communication, I'm not questioning your ability to retain information! I however do forget things! Nick From nicktrout at shaw.ca Fri May 16 12:19:05 2003 From: nicktrout at shaw.ca (Nick Trout) Date: Fri, 16 May 2003 09:19:05 -0700 Subject: client/server versions incorrect Message-ID: <004901c31bc6$defd1b70$9f604f18@quith1> Had a quick look at q2x this morning - now have GL version working (thanks for header). I get: "ERROR: Server returned version 31, not 50." So little difficult to develop and test changes. which comes from: cl_main.c:327: // BIG HACK to let demos from release work with the 3.0x patch!!! if (Com_ServerState() && PROTOCOL_VERSION == 34) { } else if (i != PROTOCOL_VERSION) Com_Error (ERR_DROP,"Server returned version %i, not %i", i, PROTOCOL_VERSION); PROTOCOL_VERSION appears to be defined only once in qcommon.h: #define PROTOCOL_VERSION 50 So I guess the version has some other source? Sorry only had limited time to do this (this project is done in my spare time). Nick From hook_l at pyrogon.com Fri May 16 12:39:13 2003 From: hook_l at pyrogon.com (Brian Hook) Date: Fri, 16 May 2003 09:39:13 -0700 Subject: [q2x] client/server versions incorrect In-Reply-To: <004901c31bc6$defd1b70$9f604f18@quith1> Message-ID: <200351693913.974159@centrino> Crap. Unfortunately my machine with Q2X installed is packed up with the shippers right now and I won't be able to get to it for a few weeks =/ I know that my build is working, but it's possible I haven't checked it in. We weren't expecting new contributors so soon, but now that you're around, I'm making it priority to make this a priority. Brian On Fri, 16 May 2003 09:19:05 -0700, Nick Trout wrote: > >Had a quick look at q2x this morning - now have GL version working >(thanks for header). > >I get: "ERROR: Server returned version 31, not 50." So little >difficult to develop and test changes. > >which comes from: > >cl_main.c:327: > >// BIG HACK to let demos from release work with the 3.0x patch!!! if >(Com_ServerState() && PROTOCOL_VERSION == 34) { } else if (i != >PROTOCOL_VERSION) Com_Error (ERR_DROP,"Server returned version %i, >not %i", i, PROTOCOL_VERSION); > >PROTOCOL_VERSION appears to be defined only once in qcommon.h: > >#define PROTOCOL_VERSION 50 > >So I guess the version has some other source? Sorry only had limited >time to do this (this project is done in my spare time). > >Nick > > > > > > > From nick at rockstarvancouver.com Fri May 16 14:04:27 2003 From: nick at rockstarvancouver.com (Nick Trout) Date: Fri, 16 May 2003 11:04:27 -0700 Subject: [q2x] client/server versions incorrect Message-ID: <911F8C8EB7A8084AAEDD55CEDC54D8F80CB459@iggy.rockstarvancouver.com> > Crap. Unfortunately my machine with Q2X installed is packed up with > the shippers right now and I won't be able to get to it for a few > weeks =/ > I know that my build is working, but it's possible I haven't checked > it in. Oh well. Arriving or leaving?! :) Wonder if I can modify the quake2 project and then just paste it into q2x when you get it working. > We weren't expecting new contributors so soon, but now that you're > around, I'm making it priority to make this a priority. Thanks very much, I'll try and help, but like I say it's a pet project done in my spare time so my contributions may be somewhat eratic. I do have other things to do. I should finish the Lua tutorial and I have plenty on at work. Hopefully tolua5 will appear soon and I can convert Doris and tinker with it. It's a very useful binding tool which could save work work on the game API. And, summer is here, so I should probably stick my head out the door and look at that real world place that you mentioned. I relocated to Vancouver some months ago; it's an amazing place (I took my hard drives out and brought them in my hand luggage ;-D). Nick From hook_l at pyrogon.com Fri May 16 14:08:24 2003 From: hook_l at pyrogon.com (Brian Hook) Date: Fri, 16 May 2003 11:08:24 -0700 Subject: [q2x] client/server versions incorrect In-Reply-To: <911F8C8EB7A8084AAEDD55CEDC54D8F80CB459@iggy.rockstarvancouver.com> Message-ID: <200351611824.356333@centrino> >Oh well. Arriving or leaving?! :) San Diego -> Atlanta. what I would ask of you -- since you're very Lua knowledgeable -- is get distracted with other stuff for a few weeks, and then when I get everything working again dive in headlong =) Brian From nick at rockstarvancouver.com Fri May 16 14:35:31 2003 From: nick at rockstarvancouver.com (Nick Trout) Date: Fri, 16 May 2003 11:35:31 -0700 Subject: [q2x] client/server versions incorrect Message-ID: <911F8C8EB7A8084AAEDD55CEDC54D8F80CB45A@iggy.rockstarvancouver.com> > >Oh well. Arriving or leaving?! :) > > San Diego -> Atlanta. Good luck. > what I would ask of you -- since you're very Lua knowledgeable -- is > get distracted with other stuff for a few weeks, and then when I get > everything working again dive in headlong =) If I can help you with information about Lua then please don't hesitate to contact me. I will endeavour to help you on this project since I think we have similar goals. I have work responsibility which is obviously my priority but this could become my primary hobby project :) You have my contact details... Nick Zzzzzzz....