PDA

View Full Version : Player Bounding Volumes (Tank Diskussion Spinoff)



serthy
30th November 2013, 11:10
Thank you Kung, guess i messed up my DP... sorry for that


You will be able to implement proper collision check if you manage to take out some trace functions from the game. Wish we had more than all those bullet-typed traces.

You are right, i tried to use as few as possible bullettraces for groundaligning and coldetection. The UN-vehicle mod for example uses like 20 traces (per single vehicle and each tenth of a second!), so i decided to use only 3 traces for the aligning stuff (since only 3 points of a vehicle are touching the ground on an uneven floor) and 2 crossed, direction and speed based traces for collision detection. I didnt found a better/faster way of achieving 'realistic' vehicle behaviour in cod2 yet.

FYI in cod players bounding volumes are represented as cylinders (thats why you can 'stay in the air' a certain distance on walledges) and the function physicsTrace() will check this volume as kind of a volumetrace. Maybe you can do something with it :D

megazor
2nd December 2013, 02:02
FYI in cod players bounding volumes are represented as cylinders
not exactly. look at the image. if players were treated as cylinders, then they would be able to move towards the corner to finally touch it. But in fact, the player can't move any closer to the corner. From the position shown on the image, player can only slide along either the vertical or the horizonal wall.
545

For more clear understanding, see this image:

546

If player is sliding to the left side along the horizontal plane from sector 1, he is, obviously, moving strictly along axis x. Once player is completely in the sector 2, he is no longer moving along axis x - he will move in the direction of his angles vector.

The green line is his motion curve. This is exactly how it is done in the game.
547

But it wouldn't be true if players were considered as cylinders. In that case the motion curve would be this:
548

In CoD and many other games, players will not move like this.

serthy
2nd December 2013, 10:40
Thanks for your reply, I'd like to discuss this intresting stuff in another thread, so almighty, can you please move this? :D

I have to re-read this when im home, but thank you for your illustrations!