lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> void  ()some_func =  {
> self.frame = 10;
> self.think = think_func;
> self.nextthink = time + 0.1;
> ai_stand ( );
> };

And that routine would be called 10 or 20 times per second for every 
object in the game (Quake had a 10 Hz AI update IIRC).  With 200 
objects you're looking at a whopping 4000 calls per second, which is 
completely and utterly inconsequentially.

You should have NO problems using Lua for the same thing as QC.  
Again, keep in mind that Quake ran just dandy using a software 
renderer + QC on a Pentium/133 for a typical machine.  Machines today 
are 40x faster at least, and I would bet that Lua is not significantly 
slower than QC.

> self.velocity = (normalize ( ((self.enemy.origin + (v_forward *
> 24)) - self.origin)) * 200);

Inconsquential time on the above.  Code it up and time it and I'll bet 
you'd be surprised.  In the grand scheme of things that's just not 
very complicated at all.

When you start getting into the code that has to descend into a BSP 
tree or cast rays and perform collision, then yes, you need to do it 
in C, which is exactly what Quake did -- it exported a native API to 
QC for things that had to run fast (and this is also what Q2 and Q3 
did as well).

Brian