Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / [Dark Physics] Ideas for locking a door

Author
Message
Fallout
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 4th Aug 2006 16:17 Edited at: 4th Aug 2006 16:18
In my game my swing doors are now setup with revolute joints and can be pushed open and closed nicely. However, certain doors cannot be opened until "unlocked" either by the player opening them (turning the handle) or a series of previous triggers being set off.

I'm wondering what people would suggest as a good way to lock my doors until these triggers are activated. The two methods that spring to mind straight away are a rigid body that blocks the door (and could be invisible) making it impossible to open that is deleted when the triggers are activated. The other idea I had was to attach another revolute joint on the other side of the door frame, holding the door in place.

The first method is probably the easiest to implement, but the second method will still allow my doors to be blown open with explosives etc (which may be desired). Does anyone have any other suggestions or ideas?

monotonic
17
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 4th Aug 2006 16:22
Quote: "but the second method will still allow my doors to be blown open with explosives etc (which may be desired)."


That's how I'm implementing locked doors in my game, so like wooden doors can be opened by kicking them and sturdier metal doors would have to have lot more force to be opened i.e. explosive.

I know the voices aren't real, but they have good ideas!
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Aug 2006 16:34
Definitely method 2. You can set joint break limits for the door strength, then different characters may or may not be able to batter it down without any extra coding



Fallout
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 4th Aug 2006 17:01
Ok, I'll give that a bash then. The only problem I've found with joint strength so far is that character controllers seem to exert bizarre forces on the world. For example, if I run my character into a door when the door isn't moving, he can't push it, but when it's already in motion, he can send any object of any mass flying all over the place. So at the moment I'm having a few problems with once a door is in motion my character snapping it off its hinges when he charges into it.

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 4th Aug 2006 17:13
I found that a good way to make characters interact with physics objects is to make a kinematic object slightly bigger (but not taller) than the character and continually position it at the character's position. The kinematic object then moves objects around your character for you.

Something like this:

Fallout
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 4th Aug 2006 17:24
I do like that idea, except it poses a few problems with objects of a large mass that you dont want the character to be able to push.

Cash Curtis II
18
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 4th Aug 2006 17:59
Quote: "So at the moment I'm having a few problems with once a door is in motion my character snapping it off its hinges when he charges into it. "

I tend to do that too. Drake will just have to learn to deal with it.


Come see the WIP!
Fallout
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 4th Aug 2006 18:20
hehe. Well, he is the sort of character that will get up to that sort of business. I'm quite happy for him to blow doors off their hinges with a shotgun, or kick them off, but catching big steel doors with his little toe and kicking them down the corridor is going a bit too far.

By the way, the second joint method worked fine. What cool about it is when I apply force to the doors when they're locked they rattle slightly but dont open, clearly showing they're locked.

Login to post a reply

Server time is: 2024-03-19 07:23:02
Your offset time is: 2024-03-19 07:23:02