Page 1 of 1
QConstruct (Lua scripting for quake III)
Posted: Fri Jun 11, 2010 6:19 am
by Hxrmn
QConstruct is a quake3 mod that allows anyone with at least some knowledge of the lua programming language to create simple small modifications for the Quake 3 engine without touching a single line of C code. These scripts can be executed in realtime while the game is running, which allows for rapid prototyping.
Through the use of hooks and bindings to the quake3 engine, users can assign their own responses to particular events that happen in-game.
Lua is a high-level programming language, usually used for providing scripting access for lower-level code. (see
http://www.lua.org/pil/)
I have been developing this modification for almost 2 years now. At this point I really need some feedback and possibly some help from testers. The mod is very unorganized but moderately stable and it may take some messing around to figure it out. You can download the mod here
http://code.google.com/p/quakeconstruct/ (Windows Only)
Make sure you read the readme.txt file, it's kind of important.
[lvlshot]http://quakeconstruct.files.wordpress.com/2009/04/shot0009.jpg[/lvlshot]
Development Blog here
http://quakeconstruct.wordpress.com/
Wiki here
http://quakeconstruct.wikispaces.com/
Email here
Hxrmn@comcast.net
Videos here
http://www.youtube.com/view_play_list?p ... 805470729E
Questions, comments, discourse?
Re: QConstruct (Lua scripting for quake III)
Posted: Fri Jun 11, 2010 8:00 am
by Perle
Hi man. Still some work on this? Nice to read from you.
Re: QConstruct (Lua scripting for quake III)
Posted: Fri Jun 11, 2010 8:36 am
by ^misantropia^
Looks neat, Hxrmn. But is there a reason why it's win32-only? A quick peek at the SVN repository indicates you are distributing the Lua interpreter as source. Shouldn't it build on all platforms?
Re: QConstruct (Lua scripting for quake III)
Posted: Fri Jun 11, 2010 9:57 pm
by bludshot
This is cool!
My current project still has a ton of things to be done in it, so, until I get all that done I won't be able to investigate if or how I could make use of this with my project.
So I guess my point is, very cool lua mod, I support the cool stuff you are doing, but I won't be able to play with it being knee deep in my own mod currently.
Re: QConstruct (Lua scripting for quake III)
Posted: Sat Jun 12, 2010 12:51 am
by Hxrmn
^misantropia^ wrote:Looks neat, Hxrmn. But is there a reason why it's win32-only? A quick peek at the SVN repository indicates you are distributing the Lua interpreter as source. Shouldn't it build on all platforms?
It should build on all platforms but I still haven't decided on how to do it.
Currently it's loaded via DLL which is a windows only thing.
I could use static libraries or just integrate the lua source code with the mod's source code (it didn't work the first time I tried it).
Might branch the svn for that so the changes are easily reversible.
Re: QConstruct (Lua scripting for quake III)
Posted: Mon Jun 14, 2010 11:27 am
by Eraser
Is there some kind of API described somewhere that we can code against?
Re: QConstruct (Lua scripting for quake III)
Posted: Tue Jun 15, 2010 1:05 am
by Hxrmn
Eraser wrote:Is there some kind of API described somewhere that we can code against?
I'm working on one here
http://quakeconstruct.wikispaces.com/.
It's far from finished, but I'll get the basics finished soon.
Re: QConstruct (Lua scripting for quake III)
Posted: Tue Jun 15, 2010 8:49 am
by Eraser
If it's stable enough with a proper API description I'd be very interested in messing around with it

I'm not familiar with Lua though, but never too old to learn. Why the choice for Lua by the way and not, for instance, JavaScript?
Re: QConstruct (Lua scripting for quake III)
Posted: Tue Jun 15, 2010 9:37 pm
by Hxrmn
Eraser wrote:If it's stable enough with a proper API description I'd be very interested in messing around with it

I'm not familiar with Lua though, but never too old to learn. Why the choice for Lua by the way and not, for instance, JavaScript?
I went into the project knowing Lua, not Javascript (although I do know some javascript now). Lua seemed like the logical choice at the time. Plus Lua is faster than Javascript.
Btw, I will be working on the documentation wiki more this week.
Re: QConstruct (Lua scripting for quake III)
Posted: Wed Jun 16, 2010 8:05 am
by ^misantropia^
Hxrmn wrote:Plus Lua is faster than Javascript.

Check out Google's V8 JavaScript engine, the one used in Google Chrome. I bet you a sixpack it'll outperform Lua on most tests.
Re: QConstruct (Lua scripting for quake III)
Posted: Thu Jun 17, 2010 1:04 am
by Hxrmn
^misantropia^ wrote:
Check out Google's V8 JavaScript engine, the one used in Google Chrome. I bet you a sixpack it'll outperform Lua on most tests.
I Dunno man, Lua is a very fast language.
Code: Select all
-----------------------------------------------------------
Execution times for recursive F/P factorial(n) to /dev/null
Langs @ 2008 Times: n=1 n=170 difference
-----------------------------------------------------------
C 0.000 ms 0.090 ms 0.090 ms
Lua 0.001 s 0.005 s 0.004 s
Parrot-opt/iterative 0.013 s 0.018 s 0.005 s
Parrot/iterative 0.014 s 0.019 s 0.005 s
V8-Javascript 0.007 s 0.013 s 0.006 s
Ocaml 0.022 s 0.029 s 0.007 s
Python 0.013 s 0.027 s 0.014 s
Parrot-opt/recursive 0.013 s 0.029 s 0.016 s
Mozilla-Javascript 0.001 s 0.018 s 0.017 s
Perl 0.002 s 0.021 s 0.019 s
Nickle 0.031 s 0.065 s 0.034 s
Parrot/recursive 0.014 s 0.056 s 0.042 s
Ruby 0.041 s 0.095 s 0.054 s
Lua_on_Parrot 0.303 s 1.314 s 1.011 s
-----------------------------------------------------------
Re: QConstruct (Lua scripting for quake III)
Posted: Thu Jun 17, 2010 7:05 am
by Eraser
Well it doesn't really matter. It's just a tool. If you know how a regular screwdriver works, it's easy enough to figure out how an electric one works as well.
Besides, I read that the semantics of Lua and JavaScript are very similar, they just have a somewhat different syntax.
Re: QConstruct (Lua scripting for quake III)
Posted: Thu Jun 17, 2010 9:18 am
by ^misantropia^
I counter your impressive stats with a +2
language shootout (admittedly, LuaJIT still whips V8's hiney). I do have a beef with shootout.alioth.debian.org in that tests for the more exotic languages often have incredibly naive implementations. But at least the site
admits so itself.
Re: QConstruct (Lua scripting for quake III)
Posted: Fri Jun 18, 2010 3:29 am
by Hxrmn
^misantropia^ wrote:I counter your impressive stats with a +2
language shootout (admittedly, LuaJIT still whips V8's hiney). I do have a beef with shootout.alioth.debian.org in that tests for the more exotic languages often have incredibly naive implementations. But at least the site
admits so itself.
Well played sir.
Re: QConstruct (Lua scripting for quake III)
Posted: Sat Jun 19, 2010 2:49 am
by bludshot
Although if we're talking about using this stuff for current PCs and not phones or something then wouldn't there be no noticeable difference?
Re: QConstruct (Lua scripting for quake III)
Posted: Sun Jun 20, 2010 7:28 am
by Hxrmn
bludshot wrote:Although if we're talking about using this stuff for current PCs and not phones or something then wouldn't there be no noticeable difference?
True, though it kind of depends on what it is your doing with the scripting language.
Re: QConstruct (Lua scripting for quake III)
Posted: Tue Jun 29, 2010 1:30 pm
by bitWISE
Cool idea. Been a fan of lua since I started playing WoW.
Re: QConstruct (Lua scripting for quake III)
Posted: Sun Jul 11, 2010 4:34 am
by Hxrmn
Working on integrating the Bullet physics engine. Got it working on the client but still need to parse the level geometry and network it.
Re: QConstruct (Lua scripting for quake III)
Posted: Sun Jul 11, 2010 6:37 pm
by ^misantropia^
What's the use case? Gary's mod-like, rag doll physics?
Re: QConstruct (Lua scripting for quake III)
Posted: Mon Jul 12, 2010 3:24 am
by Hxrmn
Sort of garry's mod like. Ragdolls would require new player models (seeing as how quake3 is all vertex animations). I added a video showcasing the physics on the youtube playlist in my first post.
Re: QConstruct (Lua scripting for quake III)
Posted: Mon Jul 12, 2010 7:43 am
by ^misantropia^
That's pretty awesome. What's performance like? A while ago, I hacked something up with ODE (rigid body physics only) but performance on anything non-trivial was abominable.
Re: QConstruct (Lua scripting for quake III)
Posted: Mon Jul 12, 2010 8:46 am
by Eraser
Awesome. I see a Half-Life gravity gun coming up

Re: QConstruct (Lua scripting for quake III)
Posted: Wed Jul 14, 2010 3:17 am
by Hxrmn
The performance is great (doesn't look it in the video because it's fraps). I'm getting realtime accurate simulation on my older 1.2Ghz(single core) PC. Also gravity gun is a possibility.
Also found the Bullet physics code for converting the BSP plane equations to primitives so I can create the map geometry in Bullet. Woot!