[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] AI



> In Pygame, I use the Dictionary data type to create lists of qualities
> in objects and what they mean mechanically to those objects.  For
> example, a bad guy might have the caster quality "Damage":5, and the
> good guy might have the receiver quality "Damage":Life - badguydamage
> or something.  That's an inarticulate example, but in your case, Niss
> could have "rabbit" and then the qualities it knows comprise a rabbit.
>  For example, a rabbit is an animal.  It may know that it can "eat" an
> animal for more energy.  Therefore, it can traverse keys and create
> the link that it can "eat" a "rabbit".  Since you can dynamically
> allocate to Dictionaries and nest them, I think this might be a
> feasible solution, although you'd probably also want to be able to
> read in and write out to a file format (XML probably).  Also, watch
> out for linkage loops when traversing...

Yup! I've been thinking along those lines, and have really gotten into
dictionaries lately for storing information. Before, for instance, parsed
sentences had to go into a rigid format with slots for "verb" and so on.
Now, nested dictionaries allow for nested phrases. And XML lends itself to
dictionary input/output. And multiple, overlapping categories are OK, with
a bit of code protecting against "An A is a B is a C is an A." I think.

Oh, if you use dictionaries yourself, I learned this the hard way:
accessing part of a dictionary returns _that part of the dictionary_, not
just a copy of it, unless you do copy.copy(). I found my program changing
its "constants" because of this problem!

Have a look at this article on game design:
<http://www.igda.org/articles/hsmith_future.php> It's got good ideas on
how "tags" on bits of the environment allow for complex and surprising
gameplay. Eg., if a fire spell affects anything marked "flammable," the
hero can use it to burn trees and walls, not just enemies -- doing logical
things that modern RPGs generally don't allow because all interaction has
to be hard-coded. I think the complex, yet barely-interactive game the
author refers to is "Morrowind." RPGs are badly in need of ways to
interact with the environment other than murder.

Does anyone know the details on Bethesda's upcoming "Radiant AI" system
for the sequel, "The Elder Scrolls: Oblivion?" What I've heard is that
there's some sort of goal system, facial expressions, and NPC-on-NPC
interaction. The dialogue system in "Morrowind" was simple (and easy to
duplicate), and I'm wondering if they've gone beyond that.

One more thing: check out "The Unreal World" at
<www.jmp.fi/~smaarane/urw.html> for inspiration. It's an old game with an
awkward interface, but has very detailed item creation and unique
survival-themed gameplay. And for world-building,
<http://www.fur.com/~ollie/rym3.html>!

Kris
Give a man a parser, and everything looks like XML.