Collision wonkyness
Hi. I've been spending some time over the last few days, trying to mod the movement code into something that emulates the HL/NS feel, including bunnyjump, air-movement, wigglewalking and all that. I've already had the code in C# (that I've been tweaking for over a year), so it was mostly just a matter of porting it.
So far, so good - it works pretty well. I still need to figure out how to bind jump to scroll, to really have a chance to test the feel.
One very big problem I've encountered though is the collision system, and the results it returns - I think this is best displayed in pictures:
<img src="http://i.imgur.com/SGdWv.png" border="0" class="linked-image" />
<img src="http://i.imgur.com/1AxKE.png" border="0" class="linked-image" />
The green lines represents the Normals of what the player collided against. So, when you stand on flat ground, it has a normal that point's straight up.
Notice something about the first picture? The normals returned are "bended", but the walls that were collided against are straight!
In the second picture, this become an issue for my movement code, because all these small steps return imprecise results that vary according to how close you are to the "corner". When I get a imprecise normal like that, sometimes it will be so turned that is changes results to compares to Player.kMaxWalkableNormal
My theory is that this happens because the collision system uses a capsule, and not an axis aligned bounding box - that would explain why it seem to regard small sharp edges, like steps, as rounded.. One more picture:
<img src="http://i.imgur.com/yVOnT.png" border="0" class="linked-image" />
So, I guess my question is if anyone has any ideas for battling this problem? I'm sure it's possible to get solid collision results, but it will take a bit of a different approach.
Also, if anyone's interested in the code, I'd be glad to put it out there.
So far, so good - it works pretty well. I still need to figure out how to bind jump to scroll, to really have a chance to test the feel.
One very big problem I've encountered though is the collision system, and the results it returns - I think this is best displayed in pictures:
<img src="http://i.imgur.com/SGdWv.png" border="0" class="linked-image" />
<img src="http://i.imgur.com/1AxKE.png" border="0" class="linked-image" />
The green lines represents the Normals of what the player collided against. So, when you stand on flat ground, it has a normal that point's straight up.
Notice something about the first picture? The normals returned are "bended", but the walls that were collided against are straight!
In the second picture, this become an issue for my movement code, because all these small steps return imprecise results that vary according to how close you are to the "corner". When I get a imprecise normal like that, sometimes it will be so turned that is changes results to compares to Player.kMaxWalkableNormal
My theory is that this happens because the collision system uses a capsule, and not an axis aligned bounding box - that would explain why it seem to regard small sharp edges, like steps, as rounded.. One more picture:
<img src="http://i.imgur.com/yVOnT.png" border="0" class="linked-image" />
So, I guess my question is if anyone has any ideas for battling this problem? I'm sure it's possible to get solid collision results, but it will take a bit of a different approach.
Also, if anyone's interested in the code, I'd be glad to put it out there.
Comments
[attachment=35985:normals.jpg]
It seems like this is what's happening in those images, but without seeing it in 3D I'm not sure. I've rewritten all of the collision code for Build 162, so I will check to make sure there isn't a problem with that code. Also, with Build 162 it will actually be possible to use a box shape for the player movement if that's what you prefer.
Also if you are lerk and fires spores, its like a "invisible wall" of spores, so if you shoot again its against the invisible wall.
maybe im wrong but the only engine which has a good hitdetection was crysis or i remember wrong.
Edit:
can this be the reason why sometimes you stuttering?
I got this today with a 56 ping, its like you move but it holds/grab you on one place.
movement is horrible now, getting stuck on anything that isn't flat ground!
almost impossible to get up the edges in rockdown MS
the previous movement was very smooth, granted, not usual for games, but it was awesome!
the new in B162 is HORRIBLE!
movement is horrible now, getting stuck on anything that isn't flat ground!
almost impossible to get up the edges in rockdown MS
the previous movement was very smooth, granted, not usual for games, but it was awesome!
the new in B162 is HORRIBLE!<!--QuoteEnd--></div><!--QuoteEEnd-->
The shape wasn't changed. What you are seeing is not a result of changing the collision code, but the changes to the player acceleration values (I believe in response to <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=112440" target="_blank">this</a> thread).
I feel like in general there are some bugs/issues with the player movement code, so right now I'm actually going through it and making sure everything is working properly.
I feel like in general there are some bugs/issues with the player movement code, so right now I'm actually going through it and making sure everything is working properly.<!--QuoteEnd--></div><!--QuoteEEnd-->
maybe overreacted a bit, other than this i was really impressed, the build is still KICK-ASS! fps is maybe +50% in combat!
just, if i were in charge, i'd easily keep the "organic, a bit uncertain" movement that sets NS2 apart from the rest, over the "mechanical/robotic/hollow" movement of HL1.
I agree with this to an extent. I like how a lot of the modern shooters are moving to a much more organic and realistic type movement system vs the older mechanical and almost arcady movement system. However, uncertainty is never good in a game, unless you're a Nintendo developer. You can both keep the natural organic feel while keep the movement system itself tight. I feel this could be accomplished by allowing players the ability to easily stop on a dime when they're in normal movement so they have complete and certain control of their character. However, when there in sprint mode then you can give a little lee way to how the character slides a little bit, as would be expected in real life if you're in a full out sprint. Make since? Just some thoughts.
Also on a side note, while I hopefully have your attention max. I experienced a bug earlier today along with others where we would get stuck on stairs, especially the ones in rock down spawn. I would be moving up them when my character would stop and I would have to walk back down and try again. I'm sure this is tied to the changed movement variables. Something to look into.