lua-users home
lua-l archive

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

Nicholas Hesketh wrote:

> That would depend on the sort of AI you're trying to do, and the number of entities you need to do
> it for.
> For the mid to high level portion of rpg character AI it should be ideal as the scripting
> flexibility outweighs computational overhead, and you can always migrate the expensive stuff to
> C/C++ as the game develops.
> Using it for adaptive pathfinding of several hundred units in a strategy game is probably not a good
> idea though ;-)
> It's a case of flexibility verses performance, but you'll probably find scripting useful for at
> least a portion of your game logic.
> Nick Hesketh.
> -----Original Message-----
> From: Christophe Gimenez <>
> To: Multiple recipients of list <>
> Date: 24 March 2000 19:51
> Subject: LUA and AI
> >
> >Okay that seems a strange question...
> >
> >But here is my problem : as I would (and will) use LUA as the scripting
> >langage for a game project I've started to find information about AI in
> >games (and of course I don't know a word about AI).
> >
> >Thus, do you think that implementing basic AI principles could be done with
> >LUA ?
> >
> >If yes, we to start from ?
> >
> >I've spent many many many hours and collected many many many links, pdf,
> >doc, html files but for the moment I could'nt learn some basic that I could
> >use in a game.
> >
> >thanks
> >
> >[ if there is an AI-GOD in the mailing list, please send me a mail ;-) ]
> >
> >

AI is fun.  The best AI model I've seen was implemented in Java for a roguelike game... The
object-oriented nature rocked.

For an AI, write the unmutable stuff (like pathfinding, logic, etc.) in your C/C++ code.  Then write
the control in script.

Something like (in PSEUDO code)

if (see_enemy) then
 enter_battle ()

if (is_dying) then
 find_path (ESCAPE)
 follow_path ()

That's a damn poor example, but I'm tired, so I have an excuse.  ;-)

I think for controlling actions (like go north 3, west 4, get item, east 6, say "My, it is raining
frogs.", attack duck,  south 3, west 2, say "Oh no!  I lost my magic Blunt Stick of Sharpness!!!") a
specialized language would do best... something simple like

MOVE east 3
SAY "I'm lost"

is best.

Sean Middleditch