adonthell-devel
[Top][All Lists]
Advanced

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

[Adonthell-devel] Battle lifetime


From: Kai Sterker
Subject: [Adonthell-devel] Battle lifetime
Date: Sun, 27 Apr 2003 20:45:08 +0200

So far, most of my thoughts concerning combat covered the underlying
rules. But when I mentioned spells that might affect more than a single
character, I figured that there is more low-level combat stuff to think
about.

For example, it is vital to know who is involved in a battle. I suggest
that everybody in a certain area around fighting characters will be
automatically involved. Of course, being involved does not mean they
start to fight. What characters do when getting involved in battle will
depend upon their schedule: guards or beasts of the wild will probably
attack, ordinary NPC or tame animals will flee.

What we should have is a group of characters that are involved in the
same battle. Only characters from this group could become target of
attacks and spells. Obviously, such a group can change dynamically. If
characters that walk around come near such a group, they will become
involved. Characters running away could be removed when they get far
enough, etc.


Here are some more details about the lifetime of combat groups:


Creation
========

A new combat group will be created when a character attacks another
character (unless both are involved in battle already).

On creation of the group, all nearby characters are automatically
involved, even if they are not attacked themselves. (But obviously, they
can spot the fight and should have the chance to react accordingly.
Would be odd if a fight breaks out and most NPCs just continue their
business as if nothing had happened.


Update
======

A combat group should be updated regularly. First of all, if the
combattants change location, NPCs might "notice" the battle without
moving themselves. Further it seems to be more efficient to check
whether NPCs need to be involved in battle only when a battle takes
place. (So when characters walk around, they would not test whether they
get near a battle or not.)

So the update should make sure that characters get involved, if they are
near enough, and involved characters are removed when they get far
enough (or die).


Destruction
===========

Combat groups should cease to exist when only members of one side are
left. Remains the question how the engine will know that. If the fight
is between player/party and some NPCs it seems to be easy. If NPCs fight
amongst themselves, it seems harder. Maybe we can check whether involved
characters can find a target or not. If no character can find a new
target any more, the battle is over and the group can be destroyed.


Merging groups
==============

If we allow NPCs to start battles amongst themselves, it may happen that
different combat groups "meet". In this case, they should be merged.


Splitting groups
================

This may happen too, but it needs not be taken care of explicitly.
Imagine a character is fleeing from battle with an attacker after him.
That way, both might leave the combat group. When the attacker finally
reaches the other character and hits him, a new group will be created.



So a combat group serves two main purposes:

* "realism": nearby characters are able to notice battles, allowing them
  to show "natural" behaviour.

* list of possible targets. This might speed up the AI, as there is no
  need to search the map for nearby characters once a battle has
  started. (Of course, beasts of the wild may have to sense their
  surroundings for prey as long as they are not involved in battle.)

Kai




reply via email to

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