Well, I've spent some time looking at the issue, and here is what I've
found.  I think there are two problems (which may be related).  The first is
that there is no shadow on some (most?) of the tiles when you are over
them.  I've looked at this a bit and here is what I know.  In
moving::calculate_ground_pos, it is not finding any ground_tiles in those
locations.  I'm not sure why we don't just fall through the ground, so there
must be some other collision going on.  But I've tracked down why there are
no ground_tiles, and it looks like to me is an issue with either chunk::add
or chunk::find_chunks.  If I set MAX_OBJECTS very high, (so there is no
split) then the shadow problem goes away.

I was hoping that that would solve the other problem of 'falling through the
stairs'.  I haven't looked much at this one, other than the bounding box
values seemed reasonable.  I'm not sure at all that they 'line up' so
something shouldn't fall through.

I'm done for the night, but my plan tomorrow is to continue looking for the
real fix to chunk::find_chunks.  If you think there might be some amount of
duplicate work let me know and I'll find something else instead.

Tyler

On Mon, Mar 22, 2010 at 4:25 PM, Kai Sterker <kai.ster...@gmail.com> wrote:

> Splitting that into its own topic, as it's a separate issue.
>
> > The second issue is the shadow when going down the stairs. It appears
> > the shadow position is based on an object's global bounding box, not
> > the fine grained shape used for collision detection. Since the
> > staircase is a single object (unlike the one in the old test map,
> > which is one object per stair). So here we have two solutions:
> >
> > Improve rendering of the shadow (although I fear this isn't a small
> > task) or updating the staircase object, so that each stair is an
> > individual sprite.
>
> Tried this out today and created my first composite object, i.e. a map
> object consisting of multiple sprites/models.
> (see models/map/ground/inside/wood-stairs2.xml)
>
> Everything looked fine in modeller, but (a) it is not correctly
> rendered in mapedit, which seems to suggest that it's overall bounding
> box has the wrong proportions. It does appear on the map, although it
> faces the same problems as in mapedit, plus collision detection for it
> is broken. Again, issue might be the same, as I believe the overall
> bbox is what is checked for overlap first before the detailed
> collision detection kicks in.
>
> I've already fixed a problem with loading composite objects (only
> every second part was loaded), but I won't be able to look at the bbox
> thing tonight. I assume the issue is to be found in
> placeable::add_model and/or placeable::set_state. Hopefully, fixing
> the bounding box will automatically solve any rendering and collsiion
> issues too.
>
> One piece of information, as placeable might look confusing at first.
> There are basically 4 bounding boxes, each one specified by their
> position and size:
>
> 'Cur' and 'Max', each in the flavour 'Entire' and 'Solid'.
>
> The 'Max' variant includes the extension of all possible states an
> object can have. It is used for keeping the object on the map as this
> value will never change, so we never have to update the map structure
> either.
> The 'Cur' variant is the extension of the objects actual state, used
> for rendering, pathfinding and collision detection.
> The 'Solid' variant includes only parts of the object that are marked
> as solid. It's used for pathfinding and collision detection (as
> non-solid parts of objects don't have to be considered for those).
> The 'Entire' variant finally includes the non-solid bits too. Used for
> rendering and keeping stuff on the map.
>
> (A bit messy, I admit. Not sure if there'd be a nice way to clean this
> up a little).
>
>
> So feel free to have a look at this issue. Just let me know if you do,
> so that I won't accidently duplicate the effort. Won't look at stuff
> before tomorrow evening.
>
> Kai
>
>
> _______________________________________________
> Adonthell-devel mailing list
> Adonthell-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/adonthell-devel
>
_______________________________________________
Adonthell-devel mailing list
Adonthell-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/adonthell-devel

Reply via email to