adonthell-devel
[Top][All Lists]
Advanced

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

[Adonthell-devel] Re: Loading/Saving characters ... somewhat broken


From: Kai Sterker
Subject: [Adonthell-devel] Re: Loading/Saving characters ... somewhat broken
Date: Tue, 27 Oct 2009 23:10:49 +0100

On Tue, Oct 20, 2009 at 6:35 AM, Kai Sterker <address@hidden> wrote:

>> I'll keep you updated, but the plan is to continue with what I started
>> and move all hardcoded stuff from worldtest into appropriate data
>> files, so that we can use worldtest to run wastesedge (or what passes
>> for that, at the moment).
>
> Didn't get much further, but at least the next baby step is done. The
> association between rpg and world character instance is now created
> when a map is loaded.

Things go more slowly than expected, but at least I got the design for
the next change done. In order to properly save world::charcters, the
map data file needs to be changed from the current mix of object and
position data

<Data cs="23f915b9">
  <list id="models/char/npc/ng.xml">
    <u_int8 id="type">2</u_int8>
    <list id="unique">
      <string id="id">Player</string>
      <string id="p3d">[518, 297, 0]</string>
        ...

to separate sections for objects that can be referred by the position
data. Something like that:

  <list id="objects">
    <list id="0">
      <u_int8 id="type">2</u_int8>
      <string id="model">models/char/npc/ng.xml</string>
      <string id="state">w_stand</string>
      <string id="pos">[518, 297, 0]</string>
      <float id="vspeed">0.0</float>
      ...
    </list>
  </list>
  <list id="entities">
    <list id="unique">
      <u_int32 id="idx">0</u_int32>
      <string id="id">Player</string>
      <string id="p3d">[518, 297, 0]</string>
      ...

Some attributes, like type, model and state are common to all
placeables, others like pos and vspeed will be limited to characters
only. Items might require yet other values.

There is a slight redundancy as both a character and the map need the
character's position. (Map needs it for initial placement, character
while moving around). Maybe I can find a way to set that properly in
the character when it gets placed on the map.

Oh, and as you can see, the model used by a map object is now will be
an attribute of the object. Right now, the two are basically the same,
which mixes static and runtime data. Maybe this hints at a problem
with the underlying design, but for now I'd like to avoid bigger
changes in that area.


Anyway, with a clear goal in front of me, I hope the actual coding
will not take me too long. I'd like to have that ready by the weekend.

Kai




reply via email to

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