lua-users home
lua-l archive

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


This actually deals with AI processing.  If you set up your AI so that it
can handle command ques then it will manage itself between frames.
Basically, you need to create an AI interface that can add these
instructions to it's list of things to do, then take it's turn in the loop
to update it's own position or whatnot for the frame.  With Lua 5's
multithreading support it would be possible to give each AI it's own script
cue, making this even easier.

This sort of command que structure is described in extensive detail in
several books - Game Programming Gems 1-3, Data Structures for Game
Programmers, The Zen of Direct3D Game Programming, Game Scripting Mastery,
Tricks of the Windows Game Programming Gurus, and probably in about twenty
other books that deal specifically with AI issues.

I'd also recommend looking through GameDev.net's tutorials and articles, as
well as Gamasutra.

Game Developers' Magazine is available free for simply filling out a quick
survey every so often (or to all IGDA members) and it has articles in it
covering a wide range of game programming topics.

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br]On Behalf Of ted
Sent: Saturday, August 09, 2003 3:48 PM
To: lua mailing list
Subject: stage management in games


I would like to be able to write a script for my game to stage manage the
characters. Something like:

ogre = monster("Eric")

ogre:WalkTo(30, 40)

ogre:Say("HelloWorld")

The trouble is, with something like this the rest of my game will pause
until Eric's said his line. Is there a way each agent can call a script like
this, which will do a frame's worth of logic and then hand back control so
that everything else in the game can be updated too?

thanks for any help with this.