adonthell-general
[Top][All Lists]
Advanced

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

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


From: Alexandre Courbot
Subject: Re: [Adonthell-general] NPC's and the perception of their surrounding
Date: 16 Feb 2002 11:19:59 +0100

> 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.
[....]

Eh. And I was satisfied with the current schedules. Brilliant idea you had!

> 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.

Fine. I guess the new map_coordinates class just fits as a class type
for 'pos' ;) While find_nearest_object would be coded in the map class
for efficiency.

> 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.

That's what I had in mind too. I don't know how easy it would be to do
cross-map pathdfinding, but it should be at least possible to do
pathfinding between submaps. Naming submaps isn't absolutely necessary
I'd say (as they have an integer identifier), but would make the job
easier as you said.

> 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.

The problem is that you agree we can't make hundreds of characters
schedules running all the time, on all the maps. Maybe we can only
"really" run the schedules of the characters which current map is loaded
into memory, while others characters would 'sleep'. And when you enter
the map they are on, their schedule and place would be calculated
according to the current time of the day, and others parameters. We
would of course need something more sophisticated, but the basic idea is
there.

> 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. 

Exactly. This is about the same thing as items behavior now :)

Excellent idea, once again.
Alex.

-- 
http://www.gnurou.org




reply via email to

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