[Algorithms] more character motion trouble
Brought to you by:
vexxed72
From: Charles B. <cb...@cb...> - 2003-01-10 22:35:40
|
I'm having some trouble with "slide" surfaces. Essentially every game has this concept - there are "ground" surfaces and "slide" surfaces. Slide surfaces are steeper, and you're not allowed to stand on them, roughly. More pragmatically, you can stand still on a Ground surface. eg. gravity will not move you at all when you're on a Ground surface. In contrast, if you're on a Slide surface, gravity will move you, and you'll slide down it. In many games you also can't apply any more drive when you're on a Slide surface; this is done so you can't scale steep walls and otherwise get out of the play-field. The problem I'm having is that this is such a binary change, and binary changes cause great problems. The biggest problem occurs when you're standing right at the crease between a surface that's Ground and Slide. You can move epsilon in either direction and you'll change between being on a Slide and being on the Ground. Now, we also want to do "Quake Sliding" with character movement; eg. if you put the stick at an angle into a wall, you'll glide along it. If you just do normal velocity clamping with a Slide surface, your velocity will take you up onto the slide surface. In some ways, you want to treat it as if it were vertical. You cannot do that, however, because to do so would require that you know all the edges of intersection between the Slide surfaces and other polygons, and since we have Triangle Soup you might not get a proper 2d poly-line of walls around your Ground (among other problems). There is no simple physical model that works here, eg. friction doesn't work. You never want the character to slide on a Ground surface, which he would do with a friction model. I've got a couple of evil things going on. One is that if you're on a Slide surface, I don't immediately start making you slide; instead I try to push you off it (back to Ground presumably). If you get back to ground, you don't slide; you only start sliding if you're on the Slide surface for > 1 second. This is ok, but the epsilon problem bites the other way - when you're barely on ground, you still need to be pushed away from the Slide surface. Anyway, I'm curious how other people deal with this. Largely, 1st person games can ignore a lot of these problems because you can't see your avatar so you can do things that feel good but look really strange. A lot of console games (eg. Jak & Daxter) use hand-marked walkable areas, and you can essentially only walk on flat ground. We're trying to allow character motion on triangle soup. ---------------------------------------------------- Charles Bloom cb...@cb... www.cbloom.com |