adonthell-general
[Top][All Lists]
Advanced

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

[Adonthell-general] NPC's and the perception of their surrounding


From: Kai Sterker
Subject: [Adonthell-general] NPC's and the perception of their surrounding
Date: Fri, 15 Feb 2002 21:32:07 +0100 (CET)

On a completely different matter. It's possibly not relevant yet, as we
are just starting with items, but I've been thinking about it lately, so I
want to mention it at least.

It's all about character schedules, and why the schedules we have are no
good :). It's the same as with the item scripts. One python script for
each character is basically too much work. We had 14 NPC's at Waste's
Edge, and Waste's Edge wasn't big. We'll possibly have 50 in Cirdanth
alone, and only god knows how many there will be on Adonthell.

Granted, many of them would not be deeply involved into the plot, but they
should still show life-like behaviour and thus need some sort of schedule.

The problem with the current NPC's is that they have a very limited
perception of the world: they 'know' where obstacles are, nothing else.
That means, we can not really generalize schedules. Say we have to
blacksmiths that work at different locations, then they would basically do
the same things, but each of them would need a schedule of his own.

But if they would have a greater perception of their surroundings, we
could start writing general schedules. 

Lets look at the smith again:
In the morning, when he starts his work, he might fetch water from the
well first, as he'll need it later to cool the stuff he's been working on.

When he's ready, he'd put a piece of metal on the fire, operate the
bellows for a while, then put the glowing metal on the anvil, pick up a
hammer and start turing it into whatever. When finished, he'd put it in
the water, place it on a table and start over with a new piece of metal.

To make a script that works for any smith, no matter how his forge looks
like, we need him to locate items and objects on the map. So the script
would go something like

    # -- locate bucket
    pos = find_nearest_item ("bucket")
    goto (pos)
    pickup ("bucket")

    # -- locate well
    pos = find_nearest_object ("well")
    ...

That way, we would only need one smith-schedule, not one for every smith
in the game.


What works for items and objects (the difference is that items can be
picked up, whereas objects are static, like a well or anvil or table, etc)
should also work for locations.

Each submap should get an ID, so that I need only say 
    character.goto ("Redwyne-Inn.Common-Room").

"Redwyne-Inn" would be the name of the map, and "Common-Room" the name of
the submap. Not exactly sure how (or whether) that should work across
maps, but it will make things a lot easier for script writers.

Maybe we can have a have a structure with all the maps and submaps and
their connections in memory and use that for cross-map pathfinding
without the need to have every map in memory.


Anyway, such map names could be fed as parematers to schedules again.
Each character could have a 'home' and 'work' variable containing the
location where he is at home, and where he is working. Then it is easy to
send him to work in the morning, and home in the evening (or vice versa).


In general, each character would have several schedules over the day,
maybe with extra schedules for holidays or certain events. For example a
number of people could have a 'pub' schedule after work, that might get
the location-ID of the pub they should go to as an argument. Others might
have a 'hunt' schedule instead.

There could be a centralized schedule changing mechanism, that takes a few
attributes of a character into account (that can of course be changed
during a schedule or dialogue, etc.) to figure out what schedule to use
next, and espacially when to switch. There could be a schedule for market
day, where everyone will pay a visit to the market place. The possibilites
are numerous.


To cut a long story short, what we need is no character-based schedules,
but activity-based schedules that are independent of location and
character. That of course requires that NPC's have a better grasp of their
surroundings. 

And that's about the whole message :). As I said, it's not relevant now.
Let's hold it back for v0.5 or something. But since you are going to
design the map now Alex, it might be good to think a bit ahead. Otherwise
it might be neccessary to change stuff all over again.

Kai 





reply via email to

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