adonthell-devel
[Top][All Lists]
Advanced

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

[Adonthell-devel] More on character schedules/actions


From: Kai Sterker
Subject: [Adonthell-devel] More on character schedules/actions
Date: Wed, 19 Feb 2003 15:25:31 +0100

As that is the most interesting issue right now, here some more
thoughts:

First of all, characters could respond to many different situations,
with a seperate script for each situation. As some situations might be
very rare, it wouldn't make sense to keep all scripts in memory all the
time. The only thing a character needs is a list of situations he can
respond to. The name of the action script will do for that.

So there could be a method like the following:

bool character::do_action (const string & action, PyObject *args)

It would check if the character knows about the given action. If not,
it'd return false. Otherwise it would load the action (with args as
parameters) and launch it.


The action itself is a little more than just the action script. As
suggested in the other mail, it would contain a priority. So if the
character is currently engaged in an action, the priority of the new
action would determine what happens. If it is higher than the current
action's priority, the character will immediately switch actions.
Otherwise the new action will be put into the character's "action queue"
(which of course is sorted by priority).

However, as it often makes no sense to delay an action for too long,
each action would also have a MaxDelay value. This specifies how long
the action may be delayed before it expires. Once an action is started,
it would run until finished, or until it is interrupted by an action of
higher priority.


Alternative:
Instead of attaching the priority to an action, each character/action
pair could have its own priority. That way, different characters could
react differently (well, with different priority at least) to the same
action.



So far, we haven't thought much about character AI during combat. I
think that something like above could also be used for combat. Here an
action is something like "attack this target in that fashion" or "flee",
or "drink healing potion", etc. All different actions, with different
priorities. We could go even further and have creatures (or player and
party members) "communicate" with each other. A creature that is
attacked could send "heal me" (or "attack my attacker") to its friends,
and depending on their priority, they might help or not.

The actual AI would of course be figuring out the best action for the
given situation. But the actions itself could be implemented via the
ordinary character schedule system. Also, each creature would not only
fight for itself (i.e. rely to its own AI), but also react to the other
fighters.

So a clever boss could for example direct his minions much more
effectively than when they were on their own.


Kai




reply via email to

[Prev in Thread] Current Thread [Next in Thread]