lua-users home
lua-l archive

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

> Uhhrm.. then.. what faster scripting language do you suggest?, i have see
> in various benchmarks page that lua is one of the fastest.

None.  Low level AI functions and patterns should be programmed in C, for

However, Lua is great for setting decision branching, setting up patterns,
level scripting, and higher level control.

I would suggest you set up your A.I. routines as a set of behaviors in C,
and then configure the behaviors and their parameters in Lua.   For example,
one tank might have an attack range threshold, a movement pathfinder, etc.
The parameters for these could be set interactively in lua during testing
and game balancing, allowing the designers to get a good handle on them.  It
could also be set or changed by a lua script callback when a unit changes
modes (if the mode change isn't too frequent and there aren't too many

You could also progam the high level 'strategy' of your AI in lua (as it
doesn't execute every frame).  For example, various threshold values in your
C code could signal events to your Lua scripts which would cause your lua
scripts to reevaluate what the AI player should be doing.

Anything that doesn't require frame by frame updating, or constant calls,
can (and probably should) be done in lua.  Anything that is time intensive
should be done in C or C++.

> And.. there is a URL for Taina?
> _------------------------------------------------------------.
> | Nahuel Greco                 Web Development - Open Source |
> |  Game Programming - Research   |
> | Freelance coding / sysadmin  Networking. The answer is 42. |
> '------------------------------------------------------------'