Game Development Community

Collision Or Camera

by J L · in Torque Game Engine · 12/15/2008 (2:03 pm) · 6 replies

What cause you to be able to see through a building for example. WOuld it be the collision box is not big enough or is it the camera itself. ?

And could explain on either part what I would need to do to fix this.

#1
12/15/2008 (2:31 pm)
Post more details....
#2
12/15/2008 (3:39 pm)
Do you mean something like this?
i167.photobucket.com/albums/u143/heretek/torque/screenshot_001-00001-2.png
You are using the Combat Starter Kit, right? That's the only place that I've seen something similar to your description -- other than missing faces on a .dif which are obvious.

I'm not really sure where the hack/bug/feature is coded at - it's something I've been meaning to track down and remove since it allows you to cheat by running into a wall and seeing what's on the other side.
#3
12/15/2008 (3:50 pm)
Yep, thats exactly it. It also allows you to clip into stuff that is not a solid
#4
12/16/2008 (11:46 am)
@Jason: while reviewing some other inconsistencies with the CSK I found the cause for this. Look in player.cs at the player datablock for a field called useWeaponBackFraction and set it to zero - which turns it off, or on rather - the usage is misleading.

I found reference to this here.
Quote:A new collision system was developed which uses the weapon tip as a collision point rather than have the weapon slide backwards when it encounters an obstacle. By default this is off but can be enabled by a setting in the player datablock.

This will reduce the object see-through bug for all weapons that are larger than the player's collision box and prevent the weapon from sliding backwards. However, using a knife or something smaller (pistol, grenade, satchel bomb, etc) for example and then colliding with a wall will still cause the rendering bug but also introduces a collision bug that can cause you to fall through the object and then through the terrain - which is bad.

The CSK is the only place I've seen this see through and potential fall through behavior and the best thing to probably do is to find the changes to WeaponBackFraction in the source and remove the offending collision hack since it introduces more problems than it tries to improve.
#5
12/17/2008 (7:11 am)
I searcheed for this through the engine code and this is the thing I found in player.cc


useWeaponBackFraction = false;
#6
12/17/2008 (9:43 am)
Yeah, that wasn't added by the CSK though, they implemented some kind of collision workaround around the stock Torque behavior. I still haven't explored enough in detail to understand what those changes are. It'll probably be after the first of the year before I get serious about tracking that down and doing some further cleanup of their code.

If you really want to find all the differences between the CSK stock Torque then try out Windiff - it's free and it's a great tool for figuring out what got changed. There are a lot of changes though, somewhere between 60-70 files got changed.