0
| Thumbs Up: |
| Received: 193 |
Thread... derailed.
Wow, it looks hairy.
== Alaris & clone ==
Proud Officer of The Order Of Dii [Dii] - join us
You can tell the quality of life of people by what they complain about
So what is this health system you speak of? I just mentioned on irc that my suggestion for the shape of the health bar should be... what shawn just pictured. But I didn't post it because it would be detrimental to the idea of not playing the UI but playing the game. But, it was relevant now, so there you go.
| Thumbs Up: |
| Received: 193 |
Big issue atm (which is leftover from old code) is that my characters don't react well to walls. Walls stop them most of the time, but sometimes, walking on a floor at an angle flings them way up in the air. Also, walking on a straight floor makes them bounce a bit especially towards corners. Walking against a wall is jaggy.
The algorithm I made for this does this:
1) detect if you will hit the plane the wall is in
2) if so, detect if you will hit the plane within the boundaries defined by the wall
3) if so, adjust your motion so you do not
My calculations are using a lot of cross and dot multiplications...
== Alaris & clone ==
Proud Officer of The Order Of Dii [Dii] - join us
You can tell the quality of life of people by what they complain about
Uh... Do you mean that they bounce around while walking on a straight floor without being in contact with the walls?
If you mean when they are pushing in against the wall, I'd say the problem is in step 3 of yours. Just split your movement vector into normal/tangential components (normal and tangential to the wall, that is) and assign the tangential vector as your new movement vector. If that's what you are already doing, you have some other math problem somewhere.
| Thumbs Up: |
| Received: 193 |
Yeah, they do bounce around while walking on a straight floor without contact with the walls.
My fear with just keeping the tangential is that with rounding errors and/or several walls (e.g. corner), I might get into cases where it's possible (even if rare) to go through walls. I think that in an earlier version, I tried that and I had that problem. The movement was nice and smooth, but sometimes I'd squeeze through corners.
What I am doing is (1) push the character to a fixed distance from the wall, and (2) adjust the movement so it's tangential. I think that I have not figured out a good way to do #1.
== Alaris & clone ==
Proud Officer of The Order Of Dii [Dii] - join us
You can tell the quality of life of people by what they complain about
If you push away the character, that's what causes the jagginess.
Normally, the character isn't blocked when he (as in, his point location) comes into contact with the wall, but a bounding circle/sphere/cylinder around his location. Doing that would solve the "squeezing through corners" problem. It would also solve the jagginess problem since you won't need to push away the character. In other words, your collision detection should not be between a plane and a point, but between a plane and a circle/sphere/cylinder.
I wish I could draw a picture but I'm sure you get it lol.
| Thumbs Up: |
| Received: 193 |
Oh yeah, I forgot to mention, I'm treating characters as thought they are spheres.
== Alaris & clone ==
Proud Officer of The Order Of Dii [Dii] - join us
You can tell the quality of life of people by what they complain about
Do you push away the character more than his bounding sphere radius? If you push them away to exactly the same distance as the sphere radius, there should be no jagginess or bouncing.
| Thumbs Up: |
| Received: 193 |
In theory, I am pushing them to exactly the same distance. In practice though...?
== Alaris & clone ==
Proud Officer of The Order Of Dii [Dii] - join us
You can tell the quality of life of people by what they complain about