Lets discuss collisions!

Blitz3D Forums/Blitz3D Programming/Lets discuss collisions!

poopla(Posted 2003) [#1]
Well this is something that is very mysterious and confusing for new people (and some of the veterans), to do get working right. For example, in plasma, I'm having one hell of a time getting the player mesh to smootherly slide down steep hills. ESPECIALLY in "pinch" areas. If the player moves into a corner in any area, he seems to get stuck. What have you guys found for solving this, and other, problems?


Rob(Posted 2003) [#2]
There's still a bit of a problem with ellipse collisions AFAIK. I've never had any problems like you describe though.


IPete2(Posted 2003) [#3]
Dev,

Perhaps when a character gets stuck and cannot move (no matter how much input the user gives) a flag is set. In turn this flag temporarily increases the entityradius for the character. I think this will enable thew character t release himself, and as sonn as movement begins again the radius should be reset along with the flag.

Just a thought.

IPete2.


(tu) sinu(Posted 2003) [#4]
@Dev

to allow smooth transition down steep hills you should

a) transform the collision normals to player space.

This means that all collisions in front and behind of the player resulting in a collisionNZ value, this will allow you to tell if the player is moving up a slope or down one.
a positive value means a front collision etc.

b) then modify the moverate by the collisionNY value based upon wether the character is going up the slope or down(the NZ value).


Warren(Posted 2003) [#5]
I've run into the "corner" problem as well. I have gravity being applied to my character every frame and I recently added the ability to jump, by applying an upward force to him that degrades over a half second or so.

Anyway ... if I just against a single wall, it's fine. He goes up and forward until he hits the wall and then he slides down. But if I jump into a corner so that I hit 2 walls at once, he sticks in place (in mid air) and when the jump timing is over he suddenly snaps to the floor and all is normal again.

It's the weirdest thing...


(tu) sinu(Posted 2003) [#6]
strange problem, haven't seen it yet, gonna try a level with corners now and see how it goes.


(tu) sinu(Posted 2003) [#7]
crap, this is weird, i've just tried this and if i collide with a wall while jumping with a +z value i also get stuck or slowly slide jerkily down the wall. funny thing is it only happens every so oftne ie 1 out of 5 attempts and is usually near a corner!


Rob(Posted 2003) [#8]
* use countcollisions to count the number of collisions
* loop through each collision and add the normals returned to
nx, ny and nz
* finally divide each by the number of collisions occured so you have the averaged normals

Then when you get stuck, simply push by the average (aligntovector nx,ny,nz will point out by the normal if you're wondering).


Genexi2(Posted 2003) [#9]
>> In turn this flag temporarily increases the entityradius for the character.

From what I've experianced, if an object is colliding and you increase that object's radius, the radius will go through the object it was colliding with, thus screwing everything up....


wmaass(Posted 2003) [#10]
Believe it or not, games as good as Battlefield 1942 have similar problems, especially where steep terrain meets sunken bunkers. You can get stuck in these spots and your only choice is to sit on a grenade.


(tu) sinu(Posted 2003) [#11]
edit: :)


(tu) sinu(Posted 2003) [#12]
EDIT: setting the players move speed to 0 on collision with the wall while jumping fixes the problem perfectly for corner collisions.


DH(Posted 2003) [#13]
Believe it or not, games as good as Battlefield 1942 have similar problems, especially where steep terrain meets sunken bunkers. You can get stuck in these spots and your only choice is to sit on a grenade.



As good as??? what world are you living in? BF1942 isnt a well designed game, its pure crap in code. The only reason you hear about it is because it is popular, and backed by EA Games... If it weren't the only game to allow you to drive a plethura of veichles, it would be as faceless as every other FPS out there..

The physics are crap, the collisions are crap, the gameplay is crap, the "crash to desktop" is crap, the "Take all the memory you have free, and dont release it when wer're done" is crap.. it was a rushed project, and if it were't for the above named things, it wouldn't be worht 2 cents.


Warren(Posted 2003) [#14]
Wish I could have a badly designed game, filled with crap code and no gameplay like BF1942.

Seriously, pass whatever you're smoking over here ...


LostCargo(Posted 2003) [#15]
Does anyone know how to overcome the collision issue where you have two sphere type collisions that when they bumptogeather at the wrong angle, they enter each other?


Warren(Posted 2003) [#16]
Would like to pass along thanks to everyone in this thread BTW. Negating foward player movement when I detect I'm jumping into a corner is starting to solve the problem for me (needs a little refinement, but the concept is sound).

Aces!