On Sun, Oct 5, 2008 at 1:00 AM, Andrew Phillips <[EMAIL PROTECTED]> wrote:
The whole implementation isn't something I dreamed up (of course). Although I wish I could. It's based on the collision tutorial from http://www.peroxide.dk/ . The collision code itself still works, as nothing changed there. It's the interface with our own code that's messed up, i.e. what we're passing into the collision detection is not quite right. When everything was still based on a fixed grid, the precise character position used by the collision code was always relative to the current position on the grid. And the position of everything else was relative to that as well. Now we're using absolute positions for both character and world. While this shouldn't make a difference in theory, it does in reality. Right now, I am thinking that maybe it would be better to assume the character location to be at the origin and have everything else relative to that, but apart from keeping the numbers small, I don't see how this would improve anything. So better to track down the current issue first before introducing yet another source of errors :-). Kai > I can see how that would happen. I've been working with a game prototype at > work and with issues of landing and falling, but I've been using a > rectangular bounding box. The prototype is only in 2D, so this suffices. I > worked on the assumption that the movable characters have good balance, so > they only fall if no part of them is still over the platform currently > holding them up. In more concrete terms, the bottom of the rectangle > represents their feet, so they remain on the platform if they have any kind > of toehold or heel-hold. I say this not to suggest my method, however. I > think the spherical bound works better in 3d. A rectangular prism might not > be appropriate and a compound of N ovoids (one for each foot of the > creature) is just too complicated and ugly. > > I will try to take a look at moving.cc to see what I can see. > > Andrew > > On Sat, Oct 4, 2008 at 4:28 AM, Kai Sterker <[EMAIL PROTECTED]> wrote: >> >> On Fri, Oct 3, 2008 at 11:48 PM, Andrew Phillips <[EMAIL PROTECTED]> >> wrote: >> >> > So, am I right in thinking that if the character is not completely on >> > the >> > one tile, the character falls through it? >> >> That sums it up pretty nicely. It's the details where it gets complicated. >> >> For sake of collision detection, the character is represented by a >> sphere, so basically there is just a single point where it touches the >> ground, in the center of the character's bounding box. That means, as >> soon as the center moves over the edge of the tile, it begins to slide >> downwards. >> >> Of course, usually you'll have another tile right next to that tile, >> so by going over the edge of one tile you are now on another tile and >> nothing should happen. For some reason, this is not the case with the >> current code. This could mean that the tiles that get checked for >> collision are not the tiles the character is actually on. I should >> probably increase that area just to check ... but of course for >> efficiency it is important to really only check probable tiles. >> >> Oh, btw. all of this is going on in world/moving.cc, in case somebody >> wants to have a closer look. >> >> 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 > > _______________________________________________ Adonthell-devel mailing list Adonthell-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/adonthell-devel