adonthell-devel
[Top][All Lists]
Advanced

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

[Adonthell-devel] Re: Code improvements and next steps ...


From: Kai Sterker
Subject: [Adonthell-devel] Re: Code improvements and next steps ...
Date: Thu, 15 Jul 2010 22:15:10 +0200

On Tue, Jul 13, 2010 at 10:23 PM, Kai Sterker <address@hidden> wrote:

> 1. If v0.3 of Waste's Edge defines the features we want, then we need
> to allow different comments for the same object. (Try to interact with
> the crates or barrels in the cellar for an example, or the chests in
> the individual guest rooms). That means we need to tie a comment to a
> certain object at a certain position. OTOH, the most logical place to
> put a comment would be with the entity. We could still imitate the
> desired behaviour if we'd create different entities that represent the
> same object, only with a different comment. But if we think further,
> maybe we also want to allow different comments, depending on race or
> gender of our character. Maybe we even want to execute a piece of
> python code to generate a comment dynamically (think about the
> grandfather clock in the common room. Would be great if we could get
> the actual in-game time when looking at that).
>
> The biggest problem is really how to tie a comment (no matter how
> complex) into the current data structures (and the map editor). Any
> suggestions are welcome.

After studying the code for a while, I've come to some conclusions on
how to handle comments:

1. There are two places where we could store comments and my idea
would be to use both. Per-Entity comments can be stored in
world::entity. Each instance of such an entity on the map will have
the same comment. It could be edited in mapedit by picking an entity
from the entity list. The second place is world::chunk_info, which
would allow unique comments by entity location. Again, those comments
would be set in mapedit by editing an object already placed on the
map.

2. Handling of comments must happen in schedules/char/action.py. In
the case that no character or item was found to interact with, we'll
search for scenery objects and get a list of chunk_info instances. And
here's the clou: If we use a hypothetical method
chunk_info::get_comment() we can either get the specific comment for
that location or chunk_info can delegate the call to the entity it
contains and we can get the global entity comment. Exactly what we
would want.

3. The rest of the details are then encapsulated by the comment class.
It will get the character triggering the comment (usually the player)
and the object to comment on. In case we have a text-only comment, it
can be popped up next to the character. If it's a dynamic comment
produced by a python call, we pass in the character and object as
arguments to that call. That will give us enough data to create
comments depending on character or object state.

4. Some additional thoughts: chunk_info and entity data is all kept in
the respective map file, so comments are all in one place (and
editable in one place too). The caveat is that only scenery objects
can have comments. But that should be okay, since we only have one
action button and that will perform "talk" with characters, "pick up"
with items and "look" at scenery objects. (True items can have a
comprehensive description in the inventory view.)

5. In the map editor, "comments" would be an extra tab of the edit
entity dialog. It would show the global entity comment and a list of
location specific comments. So all data for one entity is accessible
in one location again, but to create a new location specific comment
you would have to select that location on the map first.


That should give us anything we had in v0.3 and much more :-). So if
nobody has suggestions for a better design, I'll start with the
implementation on the weekend.

Kai



reply via email to

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