Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: More roleplaying



> Date: Mon, 20 Sep 1999 11:10:08 -0700
> From: Ian Main <imain@netidea.com>

> ..  what about embedding a perl interpreter to do AI ?  It's
> relatively easy to wrap perl functions around a C API.. you could
> just create a fairly simple API for controlling monsters, and then
> have ways to trigger the perl functions.  This would allow you to
> script monster movements, conversations etc..  you could get some
> pretty smart monsters actually :)

I've been thinking about this.  It's an interesting idea, but I don't
know that it's practical.  PERL is great for those of us who spend
more time reading and writing programming languages than human
languages, but the AI scripting for Crossfire should ideally be
something more accessable to non-programmers.

I could suggest something like Prolog, which was designed for AI, or
its descendant, Python, since both of them have relatively simple
syntax.  The problem there is the concept of exactly how to get
complex behaviours out of that simple syntax.  Not what I'd call
intuitive.

Look at an example from a commercial game that did a fair job with
scripting, StarCraft.  Each script object has a list of which players
can trigger it, what comination of events will trigger it, and exactly
what the effects are.  StarCraft has a point-and-click interface for
creating scripts, which makes things even easier for non-programmers,
but we don't have to go quite that far.

We already have lots of different kinds of detectors, and a fair
number of things that can be triggered by them.  Adding to those some
detectors that respond to an NPC's status and commands that change
certain internal variables, we'd have our own little object-oriented
scripting language, fairly similar (in functionality) to StarCraft's.

A PERL interpreter wrapped around a C API would certainly be more
powerful, but might be just a bit on the global thermonuclear overkill
side.  If anyone wants to volunteer to do it anyway, be my guest.


> If I were writing the game from scratch, I would seriously consider
> taking the approach of having every character controllable through
> the same API, and then using perl to control the monsters, and of
> course, the client to control the players.

I think in many cases, the same functions are called for player
actions and NPC actions, with some important differences in their
object structures.  With the 0.96 object rewrite, those structures are
going to change, so some of the functons that are not currently
relevant to NPCs may become relevant soon.  ("Soon" being a relative
term.)  The next step would be enabling those functions to be called
from a script of some sort.  How powerful, accessable, extensible, and
concise those scripts are depends on who volunteers to code them and
what concensus is reached here.

Scripting is a critical feature that will strongly influence the rest
of the game.  As such, it deserves all the serious discussion and
planning we can put into it.  We need a scripting mechanism, but what
functionality do we want from it?  What are our priorities here?

-- 
            -Dave Noelle,                 dave@Straylight.org
            -the Villa Straylight,  http://www.straylight.org
Coalition Against Unsolicited Commercial Email  ==  http://www.cauce.com

Disclaimer:#include <std_disclaim.sig>

Quote of the Day:
A closed mouth gathers no foot.
-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to crossfire-request@ifi.uio.no]